[Discussion] Human I vs. AI - Risk tolerance, Math, and irrationality

"Evaluate" - notice this word comes from the root word, Value.  It means to attach numerical values for the purpose of comparison and decision making.

 

Intelligence, as it relates to games and game theory, has basically two components - Evaluation and Temporal awareness.  You must be able to make a decision on some sort of sensical basis.  You must be able to differentiate between "now" and "not now".  The first component is the dominant one.

 

For humans, we call the latter bit "learning".  We remember what happened in the past, and that helps in decision making in the present, as well as anticipating what will happen in the future (which also helps in decision making in the present).

 

For Artificial awareness, this learning element is difficult to approximate.  It requires independent thought, or true randomness - which a computer can't do.  Your calculator doesn't just do math all on it's own - it requires input to generate output.

 

Instead, the "past" learning element is essentially encoded into an artificial intelligence, in the form of attached values to possible events and decisions.  These are not generated at random from experiential data, although advanced methods will update and modify values as a result of experience.  The "future' aspect is simply a matter of looking X 'moves' ahead, and looking at the desirability of various possible outcomes, weighted by probability (which is often encoded as well).  This is, incidentally, how many computer chess programs function, with the 'difficulty' capping the number of moves-forward and possible outcomes the computer will evaluate.

 

Once you have a value, it's just a matter of Goal - something like maximize, minimize, or approach/stay within range.  This is, on some level, true of all decision making, whether artificial or not.

 

For example, let's say you attach a value of 5 to playing Elemental (arbitrary).  You attach a value of 3 to sleeping, and a value of 4 to eating.  If your goal is to maximize value, You'll just keep playing elemental and never eat or sleep.  But let's say Elemental's AI or crashes frustrates you generating a value of -2.  The result is, you'll play Elemental (+5), get pissed (5-2 = 3) and then go eat... or play more elemental anyway.

 

Human opponents inject the issue of randomness - people attach different values to different things, generating different choices.  It can be unpredictable, and quickly change.  This is because human intellect (or lack thereof) isn't bound by strictly circumscribed rules - see Cognitive Dissonance for more.  Rather than using purely numerical and analytical decision trees (value of outcome weighted by probability of outcome to generate average/"true" value), humans often skip the math - an irrationality element kicks in and overrides values.

 

This is also complicated by 'risk tolerance.'  The degree to which discount or inflate the value of a risky outcome - in short, how much risk we are willing to tolerate or endure.  Some people are highly risk-seeking: we call them base jumpers.  Some people are highly risk intolerant: we call them insurance adjusters. 

 

Take for example, my most recent scenario in Elemental:

Player is bounded on all sides by hostile factions.  Two narrow mountain passes to the north lead to a militarily advanced Krax empire.  A broad forest region to the South west leads to a resource rich Altar kingdom.  Player heavily favors AoE magic attacks, sovereign and imbued champion led armies of summons, and disfavors heavily protecting settlements.  Player controls one Air and one Water shard.

 

Player sends an army lead by the Queen (spouse) to attack Altar because altar controls an Air shard.  The altar settlement is lightly guarded.  The Queen's unit: Champion, Vigilant minion, Lord of Ice, Stone Giant, Fire giant, etc. etc.  Because of the way movement is handled, the Queen's unit proceeds one tile at a time towards the Altar settlement, after dispatching two intervening pioneers.  It will reach the settlement in two turns.

 

Now, it's not totally clear what the altar AI was doing - but apparently it was moving it's sovereign Relias very slowly towards the settlement, along with a large army.  It didn't teleport - and I don't know why.  Nor did it train any units or further increase the defense of what turned out to be the initial settlement (spouse and children present).

 

The settlement was crushed and became player territory.  In the immediate next turn, Altar's sovereign and army attacks (despite having a lower combat rating).  They are soundly defeated, and because the sovereign died in enemy lands, Altar's entire faction was eliminated.

 

What?

 

