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

Single Player AI-less Strategy Game??

Started by Wavinator Dec 17, 2009 at 12:39 AM 14 replies 3.3k views
Original Post
Wavinator
Wavinator
What sorts of game design mechanics can one use to minimize reliance on AI in a strategy game? You've probably heard of game projects which crashed and burned due to AI issues and played your share of games with AI that simply fails to measure up. What game rules / mechanics can you use to eliminate the need for much beyond rudimentary AI? It strikes me that what you really need to consider are the choices the player will want to make surrounding a given situation. If you lack a reasoning opponent, you may have to substitute randomness, arbitrary constraints and a host of conditional rules (which ironically may actually be more brittle that AI programming!) More specifically, I've been thinking about the game design hole I've dug for myself in wanting to allow players to take on a wide variety of roles, from mobster to captain of industry. One way I saw that this might be possible was to have a map abstract enough so that movement and specific positioning (such as lines of supply or kill zones) was mostly non-existent or vaguely represented. The game would need to rely on possible permutations of rules to achieve any depth. If there was no "move troops behind lines to take HQ" then there'd have to be rules such as "HQs cannot be attacked unless combat strength was 2x the defender." This is boring by itself, so whatever process getting combat strength up was would have to be interesting and it would be crucial that this not be the ONLY rule for victory. Taking this approach, you'd lose flexibility but sidestep really tough issues like trying to detect patterns in player behavior or involving positions on the board (especially future ones like imminent envelopment). You might also depict a wider variety of strategic situations. Bank Heist / Prisoner Rescue / Surprise Bombing Raid How many threats do I face? Where are they concentrated? What stops them from all massing against me? What tactics can I use? (Stealth + Surprise, Hit and Run, Siege) What does tactic X, Y or Z gain me? How might they counter tactic X, Y or Z? What do these tactics cost, both short term and long term? How can this situation morph into another (e.g., calling for backup / reinforcements)? Do you think it would provide a decent amount of strategic complexity if these elements were presented to you in the form of 1) Overall plans and 2) Potential interrupts once a plan was in progress? For instance, a bank heist, prisoner rescue or surprise raid might involve identifying the number of defenders. Without specifying individual position, we could portray this abstractly, such as "concentrated," "dug in" or "scattered." Some resource (like time/turns) could then identify how long it takes for the threat we face to morph into a different kind of threat-- for instance representing how long it takes for every defender to mobilize/mass against us. Tactics then could help control this, and defender states might be represented as a series of category values. If we had attack and defense stats, maybe attacker and defender lose their defense stats when we employ "Blitz" whereas maybe a long range attack exposes us to less damage but costs far more time. It might be possible to work out the abstract basics for a wide variety of situations then layer and balance from there. Might it even be possible to do with a strategic map all together? Thoughts?
--------------------Just waiting for the mothership...
MeshGearFox
MeshGearFox
Consider this:

Start with Master of Orion. Only, instead of competing with other AI empires, the focus is shifted. You don't have other AI empires. You have vague, somewhat simple-minded, enemies out there waiting to wreck your empire.

And, instead of focusing on the warfare/conquering aspect, instead focus on the... internal affairs and infrastructural aspects. Make it more like SimCity in space, if you will.

Still requires AI in a sense but a much more rule-driven one.
Haladria
Haladria
I've made a strategy game, Imperii, that only uses a very basic AI since it's a defense game. You build a defense around a base and the enemies try to walk through it. Even if the AI is a simply path-finding algorithm the game is very strategic. The difficulty is to build and upgrade the right turrets in the right time and at the right place. The whole layout of the defense is also very important.

The game:
http://www.gamerendering.com/Imperii

/
KulSeran
KulSeran
Consider a simple cellular atomata aproach.
Set each location on your map (grid, planet, whatever) as having a defense and value.

*Value brings traders/industry.
*Traders/industry bring pirates.
*Pirates drop security.
*Low security + Traders brings military.
*Military increases security to owner, but lowers value to owner.
**Lost trader ships in an area causes a temporary value loss to the owner.
**Enemy Military == Pirates to the enemy AI's evaluation of security.

