.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 2: The Ascension Wars > Scenarios, Maps & Mods

Reply
 
Thread Tools Display Modes
  #1  
Old October 19th, 2004, 10:35 AM

Zooko Zooko is offline
First Lieutenant
 
Join Date: Sep 2004
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
Zooko is on a distinguished road
Default dom 3 wish: mod AI

I've got it! Make battle troops scriptable in a nice simple standard free language like Python or Lua (don't invent your own mini-language), and have scripts loaded as mods.

This is a win-win:

1. Illwinter can spend less time on AI coding because the Dom enthusiasts will do it for you and they won't even charge you money.

2. AI gets better, which is widely wished for single-player games.

3. Your troops do stupid things less often in battles (or at least they do more different kinds of stupid things instead of the same stupid things all the time).

4. BUT, game balance is not as badly distorted because both sides use the same mods.

5. Likewise, Users don't try to write scripts in the "Battle Orders" interface in the game. If they are programmers, they can go write their own script mods. If they are just game-players, then they choose from a nice simple set of options which is at least as simple as the current Dom2 battle orders.

Question: should individual mods be selectable from the Battle Orders menu? Instead of instructing my Grand Inquisitors to Attack, Cast A Specific Spell, or Retreat, I could instruct them to follow "Zen's Battle Mage Mod 1.01".

P.S. Dear Illwinter hacker(s): don't tell me you don't know Python. Yes you do. Go spend 30 minutes reading the Python tutorial and you are fully capable of implementing battle mods as Python scripts.
Reply With Quote
  #2  
Old October 19th, 2004, 12:25 PM
Kristoffer O's Avatar

Kristoffer O Kristoffer O is offline
General
 
Join Date: Aug 2003
Location: Sweden
Posts: 4,463
Thanks: 25
Thanked 92 Times in 43 Posts
Kristoffer O is on a distinguished road
Default Re: dom 3 wish: mod AI

I do not even understand what you want the AI mod to do.

Is it supposed to give all commanders and squads in the game the same orders? With the help of Python?
__________________
www.illwinter.com
Reply With Quote
  #3  
Old October 19th, 2004, 12:53 PM

RadiantFleet RadiantFleet is offline
Private
 
Join Date: May 2003
Location: Earth
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
RadiantFleet is on a distinguished road
Default Re: dom 3 wish: mod AI

I'm confused too. If Zooko is saying, let modders add new battle orders programmed via python, I think that would be an awesome idea. It would also be nice to be able to use this same concept at the macro level with AI control of nations.

Kristoffer, clearly you guys are great programmers judging by the quality of Dom and CoE (and the clear improvement curve between them!). However, if you need some pointers regarding integrating a python engine, please ask. Myself, and I'm sure other folks on the board are software developers with a great deal experience at simlar tasks.

Part of my interest in seeing a better AI for Dom 3 is because of having written so many "AI" type systems. Unfortunately, none of them have been for gaming applications, they've all been for things like cancer detection and buisness sales analysis.
Reply With Quote
  #4  
Old October 19th, 2004, 01:07 PM
Kristoffer O's Avatar

Kristoffer O Kristoffer O is offline
General
 
Join Date: Aug 2003
Location: Sweden
Posts: 4,463
Thanks: 25
Thanked 92 Times in 43 Posts
Kristoffer O is on a distinguished road
Default Re: dom 3 wish: mod AI

I'm a lousy programmer. I could perhaps make a program that creates a text output (name, gender and race) based on your choices (name, m/f, hobbit/elf). I can read code and I can enter new stuff in a fasion similar to previous stuff (new monsters, spells etc), but I'm no great programmer. All programming (except stats for new monsters, spells, items and descriptions) is made by JK.

JK on the other hand is a remarkable programmer (at least by my standards), but I don't think he would mind asking if he needed some input. I'm sure several fans would answer if he asked. Thanks in advance!

Caner detection is a good thing. Probably more important than gaming
__________________
www.illwinter.com
Reply With Quote
  #5  
Old October 19th, 2004, 01:35 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: dom 3 wish: mod AI

One direction in scripted AI's is one I have experience in from my mud. There was a client program (tintin++) for connecting to the MUD game which allowed you to create trigger/response commands and store them to a file. Its simplest use was to automate some actions such as low hitpoints causing you to remove backback, take heal potion from backpack, quaff potion, wear backpack. The "programming" done by Users got so extensive that we started having problems with "bot" (robot) players which would spend hours gaining experience or practicing skills while the person was off at work or asleep.

Eventually we started programming our own Version which became very popular. It had conversations, told jokes, had help files for the game which people could ask about, it sold certain useful items and cast spells for money, it did emergency summoning when people shouted for him to, identified common items, etc etc. It got to the point that it had to run from another machine (remember it ran as a player connecting from outside to the game). It used as much CPU as the game itself did when it was running and handling 100 Users.

Anyway, IF a game is written to send and receive info in a way which can be used (such as a text mode), then a program can be written (even one by a third party) to allow scripting all actions. IF I do a certain thing and get a certain response back THEN do this other thing. You could put alot of time and effort into creating a bot which plays Pangaea as sneaky armies, and Ulm making more use of its heavy armor, and Arcospale more defensive while researching/using major spells. Or even 9 different peoples concept of how the AI should best play Ulm.

I dont think that would be easy to do for this game.
So, an alternative..........

Creating a new text file for AI controls, and a new directory for AI modules. Programming AI modules which can be listed in the text file for setting wide parameters for an AI. Such as, a build priority list. A combat spells priority list. A global spells priority list. Items, summons, research,A preference/avoid list for which nations should be actively sought out and attacked in what order.