If I had been playing a human opponent, it might be possible to explain this outcome.  Altar may have attached an inordinately high probability to it's success.  It may have attached an inordinately high value to it's initial settlement.  It may have rationally decided that having a foreign power bifurcate it's territory was highly undesirable.  It may have irrationally desired revenge.  It may have saw a very high value in reducing my military by one third, despite a low probability of success.  The human player may have been exceptionally risk seeking - either because it saw itself as defeated, so any degree of risk was acceptable, or simply a "gambling man".  A more risk-avoiding player would have written settlement off as lost, and amassed a counter strike.

 

But for a strictly mathematical AI (1 is always less than 2, unlike with meatbags), it didn't make any sense.  In short, the AI had no conception whatsoever of risk or future events.  The possibility of losing the sovereign and losing it's entire faction (complete loss) didn't enter into it's evaluation at all.  It was very simply, something on the order of, "I was attacked, therefore attack back."

 

What we might have expected is that the AI would have considered the disparate combat ratings (probability of loss better than average) and the highly unfavored outcome of complete loss to generate an action of either "do not attack" or (for a more complicated system) "send sovereign to safe haven, attack with remaining forces".

 

A far more complicated AI system (more moves, more tables of values, and considers opponent's table of values) would probably have employed a "scorched earth" tactic - burn down the air shard to make my victory less meaningful (this actually happened in another game, but purely by accident - the AI had a caravan path through the shard temple, so on the subsequent turn, caravans automatically rolled right through and permanently destroyed the shard).

 

Understanding all this, it's pretty easy to see why every AI faction plays almost identically (aggressive, early expansion, followed emphasis on large numbers of grouped army units - incidentally, I have no idea how it gets the gildar and resources to support that...), why every tactical battle proceeds in almost the same manner (hit end turn twice, smite foes; enemy always targets familiar, etc. first)... and why there is a lack of variety (every unit moves 2).

 

The underlying AI - the table of values attached to units, events, decisions, etc. and the decision making process/goal - is extremely basic.  Consequently, the values it needs to consider are also very simple (and often heterogeneous, allowing for simple comparisons and decisions).

 

The upshot is, the underlying AI needs to be heavily upgraded... and that would take a while, since developers/game theorists need to consider a wider range of events and potential player strategies to 'teach' the AI.  And that's IF there were no changes being introduced.  With the introduction of various other changes (tweaking weapons damage, magic system, etc.) expect the current AI to make some bizarre decisions.  It could be a while before it becomes challenging in a sensical manner - as well as incorporate features we're all screaming for (for example 'personality' - like an AI that favors a tactic of 'mine or no-ones' by scorching resources and npcs).

39,836 views 9 replies
Reply #1 Top

i would bet that the AI will be outstanding before this year is up, and i would also bet it will have a huge improvement before this month is up.

Reply #2 Top

I agree - and I'm not saying it wont be, but rather, that people shouldn't expect it to suddenly become everything they hoped for in the next week.  It's a complicated process to model a decision making algorithm, more so a good multi-factor one.  people should expect it to be a gradual, step-wise process of improvement, particularly as changes to the game in other areas are rolled out.

Reply #3 Top

It's really nice to bet/hope/assume that the AI will magically become an unstoppable juggernaut, or hell even basically competent, but I'm more than a bit concerned given the nearly blank slate that is running the roost now.

I'm honestly rather surprised this didn't come up a lot more in testing, even if the preponderance of battles were done in auto resolve.  The base enemy sovereign behavior is just baffling to the core:

  • Suiciding sovereigns that can't end their own game fast enough
  • Single town empires with no improvements and no guards
  • Worse, empires that have NO towns at all!
  • Enemy troops that will attack one town but gladly leave the nearby undefended ones alone for dozens of turns at a time
  • Repeated demands for cash from enemy sovereigns (to forstall an attack)...  when you don't pay, they don't come for you

There's much more, but it all points to a very simplistic AI that's the real Achilles heel here.  This isn't just a matter of a couple of tweaks to be performed or knobs to be turned...  an actual AI needs to be put in place.

Reply #4 Top

Do not count on that the AI will be outstanding in a month or even in this year. It might still get an huge improvement in that timefrime, yes, but Elemental AI in it's current state will still take up about 6 - 12 month development time to get it to an challenging/hard/ridiculous difficult state.

Reply #5 Top

WOW it's either too early in the morning here in Rome, Italy, or this is one of the most brilliant posts ever written... Problem is you can show off the beautiful graphics when you sell your products, but it's much harder to sell intelligent AI, so that's where the priorities end up. I wish the developers were doing that more often. I have a feeling that Stardock is honestly committed to bring us intelligent games, and I certainly wish them to work on ideas like these and find a way to prove they did. The players behind their games certainly deserve more than what they got now.

Off for a coffee...

(PS I believe realism would help making intelligent choiches, for example a faction just cannot risk to move their sovreign in enemy territory EVER, since the sovreign death would make them risk their cities to disappear in thin air (silly), which would be very easy to achieve since the enemy sovreign could be anywhere in the map with a huge army and just teleport back on the spot (teleport spoils all strategic games... the Age of Wonders forum wa sfull of complaints about teleport and they had to make it optional)... But they will realize all that very soon, when multiplayer is enabled.

Off for two coffees.

Reply #6 Top

With regards to testing, I think the industry overall is to blame, more than Stardock 'individually'

 

these days, "beta testing" pretty much means - publicity demo.  We give the player base a near complete version to play with, catch the most egregious errors, and triage everything else.

 

And you can't blame them for that.  On the one hand, it's cheap, basically free advertising of the best sort - hands on.  Customers don't have to hold that box in their hand and wonder, "is this what i want?"  And potentially put it back, go home, read some reviews (or forget about it entirely).  And word of mouth - do you trust any other source as much?  Think about, say, gamespot reviews about how awesome the combat is in dragon age.  Seriously?  The combat in dragon age... is pathetic.  gory, but pathetic.  It's like the most expensive, shiny, sexy and sleek car that is missing an engine, transmission, steering wheel, and doors.  Not surprisingly, DA had spent quite a lot of money on advertising on that website.  it's practically a given and understood now that there are, indeed, back curtain transactions going on between large companies and large review websites.

 

So what is a smaller, more ethically inclined company going to do?  Especially if it doesn't have deep pockets to sink into more traditional forms of advertising?  Short interviews, mag articles, previews, etc. only get you so far... especially if those outlets are, on the one hand 1) not getting paid by you to update info on your product, and thus may not generate the advertising revenue needed to stave off cup-o-noodle, and on the other hand 2) ARE getting paid by others to do just that.  Who is going to get top billing and faster service?

 

So open, and even closed betas, whatever the genre and company (because even the big sleezy can get in on the action) become advertising outlets - if timed properly, it generates the right amount of release day hype and demand, and even works to 'guarantee' a certain amount of sales - kind of like a pre-order.

 

As for error catching in betas, again, you can't blame a company, any company, for triage-everything-but-the-most-egregious.  Have you looked in the support forums lately?  30 pages.  I'm certain there are NOT 30 pages of bugs.  Some of it is suggestion.  Some of it is people reporting a "bug" simply because they disagree with how a feature should be implemented, damn what anybody else thinks..  Some of it is duplicate posting.  Some of it is people not sure if something is a bug.  of the legitimate bug reports, some don't adequately describe the error.  Some are not reproducible.  Some are unintelligible to educated persons because it was written by an overexcited 11-27 year old who can't be bothered to use the proper syntax and spelling of their language, whichever it may be.  All of them are tagged differently, and written in different formats.

 

And then there are the trolls.  And the preponderance of conspiracy theorists.  And the endless flood of people with a false sense of entitlement and self-righteousness.  People who just can't say anything nice.  You really want to do anything to help anyone out after reading page after page of how you are a crooked individual?  And let's not forget the ubiquitous "i used to be a game developer" post (yes, the operative is "used to").

 

So basically, you end up with a clusterfuck.  that's about the nicest way you can put it.  You pay someone to go through it and consolidate the information as best they can, but it's not as simple as a job as you might think.  Plus that person ends up with a seething hatred for humanity.  And everyday, pages and pages are added, so it's a never ending job (30 pages, and the game has been out, what, a week?).

 

The key is the internal beta, and even then, there are problems.  The generally involve fewer people (especially vs. open beta), and they are given a checklist of things to beta - to test.

 

From here on it, this is speculation:  As i understand it, it's a tedious job of "do this, and then do it 50 more times."  And you aren't really asked for your opinion (in the event that you even care anymore, after days and days of hours of "research this tech and then find this quest and complete it" over and over again).  It's "does this work yes/no - what was the problem __________"  It's not "how did this make you feel, what are some improvements that can be made, would you like some cake?"

 

Did combat work? yes/no - well let's see, I was able to engage in a fight, units were basically on opposite ends, and I was able to make attacks that killed the other side.  that's a yes.  Not a "Yes, see comments" and then a page about how the tactical map makes it hard to see the smaller units, sometimes it's hard to click specifically on a unit, wtf is this morale system, can we make hits and misses more clear on how those work, and so on and so forth."

 

because that doesn't help the coding team FINISH the product.  because that gets right back up into "clusterfuck."  In pretty much all of the real world, it's not about perfection - it's about screwing up the least.  it's not about acing your exam - it's about not failing it.

 

I would even suspect, as the internal betas are frequently actually in-house, that they are all run on clone-pcs... identical rigs that will run the game.  Because the point is not to see if it will run on EVERY possible hardware and software configuration.  the point is to see if it runs AT ALL - if there is such a grievous coding error somewhere in the program that it will not even run on a PC meant to run the program.  Because that NEEDS to be caught - that affects everyone.  Whether your IRQ tubes having a hate-conflicting with your over-graphics heated super neon lighted whatever it is does-not-matter.  Because it is impossible to anticipate for every possible hardware configuration.

 

Officer Calhoun, why didn't you shoot the fleeing armed robber?

"Well, I didn't have any bullets you see.."

Why not? Records indicate that the station is well stocked on 9mm rounds and that you were issued two clips before duty.

"Yes, that's true, but you see, I use a Frabrique Nationale Five seveN instead of a 9mm pistol, and it wont use 9mm bullets; those are the wrong caliber for an FN."

Dot dot dot. 

Compare to:

Officer Calhoun, why didn't you shoot the fleeing armed robber?

"Well, I tried, but the bullets exploded in my gun."

What?

"I used my standard issue sidearm and the standard issue bullets given to me, and when I tried to fire the pistol, it exploded.  As you can see, my right hand is now a bloody stump."

Yes that is a problem, we'll have to thoroughly investigate this matter.

 

So it's not surprising that we are now seeing, almost as a surprise, that the AI is a bit... special.  It rides a very short front-side bus.  or whatever.  And that all sorts of suggestions are now being made.  What we, the consumer, think of when we hear "beta test" is actually more like "focus group."  Where a select few people of the appropriate target market segment play around with something, and then are asked for their opinions, and so forth.

 

But even there, you got problems.  1) money.  People don't spend that kind of time and effort for free, no matter what they say (and the people that DO, aren't necessarily the ones you want).  and 2) you can't make everyone happy.

 

