SFML community forums

Help => General => Topic started by: StormWingDelta on April 09, 2014, 04:46:25 am

Title: Space Shooter AI Questions
Post by: StormWingDelta on April 09, 2014, 04:46:25 am
Been working on this and I know some of what I need but my issue is finding the logic and equations I need. >.>


I'm trying to get a ship AI working for my space shooter and one of my main snags is I keep finding things that use the window size, length, and width to tell the AI things but my issue is I'm using a borderless map that doesn't stop at the window's edge and any time I try to change these to not use the window and just go for open space they fall apart like toothpick houses.  :'(

I know I'm going to need to tell the AI if it should, attack, guard, follow, build something, mine some resources, etc so that kills part of my issue of knowing what it should do.  Also I got things to get the direction something is in and other things an AI would need I just need help finding something that works in open space rather than a map no bigger than the window it is in. >.>

Mainly needing help finding AI Examples and tutorials that deal with borderless maps for shooters like the one I'm working on.   Mainly interested in the logic and equations of these AI's but as for the code I can figure that out myself if I have enough information.

That aside my SFML game should be turning up in the projects section when I finally work out this annoying snag. :)
Title: Re: Space Shooter AI Questions
Post by: MadMartin on April 09, 2014, 08:46:25 am
This isn't a SFML-specific question, but a short answer can do no harm  ;)

One of the best ways for me to solve these problems is to look at other game's sources. Often, your problem is exactly one of their problems and they have a solution ready. So, just go to http://en.wikipedia.org/wiki/List_of_open-source_video_games and look for inspiration.

Apart from that, if it works for fixed sizes, why don't you increase those "logic window" size like going for 10 times or 20 times? Or is this what you already did and meant by "just go for open space"?

What's the problem / algorithm exactly, by the way?
Title: Re: Space Shooter AI Questions
Post by: eXpl0it3r on April 09, 2014, 08:57:56 am
I've no experience with AI programming, but I'm sure at some point you'll most likely want some path finding algorithm, so it probably doesn't hurt to take a look at the A* algorithm.

The you might also want to search the terms "steering behavior" since you'll most likely need that as well. For the last SFML Game Jam, Nexus wrote some simple AI for our game. It's not that pretty, but works quite nicely.

Speaking of Nexus, he's recommended AI for Game Developers (http://shop.oreilly.com/product/9780596005559.do) a few times, so you might want to check that out as well.
Title: Re: Space Shooter AI Questions
Post by: StormWingDelta on April 09, 2014, 04:19:00 pm
Since I'm dealing with an open map with no grids A* wouldn't work too well.  Also most things in the game are moving targets so the lag would unimaginable even more so if you factor in the distance between these objects on top of it. XD

A Follow, Flocking, Steering AI might work better in this situation since it wouldn't care about things not likely to affect it.

Nice suggestions though and I'll see what I can get from them. :)