.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 September 28th, 2010, 09:23 AM
WraithLord's Avatar

WraithLord WraithLord is offline
General
 
Join Date: Sep 2003
Location: Tel Aviv, Israel
Posts: 3,465
Thanks: 511
Thanked 162 Times in 86 Posts
WraithLord is on a distinguished road
Default Battle AI hooks

AI hooks

I think no explanations are required re. how poor is the battle AI (and AI in general…).
Some notable examples:
- Mages refusing to cast scripted key winning spells
- Mages casting utter rubbish, like spamming protection on some militia instead of sleep to fatigue SCs, casting encase in ice million times on units already encased etc.
- Big formations just clog instead of spread thus dying slowly to a few SCs

It’s also well known that IW would never improve the AI but what if they were to do this relatively small effort to install hooks into their battle AI source code so that we could mod the AI. I’ll explain what I have in mind by way of example, (changed pseudo code in bold font):
- New mod command: #prioritize_spell_2_cast_hook $DOM_INSTALL_HOME/mods/ prioritize_spell_2_cast_hook.py
- In the belly of the source code leviathan where lies the code to decide which spell to cast, perhaps something like:
o Get list of targets
o Get list of available spells
o If isDefined(prioritize_spell_2_cast_hook ) then call prioritize_spell_2_cast_hook else Rank spells
o Sort ranked spells
o dequeue spell from list of spells

Motivation:
- Make battles more interesting
- Make mages vs. SCs more viable. right now the SCs take full advantage of the 5 slot script. The AI likes to buff so they'll always manage to buff while mages are at mercy of the AI
- Rarely researched/used spells will become more important/frequent
- Allow us to mod cool stuff like: black list spells and more

Opinions?
Reply With Quote
The Following User Says Thank You to WraithLord For This Useful Post:
  #2  
Old September 28th, 2010, 03:16 PM
Hadrian_II's Avatar

Hadrian_II Hadrian_II is offline
Major
 
Join Date: Oct 2006
Location: Bern, Switzerland
Posts: 1,109
Thanks: 14
Thanked 17 Times in 14 Posts
Hadrian_II is on a distinguished road
Default Re: Battle AI hooks

yes please
Reply With Quote
  #3  
Old September 29th, 2010, 05:37 PM

Grand Stone Grand Stone is offline
Private
 
Join Date: Dec 2009
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Grand Stone is on a distinguished road
Default Re: Battle AI hooks

This game has a lot of different units rules etc. and a lot of these rules are fun etc. But I allways feel like, well, it dosn't matter what I do as long as I have some kind of strattegy. I play mostly versus the AI, but often it seems to play very little role which AI i'm playing against. I useually find some of okish units, mass them out, and go hunting. Thats my style of play. But it seems that often that it doesn't matter what you do. Ok, flaming arrows and lots of archers is fun. But, all in all I actually think that to many units are too alike.


The game would have been way more interseting if the detalied description of each unit had more importance. And I think a slightly better AI in combat is part of the trick to making combat more interesting. On the top of my list, and an easy fix is to order my (and the AI) mages to cast more evocations spells!!! KILL, KILL, KILL...
Reply With Quote
  #4  
Old September 29th, 2010, 06:26 PM
Slobby's Avatar

Slobby Slobby is offline
Sergeant
 
Join Date: Nov 2007
Posts: 397
Thanks: 14
Thanked 15 Times in 10 Posts
Slobby is on a distinguished road
Default Re: Battle AI hooks

It would be awesome if the 'hooks' could be set up differently for each type of mage in the game, so that each mage would bring something different to the table depending on what has been researched.

For example assuming both paralyze and soul slay are researched, set it up so that guru's of kailasa etc prefer to cast paralyze while the illithids of r'lyeh prefer to cast soul slay.

Complicated and probably not going to happen but it would be fun.
Reply With Quote
  #5  
Old September 30th, 2010, 09:59 AM
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: Battle AI hooks

Kudos to WraithLord. This is one of the few times that Ive seen a suggestion like this where the person ACTUALLY seems to have a grasp on what the AI does before making their suggestion. The AI does go thru an extensive thinking process which anyone can look at (in a debug log). Instead of just a general desire to make the AI "smarter" (which when pressed tends toward a huge amount of IF statements for every possible nation/enemy/strategy) WaithLord has laid out a small fix which might actually be easy to do

One note though before anyone gets their hopes too high....
Even if such a change were made, it would most likely come in the form of an added "suggestion" from the pretender. Its not likely to go in as an absolute that you can count on. Probably something more like an added plus or minus to the priority list. Im not sure that an absolute would be considered appropriate for this game by the devs. They dont seem to regret the quirky AI.