Now, the player will be able to place anything he wants far more strategically than any AI would. But the AI would seem to be acting intelligently. It would attempt to counter your military to protect traders, traders would move around to capture high value areas, etc. Much like the fish/sharks/algae atomata, you'd see everything swimming about the map, acting in its own best interest.
To make things more "strategic" on the side of the computer, limit the military and trader sizes by some economic value for the empire, so the resources of the empire have to move around.


If you can distill the experience down to one or two features, it is easy to make an AI that SEEMS like it is doing good. A lot of RTS games deal with this by coding in what units are hard/soft counters to what other units. Causing any AI that sees you build Air to produce AntiAir to counter your exact move. The AI might not do anything else "smart", but it tends to have the right unit combination to counter your moves, making anything it does do seem all that more effective. Or again, some RTS games manage to always place units at the right spots (chokepoints, near resourcers, etc.) making it much harder to kill/counter at any encounter, because of good positioning.

So, anything you do ontop of the simple AI system is just flavor, the AI picked units and positions that were good. Now you get to pick how the dice roll in combat, ie.
he picks randomly and hidden from you 'turtle'.
You pick 'stealth'.
He gets a low attack(can't maneuver, reducing his options), high defense and scout. 3/7/7
You get a bonus to getting past scouts, very high attack (surprise), low defense. 7/2/4
So, he sees you, does moderate damage, but you still catch him somewhat off guard, doing moderate damage.
A diplomacy option would end up with both sides not losing anything, but all the enemy units being removed from the tile, and yours placed there instead. etc.
Kekko
Kekko
If you can represent all decisions as slider values you can create a system of equations that is then solved numerically to get an optimal solution. Computers are good at that. The AI can also approximate the probable values the player will use and expand the equations into several steps, thus looking into the future. Some of these equations can include map coordinates, morale, firepower, formation, area knowledge, ammunition and whatever else you can think of.
Then let the GPU solve that matrix.

EDIT: Note that map coordinates can also be considered slider values. And you might put in equations to prevent them from being to close to each other.
Yvanhoe
Yvanhoe
Have a stupid but overwhelming ennemy : ZOMBIES !
I never played DOTA but apparently this is the same motivation.

Tower defense games involve a predictable, stupid but overwhelmingly powerful enemy. It takes skill and strategy to defeat those.

Alternatively, you could have a game where a natural process is the "enemy" : manage an ever growing population, manage resources in a sea-rising world, build a civilization/city/base with a countdown timer that unleash a vague of destruction you have to resist for the longest time, etc...
Psilobe
Psilobe
Considering how many fps games where the AI is so horrendously stupid it isn't fun to play I've been trying to figure out how to make them seem more intelligent in generally easy ways and the approach I've come up with would be using elements from rts games.

If you use layers of AI so to speak I think you could create a rather intelligent but simple enemy for different types of games.

At the lowest level we have the traditional things most units need to have, path finding, aiming and maybe some way of finding cover and similar.

By adding another layer we can create squad behavior, a commander who analyses a tactical situation. From here order like flanking maneuvers or similar could be given to the units.

We can keep adding layers with command over lover levels until we tailor it in such a way that we get the effect that we want. Here more strategic decisions are taken, that area needs to be secured, defend this area.

As layers are added as needed we can get to the point where the main goals are defined for the game. Is it to rob a bank, conquer the world, defend something or whatever you need.

Maybe this doesn't really fit what you are looking for but by separating single units from the main enemy you can tailor it to fit different roles.

Different levels in this hierarchy could then take care of a variety of tasks, the tactical threat could be assessed by a commanding layer for that squad or unit. A higher commander could asses where the unit would be best deployed or most likely to encounter a more dangerous enemy, spotting weaknesses and order deployment, you name it.
MeshGearFox
MeshGearFox
A few points:

Don't think so much about *smart* enemies. Think about interesting enemies.
Don't think about *human-like* enemies. Think about challenging enemies.
Don't think about *perfect* AI. Think about fun AI.

Here's some ideas.

Good AI is meaningless without giving the enemy things to do. If you have perfect AI but the enemy is only capable of running and shooting, it's not very interesting. On the other hand, if you give the enemy interesting actions and some simple rules about when to do these, you can have simpler AI that's more fun to play with.
Drethon
Drethon
Quote:
Original post by Psilobe
...
If you use layers of AI so to speak I think you could create a rather intelligent but simple enemy for different types of games.
...


This is the direction I've been looking at going with my game. It seems like this would help ensure a single AI doesn't completely loose track of itself and keeps the overall stratigy going the right direction. Also each higher level of AI could be run less often than the lower levels which would save on processing.
My $0.02
Tim Ingham-Dempster
Tim Ingham-Dempster
I definitely think this style of gameplay has enough depth to sustain a game if done properly. Looking at a simple example (which I now realise is fairly similar to KulSeran's):

The game world is made up of a number of territories.
Each territory has revenue and defense values and belongs to a faction.
If the player's faction owns a specific territory he can choose the level of extra defense to give it.
If the player's faction does not own a specific territory he can choose the level of attack to give it.
Attack and defence cost revenue.
If the ratio of attack to defence is high enough the territory is captured.
There are attack and defence bonuses for territories based on borders/distance from enemy/depth within friendly territory.

As I'm sure you can imagine the strategic possibilities are huge. There are also three main benefits from an AI point of view:

1) Computers are very good at making reasonable decisions in this type of game, its essentially an optimisation problem.
2) Most of the show-stopping AI issues are null and void. There is no need for pathfinding and combat AI.
3) Humans tend to ascribe intelligence where none exists in this kind of situation. It will feel like the computer is making complicated plans when its just trying to maximise its territory.

So yes, I do think gameplay this abstract can work. How to create a working mechanic for your examples is a harder problem. If it was to follow the game described above, which I am not suggesting but just using as an example, the territories could represent the captain of industry's facilities or the mob boss's front businesses. There could be more than one revenue type associated with each territory and some territories could need to use one type of resource to create another.
Wavinator
Wavinator
Wanted to say thanks for the replies. KulSeran and Tim Ingham-Dempster got me thinking about a mixed approach to cellular automata approach where the rules change over time. Different cells in the form of different factions could operate by different rules and constraints to growth, but maybe everything is limited to common resources (like people or energy) so that growth is balanced, competitive and checked. But maybe growth would introduce new resources which again changed how cells could grow.

Quote:
Original post by KulSeran
Now, the player will be able to place anything he wants far more strategically than any AI would. But the AI would seem to be acting intelligently. It would attempt to counter your military to protect traders, traders would move around to capture high value areas, etc. Much like the fish/sharks/algae atomata, you'd see everything swimming about the map, acting in its own best interest.


Not sure if this would be frustrating but one big key to this I think would be NOT being able to see the big picture. If your resources limit the window of what you can see in terms of emerging behavior, you won't be able to control and outsmart the AI. It would be like having a limited window or fog of war in strategy game-- surprises come from what you can only guess at.

Quote:

So, anything you do ontop of the simple AI system is just flavor, the AI picked units and positions that were good. Now you get to pick how the dice roll in combat, ie.
he picks randomly and hidden from you 'turtle'.
You pick 'stealth'.
He gets a low attack(can't maneuver, reducing his options), high defense and scout. 3/7/7
You get a bonus to getting past scouts, very high attack (surprise), low defense. 7/2/4
So, he sees you, does moderate damage, but you still catch him somewhat off guard, doing moderate damage.
A diplomacy option would end up with both sides not losing anything, but all the enemy units being removed from the tile, and yours placed there instead. etc.


Right if you could put a lot of depth to this part I could see this possibly working well. Taking a page from RPGs, put some of the tactics in creating states in the enemy-- making them suppressed or demoralized or fatigued, then hitting them with the right manuever once they're in this state. Then allow the enemy to do the same to you and alter your stats based on these states, so that maybe you're demoralized or fatigued and now have to worry about how to recover or what might happen when you're in this state.

Older strategy games used to do this, but I think the novel twist would be in applying this to factions. If drop the player in a petri dish of mixed groups (corporate operatives, zealots, hackers, patriots, etc.) and give them goals while the groups are trying to achieve goals I think it could be quite interesting-- even if it would be at times unweildy!
--------------------Just waiting for the mothership...
Wavinator
Wavinator
Quote:
Original post by Tim Ingham-Dempster
The game world is made up of a number of territories.
Each territory has revenue and defense values and belongs to a faction.
If the player's faction owns a specific territory he can choose the level of extra defense to give it.
If the player's faction does not own a specific territory he can choose the level of attack to give it.
Attack and defence cost revenue.
If the ratio of attack to defence is high enough the territory is captured.
There are attack and defence bonuses for territories based on borders/distance from enemy/depth within friendly territory.


Thanks for the thought put into this.

Attack is one dimension that I think works well but could be modeled different ways. When a mobster takes over a business, for instance, he's likely not attacking it in the traditional sense; likewise when the feds show up to knock out the mobster, their "attack" may be surveillance and wiretapping. So what we're talking about is influence and control.

If I can mutate this thread a bit, this is what occurs to me:


  • Conceptualize the area and it's reasources (a city map or whatever)
  • Create several factions and cellular automata-like rules for how they grow
  • Create rules to resolve conflict when they want to grow in the same area
  • Simple AI tracks TOTAL growth of influence and creates a priority for factions to target other factions (this seems to be what nations and companies do, looking ahead to future strategic positions)
  • Come up with how the player interacts with this information (news? rumors? intelligence reports?) and limits to how much the player sees/knows
  • Merge the rules for growth and interaction with cells / factions with player options. This assumes that the player's palette of actions is greater than the factions simply because we never want to bring the player's problem solving abilities into direct competition with the AI


Quote:

So yes, I do think gameplay this abstract can work. How to create a working mechanic for your examples is a harder problem.


Yeah that's the bear. When I started this thread I was thinking of the low level (per cell) interactions, because as a player you're NOT a faction-- at least not initially.

So if the bank in the example was a mob bank it would be a cell. But what I want to avoid is the minutiae of actually plotting NPC walk paths and such inside. I want the interactivity to model what you might find in a story told in the past or future planning tense: There were X doors, Y guards, Z security measures; resources were X time until reinforcements arrived, Y skill level to crack the safe, etc.

Maybe what's important here is to try to figure out how all these little factors weigh in in relation to the larger automata system I might use. It could be simple in that guards, doors and security measures all add some Security value, which directly opposes certain types of faction attacks (crime gangs, for instance).

--------------------Just waiting for the mothership...
Alpha_ProgDes
Alpha_ProgDes
This might be leaning toward a zombie-esque, puppeteer approach but how about just regular event-based attacks.

For instance:
  • When your base has a thousand soldiers, CPU sends in 3 waves of sentries
  • When your base acquires fire arrow cannons, CPU sends in 5 waves of bull against your gate
  • If your empire lasts for more than a year, CPU begins the dreaded Winter campaign
  • You have a Hero(TM)! Your base sees an influx of prostitutes and gypsies. 25% of which could be either spies or assassins.
  • Your base has created the Spiked Chariot(TM). CPU creates a battle on your outer border/perimeter, forcing your base to leave only a minimum amount of soldiers stationed at the base.

Very little Complex AI, I would think.
Beginner in Game Development?  Read here. And read here.  
Platinum_Dragon
Platinum_Dragon
In What makes a good 4x space game economy model?
Quote:
Original post by Platinum_Dragon
....
The split of the game:
Logistics : Production for more income or production for more units
Tactics : fight to steal others' resources or to defend resources
There that's 2 level of 2 controls. Top level split into tactics and logistics, and the bottom level split into offense versus defense.
Then the game is about dynamically shift only 2 shifters during different time frames. And that is all about strategy game at the most abstract level (in my opinion). The dynamic change of these shifters at the right moment is the same as any other strategy game, the timing is what really matters, not the micromanagement skill level.
....


Anyways, the simplest game is one with the simplest AI. AI always exist because you cannot remove the action-reaction from a strategy game.
The idea I post above is the simplification of strategy game. Just simplify it into a flip of two coins for every game iteration. The average heads will calculate the percentage in economic production vs unit productions for logistics, and in defense vs offenses for tactics. The order can also calculate if the player is rushing or not.
Offense/Unit production is the same as rush command.
Defense/Unit production is turtle.
Defense/Economy production is just teching up.
Offense/Economy production is usually a recovery period after a rush or large battle.

The game is simplified into a tactics coin and a logistics coin. That way, the AI is as simple as just a pseudo Random Number Generator modified to keep the difficulty level low enough for the player.

I tried simplified the strategy game until it cannot be simplified further. I got two Nash equilibria.
I use QueryPerformanceFrequency(), and the result averages to 8 nanoseconds or about 13 cpu cycles (1.66GHz CPU). Is that reasonable?
I though that the assembly equivalent to accessing unaligned data would be something similar to this order:
move
mask
shift
move
mask
shift
or

So it seems reasonable to say that it takes 14 cycles for unaligned data since we'll have to do the series of instruction
Tim Ingham-Dempster
Tim Ingham-Dempster
You appear to have a handle on the cellular automota side of things, although I wasn't suggesting that you need this, just making an example of that kind of gameplay.

On that subject though, a cell could be owned by both the mob boss and the FBI. The mob boss would attack it with a balance of threats to the owner and cash to buy it. The feds would attack it with resources in the form of wire taps and informants as you said. Once the mob boss succeeds it would generate revenue from money laundering (or thugs to use if it is a hideout etc). Once the feds own it it would provide them with intel. This could be used to convince the government to provide more wire taps allowing them to attack other mob cells or to reduce the fog of war around the mob bosses other cells. It could also go to a cumulative intel pile to get a prosecution going against the mob boss. There is no reason that the mob boss couldn't continue to use the cell as normal, in fact it would be important to the feds that he does. There would also be factions that couldn't own the same cell, two rival mob bosses for example.

The gameplay inside a cell is going to be tricky. I think it would have to revolve around the player dividing resources (and the award for "Captain Obvious 2009" goes to...). What I'm trying to get at is that there can't be a "solution" the player will have to react to a continuously changing situation. The problem I see is that it will tend to lead to very static scenarios.

For example, in the bank heist you could assign gang members to raid the vault or cover the customers and security guards but then what? Presumably there would be a countdown until the police arrive and for every second you stay the amount you get from the vault increaces. There would be the initial distribution of gang members and the descision when to leave, but thats all. There isn't a lot for the player to do in between. There is also the possibility that the security gaurds or customers will fight back if you don't assign enough people to them, which would add tension. This could work, as long as it only lasts a few seconds, but it doesn't seem much to pin the rest of the game on.

Perhaps there could be a number of zones and each one would have a "fight back o-meter". The player would have to balance gang members amongst these zones. If their level of "fightbackness" changed randomly over time, the player would have to constantly react. I'm not sure how much fun this would be as it basically boils down to a reaction test.

What would get more interesting is if the police do arrive and you have to deal with hostage negotiators. There you have an outside force which is going to cause the situation to change constantly, making the player react.

I think you need to find something like this for each of the scenarios that the player encounters, which could be time consuming.

Not sure if I had a point in there or not but I can't condense my thoughts much more than that.

Edit: Had a thought a couple of minutes after posting this. In the bank example, gang members could have skills which would affect their efficiency in certain tasks, increasing the richness of the possibilities. The main problem with any approach to this scenario though is that the other side is completely at the mercy of the player so the bank defenders would not be able to move to different zones to change the problem presented to the player.
Tim Ingham-Dempster
Tim Ingham-Dempster
I'm sorry, the ideas in my last post were terrible. I was having a hard time thinking of complex gameplay that isn't primarily space-based. Looking at games in general I was having trouble thinking of games that don't use spatial configuration as a core mechanic. Then I thought of card games, this could be a useful avenue of investigation.

As a quick example using the bank again, the heist could be made up of a number of screens. These could include the lobby, the backroom and the vault. Each member of your gang would have a number of skills (the "cards"). The cards would be split into two types, ones that can be used as many times as the player wants and ones that can only be used once. At each screen the bank would deploy its own cards, in this case in the form of security measures. The player would have to play cards to counter them. The one use cards would need to be potentially usable in multiple situations, for example electronics, demolition, etc, so that if the player uses them in one place they will meet other situations where they may have been helpful.

Or something like that anyway. Hope that helps more than my last ideas.

Topic Locked

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

Sign in to reply to this topic.