.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening

Reply
 
Thread Tools Display Modes
  #1  
Old March 14th, 2007, 05:04 PM

MaxWilson MaxWilson is offline
Major General
 
Join Date: Mar 2007
Location: Seattle
Posts: 2,497
Thanks: 165
Thanked 105 Times in 73 Posts
MaxWilson is on a distinguished road
Default Atten Devs: AI (Rules-based dynamic scripting?)

Here's a paper on an AI technique called dynamic scripting. The authors took a complex tactical game (Neverwinter Nights) with a script-based AI, and were able to show that a learning algorithm can 1.) pick out effective combinations of rules vs. different play styles, and 2.) adjust difficulty to "barely lose, in interesting ways" against human players of different skill levels. They also report that a later, improved AI from the game developer resembled the scripts the algorithm learned by itself at much less effort.

http://www.cs.unimaas.nl/p.spronck/P...cScripting.pdf

I wonder whether this is something that can be applied to Dominions. I don't know whether the strategic AI is rules-based, but a learning AI does seem to be well-suited to Dominions because 1.) tactical combat is AI-controlled anyway, so you don't need to worry about self-trained AIs somehow missing out on tactical "tricks" because of e.g. bad pathfinding, 2.) AIs can easily play games against themselves because the engine is fast, 3.) the strategic space is *huge*, with many different and interesting counters possible to any specific tactic, so even a fairly dumb hill-climbing search may stumble across a good counter to, say, E9N9 Niefelheim (e.g. race for Alt-6 and Iron Bane).

I'm still kind of new to Dominions, but is writing AI rules something that can be done in a mod, or is it something only the devs can do? I'd love to implement "dynamic scripting" and see what kind of AIs fall out.

Also check out http://rolec.unimaas.nl/.

-Max Wilson
__________________
Bauchelain - "Qwik Ben iz uzin wallhax! HAX!"
Quick Ben - "lol pwned"

["Memories of Ice", by Steven Erikson. Retranslated into l33t.]
Reply With Quote
  #2  
