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

This Month's Specials

BCT Commander- Save $6.00
World Supremacy- Save $10.00

   







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

Reply
 
Thread Tools Display Modes
  #1  
Old October 4th, 2010, 01:07 PM

Muse Muse is offline
Corporal
 
Join Date: Jul 2010
Posts: 62
Thanks: 2
Thanked 1 Time in 1 Post
Muse is on a distinguished road
Default Re: Battle AI hooks

Quote:
Originally Posted by WraithLord View Post
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)
It may be possible to assign a category to each spell, then utilize the current script of the mage to determine which category the mage is expected to cast post-script.
Perhaps the category of the last spell scripted is given higher priority weight.

Though, this does run the risk of reducing the delicious quirkiness of the AI-- it may be useful to add an On/Off toggle, default to Off, for such a feature. Thus modders can control the 'Obedience Level' of a particular mage.

Last edited by Muse; October 4th, 2010 at 01:15 PM..
Reply With Quote
  #2  
Old October 4th, 2010, 01:13 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

yes, or just add a sixth slot to script with role, something like:
spell1,...,spell5,anti-SC
or
spell1,...,spell5,buffer
etc.
Reply With Quote
  #3  
Old October 4th, 2010, 01:24 PM

Muse Muse is offline
Corporal
 
Join Date: Jul 2010
Posts: 62
Thanks: 2
Thanked 1 Time in 1 Post
Muse is on a distinguished road
Default Re: Battle AI hooks

Quote:
Originally Posted by WraithLord View Post
yes, or just add a sixth slot to script with role, something like:
spell1,...,spell5,anti-SC
or
spell1,...,spell5,buffer
etc.
I'm uncertain-- there is a finesse to positioning, equipping, and scripting mages to gain the desired effect.
An overt behavior-directing addition would take a bit of the cleverness out of it. (And a significant portion of the entertaining 'AI Manipulation' skill requirement.)

A larger project that may preserve such an element would most likely involve: multiple categories per spell, algorithm for determining weights from script, mage-personality modifier.
As a side note: While 'mage personalities' may be somewhat thematic, they may also serve to 'lock' a particular faction into playing a certain way, reducing tactical diversity.

Dominions has an appeal partially stemming from the semi-organic unfolding of battle events due to the complex AI structure.
A good bit of fun is had from SP testing, in chaos theory fashion, to find the most optimal starting arrangement.

Last edited by Muse; October 4th, 2010 at 01:52 PM..
Reply With Quote
  #4  
Old October 4th, 2010, 03:01 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

The problem with assigning roles is that there would never be agreement on it. And to get it totally good for most of the players would involve way too long a list of IF statements. The hosting would take forever.

Even now, the AIs recognition of SCs is continually questioned (the AI sending gods to war and to the arena)
Reply With Quote
  #5  
Old October 4th, 2010, 05:22 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

I think the AI is clueless when it comes to SCs. It doesn't recognize them, it can't build, equip or script them and its certainly unable to counter them. SCs would have been seriosly toned down as well as MM hell of nurturing them (equipment, scripting etc) if the (friendly) AI had a clue what they are and how to counter them (by making sure your mages cast the anti-SC spells and not some junk that fatigues them until they pass out).

Even if you manually script a bunch of N mages to charmX5 and face the enemy's SC on holdX5 (out of range) you're likely to lose all your mages due to that limitation of the AI. In-fact however you'd script your mages you'll most likely lose them in said scenario.
Reply With Quote
  #6  
Old October 4th, 2010, 06: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: Battle AI hooks

Its not clueless. Not great, but not clueless.
The computer players common complaint "sending god sto war and arena" is definitely mitigated by not giving it an SC god.

The AI for both player and computer, does make decisions based on who its combating despite the complaints. But recognitions are general such as scout, infantry, cavalry, archer, mage, priest, assassin, seducer, thug, SC. There wasnt room for tons of IF statements defining things further. Most of the complaints about what the AI casts, purchases, etc are based on wanting IF's

The problem there is that hosting would take a day. Which is something I voted for.
Reply With Quote
  #7  
Old October 5th, 2010, 02:54 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

The source code is in C or C++ right?- If so, there are optimizations for compound IF statements that the compiler can do when writing the assembly code. Also, IIRC the dev can "help" the compiler optimize by keeping to certain forms. I don't recall the details as my course on this was 12 years ago and I'm not doing this as common practice.

Anyway, lots of IFs shouldn't have such an impact on performance. It's usually IO and blocking threads that kill performance - both not relevant to turn processing.
Reply With Quote
  #8  
Old October 5th, 2010, 04:39 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

I doubt the AI uses a lot of ifs, it rather assigns priorities given circumstances and then takes the one with the best result.

Given that, whatever was suggested can be done by applying a high bonus to single target kill spells when facing one strong opponent. To a certain extent this appears to be implemented. The issue is finding the correct weighting. My suggestions for the two mod commands could address many problems.

