So I'm making a testbed for an AI actor(ship). It's a simple asteroids game using an AI controlled actor. I'm doing this using VS, monogame.
I have implemented a simple steering behaviour using a tutorial as a guideline, found here. https://gamedevelopment.tutsplus.com/tutorials/understanding-steering-behaviors-collision-avoidance--gamedev-7777 It works somewhat.
The problem occurs when the objects(asteroids) are all moving around(at different speeds), using the guidelines from above, it only checks for collisions for whats infront, at specific points. Which would work if all other objects were static. My initial thought was to add a check for back,left,right. Then loop it to check all these positions in a 50-150 units radius. But the more I think about it, the more realize there must be a better way. As understand it, that wouldn't really solve it either, and would be performance heavy.
How would I go about implementing a collision avoidance check that 1; takes into account the approaching objects may come from any direction. 2; the differnt velocities of those objects.
Or might it be better to apply the existing check to the objects and passing the data to the actor?
Any references, tips, guide, code snippets or good old wisdom or simple pointer in the right direction, would be enormously appreciated!