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

This Month's Specials

Air Assault Task Force- Save $8.00
Bronze- Save $10.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 2: The Ascension Wars

Reply
 
Thread Tools Display Modes
  #1  
Old January 8th, 2006, 08:12 PM
Saber Cherry's Avatar

Saber Cherry Saber Cherry is offline
Major General
 
Join Date: Oct 2003
Location: Crystal Tokyo
Posts: 2,453
Thanks: 0
Thanked 0 Times in 0 Posts
Saber Cherry is on a distinguished road
Default Highly Parameterized AI

Ok, so code-modding is out, but as for "a way to influence the AI through mod settings that are easy to fiddle around with"... how about parameterizing the AI, and making all the parameters moddable?

For example, a mod file might look like this:

Code:

Abysia_Recruit_Mage_Priority==80
Abysia_Recruit_Heavy_Infantry_Priority==150
Abysia_Recruit_Assassin_Priority==40
Abysia_Build_Temple_Priority==160
Abysia_Build_Fort_Priority==220

Mictlan_Recruit_Mage_Priority==130
Mictlan_Recruit_Heavy_Infantry_Priority==20
Mictlan_Recruit_Light_Infantry_Priority==100
Mictlan_Recruit_Sacred_Priority==250
Mictlan_Blood_Hunt_Priority==1000
Mictlan_Blood_Sacrifice_Priority==400
Mictlan_Build_Temple_Priority==40
Mictlan_Build_Fort_Priority==50




The values could range from 0 (never) to 1000, with the default of 100 meaning "the usual amount". They would modify AI behaviors, such that setting "Mictlan_Recruit_Sacred_Priority==250" would make the AI try to recruit 2.5 times as many sacred units as normal. Or, at least, it would increase the number of sacreds in the unit mix. "Mictlan_Recruit_Heavy_Cavalry_Priority==0" would make them never recruit heavy cavs, even if they conquered an indy province that had them.


Things I feel might benefit from parameters. Note that each of these should be moddable per-nation! And note that the numbers generally modify behavioral probabilities, rather than setting a fixed order in which the activities occur; if research_priority is greater than blood_hunt_priority, both activities would still occur at the same time, but more mages would (generally) be devoted to research.


1) Mage Orders (only for stationary mages)
Search
Research
Blood Hunt
Summon
Craft Artifact
Cast Spells


2) Army Orders (only for stationary armies)
Defend
Patrol
Siege
Break Siege


3) Priest Orders (only for stationary priests)
Search
Preach
Sacrifice
Reanimate


4) Strategic: Research
(one per magic school)


5) Strategic: Buildings
Fort
Temple
Lab


6) Nation Design
Combat Chassis (probability a combat chassis is selected...)
Bless Chassis
Rainbow Chassis
Dominion Strength (priority of spending points here)
Order, Growth, etc. (one per scale)
(one per magic path)


7) Recruitment Priority

This is a little different. First, all Dominions II units need a "role" or "type" (that is displayed in the unit description). This could be auto-generated based on simple rules regarding their stats and equipment. They should be changable through modding, though. Then the recruitment priorities can be set for each type (for each nation).

Types:

Scout
Spy
Assassin
Commander
Priest
Mage

Militia
Skirmisher (light infantry w/ javelin)
Medium Infantry
Heavy Infantry

Horse Archer
Light Cavalry
Heavy Cavalry

Slinger
Archer
Crossbow

Melee Monster (anything with lots of HP, like Jotuns, Hydras, elephants)
Ranged Monster (Illithids, Jotun Hurlers)


Properties: these are parameterized independantly of unit types.

National
Indy
Flyer
Amphibian
Aquatic
Magical
Trampler
Sacred


8) Tactical Spellcasting
Summon
Mass Damage
Single Damage
Mass Support
Single Support
Self Support
Gemcosting Spells
Additional Gem Usage



That's a bit confusing, so here is an example of a complete null-mod for Abysia's strategic AI, that does nothing:

Code:


** Mage Orders **

Abysia_Mage_Search_Priority=100
Abysia_Mage_Research_Priority=100
Abysia_Mage_Blood_Hunt_Priority=100
Abysia_Mage_Summon_Priority=100
Abysia_Mage_Craft_Artifact_Priority=100
Abysia_Mage_Cast_Spells_Priority=100



