.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 October 13th, 2008, 07:17 AM

Myotis Myotis is offline
Private
 
Join Date: Oct 2008
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts
Myotis is on a distinguished road
Default AI and following scripts

Hello Everyone!

I have tried to see if there is a post about this, but I have found none (maybe I am blind), thus here is my question.

What determines if the AI will follow a script or not?

I have had on a number of occasions, that the AI simply did not follow a script. Namely to cast Wind Guide at the beginning of battle. My mage had everything needed, including the gems and the necessary magic paths. (This I have double checked). There were also archers in my army (120 of them) and still it did not follow it. I cannot really understand this and as I have not found any indication about why it does not follow, I thought I will ask here as to be able to better foresee what the AI might do.

Thank you all for your help in advance!
Reply With Quote
  #2  
Old October 13th, 2008, 07:28 AM
vfb's Avatar

vfb vfb is offline
General
 
Join Date: Mar 2007
Location: Japan
Posts: 3,691
Thanks: 269
Thanked 397 Times in 200 Posts
vfb is on a distinguished road
Default Re: AI and following scripts

You can run with debugging on, if you have a command prompt that would be:

dom3 -ddddddd

(Actually, I don't know exactly how many d's you need, but that's enough.)

Capture the output into a text file and search for your spell, and you'll see a bunch of other spells being evaluated too. The one with the highest score gets cast, and the spell that you've given orders to cast gets a score bonus. If the enemy is considered too weak, the debug log will tell you if it's refusing to use gems. There's not much you can do in that case.
__________________
Whether he submitted the post, or whether he did not, made no difference. The Thought Police would get him just the same. He had committed— would still have committed, even if he had never set pen to paper— the essential crime that contained all others in itself. Thoughtcrime, they called it. Thoughtcrime was not a thing that could be concealed forever.
http://z7.invisionfree.com/Dom3mods/index.php?
Reply With Quote
The Following 2 Users Say Thank You to vfb For This Useful Post:
  #3  
Old October 13th, 2008, 09:45 AM
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: AI and following scripts

The more Ds in the debug, the more info you'll get.


Sometimes the AI refuses to cast spells because it considers the enemy army too weak to be worth investing gems on. This is necessary because ritual attacks like Call of Winds happen before normal battles, and it'd be very annoying if your mages spent all your gems on some birds instead of the enemy army that attacked you later on the same turn.

The logic isn't perfect, so sometimes you'll lose battles you'd have won if your mages had obeyed their orders.
Reply With Quote
  #4  
Old October 13th, 2008, 10:44 AM
TwoBits's Avatar

TwoBits TwoBits is offline
Second Lieutenant
 
Join Date: Jan 2007
Location: Osaka, Japan
Posts: 481
Thanks: 42
Thanked 33 Times in 12 Posts
TwoBits is on a distinguished road
Default Re: AI and following scripts

I've also heard that unit placement can sometimes affect following scripts.

Of course, range will always be an issue for many spells, but I think I remember hearing that for some battlefield spells, such as Flaming Arrows, the casting unit needs to be able to "see" the enemy? And that if you place the casting unit towards your rear, it'll be much less likely to cast than if it was farther forward?

If this is so, I hope some more experienced players can chime in on this, and give some details on the mechanics of how placement can affect scripting (or at least confirm or deny it), outside of obvious range issues.
Reply With Quote
  #5  
Old October 13th, 2008, 11:03 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: AI and following scripts

The AI TRIES to be thinking intelligent.
You are basically making suggestions to the mage or commander. But out on the battlefield the unit will read the situation for themselves. Sometimes all they can see is undead which might change their mind about what to do. Sometimes terrain can affect decisions or even temperature.

Placing archers or people told to attack "rearmost" enemies can be helped by placing them far off to the sides of the battlefield (the top or bottom of the placement screen). I like to put archers at the top (left flank during the battle) set to fire at archers, and put mounted or other 4-footed attackers such as tramplers off to the bottom (the right flank during a battle) set for "Hold and attack Rearmost". That seems to match up well with how the enemy AIs like to place their units.

Also check the range on the spells you are asking for. Sometimes you might want it to attack for one round and then cast if they are short-range spells.

I know this can be irritating but it also helps. If a unit is damaged and incapable of carrying out its original orders it will at least do something instead of just standing there stupidly trying to carry out its commands.

By the way, each commander can lead 5 squads. Use those. Even if you are just breaking up one large group into 5 smaller ones but leaving them all standing in the same spot with the same orders. It can help you avoid things like having them all rout at the same time, or having them all make the same bad decision.
__________________
-- 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!)

Last edited by Gandalf Parker; October 13th, 2008 at 11:06 AM..
Reply With Quote
  #6  
Old October 13th, 2008, 12:28 PM

Dorjan Dorjan is offline
Private
 
Join Date: Oct 2008
Posts: 37
Thanks: 8
Thanked 0 Times in 0 Posts
Dorjan is on a distinguished road
Default Re: AI and following scripts

But doesn't each unit's morle increase with more numbers? So a block of 80 is harder to break then 5 squads of 16?
Reply With Quote
  #7  
Old October 13th, 2008, 03:25 PM
Tifone's Avatar
Tifone Tifone is offline
Lieutenant Colonel
 
Join Date: Jun 2008
Location: Florence, Italy
Posts: 1,424
Thanks: 740
Thanked 112 Times in 63 Posts
Tifone is on a distinguished road
Default Re: AI and following scripts

Quote:
Originally Posted by Dorjan View Post
But doesn't each unit's morle increase with more numbers? So a block of 80 is harder to break then 5 squads of 16?
I know what you mean because that's a thing that drives me crazy, and probably shows how n00b I am. Except for different orders, I often keep all the units with the same function always grouped (the ones with shield that should attack closest together, the fast ones that should attack rearmost together). It makes far more difficult to have them routing but surely it's quite dumb, you often have like one third of your army actually fighting in melee.

That's probably that I just hate to need losing turns regathering my routed units from 3 or 4 different provinces. And that's why I see no use for "fire and flee" command. While I retake and regroup them, the enemy is conquering provinces.
__________________
IN UN LAMPO DI GLORIA!


Last edited by Tifone; October 13th, 2008 at 03:28 PM..
Reply With Quote
  #8  
Old October 13th, 2008, 04:16 PM

rdonj rdonj is offline
General
 
Join Date: Oct 2007
Posts: 3,007
Thanks: 171
Thanked 206 Times in 159 Posts
rdonj is on a distinguished road
Default Re: AI and following scripts

I find the fire and flee command annoying too, it would be far more enjoyable if they all run to the same province when you tell them to retreat. You can somewhat get around it by making huge numbers of commanders and keeping them in all the provinces where your units could retreat to, but that's pretty annoying in itself.
Reply With Quote
  #9  
Old October 13th, 2008, 05:24 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: AI and following scripts

The problem is the basic recognition of commander vs militia. Telling a commander to retreat means an orderly withdrawal to a location keeping all together as you go. Telling the units themselves to flee means mindlessly fleeing the battlefield every-man-for-himself.

Have you tried using them as decoys? set some small cheap flak units to flee up the middle of a gauntlet of your best warriors. Set those to Hold and Attack closest which saves them running up in armor and getting all fatigued before they strike a blow.

Last edited by Gandalf Parker; October 13th, 2008 at 05:37 PM..
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 07:52 PM.


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