Search This Blog

Thursday, August 28, 2014

I'll be tweaking the fighter AI till the end of time

You'll have to go sideways...

I just added another state to the fighter's menu of things to do called "sideways." about once every second, the fighter checks to see if it has line of sight to its target.  If not it picks a direction randomly (right or left) and goes into "sideways" mode.

Really it means fly tangentially to the target.  In basic terms it means face the target, now turn 90 degees right or left.   This will create a circling pattern where it circles around you until it gets a clear shot.

When there's a group of fighters together, they block each other and are forced to spread out which is really cool actually... and deadly to the target --which is usually going to be you.

This also gives them a primitive and very cheap kind of "pathfinding" to go around objects to get to their target.  Since you're in mostly open space with scattered objects. There are no dead ends, so going around things is all that's needed.  This works great with asteroids, space junk, and other ships getting in the way.

As soon as it gets a clear shot, it's back to tracking which involves fly-by shooting you and coming back around to to do it again.

I'm also encouraged by the fact that I was able to add 50 of these fighters to the game --all spitting out tons of particle trail objecs out their back ends and doing their flying around thing with no noticeable slowdown on a 5 year old cheap-when-I-got-it PC.

Oh... crap.

See the ones in the back jockeying for position? ...and nobody's on top of anybody else? It's the magic of sideways.

Also... I'm very happy with how my efighter3 turned out.... Shiny! They have some nasty rayguns on the front there and they're not afraid to use them.

No comments:

Post a Comment