** Army Orders **

Abysia_Army_Defend_Priority=100
Abysia_Army_Patrol_Priority=100
Abysia_Army_Siege_Priority=100
Abysia_Army_Break_Siege_Priority=100



** Priest Orders **

Abysia_Priest_Search_Priority=100
Abysia_Priest_Preach_Priority=100
Abysia_Priest_Reanimate_Priority=100
Abysia_Priest_Sacrifice_Priority=100



** Research **

Abysia_Research_Construction_Priority=100
.....
Abysia_Research_Thaumaturgy_Priority=100



** Buildings **

Abysia_Build_Fort_Priority=100
Abysia_Build_Temple_Priority=100
Abysia_Build_Lab_Priority=100



** Nation Design **

Abysia_God_Chassis_Quality_Priority=100
Abysia_God_Combat_Chassis_Priority=100
Abysia_God_Bless_Chassis_Priority=100
Abysia_God_Rainbow_Chassis_Priority=100

Abysia_God_Dominion_Strength_Priority=100
Abysia_God_Fortress_Quality_Priority=100
Abysia_God_Increasing_Magic_Paths_Priority=100

Abysia_God_Nature_Magic_Priority=100
.....
Abysia_God_Fire_Magic_Priority=100

Abysia_God_Growth_Scale_Priority=100
.....
Abysia_God_Luck_Scale_Priority=100



** Recruitment **

** Properties **
Abysia_Recruit_National_Priority=100
Abysia_Recruit_Indy_Priority=100
Abysia_Recruit_Flyer_Priority=100
Abysia_Recruit_Amphibian_Priority=100
Abysia_Recruit_Aquatic_Priority=100
Abysia_Recruit_Magical_Priority=100
Abysia_Recruit_Trampler_Priority=100
Abysia_Recruit_Sacred_Priority=100
Abysia_Recruit_Undead_Priority=100

** Types (Commander) ***
Abysia_Recruit_Scout_Priority=100
Abysia_Recruit_Spy_Priority=100
Abysia_Recruit_Assassin_Priority=100
Abysia_Recruit_Commander_Priority=100
Abysia_Recruit_Priest_Priority=100
Abysia_Recruit_Mage_Priority=100

** Types (Infantry) ***
Abysia_Recruit_Militia_Priority=100
Abysia_Recruit_Skirmisher_Priority=100
Abysia_Recruit_Medium_Infantry_Priority=100
Abysia_Recruit_Heavy_Infantry_Priority=100

** Types (Mounted) ***
Abysia_Recruit_Horse_Archer_Priority=100
Abysia_Recruit_Light_Cavalry_Priority=100
Abysia_Recruit_Heavy_Cavalry_Priority=100

** Types (Ranged) ***
Abysia_Recruit_Slinger_Priority=100
Abysia_Recruit_Archer_Priority=100
Abysia_Recruit_Crossbow_Priority=100

** Types (Large) ***
Abysia_Recruit_Melee_Monster_Priority=100
Abysia_Recruit_Ranged_Monster_Priority=100



** Tactical Spellcasting **

Abysia_Tactical_Summon_Spell_Priority=100
Abysia_Tactical_Mass_Damage_Spell_Priority=100
Abysia_Tactical_Single_Damage_Spell_Priority=100
Abysia_Tactical_Mass_Support_Spell_Priority=100
Abysia_Tactical_Single_Support_Spell_Priority=100
Abysia_Tactical_Self_Support_Spell_Priority=100
Abysia_Tactical_Gemcosting_Spell_Priority=100
Abysia_Tactical_Use_Additional_Gems_Priority=100

__________________
Cherry
Reply With Quote
  #2  
Old January 9th, 2006, 12:24 AM
Ighalli's Avatar

Ighalli Ighalli is offline
Corporal
 
Join Date: May 2004
Location: Ohio
Posts: 133
Thanks: 2
Thanked 0 Times in 0 Posts
Ighalli is on a distinguished road
Default Re: Highly Parameterized AI

