Posted October 06, 2024 by Linkyboy26XA
Remaining at a high difficulty, this week picked up on previous weeks' dropped tasks.
TL;DR: Implemented most required features for smarter BehaviourCreatures, allowing them to choose Actions from a decision tree, and rejigged some shoddy alignment processes.
As can be seen in Devlog 2, some of last week was spent on starting a Behaviour system, which would allow for smarter and more varied actions from enemy Creatures. Plans were made to use a new BehaviourCreature Derived Class to utilise a BehaviourTree ScriptableObject, which could be unique between enemy types. Development of this idea was previously shelved, as one part the BehaviourTree required was Spells, and those were needed to properly flesh out (and subsequently debug) this new feature. [There will be an addendum to this at a later time.]
Prior to recent changes, Creatures would animate bouncing off of terrain and each other. After edits and additions of code, noticable issues of clipping and phasing arose. Some time this week was spent resolving this issue (when I was having troubles with the Behaviours). The basis of these issues arose from two sources: an oversimplified alignment Coroutine using Transforms, and edits to the Creature script's collision code made when Spells were implemented. The issues with the main collision code was resolved with some minor adjustments, but the alignment problems would require much more extensive changes.
The original alignment Coroutine would attempt to place the centre of the Creature at the centre of the closest tile, this seemed reasonable during its creation, but other features clashed with this approach. Not only did Creatures have Colliders (or bounding shapes) smaller than a tile, which previously allowed multiple Creatures to cram into a single tile, but the reduced size of the Custom Physics Shapes implemented in week 1 (see Devlog 1) allowed Creatures to slide into solid tiles. [There will be an addendum to this at a later time.]
To summarise again, minimal efforts were put into fixing the minor existing bugs and issues, though larger issues have recieved some progress.