Skip to main content
GameDev.net gamedev.net
🔒 Locked

AI for the player

Started by KeylanFarr Jul 30, 2004 at 5:05 PM 2 replies 1.3k views
Original Post
KeylanFarr
KeylanFarr
I've played a lot of RTSs, and I've noticed a distinct lack in the games I've played. In most RTSs, there is the human player(s) and there is the computer player(s), but I've yet to play an RTS where the player's units are intelligent. In every RTS I've played, the strategic and thinking AI is totally devoted to the non-human players. The problem with this is the fact that I find myself (when I'm 60% done with the campaign) having real difficulties (if the AI is good enough) matching the computing power of the AI. Fact is, humans can't control over a hundred units simultaneously and computers can. This gives the AI a distinct advantage with even just five or so different groups. Most people just can't match that level of control when the battle gets rough. I am constantly annoyed at watching every enemy acting, while the bulk of my forces mills around waiting for orders. Wouldn't it be interesting to have your units actually do something while you're too busy to deal with them. Maybe I'm not that good at RTS games, but I know plenty of other people who agree that the games are needlessly frustrating because your units are so stupid. They frequently make me think that I'm leading hordes of mindless zombies, instead of the intelligent soldiers, I want to deal with...of course, if you ARE leading hordes of mindless zombies, there isn't really a reason to change that, is there? Now that I've got that out of my system... The design I have in mind is just a rough AI sketch so far, and I'm posting here to improve it (and maybe provoke thought and discussion) I plan to build a unit-based heirarchy AI, one that incorporates a more realistic (and still fun) version of warfare than is usually seen. Firstly, the units will be fantasy. They will have no numerical hit point system (this unit has more hit points than that unit), but instead a simple healthy, injured, badly injured, out, down(condition unknown), or dead state. I suppose that is a numerical hit point system, but every unit has the exact same amount of hit points, five. Down is not counted as it's own number, because when a herbalist/medic checks the person out, the unit is then given either the out, or the dead state. The injured and badly injured states are actually much rarer than the out, down, or dead states. In a real battle, if you do get hit, you're lucky to be able to move, and luckier still to be able to fight. Even the most minor damage causes a unit to enter the injured status, and it doesn't take much to put them in the badly injured status. They have an attack and a defense value that decides how well that unit can fight. Ranged attacks negate much of your defense value (unless the unit has a shield), while good terrain raises it. The AI is what we will concentrate on the most. The AI is unit-based in that the units it is based on are special leader units. A higher ranking officer will tell the lower ranking officers what to do, and the lowest rank tells the grunts what to do. The highest ranking officer will command the entire battle, so be careful where you put him. The player/AI will have the ability to promote and demote officers, but doing so at their own risk. Officer units are kept better track of than non-ranking units, and they have different skills and tendencies. The player still has the ability, if desired, to command individual units, or groups of units, but this way, you also have the option to delegate. You have a limited number of overall troops, so you have to use them wisely, or risk defeat. Gaining troops is not as easy as clicking on a building and telling it to produce units and doing so won't accomplish anything(unless you are clicking on a robotics factory or something) You get troops when troops are sent, or recruited from the population, and at no time do you 'build' soldiers. Flight and artillery units will probably not be used in the game, however, the AI needs to be able to handle them because we need the AI to work for a sci-fi world as well as a fantasy. I'll post more later, but probably not during the weekend.
"The fell winds blow,The darkness grows,And I, I stand alone."
gryfang
gryfang
A few statements ...

1. In the RTSs it is possible to beat the computer, but maybe you have to change your strategy ... but it can be done.
2. For a RTS where you don't control the units, just tell them what you want them to do, try Majesty.
3. For a AI that works for a system and can be used in a different one try to make it more heuristicly. Give the unit the ability to poll itself to find out what it can do (movement {flight, swimming, walking} attacking {where it can hit, the name of the weapon, the weapons needs} and in your system ordering {unit's directly under it's command, unit's it outranks, unit's it obeys}) so the agent makes a list of what it can do unique to itself so it doesn't matter if it's a stone golem, a drag racer, or a spaceship. This means you'll have to make all your units able to respond with lists of what it can do whenever it's asked (it's kinda like a baby growing up learning what it can do).
4. Using units wisely so you don't risk defeat is always a key idea in RTSs, but mostly it's because you waste time and resources for making mistakes.

I don't want to say not to do it, just do what you want it in these are just a few things I had to say.
God bless-Gryfang
nife
nife
You're right that you can't keep maintance with the same number of humans as the computer, but you can think, that the AI can't.
That's a very big advantage, and as you get better at RTS or strategic games in general, you will properly also be able to control more units because you know how to react instead of using the time to think your plan through.
You can almost always spot a slip in the AI in any game and therefore think in another pattern than the AI is programmed for, though it's getting harder almost every new RTS (if you see beyond all the AoE clones)...
Killers don't end up in jailThey end up on a high-score!
Timkin
Timkin
Actually KeylanFarr raises a good point... human strategies in RTS are principally designed to counter the fact that we can't micro-manage hundreds of units simultaneously with the same efficiency as computer players. Indeed, this even dictates interface design, so that we can interact with large groups of units simultaneously. This is why turn-based RTS games were so popular... because you had all the time you needed (theoretically) to determine your strategy and implement it... making micro-management just an issue of effort. I still remember my earliest experiences of massively multiplayer strategy games (conquer, galactic empire, etc) where you had a week to determine your orders! Very fast games were played with an hour to determine your orders!

The idea of having AI-assistants for game players has arisen in the past. Consider, for example, Black & White. In that game you trained your Avatar to do your bidding. Your Avatar then went out into the world and acted in accordance with its training. It would be an interesting strategy game indeed that came with AI advisors and assistants to handle the micro management for you and to offer advice on how to defeat your opponent. Imagine crossing Microsoft's Office Assistant with Sun Tzu! It would be even better if you could train these assistants to play in your own style!

Personally, I think it's well worth discussing the abilities of such agents, rather than just assuming that everyone will become a master RTS player with enough practice!

Cheers,

Timkin

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.