For example, there is at least one person who wants real-time action in elemental.  Personally, i DON'T want that.  So what's the result? Between the two of us, stalemate.  whichever way stardock goes, in this closed universe of two-players there are 2 guarantees:

1) at most, 50% of the base will be happy.  Potentially 0% will be happy.

2) it is 100% certain someone will not be happy.

...did you really need to spend money to figure that out?  So you do what you do, and you generally figure people will self-select: once the details get out in the "open beta" (haha, there it is again!) people will either figure out "yes i want this" or "no i don't want this".

 

Predictably, there is always a significant proportion of the consumer base that decides, "No, I don't want this, but Yes, I do want to bitch about it."  this isn't necessarily bad for the company - because income (let alone profit) is determined by how much you can sell.  So from a "god, not cup o noodle again" standpoint, it's a good thing to capture that part of the market as well.  It's just too bad that part of the market tends to piss everyone off, and occasionally muck up an otherwise great product.

 

TL;DR - beta testing isn't what you think it is, and stop bitching and let stardock do it's thing.  Much love.  =)

Reply #7 Top

I should clarify, the latter half of "tl;dr" is not directed at anyone in this thread, nor anyone in particular... but rather to the community at large, particularly the portion that likes to complain/denounce the company and devs.

Reply #8 Top

