Hello everybody,
a little work in progress of enemy behavior among the asteroids, this one can dodge and keep chasing the player without too many issues it feel a bit artificial for it has only 2 ways of dodging the asteroids and I will look further on the subject to make some more fluent behavior.
It was long time that I wanted to dig deeper in enemies behavior and I kept away from it because I was thinking that would be too much of an undertaking but to my surprise there are some easy solutions. Here I didn't use any pathfinding route as the map is constantly changing due to the random asteroids movement so the enemy has to be prepared to many different situations.
This is all the code it takes to move this Gurd ship to chase the player and dodge the asteroids I'm still working around with the speed variables and the distance_to_object that activate the sequence. I have tried to randomize the way the ship approach the asteroids but for now I didn't make work and I have a 98 degree path change that works even if it is an approach that don't look very clever as it will most of the time evade by moving around that same direction.
Next time I'll show some dogfight!
Enjoy :D
▶️ 3Speak
Dear @mproxima, we need your help!
The Hivebuzz proposal already got an important support from the community. However, it lost its funding few days ago and only needs a few more HP to get funded again.
May we ask you to support it so our team can continue its work this year?
You can do it on Peakd, ecency,
https://peakd.com/me/proposals/199
Your support would be really helpful and you could make the difference! Thank you!