Sign in to follow this  

RTS Strategic planning part

This topic is 2340 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
[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
[/quote]
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote name='IADaveMark' timestamp='1311170102' post='4837957']
[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
[/quote]
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]


[quote name='Emergent' timestamp='1311172952' post='4837981']
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]

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.

Share this post


Link to post
Share on other sites
[quote name='Todilo' timestamp='1311181277' post='4838041']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? [/quote]
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 [i]n[/i] soldiers of [i]s[/i] strength... but what is the [i]threat[/i] that is represented by those?

[quote]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 [i]Kohan 2: Immortal Sovereigns[/i] that was pretty good stuff.

[quote]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. [img]http://public.gamedev.net/public/style_emoticons/default/cool.gif[/img]

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. [size="2"]"[font=Arial, Helvetica, sans-serif][/font][font=Arial, Helvetica, sans-serif][url="http://www.intrinsicalgorithm.com/media/2010GDC-DaveMark-KevinDill-UtilityTheory.pdf"]Improving AI Decision Modeling Through Utility Theory[/url][/font][font=Arial, Helvetica, sans-serif]"[/font][/size]


Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 2340 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this