674f5a656f
(65debb5e8) Remove HasAccessToPath method. Add CanAccessThroughDoor method and use it in GetNodePenalty method. Shouldn't anymore find paths to places where doesn't have access to. TODO: CheckDoorsInPath should ideally use the same code for checking the doors, but since it works ok, I didn't touch it (much). Merely reduced the interact distance.
Joonas Rikkonen
2019-05-16 05:38:17 +03:00
4695e6f92b
(89fea1963) Refactoring and fixing: - Remove relatively expensive HasAccessToPath calls. - Fix finding diving gear subobjective of goto main objective not checking if we need the gear. - Move the abandon checks from CanBeCompleted property under Act method and use the inherited property. Fixes incorrect results when the goto objective is not the active objective. - Improve the support for concurrent sub objectives.
Joonas Rikkonen
2019-05-16 05:38:02 +03:00
96eb27140e
(ab2157c70) Remove KeepDivingGear property, because it can cause issues when the objective tree is deep. Checking the property is possible via recursion, but it seems that the checks can miss a frame. Instead, let's just make it simple and remove the diving suit only when idling.
Joonas Rikkonen
2019-05-16 05:37:46 +03:00
c060c90cba
(e3f599b5d) Go to objective checks the path access only once per second. Add notes.
Joonas Rikkonen
2019-05-16 05:37:29 +03:00
6f9690eeaf
(326dbd217) Don't take the diving suit off while trying to get a diving suit as a part of the goto objective. Fixes bots occasionally standing next to the diving suit cabinet apparently holding the suit in hands but not putting it on or moving anywhere.
Joonas Rikkonen
2019-05-16 05:37:14 +03:00
01743eb7e1
(6fe53068b) Add a wait timer at the beginning and a temporal spread on creating the autonomous objectives. Should improve performance, because the find target loops are thus spread a bit.
Joonas Rikkonen
2019-05-16 05:36:58 +03:00
5ba3c802ea
(d4abdd937) Fix security officers fleeing from the enemy and others ignoring them until attacked :D
Joonas Rikkonen
2019-05-16 05:35:47 +03:00
14e894cbc8
(82dc10a74) Some margin.
Joonas Rikkonen
2019-05-16 05:35:30 +03:00
9fba7b1d7a
(1136677c2) Fix Extinguish fire objective. Implement ConcurrentObjectives property (should use this for Combat).
Joonas Rikkonen
2019-05-16 05:35:12 +03:00
e1584be2f7
(bfd095a0a) Fix a bunch of bugs related to the recent refactoring.
Joonas Rikkonen
2019-05-16 05:34:56 +03:00
6bb7f5f0f1
(5dc7f59e5) Remove an unnecessary check. The priority system should take care of this.
Joonas Rikkonen
2019-05-16 05:34:37 +03:00
70ffc27667
(e80994d9b) Refactor get item.
Joonas Rikkonen
2019-05-16 05:34:19 +03:00
f667ed8e12
(3f4e69c0d) Only unequip items when idling. Fixes bots not being able to repair, because the tools were unequipped (if they were weapons).
Joonas Rikkonen
2019-05-16 05:34:03 +03:00
155cb83f91
(f0f961ac3) Fix some priority related issues.
Joonas Rikkonen
2019-05-16 05:33:46 +03:00
a3db11876b
(d34fb2097) Major refactoring: - Replace custom logic regarding subobjectives with generic logic. - Ensure that all the objectives follow the same logic, reduce duplicate code where possible.
Joonas Rikkonen
2019-05-16 05:32:56 +03:00
05270aa165
(d9e651e1c) Add a generic method for handling subobjectives, when we don't use a collection but individual references instead.
Joonas Rikkonen
2019-05-16 05:32:37 +03:00
0714599f05
(10a11fd09) Rename a variable.
Joonas Rikkonen
2019-05-16 05:32:20 +03:00
54a0164f89
(98501b696) Reduce the max accepted distance for repair tool ai operate.
Joonas Rikkonen
2019-05-16 05:30:23 +03:00
348f21598e
(439481a07) Set the random factor for initiative each time the objective changes and once per 5 secs when the idle is active. Change the formula. Fix the waiting after character has been unselected.
Joonas Rikkonen
2019-05-16 05:30:06 +03:00
ca3b5ae04b
(0976ef4d1) Fix repair hint text being displayed even when the item condition is not below the threshold. Move the GetHUDText method from shared to client project.
Joonas Rikkonen
2019-05-16 05:29:50 +03:00
32fe6e24de
(991f75225) Change the welding progress bar size.
Joonas Rikkonen
2019-05-16 05:29:33 +03:00
268389a128
(c5e44ed94) Take access into account before accepting a path. Fixes bots trying to reach places where they have no access to (#1351).
Joonas Rikkonen
2019-05-16 05:26:09 +03:00
812598774e
(24bcea40e) Fix the ai checks about door buttons. Don't aim at targets that cannot be seen.
Joonas Rikkonen
2019-05-16 05:25:52 +03:00
bd4b3bd7f9
(479cebd45) Fix not being able to open partially broken doors with integrated buttons.
Joonas Rikkonen
2019-05-16 05:25:35 +03:00
f46990d539
(d74fee449) Revert "Fix bots not knowing how to use the integrated controllers, effectively failing to use the doors with integrated buttons."
Joonas Rikkonen
2019-05-16 05:25:20 +03:00
4c53a56b20
(e25e32b17) Fix bots not knowing how to use the integrated controllers, effectively failing to use the doors with integrated buttons.
Joonas Rikkonen
2019-05-16 05:24:11 +03:00
52d25694ed
(050157f65) Fix bots not being able to use buttons or ladders because the were aiming. Don't aim when farther than 500 pixels away from the target.
Joonas Rikkonen
2019-05-16 05:23:39 +03:00
abd19f614f
(913d93c32) Setup new skills: initiative and courage. Not yet implemented.
Joonas Rikkonen
2019-05-16 05:23:03 +03:00
8f8ff7f1a9
(7e5ee2800) Add the job requirement for fight intruders order.
Joonas Rikkonen
2019-05-16 05:22:47 +03:00
cf55de90ba
(0ccb08c95) Remove item collision category, since we only want to check the walls and the characters here.
Joonas Rikkonen
2019-05-16 05:22:30 +03:00
ad604a44c4
(0bc1c5f88) Fix bots trying to rescue enemies in single player game.
Joonas Rikkonen
2019-05-16 05:22:12 +03:00
9ec9adb2a7
(cec5cdbcd) Reset steering when an objective is activated.
Joonas Rikkonen
2019-05-16 05:21:39 +03:00
f95a59cc50
(cc14ef57a) Remove the Doing text, because it's not used and because there can be multiple. Remove order names, because they should be defined in EnglishVanilla.xml. Add todo notes about the texts.
Joonas Rikkonen
2019-05-16 05:21:20 +03:00
88de435487
(cf495e03c) Check the visibility to the target when engaging (the distance is not enough, if there's something blocking the line of sight).
Joonas Rikkonen
2019-05-16 05:20:45 +03:00
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.
Joonas Rikkonen
2019-05-16 05:19:14 +03:00
f61bff8970
(a1fe45652) Add some margin.
Joonas Rikkonen
2019-05-16 05:18:01 +03:00
cbfef49e9d
(d9fd52f40) Change the priority calculations for charge batteries and pump water loops. Tweak the operate item priority calculation.
Joonas Rikkonen
2019-05-16 05:17:42 +03:00
c9bfc21880
(49f837fbb) Fix: operate battery or pump should not be looping objectives.
Joonas Rikkonen
2019-05-16 05:17:24 +03:00
c8160f6e0b
(a599eccb0) Expose the ai recharge target ratio and add a property for easy accessing to the recharge ratio.
Joonas Rikkonen
2019-05-16 05:17:06 +03:00
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.
Joonas Rikkonen
2019-05-16 05:15:34 +03:00
2ae54a01a5
(ac7ab10b0) Pass AIObjectiveManager reference in the constructors instead of methods so that we can always access it.
Joonas Rikkonen
2019-05-16 05:14:20 +03:00
8be0b0676e
(83868bb0e) Refactor AIObjectiveExtinguishFires to use the AIObjectiveLoop class. Significant refactoring of the other looping objectives. Reduce the duplicate code.
Joonas Rikkonen
2019-05-16 05:13:40 +03:00
7fb7c13198
(fbfb76aeb) Implement automatic extinguishing. TODO: should use the AIObjectiveLoop class.
Joonas Rikkonen
2019-05-16 05:13:21 +03:00
ab2ca90d08
(900eddc26) Take the priority modifier in account when calculating the priority, not the max value.
Joonas Rikkonen
2019-05-16 05:13:03 +03:00
3c8707fc16
(d9d8b0f27) Always display waypoint ids in debug draw. Adjust the positions and the colors.
Joonas Rikkonen
2019-05-16 05:12:44 +03:00
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.
Joonas Rikkonen
2019-05-16 05:12:07 +03:00
dbccd76613
(c6ca0ef58) Recreate objectives when the bot is dismissed.
Joonas Rikkonen
2019-05-16 05:11:49 +03:00
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.
Joonas Rikkonen
2019-05-16 05:11:32 +03:00
759e4aee0d
(96ccafd88) Fix the goto objective not always completing because of too high NearEnough value.
Joonas Rikkonen
2019-05-16 05:11:17 +03:00
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.
Joonas Rikkonen
2019-05-16 05:11:01 +03:00
781fd44a8c
(4efa46ffe) Limit the base priority due to devotion to 10.
Joonas Rikkonen
2019-05-16 05:10:42 +03:00