Wow that's some seriously long posts Jingseng, I practically forgot your first after the 2nd one. In anycase, I'll make some comments, which, might or might not respond to either posts:

 

The AI in GalCiv2 didn't start the way everyone remembers of it now. There wasn't all that different "feel" or "strategy" for each race. It was, however, pretty brutal and gave first timers a hard time on normal, and managed to play the game decently. But as time went on, and players figured out how to play the game, it was discovered to be full of holes, it couldn't properly value military starbase bonuses, didn't realize the advantages of first strike, and tech brokering was plainly broken, etc, etc... These issues were all eventually patched into the game, some into the game mechanic itself, and some as game options (like to disable tech trade), which solved the fundamental problems. After these issues were addresses, the AI got "flavor" in different tech trees and abilities, and thus ended up having varying styles of play. You have to remember though, that this process took 2 expansions and almost 2 years of development after release. The moral of the story? It takes a really long time to get AI right, but at least Stardock has proven that they can do it.

 

To be honest, looking at Elemental now, I am having some serious deja vus. The only difference seems to be that the AI has a hard problem actually playing the game (IE: bad at where it builds cities and what to build in it). There are some serious issues with the game mechanic that needs to be addressed (like AI empire destruction upon sovereign death), and those will probably be done through fixes in the coming months. Then, and only then can the AI be seriously improved. Until then, I don't expect anything more than minor fixes that addresses some horrible imbalance (like Sovereign suicides). To be honest, right now, Elemental plays like an cross between an empire building and an adventuring game for me, I just wish the AI wouldn't kill themselves doing idiotic things while I'm messing around. So here's to hoping that they release those fixes soon and pull off what they did with GC2 for Elemental.

 