These can either be done by the programmer in tight programmed modules so that you start out only getting to choose 1 out of 3 different build-queue preferences. Or open text files. There are pros and cons to both.

Just from me personally:
The thing I like most about Version 2 is that its more open to randomization
And for a scripting language Id think that Basic would make sense. thats kindof what its for.
__________________
-- 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 October 19th, 2004, 02:22 PM

Zooko Zooko is offline
First Lieutenant
 
Join Date: Sep 2004
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
Zooko is on a distinguished road
Default Re: dom 3 wish: mod AI

Sorry to be unclear. What I want the AI mods to do is just to control the behavior of units in battle. For example, if I've loaded Zen's Battle Mage AI Mod, then whenever my battle mages have no specific battle commands, they don't do the normal battle mage AI implemented by Illwinter, but instead execute the code from Zen's Battle Mage AI Mod to determine what they should do.

This would presumably make mages more powerful in battle as the modsters figured out better and better AI's.

Does this sound like a sensible notion?

The other thing that I mentioned is that the player might be able to select among mods on a per-unit basis. For example, as a "general action" instead of Cast Spells, Attack or Retreat, you might have "do as Such-And-Such Mod says to do" button.
Reply With Quote
  #7  
Old October 19th, 2004, 02:59 PM
PhilD's Avatar

PhilD PhilD is offline
First Lieutenant
 
Join Date: Sep 2003
Location: Bordeaux, France
Posts: 794
Thanks: 0
Thanked 0 Times in 0 Posts
PhilD is on a distinguished road
Default Re: dom 3 wish: mod AI

Zooko, your idea would have several problems:

* it would be very easy for the AI programs to "break" the game, unless some very strict control was exercised by the game engine interpreter. Bad programming on the player's part could result in the game hanging, or crashing, or whatever. MP would become a nightmare...

* even if done in a foolproof/attackproof way, it would turn the game into a programming contest. There are already "games" that are actually programming contests, but I don't want Dominions to turn into one of them.
Reply With Quote
  #8  
Old October 19th, 2004, 05:07 PM

Zooko Zooko is offline
First Lieutenant
 
Join Date: Sep 2004
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
Zooko is on a distinguished road
Default Re: dom 3 wish: mod AI

Those are good objections, PhilD, however there are good responses to each of them:

*) one could design the interface so that a buggy mod could (more or less) never break the game. Python starts by being memory-safe, so you're already safe from memory mismanagement. You can make the mod single-threaded, so you are safe from multithreading issues. You can offer only a limited ability to manipulate the game (basically just "this creature moves", "this creature casts this spell", etc.).

*) the game would be a programming contest only if you got to use your own mod and your opponent didn't get to use your mod. But that's not the idea. Rather, it would be just like the current modding system: the server would have one or more mods configured at the beginning of the game and all players would have access to the same mods.

In the simple case that AI mods are invisible to the player, this would just mean that the behavior of your battle mages would depend on what mods were configured for the game, rather than being the default battle mage AI.

In the more complex case that players get to choose specific mods for specific units, at least all players would have the same options.
Reply With Quote
  #9  
Old October 19th, 2004, 06:21 PM

Tuna Tuna is offline
Corporal
 
Join Date: Aug 2004
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Tuna is on a distinguished road
Default Re: dom 3 wish: mod AI

Well, just my 2 cents:

If the game is in really early developement, and you are considering rewriting the strategic map engine, please please consider doing it with open file formats.

That would mean that a .trn file has (encrypted by the turn password) all the data of the game situation that the player nation is capable of knowing in just (zipped) plain text. The format already exists as your modding commands, just reverse the # and no # to save some space.
Code:

province 112 (owned rich province)
owner 2
unrest 1
tax 50
plains
population 10000
income 100
resources 10
site = "ten thousand things"
dominion 1
scales = 1, 1, -1, 3, 1, 1
End

province 113 (seen indie province with neg dom)
owner 0
plains
dominion -1
scales -1, 0, 0, 0 ,0, 1
End

unit 23 (pretender)
owner = 2
location = 112
type = 10
affliction = lost an eye
magic 2,2,2,2,2,2,2,2
pretender
item 26, 37 (eye of aiming, robe of invulnerability)
Battleorders cast 13, cast 15, cast 15, flee
battlelocation -20, -20
end

unit 1001 (some standard HI with nothing special quarding commander)
location = 113
leader = 23
squad = 4
Battleorders = guard commander
battlelocation -20, -20
type = 50
end




In the same way, the .2h would have all the orders in encrypted zipped plain text.

Code:

orders:
unit 23
cast 222
battleorder cast 113, cast 114, cast.
end

unit 1001
squad 1
battleorder attack closest
battlelocation 20, 0
end

province 113
hire 50,50,50,50,50,50
hirecom 75
tax 100
end



When the host executes a command, it first uses it's own fthrland file, that has all the real info on the game, to check if the move is possible, then executes if it is or disregards until the next end if not.

This would make it impossible to cheat, other than trying to break the encryption on other player's turns, and nothing stops the game from saving different things in a turnfile all mixed up making it very hard to break the code.

This way, everyone who thinks they can do a better AI, can try... The big question there is, how much extra work would that be? I have absolutely no idea...
Reply With Quote
  #10  
Old October 19th, 2004, 07:43 PM

Zooko Zooko is offline
First Lieutenant
 
Join Date: Sep 2004
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
Zooko is on a distinguished road
Default Re: dom 3 wish: mod AI

Gandalf's and Tuna's ideas sound excellent for strategic-level AI -- recruitment, army moves, research, etc.

For battle-level AI, those techniques won't work.

I highly approve of either or both of these kinds of AI mods -- strategic AI mods and battle AI mods.
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 05:41 PM.


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