If you want an absolute, then your best bet is to look toward some of the mods that remove the spell from consideration or make it more expensive. But I do think this change would be a good one
Reply With Quote
  #6  
Old September 30th, 2010, 11:50 AM
WraithLord's Avatar

WraithLord WraithLord is offline
General
 
Join Date: Sep 2003
Location: Tel Aviv, Israel
Posts: 3,465
Thanks: 511
Thanked 162 Times in 86 Posts
WraithLord is on a distinguished road
Default Re: Battle AI hooks

Thanks GP! I like your "treat it as suggestion" idea. It can work out great

Oh & I neglected to mention that some sort of consistent, generic API would be required for bridging between the game and the hook. For example dictionaries and maps are trivial in python so the hook (python code) can expect some kind of Context structure passed to it that contains all the dictionaries, maps and lists that form the basis for the spell AI code thinking process. I imagine IW already has such infrastructure in place (in C code).

Last, I have programmed such hooks (from both ends) for big commercial apps and they were always one of the customer's favorite features. If planned correctly, with foresight of future needs, they make the product that much more flexible and long lived.
Reply With Quote
  #7  
Old September 30th, 2010, 01:19 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: Battle AI hooks

Hmmm that would be great but I think it just shifted from simple to involved.

Johan would be more likely to create a typing window to tell it a spell and a slider to affect it. Or cut-n-paste the in-game code for assigning a spell on the commanders script commands, into a new command for degrading a spell. An interface to some other external language I dont see as likely.

If it did happen Id expect something more DIY than exporting the AIs thinking. The list of spells we can provide and just a setting of something like Flight -10.

The debug file could be used to try and figure out what change you want to assign if you want to do something like move a specific spell to be slightly higher or lower than another specific spell.
Reply With Quote
  #8  
Old September 30th, 2010, 05:09 PM
WraithLord's Avatar

WraithLord WraithLord is offline
General
 
Join Date: Sep 2003
Location: Tel Aviv, Israel
Posts: 3,465
Thanks: 511
Thanked 162 Times in 86 Posts
WraithLord is on a distinguished road
Default Re: Battle AI hooks

Quote:
Originally Posted by Gandalf Parker View Post
Hmmm that would be great but I think it just shifted from simple to involved.

Johan would be more likely to create a typing window to tell it a spell and a slider to affect it. Or cut-n-paste the in-game code for assigning a spell on the commanders script commands, into a new command for degrading a spell. An interface to some other external language I dont see as likely.
...
Those two options you just mentioned sound great. Do you think there's any chance to see this happen?- It would have a really big positive impact on the game.
Reply With Quote
  #9  
Old October 4th, 2010, 11:22 AM

fantasma fantasma is offline
Corporal
 
Join Date: Feb 2008
Posts: 150
Thanks: 0
Thanked 10 Times in 9 Posts
fantasma is on a distinguished road
Default Re: Battle AI hooks

If I look at the debug, it uses a points system to decide what to use, so a modcommand #sspellpriority that adds a fixed bonus is probably very easy as the decision making is not changed in nature. A #prioritypertarget that scales with the number of effects only slightly more complicated, I guess, since there is already some code that takes into consideration the effect a spell has.

Then the modder community can assign priorities to spells and the devs are spared the work to balance things out. Was not there a while ago a thread by Kristoffer asking which spells are used too much/too little? So there already are - hard coded - values like these, it seems.
Reply With Quote
The Following User Says Thank You to fantasma For This Useful Post:
  #10  
Old October 4th, 2010, 12:31 PM
WraithLord's Avatar

WraithLord WraithLord is offline
General
 
Join Date: Sep 2003
Location: Tel Aviv, Israel
Posts: 3,465
Thanks: 511
Thanked 162 Times in 86 Posts
WraithLord is on a distinguished road
Default Re: Battle AI hooks

good idea.

I encourage all who stumble unto this thread to list the spells they think are used too little/much.

Another aspect that needs to be addressed is spells that should not be repeated if desired affect was already achieved, i.e. entangle or encase when target is already entangled/encased. The AI can spam repeat those indefinitely targeting that one SC while the other SC/s would slowly butcher all your mages.

edit: another caveat of this suggestion is that it doesn't take into acct the circumstances. i.e a whole different set of spells are required when the mage is on:
a- support role (i.e. please buff my soldiers)
b- mass kill (i.e. fireball those militias)
c- eliminate elites (i.e. put that SC to sleep/charm/frozen heart etc)
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 10:53 AM.


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