Repositioning Enemies - Explained
Normally the best way to be able to beat an enemy in any game is to understand exactly how they work. One of the more complicated features for the enemies in Tenril is their ability to reposition themselves for an attack. The better you can understand this, the better you will be able to predict the action they might be taking.
The main reason for this feature was due to some limitations with the game engines' built-in way for character navigation, as it works perfectly for making our enemy move towards a point, but does not work when moving away from a point. This is where this repositioning movement mechanic comes into place.
To briefly explain it in practice, when an attack is not possible due to being too close or too far away from a target, the enemy will try to choose a direction to move towards to be within range for the current attack, or until it runs out of time and chooses a new attack to try and perform.
This repositioning mechanic had gone through many iterations, most of which had failed due to the enemy struggling to move around obstacles, or due to them getting stuck when two paths are nearly equally liked.
However, after a lot of prototyping, this was refined and drastically improved. This movement works by using something known as a ray cast, which is a beam that goes in any given direction and can be used to check for potential obstacles around the enemy. These beams are fired out from the enemy in all directions around it so that it could have a clear understanding of its surroundings.
These rays can also keep track of additional information, such as how valuable or important it is. The value of these directions is decided on by comparing several factors. The most common one is how desirable an obstacle is, often making a direction less valuable as to avoid bumping into them. The next most important factor is to compare how close this direction is to the enemy target, which will vary depending on if we want to move away or towards it. Once the value of every direction is calculated, they are combined based on how valuable they are, and with some minor tweaks to balance and smooth out the calculation, the AI is now able to move towards or away from a target with a lower risk of bumping into obstacles and getting stuck.
Although the current implementation of this repositioning movement works quite well, it still has its flaws and will likely be updated in the future to be smoother and better at obstacle detection. But with this, I hope you've all learned a bit on how their ability to reposition works, have perhaps already thought of ways how to take advantage of it in your fights, and enjoy the game further!
Get Tenril
Tenril
Put an end to the conflict of the two races of Tenril.
Status | On hold |
Publisher | |
Authors | HeavensGates, JacquesAV, LapizLazuli, Tessa |
Genre | Role Playing, Action, Adventure |
Tags | 3D, Atmospheric, Fantasy, Singleplayer, Story Rich, Third Person, Unity |
Languages | English |
More posts
- Xipilian Social CeremoniesMar 02, 2024
- Skill Tree: Swapping spells, Pyromancy tree path and much more!Feb 17, 2024
- Forging Your Destiny - Crafting System Part 3Feb 10, 2024
- Forging Your Destiny - Crafting System Part 2.5Feb 04, 2024
- Lunaegan Social CeremoniesJan 20, 2024
- Skill tree: Menu creation and Biomancy pathJan 06, 2024
- Forging Your Destiny - Crafting System Part 2Dec 23, 2023
- Social Structure; Xipilian CityDec 09, 2023
- Conclusion of the In-Game Menu Rework (Inventory, Stats and Settings)Nov 25, 2023
Leave a comment
Log in with itch.io to leave a comment.