adaptive RTS AI
Hi all, I probably have no legs to stand on in the AI arena, but I am wanting to take on an AI project (more like a pet project).
The idea is for a RTS game that I wish to call adaptor. It revolves around the idea of constantly changing conditions and units and forces players to make quick strategic decisions and 'adapt or die'!
The biggest focus on the game is to be AI. Im not too sure what will all be entailed here, perhaps you guys can give me some pointers.
What I thought of so far:
- A map will need to be pre-processed to calculate important influencing factors, like bottlenecks and vantage points for different types of strategies (hit and run, flanking, ect.)
- AI should have a set of properties that could give them personality traits (like cowerdice, aggresivness, ect.
- AI would need to learn from their mistakes when playing agaist a specific player (learn his weakness, how to overcome his tactics)
- And maybe as an advanced option, learn to characterise a human player into these same personality traits, so as to make him a little more predicatable.
I am not yet sure if any of these ideas are even feasable, but it is interesting stuff nonetheless.
OK, so I was giving this some more thought and it is frightening, the amount of nn's and processing (not to mention complexity and work) that it will take to do something like this. So maybe I could rather do a TBS game! This would allow alot of time for 'thinking'.
1 & 2 are commonly done in modern RTS games
3 is too vaguely defined to be implemented. Learn what specifically? Define weakness. Define tactic. Define = phrase in terms that are programmable.
4 is similarly too vaguely defined. What traits define the categories. How would you detect them, etc. There's also a danger here of the player learning to game the AI. A reactive AI can be gamed thusly: play specifically in one "style" until the AI reacts -> dramtically change style and now the AI sucks balls.
3 & 4 are things that are trivial for a human to do. Vaguely defined as you have them they are beyond the cutting edge of AI. I can think of smaller ways you can adapt: monitor your own unit losses, change construction based on units that (a) survive longest (b) do most damage (c) some other metric. Similarly you can adapt your tactics that way also (assuming you're using a "bag of tricks" i.e. scripted tactics whose weights you can change).
But, basically 3 & 4 should be expanded to about 10 "pages" worth of detailed description of exactly what you mean and ways that you might implement it.
You also need to remember that a human will possess much more flexibility in play style than your AI. The AI needs to account for that somehow. Inherent in your description of 3 & 4 is an assumption of a consistent player (that doesn't exist)
-me
3 is too vaguely defined to be implemented. Learn what specifically? Define weakness. Define tactic. Define = phrase in terms that are programmable.
4 is similarly too vaguely defined. What traits define the categories. How would you detect them, etc. There's also a danger here of the player learning to game the AI. A reactive AI can be gamed thusly: play specifically in one "style" until the AI reacts -> dramtically change style and now the AI sucks balls.
3 & 4 are things that are trivial for a human to do. Vaguely defined as you have them they are beyond the cutting edge of AI. I can think of smaller ways you can adapt: monitor your own unit losses, change construction based on units that (a) survive longest (b) do most damage (c) some other metric. Similarly you can adapt your tactics that way also (assuming you're using a "bag of tricks" i.e. scripted tactics whose weights you can change).
But, basically 3 & 4 should be expanded to about 10 "pages" worth of detailed description of exactly what you mean and ways that you might implement it.
You also need to remember that a human will possess much more flexibility in play style than your AI. The AI needs to account for that somehow. Inherent in your description of 3 & 4 is an assumption of a consistent player (that doesn't exist)
-me
Players learning to game the AI, would the same not be true for one player gaming another (IE switching tactics and confusing him)? Also, the AI would need parameters to know when a player is 'changing style as a tactic', and react by not allowing its own tactics to be as severely affected, because the human is likely to change its tactics anyway. This is after all the best another human player could react to such a strategy anyway, is it not?
Now the AI on the other hand, could adopt similar tactics and switch tactics once a player has gotten to used to the current one. I mean lets face it, nothing beats a computer at not giving up and recovering from a bad situation!
As for the 10 page detailed implementation, I am working on it, although I was kinda hoping that someone could lend a helping hand here.
Now the AI on the other hand, could adopt similar tactics and switch tactics once a player has gotten to used to the current one. I mean lets face it, nothing beats a computer at not giving up and recovering from a bad situation!
As for the 10 page detailed implementation, I am working on it, although I was kinda hoping that someone could lend a helping hand here.
Quote: Original post by chosendl
Players learning to game the AI, would the same not be true for one player gaming another (IE switching tactics and confusing him)?
No. Again you're assuming that a player never changes tactics. You can't game a player in the same way because when you do the player reacts swiftly. I guess it may just be semantics.
Quote: Original post by chosendl
Also, the AI would need parameters to know when a player is 'changing style as a tactic', and react by not allowing its own tactics to be as severely affected, because the human is likely to change its tactics anyway. This is after all the best another human player could react to such a strategy anyway, is it not?
Right. But again you're expressing this in human terms. 'changing style as a tactic'. What's a style, what's a tactic. How do you code them, how do you change them. You're taking a lot for granted in this description.
Knowing what a tactic is when you see one and knowing what it is explicitly enough to code one are miles apart.
"react by not allowing its own tactics to be as severely affected". Again this is very loosely defined. what does react mean, what's a tactic, how do you convert "severely affected" into math & code. What data do you need, what processing do you need. can it even be done realtime?
Anyway, all I'm really trying to get at here is that what you are describing is a "hard" problem. "hard" to a programmer means - no one has done it yet, i could easily spend 3 years working on this as a PhD thesis. =)
It would be a really fun project and is actually a road that I've gone down a little bit in my professional work (RTS AI programmer). Just want to make sure you know what you're getting in to =)
At the end of the day, game AI typically uses (a) random choice (b) smoke and mirrors (c) offline data generation to create the illusion that the AI is doing what you describe. A truly "learning" and "reactive" AI approaches developing a human consciousness and is therefore a pretty impractical and potentially impossible task.
What you want to do is come up with a clear understanding of exactly what it is that you want. Prototype a little paper game and make moves and analyze exactly what you are doing and therefore what the AI should do. Think of tricks that get you close, or random choices that can be interpreted by a player as intentional actions (did the AI actually plan ahead to take that hill "knowing" that it would block your later attack, or did it just randomly guess to take that hill with a tiny bit of data and just get lucky?). In games it's generally the latter, and players then think it was the former because they're used to modeling and predicting other humans' brains inside their own.
There's certainly a lot that you can do to approach your vision. Lots of tricks you can devise, lots of actual learning (like the example with how to decide what unit you want to build that I described above).
-me
First, since your new to AI, start simple.
I mean simple like an map with no obtacles and using only 3 units ("rock-paper-scisor"-like).
Its amazing how what you want can be achieved simply by making your AI stats-driven, and just updating the data as the game is played. Keep stats like favorite player unit type, favorite player target, favorite player special abilities, frequency between attacks, and then just favor the counter to this "type/attack/ability".
I mean simple like an map with no obtacles and using only 3 units ("rock-paper-scisor"-like).
Its amazing how what you want can be achieved simply by making your AI stats-driven, and just updating the data as the game is played. Keep stats like favorite player unit type, favorite player target, favorite player special abilities, frequency between attacks, and then just favor the counter to this "type/attack/ability".
Thanks all for the replys. I was indeed hoping to start simple (rock paper scissors) and I understand fully that this is probably not achievable by me or even a group of me's. But I did mention this to be a pet project!
Steadtler, I was more or less shooting for that type of analysis of a human player, and also what he likes to do (attack weak points with small, effiecient contingents or turtle and guard choke points, ect.)
Palidine, I admit that there would need to be a couple of AI layers working together, like The engagement layer, reporting back about the status of each individual fight, the Intel layer reporting back on player tactics and forces, and maybe a tactical layer assesing the information and making tactical choices and issueing commands to the commander layer which will attempt to use the forces available to carry out these orders, conquests.
Theres still alot of finer details that have to be worked out of course. But the whole idea of this is to try and get away from cheap AI tricks and tactics that I find so incredibly annoying and make them a little more competitive on a human level.
Steadtler, I was more or less shooting for that type of analysis of a human player, and also what he likes to do (attack weak points with small, effiecient contingents or turtle and guard choke points, ect.)
Palidine, I admit that there would need to be a couple of AI layers working together, like The engagement layer, reporting back about the status of each individual fight, the Intel layer reporting back on player tactics and forces, and maybe a tactical layer assesing the information and making tactical choices and issueing commands to the commander layer which will attempt to use the forces available to carry out these orders, conquests.
Theres still alot of finer details that have to be worked out of course. But the whole idea of this is to try and get away from cheap AI tricks and tactics that I find so incredibly annoying and make them a little more competitive on a human level.
Original post by chosendl
Palidine, I admit that there would need to be a couple of AI layers working together, like The engagement layer, reporting back about the status of each individual fight, the Intel layer reporting back on player tactics and forces, and maybe a tactical layer assesing the information and making tactical choices and issueing commands to the commander layer which will attempt to use the forces available to carry out these orders, conquests.
Yeah, good idea. Different layers are a great way to simplify your AI's analysis and logic.Quote: Original post by chosendl
But the whole idea of this is to try and get away from cheap AI tricks and tactics that I find so incredibly annoying and make them a little more competitive on a human level.
Yep, fair enough. The only reason I suggest the tricks is because, if done right, the player never knows but it makes their experience more fun. At the end of the day a game is for fun. So any way you maximize fun is generally good.
But I understand the purist viewpoint and it's a fine mentality to have.
You might want to search these forums for "RTS AI" or "Strategic AI". There have been a lot of great threads discussing a lot of what you're looking to implement.
-me
If you want to write rts ai, but not the rts look at TA SPRING. It is a rts game, where you can mod the gameplay. For example: a TA, C&C, and other mods. all datadriven
And it has a c++ ai interface. So you can write your ai as a dll. I did it 2 years ago, and must say it was pretty easy. The low level stuff(wayfinding, ...) is allready done, you must only tell the units where do move, build what, ...
If you have questions, there are lots of guys in their forum.
And for learning ais: You could create influence maps. If a unit dies increase the value at that position. After some time you know where dangerouse places are.
And it has a c++ ai interface. So you can write your ai as a dll. I did it 2 years ago, and must say it was pretty easy. The low level stuff(wayfinding, ...) is allready done, you must only tell the units where do move, build what, ...
If you have questions, there are lots of guys in their forum.
And for learning ais: You could create influence maps. If a unit dies increase the value at that position. After some time you know where dangerouse places are.
For your last two points, you might want to look into dynamic scripting
Enhancing The Performance Of Dynamic Scripting In Computer Games
It might not be the best solution to date, but they've considered the RTS problems you mention.
alexjc
AiGameDev.com
Enhancing The Performance Of Dynamic Scripting In Computer Games
It might not be the best solution to date, but they've considered the RTS problems you mention.
alexjc
AiGameDev.com
Join us in Vienna for the nucl.ai Conference 2015, on July 20-22... Don't miss it!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement