Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Space Shooter AI Questions  (Read 1931 times)

0 Members and 2 Guests are viewing this topic.

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Space Shooter AI Questions
« 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. :)
I have many ideas but need the help of others to find way to make use of them.

MadMartin

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: Space Shooter AI Questions
« Reply #1 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?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Space Shooter AI Questions
« Reply #2 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 a few times, so you might want to check that out as well.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: Space Shooter AI Questions
« Reply #3 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. :)
« Last Edit: April 09, 2014, 04:20:35 pm by StormWingDelta »
I have many ideas but need the help of others to find way to make use of them.

 

anything