Old March 14th, 2007, 05:21 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: Atten Devs: AI (Rules-based dynamic scripting?

Neverwinter Nights is a great game but it was built from the ground up to be scripted. From the beginning of Dominions Ive mentioned scripted AIs. Some great games are out there where players have created programs you can run which will play the enemy like it was another player.

Unfortunately adding it to a game later is like starting over. For everything that the AI does there would have to be a "hook" written in. Variables and commands. Such as, giving a commander an item would requre variables for the slots and ways to detect if it already has something. Or making a move would require variables for neighbors and commands for looking, evaluating, etc. Those are in the game of course but they usually arent done in a clear variable that can be "seen" from outside the game.

The closest we get right now are the modding commands (which there are alot of and more all the time)

Maybe for Dom4. But I think it might be something that would be so involved that they would just write a new game instead.
IMHO
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
  #3  
Old March 14th, 2007, 05:45 PM

MaxWilson MaxWilson is offline
Major General
 
Join Date: Mar 2007
Location: Seattle
Posts: 2,497
Thanks: 165
Thanked 105 Times in 73 Posts
MaxWilson is on a distinguished road
Default Re: Atten Devs: AI (Rules-based dynamic scripting?

I appreciate the point about Neverwinter Nights, and if the Dominions AI isn't internally doing scripting I guess it wouldn't be trivial to make it learn. Still, I wonder if the PBEM aspect of Dom3 offers enough "hooks" to build a scripting AI client anyway; you'd have to know how to write .trn files and, as you pointed out, how to read game state like "who controls province #33 this turn, and how many units do I see in it?" and "What items is my Pretender carrying?" It doesn't necessarily have to tie into the existing AI engine, but at least in principle the PBEM orders/execution/results division offers everything you need to write a learning engine.

Even if it did have to wait for Dom4, which I hope it doesn't (I'm off to look at my .trn files in a minute and try to figure out what's in them), an adaptive AI would be incredible for us SP folks and a real selling point. Not that Dom3 is lacking in selling points. Terrific game, even if I just discovered it three weeks ago.

-Max
__________________
Bauchelain - "Qwik Ben iz uzin wallhax! HAX!"
Quick Ben - "lol pwned"

["Memories of Ice", by Steven Erikson. Retranslated into l33t.]
Reply With Quote
  #4  
Old March 14th, 2007, 05:47 PM

MaxWilson MaxWilson is offline
Major General
 
Join Date: Mar 2007
Location: Seattle
Posts: 2,497
Thanks: 165
Thanked 105 Times in 73 Posts
MaxWilson is on a distinguished road
Default Re: Atten Devs: AI (Rules-based dynamic scripting?

By the way, how much AI programming can you do with the mod commands?

-Max
__________________
Bauchelain - "Qwik Ben iz uzin wallhax! HAX!"
Quick Ben - "lol pwned"

["Memories of Ice", by Steven Erikson. Retranslated into l33t.]
Reply With Quote
  #5  
Old March 14th, 2007, 06:10 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: Atten Devs: AI (Rules-based dynamic scripting?

You cant really change how the AI thinks. But with map commands you can build an AI nation that makes better use of the AI brain.

With mod commands you can change just about everything. Remove units and spells you feel its using too much, patch weak points that are too well known and abused by players, etc etc.

Its not really a bad AI (IMHO) but the random generation when it sets up a nation makes it rare that you get one where the setting choices match that nations best abilities. Manually making an AI would tend to work better.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
  #6  
Old March 19th, 2007, 02:43 PM
NTJedi's Avatar

NTJedi NTJedi is offline
General
 
Join Date: Jun 2003
Location: az
Posts: 3,069
Thanks: 41
Thanked 39 Times in 28 Posts
NTJedi is on a distinguished road
Default Re: Atten Devs: AI (Rules-based dynamic scripting?

Quote:
Gandalf Parker said:
You cant really change how the AI thinks. But with map commands you can build an AI nation that makes better use of the AI brain.

One really strong benefit within Dominions_2 was the #startspell command where a non-blood nation could be given two or three specific blood spells, a powerful non_moving blood caster and a few magic sites with blood income. As a result you'd be pleasantly surprised from a stronger AI opponent.

UNFORTUNATELY... in Dominions_3 the #startspell command is broken because it only works for ONE turn!! Based on the progress things are getting fixed it looks like my favorite map command will remain broken in Dominions_3.
__________________
There can be only one.
Reply With Quote
  #7  
Old March 14th, 2007, 07:00 PM

JayThomas JayThomas is offline
Corporal
 
Join Date: Dec 2003
Location: Buffalo, NY, USA
Posts: 143
Thanks: 0
Thanked 4 Times in 1 Post
JayThomas is on a distinguished road
Default Re: Atten Devs: AI (Rules-based dynamic scripting?

This is a very interesting point. Perhaps, instead of selecting AI in game set-up, a human is selected and a script would generate a turn using the ftherlnd file, if that file contains data the AI could use.

Just thinking out loud.
Reply With Quote
  #8  
Old March 14th, 2007, 07:25 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: Atten Devs: AI (Rules-based dynamic scripting?

Making the fatherland formating available in general would create a situation for cheating.

But if the game shifted to a fatherland for each nation then it might work.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
  #9  
Old March 14th, 2007, 09:56 PM

Evil Dave Evil Dave is offline
Corporal
 
Join Date: Jan 2004
Location: Wilmington, Delaware, USA
Posts: 191
Thanks: 1
Thanked 13 Times in 2 Posts
Evil Dave is on a distinguished road
Default Re: Atten Devs: AI (Rules-based dynamic scripting?

Quote:
MaxWilson said:
3.) the strategic space is *huge*, with many different and interesting counters possible to any specific tactic, so even a fairly dumb hill-climbing search may stumble across a good counter to, say, E9N9 Niefelheim (e.g. race for Alt-6 and Iron Bane).

Dominions' complexity is what I'm worried about with this method. The tests they ran were relatively simple (see section 6.2 starting on p26), but yet the AI took on average 20-30 battles against unchanging opponents to beat a static AI (table VI, p38). Given the much larger number of categories of spells, I'm not sure the AI could learn to counter players' tactics.

Still, since it looks like a genetic algorithm, it's probably the best approach there is for Dom3. I think it would be worth trying for some simple cases to see how well it does against the current tactical AI. (If the game has the right hooks, of course...)
__________________
No plan survives contact with the enemy.
--Helmut von Moltke

Have too may pretender files to keep track of? Use catgod to view them.
Reply With Quote
  #10  
Old March 14th, 2007, 10:39 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: Atten Devs: AI (Rules-based dynamic scripting?

If you are interested in seeing the AI "think" you can turn on debug logging and direct it to a file. If you turn on debugging to an extensive level, you will get a HUGE file very quickly. In linux it would be -ddddddd >log.txt
In windows I think it might be just adding -ddddd and it goes automatically to log.txt (best viewed with WordPad since NotePad doesnt handle the unix style of formatting very well)
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:33 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.