I'd be willing and able to help with a program to read the turn files and give units orders to reduce micro management. I imagine the devs would have to show us how to read the files. If it becomes a possibility, I'll gladly help out with coding (C/C++ only) and writing algorithms.
Reply With Quote
  #3  
Old January 9th, 2006, 04:38 PM
Endoperez's Avatar

Endoperez Endoperez is offline
National Security Advisor
 
Join Date: Sep 2003
Location: Eastern Finland
Posts: 7,110
Thanks: 145
Thanked 153 Times in 101 Posts
Endoperez is on a distinguished road
Default Re: Highly Parameterized AI

IIRC, it has been said earlier that giving out the turn files' syntax would make it very easy to cheat and make cheating scripts, but it stil would give only limited modding capabilities for those few people who would even want to try such a thing.
Reply With Quote
  #4  
Old January 9th, 2006, 06:53 PM
Arralen's Avatar

Arralen Arralen is offline
Major General
 
Join Date: Nov 2000
Location: 500km from Ulm
Posts: 2,279
Thanks: 9
Thanked 18 Times in 12 Posts
Arralen is on a distinguished road
Default Re: Highly Parameterized AI

Hmmm... I don't buy that argument.
( Btw., we're not talking about modding the game, but some way to automatically generate orders for all those tedious MM-task, and maybe a player-made external AI which whould use the same alghorithms. That's something different)

1) If there's a 100% check of orders on the server side, you would need to exploit bugs to cheat. And as every DOM can be run as client as well as as server, all the code to do the checks is available in the .exe => no need for and problems with dublicated code in client and server.

2) If I knew the file formats, I would be able to write an application (external AI), that can do everything a player can. Even more so: DOM in either server or client mode doesn't have any kind of memory. That's one of the causes why the AI has some troubles.
An external app could write all the info a player gets every turn to a file, so you e.g. always know which sites are in provinces you once owned, or which armies you have seen 2 or 4 turns before.
Furthermore, you could use that app to write orders to the turn file, e.g. have a commander move,patrol,move,patrol in your provinces automatically.
With everything in place, one could build an AI on top of those functions, which is -potentially- much more capable than the current one. And it wouldn't do anything else than read in a normally generated turn file, process it and write an order file, as the player does using DOM itself.

3)Security by obscurity is temporary at best
It's only a matter of time, before some figures out how things work. Sometimes you're lucky, but mostly those interested in such actvities are indeed more interested in self-profiling (even by cheating) than sharing their knowledge with the community. Search the forum for "Norfleet" ...

If, however, 1) does not apply, because the checks are made in client mode, I would suggest they throw away their code and start re-coding the game... .
__________________
As for AI the most effective work around to this problem so far is to simply use an American instead, they tend to put up a bit more of a fight than your average Artificial Idiot.
... James McGuigan on rec.games.computer.stars somewhen back in 1998 ...
Reply With Quote
  #5  
Old January 9th, 2006, 08:27 PM
Endoperez's Avatar

Endoperez Endoperez is offline
National Security Advisor
 
Join Date: Sep 2003
Location: Eastern Finland
Posts: 7,110
Thanks: 145
Thanked 153 Times in 101 Posts
Endoperez is on a distinguished road
Default Re: Highly Parameterized AI

I remember Norfleet, but I only know what he did, not how.

I haven't thought about the matter myself, though. I only remembered reading a similar comment from a dev once. You might well be right in both that the client shouldn't do anything without the server verifying it, AND that then releasing information about the turn files wouldn't give any more possibilities to cheat.
Reply With Quote
  #6  
Old January 26th, 2006, 01:54 PM

Folket Folket is offline
Major
 
Join Date: Sep 2005
Posts: 1,122
Thanks: 5
Thanked 2 Times in 2 Posts
Folket is on a distinguished road
Default Re: What Norfleet did

I did a search on Norfleet and I found that he was not the only one that found out how to cheat. Seems like the way to go is just to edit the 2h file with a hexeditor and by trial and error find out what can be done and what can not be done.

It would be possible to play a game where all players are human and then have a external program editing the 2h files for those that you do not plan to play. It would probably be a real painful exprience to do so. I remember whan I sat and decoded the map files in settlers 2 because a map was corrupt.
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 04:05 PM.


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