Archived

This topic is now archived and is closed to further replies.

baykalsa

RTS AI

Recommended Posts

I am trying to make a RTS game.But I don''t know how to make the AI.I think you ''ll say GameTrees .How can i make a Game Tree for my RTS game? New Age&Electronic Music http://www.mp3.com/baykal

Share this post


Link to post
Share on other sites
GAME TREES IN RTS??????????

at each step you have hundreds opportunities to go! so it will work very slowly and won''t calculate more than 2 steps ahead in reasonable time! you have to use neural networks or invent specific algorithms for your strategy.

tell more about your rts! has it already written?

i have some ideas to make ai to rts using neural networks, but it is hard to me to describe they in english. maybe i will do it if you want. also i have unit with nn''s in pascal.

from russia with love

Share this post


Link to post
Share on other sites
The answer to your question, newbie one, is inside of YOU. Ask yourself...
What does my game need to do?
What do my agents need to do?
What do I do when I''m playing the game?
What information do I keep track of to be informed?
What criteria do I use to make decisions?

Dave Mark - President and Lead Designer
Intrinsic Algorithm -
"Reducing the world to mathematical equations!"

Share this post


Link to post
Share on other sites
use a Finite State machine or something, but for the gentleman that said use a neural net, that would be over kill and computationally expensive, granted it may work but neural nets in this scenario would be no different than a game tree or FSM, in the way that you would be using it...

I agree totally with InnocuousFox, but I would like to add one thing, if you have never done RTS AI before start with the basics like a FSM, once you get the hang of it, build on your previous knowledge and attempt Neural Nets, Decision Trees or even Rule Based Systems...

Share this post


Link to post
Share on other sites
Finite State machine is the same as finite automate?? or not?

my hard_to_explain_idea is to build distributed system of neural networks: each square of map, for instance 4*4, corresponds to network, all networks are identical (with the same weights), they output vector of n floats, for instance 2, and input game situation in its square and output vectors of itself and its 4 or 8 neighbors. units have another networks or don''t have any network, and their behavior depends on game situation and output vector of nearest network in the distributed system.c so we have to optimize very low amount of weights.

i didn''t implemented this algorithm yet, because i''m lazy to write strategy, but i written unit with neural networks and some optimization algorithm (hybrid of darwin and gradient descent).

quote:
simple nonlinear dynamics may result in adaptive behavior!!
http://wsni2003.narod.ru/Papers/Nepomn2.pdf

Share this post


Link to post
Share on other sites
quote:
Original post by baykalsa
I am trying to make a RTS game.But I don''t know how to make the AI.I think you ''ll say GameTrees .How can i make a Game Tree for my RTS game?


Could you be a little more specific about what you need? What exactly does the "A.I." need to do?

-Predictor
http://will.dwinnell.com



Share this post


Link to post
Share on other sites
I think that''s part of the problem. There can be dozens of uses and dozens of coresponding types of AI in a given RTS. Strategic AI, Unit Buiding, Pathfinding, Tactical, Economic...

Dave Mark - President and Lead Designer
Intrinsic Algorithm -
"Reducing the world to mathematical equations!"

Share this post


Link to post
Share on other sites
pathfinding is trivial, and it is not needed in this algorithm because behavior is fully determined by network.
strategic ai - i hope it will show some strategy
buildings may also have nn

i don''t pretend to describe ALL ai with my method, it is only part of it, but the largest part.

another idea: units may excrete "smells" in the environment according to situation, smells distribute and disappear, and units behave according to smell concentration, gradient and situation. and also units may excrete "hormones" in their own "blood". in this case distributed system is not needed and therefore it will run faster.

Share this post


Link to post
Share on other sites
You may wish to check out http://www.planetannihilation.com/aicentral/

It''s the webpage of Quitch(y)*, the best 3rd party AI maker for Total Annihilation.

The articles section has information on how the TA AI decides what to build, as well as some thoughts on how to make a realistic RTS AI.

- Scott "me22" McMurray
( email/MSN me22@fastmail.ca ICQ 37213887 )

Share this post


Link to post
Share on other sites
How about you use a system of "draws"? The NPC will then be drawn in various directions (various), and the direction with the strongest draw is the one the AI takes. The first level draw would be something like, Wait, Cure/Rest, Move, Fight. If you cant fight at the moment, that draw is zero, if your surrounded by evil peeps stronger then you, you Wait may be activated a bit, if your HP is nearly gone, your Cure/Rest gets a big draw, depending on the necessity of each, the draw chooses the next path. Now, 2nd level would be something like this. You decided to move, there are 8 directions. In the most basic form, i would check for obstructions, give them a draw of 0, if there is a special item nearby, it raises the draw based on the distance it is from me. Then use a line of sight combined with goal location to figure out the next. This could also be used with what "type" of cure to use, how long to rest, exc.

Hope this helps,

Richard

Share this post