Reply #9 Top

Your entire post is facinating, but im afraid the most likely scenario about what happened when the AI sovereign attacked and suicided was simply that the AI didnt re-evaluate its orders each turn..

The AI spotted your army approaching, set a move order for relias and his army to move to the city, then when you captured the city the already existing move-order for relias simply wasnt updated, and combat was initiated (since two armies cant exist in the same city, if they are enemies, this is a gameplay consequence of an ai flaw, the ai moved to the city to reinforce, not to attack, but due to your army now occupying the city, the gameplay rules didnt allow what the ai wanted to do since it didnt update its now obsolete orders).

If the AI actually re-evalutated the situation each turn, there's no way he would have attacked. Otherwise the AI coding is just even more extremely poor than in my wildest dreams.
There's no way frogboy coded the AI to attack with his sovereign against 3-1 odds for example.

Thats why i find it much more probably that an AI re-evaluation bug is causing this, the AI sets an order, attacking a city who last scouted only had 1 peasant defending, or reinforcing a city which when last scouted was yours with no enemies around.
The AI arrives at the enemy city which now has way way more defenders, the AI does NOT recalculate, and simply continues along its waypoint to certain doom.
Or the AI arrives at the previously owned city, which is now occupied and captured by a large army, the AI does NOT recalculate, and simply continues along its waypoint to certain doom.

Sort of like a "fire and forget" order system. :dur:

If this isnt the case, if the AI really does re-evaluate each turn and actually DECIDES to attack that very same turn, well then i simply can not believe how someone could code it that way.