Now, please, don't mix the tactical AI with the strategic AI (the one that does the turns for AI players), since they don't have much to do with each other. The AI is not aware of a concept like thug or SC. He does not try to optimise a build for MR, protection or defense, give it AOE attacks and necessary resistances while trying to stay economic. This part is simply missing in the AI code, unfortunately, As is the contrary, how to specifically create a task force to deal with deliberate opponents. Now, this is a completely different cup of tea, where even many human players struggle, and is far from trivial to implement at this stage of development.
Reply With Quote
  #9  
Old October 5th, 2010, 08:33 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

I've seen little evidence to suggest that the tactical AI is any better than the strat. AI when it comes to thugs and SCs.
The tact. AI doesn't know to script and deploy them so much so as it doen't know what spells to cast in order to stop them.

Now, I'm not looking for perfection here but you know the Pareto principle?- Some measure to let the AI or us (modders) have the means to make some rough improvements.

Example: plant these hooks I was talking about and expose them to us.
Example: Add mod commands for including categories/tags/weights to spells.
Example: Add to AI rough "behavioral" guidelines so you could script mages as I suggested.
Reply With Quote
  #10  
Old October 10th, 2010, 09:49 AM

Bananadine Bananadine is offline
First Lieutenant
 
Join Date: Nov 2007
Posts: 749
Thanks: 25
Thanked 28 Times in 18 Posts
Bananadine is on a distinguished road
Default Re: Battle AI hooks

Quote:
Originally Posted by WraithLord View Post
Example: Add mod commands for including categories/tags/weights to spells.
YES YES YES

Maybe there could be an even simpler version of this. Somewhere in the source code there are probably some numbers--just ordinary, typed-out integers that are fed into the spell-selection AI algorithms. Let the game optionally read each of these from a mod. This is probably easy. I don't care how old the code is or how much they hate changing it--even so, it's probably still easy! Right? Maybe it'd take a few hours to invent a new mod command for each parameter. It might be a hassle. But how could it be hard? Well, maybe it could be. There's probably some way in which it could be. But I bet it's not!

And if every spell's priority parameters are represented as raw numbers like this, then this one, allegedly easy change would solve a big bunch of the tactical AI problems. Well, maybe it's not that simple. Maybe there are special algorithms for every spell, rather than special integers. But still, those special algorithms probably have raw numbers in them somewhere that they could probably pretty easily be taught to read from a mod.

Or maybe it would actually be easier to add a new system ("add a new system", always the badge of doom in a suggestion for game changes) to let players just specify one new number per spell. Just one little multiplier that'd modify the spell's priority just before the "last moment" in the prioritizing algorithm. Like, if Decay (spell #639) is cast too much, and Horror Mark (#637) too much, and Prison of Fire (#657) too little, then you might put in your mod:

#modifyspellpriority 639 60
#modifyspellpriority 637 75
#modifyspellpriority 657 150

where the latter numbers are multipliers in the form of percentages. That would be awesome.

Quote:
Originally Posted by WraithLord View Post
I encourage all who stumble unto this thread to list the spells they think are used too little/much.
I claim that in general, spells that work against magic resistance are used too much, and extremely powerful death-and-disablement spells are used too much, while spells with a small, sure benefit are used too rarely. A demilich in a nation that has researched Disintegrate is sometimes weaker than a D2 mage in a nation that only knows Raise Skeletons, because of this. Raise Skeletons is sometimes much better than Disintegrate, and Drain Life is often also better, but the mage will usually choose Disintegrate anyway. A necromancer priest will try to banish enemy undead, even though they've been encased in lead, rather than casting frickin Wither Bones on them, even though Wither Bones is IRRESISTIBLE. Wither Bones and Dust to Dust are badly neglected. Fire mages cast Blindness, rather than Incinerate. Incinerate is badly neglected. Air mages cast Confusion, rather than Lightning. Confusion is sometimes great but Lightning is often better. Personal Regeneration is neglected by dying nature mages. And yeah there is too much encasement in ice.

Hmm... most of my notes there concern enemies with high magic resistance, and single, extremely powerful enemies. Yeah, the dreaded "new system" is probably needed. A modder probably can't fix all this stuff without being able to base spell priorities on enemy magic resistance and the strength of the strongest enemy target. A simple, universal modification to the priority of a single spell probably wouldn't be enough. But... it might still help a lot.

Alternatively, maybe just one "small" change that drops priority for a spell blockable by magic resistance when the target has high magic resistance would do the trick, in many of these cases. And then the Dust to Dust castings I covet would naturally emerge on their own. Take that Tartarians!

I like the idea of giving different personalities to different mages, also. I think that would add good complexity to the game, and not bad complexity. (By contrast, ideas that involve new ways of controlling mages, "Cast Supporting Spells" and "Cast Damaging Spells" commands and such, could easily add bad complexity to the player's experience.) But... "new system"
Reply With Quote
The Following User Says Thank You to Bananadine For This Useful Post:
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:18 AM.


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