Commit Graph

3507 Commits

Author SHA1 Message Date
Joonas Rikkonen
7b6c2f1fa8 (663910402) Unequip weapons when not in combat mode and all items when idling. 2019-05-16 05:20:11 +03:00
Joonas Rikkonen
3b313976c5 (5394332a8) Add a note. 2019-05-16 05:19:52 +03:00
Joonas Rikkonen
bcd18aab4e (8025561da) Implement offensive combat. 2019-05-16 05:19:31 +03:00
Joonas Rikkonen
363eb0540a (a8f2f39bd) The ai now sorts the weapons by the combat priority value, which can be set in xml. Ranged weapons are favored. The required items are also taken into account. 2019-05-16 05:19:14 +03:00
Joonas Rikkonen
9facded24c (2561cb6ea) Tune the priority modifiers. 2019-05-16 05:18:55 +03:00
Joonas Rikkonen
65e284bf7c (0fde6c604) Ignore dangerous targets. 2019-05-16 05:18:37 +03:00
Joonas Rikkonen
fea0c31e85 (27b4fa143) Tune the priority modifiers. 2019-05-16 05:18:18 +03:00
Joonas Rikkonen
f61bff8970 (a1fe45652) Add some margin. 2019-05-16 05:18:01 +03:00
Joonas Rikkonen
cbfef49e9d (d9fd52f40) Change the priority calculations for charge batteries and pump water loops. Tweak the operate item priority calculation. 2019-05-16 05:17:42 +03:00
Joonas Rikkonen
c9bfc21880 (49f837fbb) Fix: operate battery or pump should not be looping objectives. 2019-05-16 05:17:24 +03:00
Joonas Rikkonen
c8160f6e0b (a599eccb0) Expose the ai recharge target ratio and add a property for easy accessing to the recharge ratio. 2019-05-16 05:17:06 +03:00
Joonas Rikkonen
6c777aa91e (d7e59613a) Ignore broken items. 2019-05-16 05:16:47 +03:00
Joonas Rikkonen
6bdd0ab8c0 (83ad1f3d2) Fix a null reference exception. 2019-05-16 05:16:31 +03:00
Joonas Rikkonen
5b3696f7e4 (d16942d30) Simplify. 2019-05-16 05:16:13 +03:00
Joonas Rikkonen
bbce41fab0 (bd2976a16) Add some automatic orders. 2019-05-16 05:15:52 +03:00
Joonas Rikkonen
82d74f7481 (a1ebc2642) Use lazy loading to ensure that the list is assigned when it's needed. Fixes null reference exceptions when pumping water or charging batteries. 2019-05-16 05:15:34 +03:00
Joonas Rikkonen
108e42edb0 (b5250291f) Merge branch 'dev' into human-ai 2019-05-16 05:15:16 +03:00
Joonas Rikkonen
b02565796a (98f1dbf5e) Merge branch 'dev' into human-ai 2019-05-16 05:14:58 +03:00
Joonas Rikkonen
7f72f72ca7 (9c0250ef1) Merge branch 'dev' into human-ai 2019-05-16 05:14:40 +03:00
Joonas Rikkonen
2ae54a01a5 (ac7ab10b0) Pass AIObjectiveManager reference in the constructors instead of methods so that we can always access it. 2019-05-16 05:14:20 +03:00
Joonas Rikkonen
bec7aadfa9 (af16ecdfa) Merge branch 'dev' into human-ai 2019-05-16 05:14:00 +03:00
Joonas Rikkonen
8be0b0676e (83868bb0e) Refactor AIObjectiveExtinguishFires to use the AIObjectiveLoop class. Significant refactoring of the other looping objectives. Reduce the duplicate code. 2019-05-16 05:13:40 +03:00
Joonas Rikkonen
7fb7c13198 (fbfb76aeb) Implement automatic extinguishing. TODO: should use the AIObjectiveLoop class. 2019-05-16 05:13:21 +03:00
Joonas Rikkonen
ab2ca90d08 (900eddc26) Take the priority modifier in account when calculating the priority, not the max value. 2019-05-16 05:13:03 +03:00
Joonas Rikkonen
3c8707fc16 (d9d8b0f27) Always display waypoint ids in debug draw. Adjust the positions and the colors. 2019-05-16 05:12:44 +03:00
Joonas Rikkonen
e06a473b41 (a63bd205d) Adjust automatic order priority modifiers. 2019-05-16 05:12:24 +03:00
Joonas Rikkonen
019712ef66 (829458a66) Don't apply priority modifier on the priority value, because it's already applied to the max value. The priority value should be normalized, because we are using the lerp. 2019-05-16 05:12:07 +03:00
Joonas Rikkonen
dbccd76613 (c6ca0ef58) Recreate objectives when the bot is dismissed. 2019-05-16 05:11:49 +03:00
Joonas Rikkonen
de8a23f687 (1137f730e) Instead of forcing the looping objectives to use the average, let them decide the method of evaluating the targets. Use the highest priority for now. 2019-05-16 05:11:32 +03:00
Joonas Rikkonen
759e4aee0d (96ccafd88) Fix the goto objective not always completing because of too high NearEnough value. 2019-05-16 05:11:17 +03:00
Joonas Rikkonen
9a1e7f8212 (1c6954251) Add IsLoop property. Fixes operate item orders being removed when they are done. Instead of calling loopable objectives done, let's just use the priority system. 2019-05-16 05:11:01 +03:00
Joonas Rikkonen
781fd44a8c (4efa46ffe) Limit the base priority due to devotion to 10. 2019-05-16 05:10:42 +03:00
Joonas Rikkonen
cdeb6d40b3 (f3bfe1ac4) Fix damage priority calculation. 2019-05-16 05:10:25 +03:00
Joonas Rikkonen
9cc9137fff (b8fa3b004) Merge branch 'dev' into human-ai 2019-05-16 05:10:07 +03:00
Joonas Rikkonen
7ebb0be29b (db42ef494) Don't allow combat priority go over 100. 2019-05-16 05:09:51 +03:00
Joonas Rikkonen
171c42f077 (3241b8fe7) Adjust the priorities. The orders should now always have higher priority than other objectives (except find safety and combat). 2019-05-16 05:09:33 +03:00
Joonas Rikkonen
7c901d8d77 (8fd36f702) Add a separate value for run threshold. Increase the order priority from 50 to 70. 2019-05-16 05:09:15 +03:00
Joonas Rikkonen
3a3d55d780 (39b4d0859) Merge branch 'dev' into human-ai 2019-05-16 05:08:56 +03:00
Joonas Rikkonen
616efac2bf (19b26d13b) Merge branch 'dev' into human-ai 2019-05-16 05:08:39 +03:00
Joonas Rikkonen
454dda56c7 (1762f02b3) Merge branch 'dev' into human-ai 2019-05-16 05:08:22 +03:00
Joonas Rikkonen
4797f6b0d3 (307219669) Add some automatic orders. 2019-05-16 05:08:02 +03:00
Joonas Rikkonen
b51fd32b88 (de7949704) Rewrite the leak priority calculations. Ensure that the damage priority is not negative. 2019-05-16 05:07:45 +03:00
Joonas Rikkonen
7f58f30829 (1c243b972) Fix steering related issues in the fix leaks objective. 2019-05-16 05:07:27 +03:00
Joonas Rikkonen
37555ed1a4 (9fc7c8e98) Only reset when the objective is an order. 2019-05-16 05:07:07 +03:00
Joonas Rikkonen
2a0e289a59 (40f4f67f8) Further changes to the calculations. 2019-05-16 05:06:49 +03:00
Joonas Rikkonen
b7272e1c96 (2f379083c) Change how some of the priorities are clamped. 2019-05-16 05:06:30 +03:00
Joonas Rikkonen
b5db30ec72 (c48cb7804) Change the operate item priority calculation so that it starts from 25 and increases with devotion and is multiplied by the priority modifier. Clamp the result. 2019-05-16 05:06:11 +03:00
Joonas Rikkonen
ff5a819ad3 (62a89ce6a) Refactor and fix priority calculations. WIP, but should already improve things. 2019-05-16 05:05:53 +03:00
Joonas Rikkonen
d0795791e7 (3bb9485ad) Add automatic orders as objectives instead of orders so that we can take advantage of the existing priority system. Turn the priority values defined in the xml into modifiers. 2019-05-16 05:04:53 +03:00
Joonas Rikkonen
5def53f7bd (2972c6da9) Add a missing text. 2019-05-16 05:04:29 +03:00