D2X-XL Worklog
Notes on features and problems from the development of D2X-XL, newest first.
Improved Robot AI |
|
I had already tackled a few problems with the robot AI quite a while ago, where I made them react if being shot at even if very far away from the player. During testing the awesome new mission "The Enemy Within" I noticed a pretty strange and somewhat funny behaviour that was shown particularly by robots with a melee attack (i.e. which are using claws or ram you): When I stood still, they tended to approach me, hover in front of me for a while, and then flew off, only very occasionally attacking me, if at all. They only started to charge me when I moved. It took me a while to understand that part of the AI code well enough to figure why the robots didn't switch from approaching to attacking me when I stood still. The AI code simply didn't properly process the fact that a robot had reached its destination position (i.e. me) and could now attack. It remained in "search" mode instead. It was simple to fix that: All I had to do was to set the robot to "idling" when it had reached its goal. The AI code would subsequently switch from idling to attack mode. There was another quirk that irked me though: Robots immediately stopped searching for me when I disappeared from their sight, instead of looking for me where they had seen me last. That even happened after I had shot at them and they were pretty agitated because of that. Well, the corresponding code simply immediately set a robot to idling when it lost sight of the player ... not good. The logical change was to make robots keep searching for the player for a while even after they had lost him, provided they were "upset" enough because the player had shot at them, or because no other event had changed their mind. Robots will now start doing that for any aggressivity level above "moderate", and will keep searching longer the higher their aggressivity is set. Sticking together in big lumps was yet another irritating behaviour exposed particularly by robots that pursued the player that I got fixed: They will now stay neatly apart and follow you in a nice, irregular formation.
|



