.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 3: The Awakening (http://forum.shrapnelgames.com/forumdisplay.php?f=138)
-   -   AI and following scripts (http://forum.shrapnelgames.com/showthread.php?t=40868)

Myotis October 13th, 2008 07:17 AM

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!

vfb October 13th, 2008 07:28 AM

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.

Endoperez October 13th, 2008 09:45 AM

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.

TwoBits October 13th, 2008 10:44 AM

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.

Gandalf Parker October 13th, 2008 11:03 AM

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.

Dorjan October 13th, 2008 12:28 PM

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?

Tifone October 13th, 2008 03:25 PM

Re: AI and following scripts
 
Quote:

Originally Posted by Dorjan (Post 645288)
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.

rdonj October 13th, 2008 04:16 PM

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.

Gandalf Parker October 13th, 2008 05:24 PM

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.


All times are GMT -4. The time now is 11:48 AM.

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