RTS Strategic planning part

Started by
4 comments, last by Todilo 12 years, 9 months ago
Hi. I am currently developing a RTS. It does not have the common terrain instead it uses planets which ships travel between. I have created the individual movement "AI" of the ships but mainly what you do is set a fix number of ship to attack a planet and you result is calculated based on your ship vs the opponents. You can build buidings and upgrade them. So now to the question, how do one develop an AI that can do all this? I have looked at decision-trees, rule-based planning, goal-oriented planning, neural network and fuzzy logic. I want a rather quick and dirty solution so I think I have ruled out neural networks. I sort of want some decision-tree which uses values for the AI such as Exploration(20 - 100), Defensive, Expansive etc. How would you approach this? If you have any links to papers/tutorials/solution that would be very much appreciated.

Thanks for reading
Advertisement

Hi. I am currently developing a RTS. It does not have the common terrain instead it uses planets which ships travel between. I have created the individual movement "AI" of the ships but mainly what you do is set a fix number of ship to attack a planet and you result is calculated based on your ship vs the opponents. You can build buidings and upgrade them. So now to the question, how do one develop an AI that can do all this? I have looked at decision-trees, rule-based planning, goal-oriented planning, neural network and fuzzy logic. I want a rather quick and dirty solution so I think I have ruled out neural networks. I sort of want some decision-tree which uses values for the AI such as Exploration(20 - 100), Defensive, Expansive etc. How would you approach this? If you have any links to papers/tutorials/solution that would be very much appreciated.

Thanks for reading

Just letting you know up front that strategic layer stuff for an RTS is crazy hard.

Also, good call ruling out NNs -- and it has nothing to do with you wanting a "quick and dirty" solution. They are simply useless in this case (and many others). You can use a combo of decision trees, utility systems and planning (although GOAP isn't necessarily your best bet). Look up HTN planners as well.

Since you seem to be relatively new at this, a rule-based approach (sweetened with utility-based math) is the best approach. That said, the way you construct the rules needs to come mostly out of the self-reflective question, "what would I do in this situation and why?" Break down the actions of your game into components, break down the information available in your game into components, and start matching things up. Your AI will logically flow out of that.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

I just want to throw out that "utility based math" and "planning" mesh together very nicely. For planning, you need an evaluation function; that's where your utilities come in. And "utility based math" can be viewed as planning, just one step ahead. Moreover, it can be shown that there exists a certain "perfect" utility function such that, using it greedily 1-step ahead is the same as planning into the future. So you can look at the design of a planning framework as a tradeoff between trying to approximate this function, and trying to just brute-force your sum. Google "Bellman Value Function," "Approximate dynamic programming," and "Markov games" for more.

[quote name='Todilo' timestamp='1311155167' post='4837865']
Hi. I am currently developing a RTS. It does not have the common terrain instead it uses planets which ships travel between. I have created the individual movement "AI" of the ships but mainly what you do is set a fix number of ship to attack a planet and you result is calculated based on your ship vs the opponents. You can build buidings and upgrade them. So now to the question, how do one develop an AI that can do all this? I have looked at decision-trees, rule-based planning, goal-oriented planning, neural network and fuzzy logic. I want a rather quick and dirty solution so I think I have ruled out neural networks. I sort of want some decision-tree which uses values for the AI such as Exploration(20 - 100), Defensive, Expansive etc. How would you approach this? If you have any links to papers/tutorials/solution that would be very much appreciated.

Thanks for reading

Just letting you know up front that strategic layer stuff for an RTS is crazy hard.

Also, good call ruling out NNs -- and it has nothing to do with you wanting a "quick and dirty" solution. They are simply useless in this case (and many others). You can use a combo of decision trees, utility systems and planning (although GOAP isn't necessarily your best bet). Look up HTN planners as well.

Since you seem to be relatively new at this, a rule-based approach (sweetened with utility-based math) is the best approach. That said, the way you construct the rules needs to come mostly out of the self-reflective question, "what would I do in this situation and why?" Break down the actions of your game into components, break down the information available in your game into components, and start matching things up. Your AI will logically flow out of that.


[/quote]



I just want to throw out that "utility based math" and "planning" mesh together very nicely. For planning, you need an evaluation function; that's where your utilities come in. And "utility based math" can be viewed as planning, just one step ahead. Moreover, it can be shown that there exists a certain "perfect" utility function such that, using it greedily 1-step ahead is the same as planning into the future. So you can look at the design of a planning framework as a tradeoff between trying to approximate this function, and trying to just brute-force your sum. Google "Bellman Value Function," "Approximate dynamic programming," and "Markov games" for more.


Thank you both for your suggestion. To get a quickly working AI my best bet seem to be a variation of a decision-tree. In "artificial intelligence for game", Ian Millington I have found some pretty good explanation of decision-trees. The problem I am having is to visualize how it is used in order to start new action disregarding player actions. What I mean is that it is probably very easy to write something like:

If(player attacks planet) -> calculate if defenses is enough > if NOT then, If then .... and so on, so reactive AI. But to actually give the AI new thoughs like: I have nothing to do, lets .... but that perhaps is gained through just starting to think what actually can be done in a game and as IADave sais: think "what would I do?" . The decision tree is it easiest just o find good conditions from the game or does it require some fuzzy logic? I mean is it enough to just take a few values when appropriate and do decisions from there or will the AI be too linear? The book also concerns itself with Markov conditions which "Emergent" mentioned, at least I think it is the same as "Markov games". Also will goal-oriented behaviour give me a lot more?

I do have trouble finding more about utility-based math as I don't really know what it is to be honest. I did find, somehwere, how values such as (AI -Exploration = high, Aggressive = low etc) can be incorporated but I have lost the link, do you know more about that? Basicly I want to have the option of different difficulties. If that is too hard I was just thinking of letting the AI either cheat by gaining a bit faster resrouces than the human players or have a lot more starting resources.

Well after reading more about decision trees and markov I will just start writing down all the types of actions that can be done and simulate a game. At start how should the AI think, if X happens what would be do based on Y an Z. I guess that is the easiest way to go.

Thanks for your help guys.
Any more information is of cause always read with much gratitute.
The decision tree is it easiest just o find good conditions from the game or does it require some fuzzy logic? I mean is it enough to just take a few values when appropriate and do decisions from there or will the AI be too linear?

Either/or. Mostly you can get information from the game in terms of concrete numbers and be done with it. However, some of the concepts that are more abstract require a little bit of creativity. For example, they have n soldiers of s strength... but what is the threat that is represented by those?

Also will goal-oriented behaviour give me a lot more? [/quote]
Again, it depends on what portion you are talking about and what you want to accomplish. Kevin Dill did both utility work and some goal-oriented work on Kohan 2: Immortal Sovereigns that was pretty good stuff.

I do have trouble finding more about utility-based math as I don't really know what it is to be honest.[/quote]
*ahem* Look down. cool.gif

I'm kinda the standard-bearer for utility systems in game AI (along with Kevin who was my tech editor). My book is pretty much all about utility-based decision modeling. Kevin and I have also lectured together on the subject. Here are the slides from a lecture we did at the GDC AI Summit in 2010. "[font=Arial, Helvetica, sans-serif][/font][font=Arial, Helvetica, sans-serif]Improving AI Decision Modeling Through Utility Theory[/font][font=Arial, Helvetica, sans-serif]"[/font]


Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Thank you very much. Browsed through the lecture and well, now I at least understand what they are and why and when they are used. Now I am ready to get started! I think I will begin small as this is my first big project.

This topic is closed to new replies.

Advertisement