Link to post
Share on other sites
I wrote graphic part and pathfinding and lots of things of my RTS.The game is a combination of RPG and RTS but not in Warcraft style.
Currently units attack but just if they can see an enemy unit.My problem is how the computer decide what to do next.For example creating units from the barack or constructing a new barack with some amount of money.What type of unit ...goes and goes..I know FSM a little bit.Neural Networks ,its name frightens me.It must be very complex(?).Decision Trees??Rule Based System??????

I draw a flow chart at weekend.



Is the flowchart correct?

New Age&Electronic Music
http://www.mp3.com/baykal

Share this post


Link to post
Share on other sites
Ignore the whole NN thing for now. Although it might be someone''s pet project, it''s the wrong tool for the problem.

There is an excellent entry on architechting an RTS AI in "AI Game Programming Wisdom". If you have the fundage, I very much recommend picking it up. If not, it''s a quick read so just sit down at the bookstore and plow through it. It will give you a good idea of how to make the decision structure on what to build when.

In a nutshell, though, you will need to construct a number of different levels. The overall AI decides, in simple terms, HOW you are planning on doing things, various 2nd level entities manage such things as building needs and placement, unit training, economic needs and management, etc. A lower level has squad level control of assembling and moving groups of units and then each individual has it''s own AI for the immediate, reaction-based things such as combat, pathfinding, etc.

Dave Mark - President and Lead Designer
Intrinsic Algorithm -
"Reducing the world to mathematical equations!"

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Thanks for the pitch, Dave!

Bob Scott
AI Developer
Stainless Steel Studios


Dude... it was an amazing article. I''m using a spin-off of it on my airline game... though it''s a bit more complicated. *sigh*

Dave Mark - President and Lead Designer
Intrinsic Algorithm -
"Reducing the world to mathematical equations!"

Share this post


Link to post
Share on other sites
quote:
Original post by wormball
we don''t look for easy ways!!!!!!!!

i wanna make ai that was never made before, but not to copy smb''s work

Which is exactly what I was adressing when I asked you before if your posts were helping him. He obviously hasn''t done it before and you are sounding the war cry of the oddest solution you could find.



Dave Mark - President and Lead Designer
Intrinsic Algorithm -
"Reducing the world to mathematical equations!"

Share this post


Link to post
Share on other sites
Unfortunately in my country there are no books about games in the stores.I''ve learned all about coding from the net.Dave is right NN is so complicated for me.Is NN is a necesity for a good AI?
What about the flow chart?Well,Do I have to write long ''if else'' combinations?
Just tell me something;how can the computer understand it needs a barrack while it has already one??Is the answer another question:"when do you construct an extra barrack?".Should I code the AI in my playing style?Questions...Questions...Questions...Questions...Questions...Questions...Questions...Questions...Questions...Questions...Questions...Questions...!!??!!??!!??



New Age&Electronic Music
http://www.mp3.com/baykal

Share this post


Link to post
Share on other sites
First thing I suggest you do is to put all the factors that you think matter into numbers. Things like the amount of each kind of resource, how hard it would be to get more, how many of each kind of building, how many of each class(melee, ranged, siege, etc) of unit you have, how many more units you want, any any other factors you can think of. The range of stuff doesn''t matter. You might want to express how hard it is to get resources as a number between 0 and 1, or maybe 1 and 59879, it doesn''t really matter.

Then, each time you make a decision while you are playing, pause the game and write down which factors you took into consideration. Then work out an arbitrary fomula using the numbers for those factors and pick a value it has to be less than, or greater than, or about equal to for you to make that decision. Remeber, all the exact numbers are arbitrary and depend on the ranges for everything. Once you have all the formulas, you can make a lot of if statements. To make the AI play differently than you, you can store the value you comapre the formula to in a variable and change it some each time you play.

Share this post


Link to post
Share on other sites
2InnocuousFox

you''re too educated and you don''t want to try new odd ideas!

maybe they won''t work so efficient as methods from books, but they give us new knowledge about decision making

Share this post


Link to post
Share on other sites
quote:
Original post by wormball
you''re too educated and you don''t want to try new odd ideas!


You have no idea what I want. However, what the original poster wanted was an introductory course in the various methods needed to architect AIs for an RTS. You gave him, in broken English, a vague description of some obscure pet project. Your idea may be great, but a little out of place.



Dave Mark - President and Lead Designer
Intrinsic Algorithm -
"Reducing the world to mathematical equations!"

Share this post


Link to post
Share on other sites
Just saw this today, "activision releases source for call to power 2"

source
http://apolyton.net/ctp2/files/CTP2_Source.exe

readme
http://apolyton.net/ctp2/files/CTP2%20Source%20Code_Readme.htm

edit - thought that it might be of use if you like to wade through source code.

[edited by - infinisearch on October 29, 2003 10:57:46 PM]

Share this post


Link to post
Share on other sites