Open lumi-a opened 2 months ago
If you get all the parameters right the enemies are actually really fun like this. I want to try out this AI first again with better parameters (acceleration, range etc.)
With the latest changes, the enemies accelerate towards the player much more, making them more hostile. That's great and more fun! However, you're immediately swarmed by the enemy-fleet upon entering the universe, which isn't the best experience.
Wouldn't it be more realistic if enemy-ships only targeted you once you're close to them? With that change, enemy-ships would also no longer need to have a fixed target, which matters in #33 as we'd probably want enemy-ships to target whichever player-ship is closest to them.
The current "decelerate" action causes an enemy-ship to stutter if it's near-zero velocity, because it'll try to move its velocity towards zero, experience a change in direction, and move the other way.
Thinking about this more: The player ship is only "allowed" to move by activating the four thrusters, but an enemy-ship is allowed to apply a force in any direction.
Though it'd make writing the AI more complicated, it'd only "be fair" if the enemy-ships would have to use their own thrusters, as well. With that, their thrusters would even be drawn on screen, i.e. you can see """flames""" shooting out their thrusters when they move!
It's dead-simple to add swarm-like behavior of enemies. Would be cool to have a small fleet of these, swarming around and attacking the player in unision!
We should improve the enemy AI. Currently, it picks from three random actions:
The last one causes erratic behaviour, and the first one is hardly useful.
Until we use ML, we could change it to: