Logo Platform
logo amplifiers simplified

AI cheating settings

Copied to clipboard!
11 years ago
Apr 28, 2014, 7:58:06 AM
It had good AI - it became a challenge to an experienced player with very mild bonuses. For Civ4 BtS 'Better AI' and additional mods make the AI very competitive. I do take your point though, there's no 4X game which comes to mind where the AI is 'good' in the sense that it can routinely beat an experienced player with no bonuses. I guess that's what I'm hoping for - the ability of players to improve the AI through mods and an AI which is competent enough that mild bonuses make it a challenge.



There are other games where the bonuses the AI receives are a joke, and because it's so predictable it still loses.



Another game which comes to mind for good AI is Shogun 2 - apart from sieges. However it is a simpler game overall, I wouldn't put it in the 4X camp.
0Send private message
11 years ago
May 1, 2014, 11:36:34 PM
Well, EL is still in Alpha, and it's probably better to code an AI only when design is pretty much set in stone. I would be more interested to see what kind of logic a finished game like ES ended up having.



I spoke too fast maybe. I should have said : No 4X game ever had an AI strong enough to be able to beat, on even ground, a player of at least average (median) skill that has played the game at least long enough that he knows the game enough to be able to make his own strategies (let's say 50 hours, seems about right)... except maybe for GalCiv2.



The thing with so called even ground is that very often, even what is called "Normal" difficulty is actually still giving bonuses to the AI.



So I am not talking about some kind of "elite" players here, just "good" using the most permissive definition of the word.



We have to give to Stardock the credit for trying to push the AI... but the reason they could pull it off is that GalCiv2 is quite simplistic relative to other 4X games, especially regarding its combat system. (And even for that game I wonder if the AI is "good" by the definition I just exposed, even though I heard it could pull off some quite human - like strategies, something that other 4X AI's are generally totally incapable of)
0Send private message
11 years ago
May 1, 2014, 9:56:04 PM
Ha, I'd never call myself elite and I wouldn't say no 4x game ever. MOO2 had a good AI I thought. I'd instead say that the AI in any 4x game published in the last 10 years is little better than an extended tutorial and the real game starts when you bring other humans into the mix.
0Send private message
11 years ago
May 1, 2014, 8:41:01 PM
BlueTemplar wrote:
Except that, AFAIK, no 4x game ever had a good AI.


It must suck to be a hardcore-elite player, I guess. Those players never find any AI to be good enough. The rest of us, regular folk, are more fortunate.



Galactic Civilizations II had good AI, devs working on it for some years after initial release and in between expansion releases. Taking hints from player tactics/strategies. And if I don't remember wrong, the difficulty settings just affected some econmic bonuses to the AI (no free techs or similar stuff), or capping the AI's strategies in the lower levels. Unfortunately for the elite, it was never good enough but I remember having to drop the difficulty, for a while, after some patches.



I read that Amplitude releases some free content after release of their games? Free AI updates is a nice free update after release.
0Send private message
11 years ago
May 1, 2014, 8:13:34 PM
glutamate wrote:
Yeah, Civ4 did it that way too, with happiness in cities and the AI's willingness to trade with each other.



As mentioned, I do hope the modding of this is left open, since then modders can add a ton of variation to the way AI is given an advantage.



All the AI cheating is useless though if it's so stupid that it can be beaten almost as easily.
Well... there is some of that already. It's just the interface for it is currently a giant xml-hell of "fudge some statistics, and pray." To give an example,



[code]







































[/code]



The game only uses xml but here's a json version if you're like me and find the above a mess, (not that json makes it all that much better)



[code]{

"Controller_Sequence": {

"Debug": "AttackCity_TryToAttackEnemyInRange",

"GetTargetInRange": {

"PositiveCheckOn": "YES",

"Output_TargetListVarName": "$TargetList"

},

"SelectTarget": {

"TargetListVarName": "$TargetList",

"TypeOfTarget": "Army",

"TypeOfDiplomaticRelation": "Enemy",

"Output_TargetVarName": "$Target"

},

"CanDefeatEnemy": {

"PositiveCheckOn": "YES",

"TargetVarName": "$Target"

},

"GetTargetPosition": {

"TargetVarName": "$Target",

"Output_DestinationVarName": "$AttackWorldPositionDestination"

},

"Controller_Selector": {

"Debug": "AttackCity_TryToAttackEnemyInRange_EnemyInRange",

"Controller_Sequence": [

{

"Debug":"AttackCity_TryToAttackEnemyInRange_EnemyClose",

"DestinationReached":{

"DestinationVarName":"$AttackWorldPositionDestination",

"TypeOfCheck":"Regular"

},

"Action_Attack":{"TargetVarName":"$Target"}

},

{

"Debug":"AttackCity_TryToAttackEnemyInRange_GotoAndAttack",

"Action_GeneratePath":{

"DestinationVarName":"$AttackWorldPositionDestination",

"TypeOfPath":"Regular",

"Output_PathVarName":"$Path"

},

"CanReachPositionInTurn":{

"PositiveCheckOn":"YES",

"DestinationVarName":"$AttackWorldPositionDestination",

"PathVarName":"$Path"

},

"Action_GotoAndAttack":{

"TargetVarName":"$Target",

"PathVarName":"$Path"

},

"MoveEnded":{"PathVarName":"$Path"}

}

]

}

}

}[/code]



Pseudo code functional equivalent of above code, (note: the xml "declares" it's logic; so this is not 100% equivalence)



[code]// randomly attack everyone

var my_armies = known_map.findFriendlyArmies();

var targets = known_map.getEnemyArmies();



armyloop: foreach (army in my_armies) {

foreach (target in targets) {

if (game.validateAttack(army, target) && game.compare(army, target) > 0) {

recomendation.push(game.createAttackOrder(army, target));

continue armyloop;

}

}

}



return recomendation;[/code]



[ReferringtoXML:] There's not much else to it, though in the devs defense this may be just a "any ai is better then no ai". You can check the files yourself.



Obviously if the Ai just attacks everything in range with out tacking into consideration intent, strategic options, consequences of attacking them, combined enemy force (is this battle going to lose the war even if I win?), it's just going to be permanently gimped/silly no matter what else you add to it. From what I've seen of the files the ai doesn't even attempt to make some basic assumptions, much less have any power to predict it's actions. Unfortunately while one might be able to do some "tweaks" unless the game's default ai is just the absolute "jewel" of perfection (which let's face it no game can achieve!) there's not much hope in modding the giant XML declarative syntax. It's essentially like coding a poker ai where the only thing you can do is say "call every time on 5000," it's just not ever going to work.



Oh and also unless I'm reading the files wrong the Ai currently has 1.1 fidsi (ie. +10% everything). Just mentioning that so those of you who wish to get the "slider of master difficulty" against the ai that doesn't even care for which target it's attacking, can just go for it. =P



Just for the purpose of making a point here's how I want to see an ai script look like,



[code]// aimod = collection of function created by the modder

// too much crap to write if I were go too deep into algorythms



if (game.turn() == 1) {

aimod.decideGlobalStrategy();

return aimod.optimalGameStartRecomendations();

}

else if (game.turn() < 15) {

return aimod.optimizedEarlyGameLoops();

}



aimod.history.updateEvents(known_map);

var event_list = aimod.history.getImportantObservedEvents();



// score, cities, strategies, armies, etc

// calculates for everyone: friends, enemies, neutrals, map objects, map events

// some personality traits are guessed based on events list

var threats = aimod.calculateThreats();



// save the threats for statistical purposes

aimod.history.recordThreats(threats);



// score, armies, strategies etc

var our_threat = aimod.calculateSelfThreat();



threats.sort('reverse');

var greatest_thread = threads.get(0);



// check for rushes

if (greatest_thread.toInt() >= aimod.DEATH_THREAT) {

recoemndation = aimod.specialTactics(greatest_threat);

}

else { // we're not going to die this turn, yey



if (greatest_threat.toInt() > aimod.POTENTIAL_DEATH_THREAT) {

greatest_threat.setForcedPriority(aimod.HIGH);

}



// project threat growth, decay

// ps. this excludes our influence on the threat

// if a player grew in threat he's likely to grow in threat

// if a player dropped in threat he's likely to drop in threat

// at least as far as this ai script is concerned only the ones growing are

// important enough to waste actions on; 20 turns projection,

// consistency is taken into account

var future_threats = aimod.threatChartedBurndown(threats, 20);



if ( ! aimod.isCurrentStrategyValid(future_threats)) {

// if we cant continue with what we're doing in 20 turns, time to

// re-think our plan

aimod.remakeGlobalStrategyLoop();

}



var real_threats = aimod.sortThreatWithStrategy(future_threats, aimod.getCurrentStrategy());

var options = aimod.createRecomendationSet();

options.add(aimod.strategyRequiredMoves(), aimod.MANDATORY);

options.add(aimod.knownHardcodedStrategicOptions(real_threats), aimod.HIGH);

options.add(aimod.maintenanceActions(our_threat), aimod.MEDIUM);

options.add(aimod.notYetAddedPossibleActions(options), aimod.LOW);



// tacking into account priority filter to get the most actions in a single

// recomendation; MANDATORY actions are like the name implies guaranteed to

// be in the recomendation

var recomendation_draft = null;

var potentially_invalid = aimod.createRecomendationSet();

do {

// uses potentially_invalid as a limiter

recomendation_draft = options.createOptimizedRecomendation(potentially_invalid);

potentially_invalid.push(recomendation_draft);

}

while (aimod.hasStrategicGotcha(recomendation_draft) || aimod.invalid(recomendation_draft));



recomendation = recomendation_draft;

}



aimod.history.save();

return recomendation;[/code](yes the above probably fails somehow, even as pseudocode, version 1.0s always find a way to suck; now way I'm writing that in xml, it's impossible)
0Send private message
11 years ago
May 1, 2014, 8:26:38 AM
Yeah, Civ4 did it that way too, with happiness in cities and the AI's willingness to trade with each other.



As mentioned, I do hope the modding of this is left open, since then modders can add a ton of variation to the way AI is given an advantage.



All the AI cheating is useless though if it's so stupid that it can be beaten almost as easily.
0Send private message
11 years ago
May 1, 2014, 1:28:39 AM
Yeah, that is part of how Hearts of Iron did it, a combination of economic penalties for the player, plus combat bonuses for the AI. The base difficulty scale also included economic boosts for the AI, but that game is so easily moddable that you could easily go into a particular text file and break the bonuses out any way you wanted to.
0Send private message
11 years ago
May 1, 2014, 12:08:14 AM
Oh, that made me think of this : one thing that is often much more fun than giving the AI a huge economic boost, is often to give a big penalty to the human player instead : it's much more rewarding for an experienced player as a challenge to triumph with limited means.
0Send private message
11 years ago
Apr 30, 2014, 10:20:42 PM
It is not cheating. However some ways of giving an AI an advantage are better than others.



You always need to give an AI some sort of advantage unless the game involved is very simple in its mechanics. Strategy games are not simple in that sense.



It is sad that the current state of AI in most strategy games is so inadequate that I consider playing against them as nothing more than an extended tutorial. I am fortunate enough to have a few live human opponents against whom I can play real games.



That being said, there are some of the easier methods used to make the AI more competetive that I simply hate. One of these is very commonly the main one used and was used in ES. I am referring to giving them a big economic boost so they try to make up for bad play by having lots of stuff. This leads to a long string of boring lopsided battles. Wading through a huge pile of troops or ships etc. (It is almost like the hero gunning down waves of bad guys in many Hollywood movies). The only thing this challenges in the end is the players' patience.



I am OK with making them more competetive with a research boost.



Even better is some sort of die roll modifier in combat. This makes them harder to defeat militarily without having to wade through piles of poorly led troops. This could even be as simple as AI troops always effectively being one or two experience levels higher than they should otherwise be.



I'd rather see (once there are different difficulty settings) a tweak where I get a flat -10 to happiness while that AI gets +10, than to see another +40 or +100% AI production boost.
0Send private message
11 years ago
Apr 27, 2014, 11:38:12 PM
In most games the AI cheats to provide a bigger challenge for the players, sometimes it's obvious, sometimes it's (almost) perfectly hidden. Why do devs allow their AIs to cheat? Well, simply because it's easier, cheaper and not as heavy on a players rig as a really powerful AI would be.



I am not saying that a cheating AI is a good substitude for a powerful AI, but why not give the player the option to have both? Create an AI as powerful as you can and than add advanced AI settings that allow us to chose if and how exactly our AI should cheat. Let us e.g. increase it's vision range, resource gain or base army size, let's adjust how likely it is for the AI to get quest or dust from ruins and so on. All this stuff should be fairly easy to implement but could provide a huge amont of additoinal challenge and add customizabilty to the game.





What do you guys think?
0Send private message
11 years ago
Apr 28, 2014, 7:02:21 AM
I'm sorry but a good player will wipe the floor with a Civ4 Noble AI (and even that one gets some bonuses compared to the human player).



I never said it's not going to happen, it's just that it's very unlikely considering that a good AI in 4X games seems to be very hard/expensive to make.
0Send private message
11 years ago
Apr 28, 2014, 5:00:43 AM
BlueTemplar wrote:
Except that, AFAIK, no 4x game ever had a good AI.

So asking for EL to have a good AI is just not realistic.



If a player wants some challenge he has to either :

- Play against multiple allied AI's.

- Limit himself using some custom rules.

- Play against an AI with an handicap (or even an AI that cheats)




Civ4 had good AI. Civ4 with mods had excellent AI. MoO2 had passable AI, and that game is over a decade old.



Also, your logic is conjured from your ass.



It hasn't been done before, therefore it's not going to happen? It hasn't been done before, therefore it's unreasonable ask for it?
0Send private message
11 years ago
Apr 28, 2014, 4:56:21 AM
nachtnebel wrote:
In most games the AI cheats to provide a bigger challenge for the players, sometimes it's obvious, sometimes it's (almost) perfectly hidden. Why do devs allow their AIs to cheat? Well, simply because it's easier, cheaper and not as heavy on a players rig as a really powerful AI would be.




I think your beliefs about how AI is coded for strategy games are wrong.



For that to be the case, you must think AI uses some sort of exhaustion search mechanism to find the best move, like an old chess AI. This isn't the case.
0Send private message
11 years ago
Apr 28, 2014, 2:45:00 AM
Except that, AFAIK, no 4x game ever had a good AI.

So asking for EL to have a good AI is just not realistic.



If a player wants some challenge he has to either :

- Play against multiple allied AI's.

- Limit himself using some custom rules.

- Play against an AI with an handicap (or even an AI that cheats)
0Send private message
11 years ago
Apr 28, 2014, 1:14:41 AM
Wredniak2003 wrote:
I consider attempting to create truly challenging AI is not cost effective.
I created a cost-effective way of doing it. See signature.



Wredniak2003 wrote:
The amount of effort needed to accomplish that at sufficient level would take away from other aspect of the game and that would IMO hurt more than cheating AI.
See the problem here is that while it might "work" considering only present circumstances, does it actually "work" long term? It doesn't matter how many cheating options you add, you could just add a unit health and damage boost to it and leave it at that since once player get bored of one cheating ai they get bored of all of them, especially if you give them one with a slider. On the other hand with non-cheating ai there's a lot more acceptance of different ai's.



I may be slightly biased in this, but I consider any feature the player CAN get bored with (in our case cheating AI) to be a detriment to the game, long term. So in a sense a double-edge feature: temporary solution, but long term handicap.
0Send private message
11 years ago
Apr 28, 2014, 1:09:04 AM
nightbasilisk wrote:
Should work as a stopgap solution for the current lack in ai capabilities but long term it may cause more harm then good.



Having a game with no cheating ai is better overall. If you have to have the ai cheat then the ai is broken. By cheating you're just masking that and the mask falls off after enough games. Worse still players can get very annoyed at the game because of ai creating situations that would normally be impossible due to added effects; even if the entire thing is transparent and even if it's by player choice the ai was cheating!



In addition the ai beeting the player or not by itself is not necessarily even the issue. Good ai should be able to properly cooperate with other ais against the player even if their ability on their own to manage their empires is subpar to the players ability to manage his empire and forces.




I don't intend to argue if there is possible to create competent AI without cheating on something as complex as 4x game due to the sheer number of choices available. And computers are best at brute force approaches not "smart" ones. Even if you would be able to create the AI that would be the genius level I don't think it would be able to mach a veteran player. But as I said that is besides the point.



I consider attempting to create truly challenging AI is not cost effective. The amount of effort needed to accomplish that at sufficient level would take away from other aspect of the game and that would IMO hurt more than cheating AI. I believe games should be fun and the amount of fun player takes from any games depends solely on the player but there are some general "rules". For example being mostly bug free is one of the most important aspect. Other is ability to offer unique experience and time before we get bored are ready to move on. All in all I think majority, although want a challenge, have no desire to be master tactician and focus more on number of races, interesting unit design ect.



The tough reality is that a game is made on a budged and choices have to be made. So after all I think all we can get is choice how AI cheats not if. Bonuses to FIDS are standard nowadays I believe and I think most players can live with them. What I consider is more important is to describe what AI gets over the player on higher difficulties and ensure there are no ridiculous tricks for AIs like teleporting armies, unit stacks coming out of nowhere where you are about to take enemy city or AI ignoring fog of war. I agree that you and some other player maybe dissatisfied with this it won't change unless there is enough need for a game with excellent ai at the cost of graphics and/or diversity for developers to profit. Only other option I see is someone with big enough wallet giving developers funds to justify the increased cost.



As for AI cooperating with each other I think that should be reserved for special option like player vs. the world ect. I'm not sure if I even wanted to play a game when AI's gang up on me as a default.
0Send private message
11 years ago
Apr 28, 2014, 12:42:01 AM
Should work as a stopgap solution for the current lack in ai capabilities but long term it may cause more harm then good.



Having a game with no cheating ai is better overall. If you have to have the ai cheat then the ai is broken. By cheating you're just masking that and the mask falls off after enough games. Worse still players can get very annoyed at the game because of ai creating situations that would normally be impossible due to added effects; even if the entire thing is transparent and even if it's by player choice the ai was cheating!



In addition the ai beeting the player or not by itself is not necessarily even the issue. Good ai should be able to properly cooperate with other ais against the player even if their ability on their own to manage their empires is subpar to the players ability to manage his empire and forces.
0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message