AI for Real Time Strategy Games

Discussion about everything. New games, 3d math, development tips...
Post Reply
Konstantin
Posts: 12
Joined: Fri May 18, 2007 3:06 pm
Location: Panketal, Germany

AI for Real Time Strategy Games

Post by Konstantin »

Hi,
Here I want to start a little talk about:
How To realize a good real-time-strategy-ai?

Does anybody knows an engine which supports such an ai?

I've made some strategy-games in the past but i've everytime used a round based ai which i have developed for myself. Now i want to make a simple rts-game with simple irrlicht graphics. But i need a good ai for this.

Thanks for Answers - Konstantin
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

you will have to implement it by yourself i gues.
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

well pathfinding is not that difficult i looked into it you just have to lead the units around the vertexes of the bounding rects or boxes but i dont really know how to achieve ai...

greets,
halan
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

A simple AI is rather simple but not too good - however:

I'd write some kind of list to tell my "AI" what it needs to have.

So for a basic "basebuilding" ai I'd take something like:

You need 1 mainbuilding.
You need 2 supply depots.
You need 1 barracks.

Every X seconds the AI will go through this list. Let's assume it already controlls all needed buildings -> nothing happens. Now you (as the opponent) destroy one supply depot. The next time the AI diggs through the list it's check "do I have 2 supply depots?" will fail so the AI know what to build. The "where" is something different bat that shouldn't be that hard either. It isn't hard to implement some basic AI. The real hard part is to balance it and make it better/harder to beat. :) Some older games achieve this by allowing their computer players to cheat by "seeing" the whole map and/or using limitless resources. However if possible don't do that too.

To get back to the "AI script" you could also add tasks like this one:
You need 10 marines.
If you've got more than 5 marines, let them attack the enemy.

Now the AI will train up to 10 marines and send them out to attack the player once their number reaches 5. If one or two die, one or two are trained again and will attack immediately. If 5 or more die between 2 checks the AI won't send them to attack anymore unless they're at least 10 again.
Delight
Posts: 42
Joined: Tue Jul 05, 2005 3:16 pm
Location: Muenster, Germany

Post by Delight »

zeno60
Posts: 342
Joined: Sun May 21, 2006 2:48 am
Location: NC, USA
Contact:

Post by zeno60 »

Delight wrote:Perhaps this could help you:

http://www.charlesriver.com/Books/BookD ... tID=149739
You should also check out a book by Mat Buckland; Programming Game AI by Example. Delves into Finite State Machines and A* pathfinding with examples and code which is what you will probably be dealing with when programming RTS ai.

Edit with amazon link: http://www.amazon.com/Programming-Game- ... 1556220782

The homepage for the book and author is at: ai-junkie.com.
Konstantin
Posts: 12
Joined: Fri May 18, 2007 3:06 pm
Location: Panketal, Germany

Post by Konstantin »

Delight?
Have You already read this book?
Delight
Posts: 42
Joined: Tue Jul 05, 2005 3:16 pm
Location: Muenster, Germany

Post by Delight »

Only partially... I got it three weeks ago but my exams are bugging me... :(

In my opinion its good, but AI could be handled a little bit more. Perhaps you should visit the author's site:http://www.cjgraphic.com. The examples from the book can be downloaded there. Perhaps a look at them helps to come to a decision...
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

zeno60 wrote:
Delight wrote:Perhaps this could help you:

http://www.charlesriver.com/Books/BookD ... tID=149739
You should also check out a book by Mat Buckland; Programming Game AI by Example. Delves into Finite State Machines and A* pathfinding with examples and code which is what you will probably be dealing with when programming RTS ai.

Edit with amazon link: http://www.amazon.com/Programming-Game- ... 1556220782

The homepage for the book and author is at: ai-junkie.com.
i have this in chm format :P
Post Reply