![]() |
Mass flight bug - wrong script processing
I just didn't get it...
I had a huge army storming the castle defended by many mages and some troops and an A3 Rakhsharaja with 3 gems scripted to cast Mass Flight (spell requires A4 and 2 gems). It should have been an easy victory. But he due to some reason decided to cast Arrow Fend and Storm Warriors and obviously things went in quite another way with much more losses. Can anyone explain this? Maybe there're some bugs with this spell? |
Re: Mass flight issue
Check the file.
If there was a Storm going on, then flight wouldn't have worked, so the AI may have decided not to cast it. Also, the AI prefers a buff for round 1, and it may not consider Mass Flight a buff. |
Re: Mass flight issue
This can be one of the more frustrating things about the spell casting AI, it sometimes decides to override your "suggestions" regarding what spells to cast. Most of the time this can be a good thing, it keeps you from blowing a bunch of gems if an enemy scout attacks your army, or shooting lighting bolts at a lighting immune guy. Sometimes though, it seems like the AI's thought process goes like this:
This battle is easy, no need to cast mass flight, I'll save the gems Hmmmm, no script, let me see what I should cast... Wow, I've got some gems, I'll cast arrow fend! This is one of the more frustrating things in dominions IMO. |
Re: Mass flight issue
Rerun the battle with debug on, see what the log says about the casting decision.
Takes a little work to interpret, but can be helpful... |
Re: Mass flight issue
I'll check it at home with debug options, probably with all those priorities displayed.
Yes, it's really frustrating, but if AI decided not to cast Mass Flight at this situation, I really can't imagine the situation when it would cast it. Two big armies (about 1300 units) were at the different sides of the walls and it was the prefect situation to cast it, but I've got Arrow Fend instead. Did you successfully cast it at all? |
Re: Mass flight issue
This is what I found there (extracts):
Quote:
The spell is punished for excessive fatigue! And thus Arrow Fend was definitely a better choice... I can't call this a bug, this is just a bad algorithm that costed me a half of my army (or even more). Actually, this either has to be changed or anyone planning to script some big battlefield spell will have to think about this algorithm and the fact that AI may find another *not so exhausting* spell instead of the one your whole strategy is based around. Actually I think that scripted spells should never be be *punished for excessive fatigue*. If someone disagrees, let's discuss this. |
Re: Mass flight issue
One more thing...
In this very case I could have given my raksha an air booster but let's imagine the situation where someone is planning to cast something like mast flight (I don't mean exactly this spell as it is useless in the storm) with A2 mage and storm power. He will never be able to do this as the mage will always be *punished for excessive fatigue*. If it is really so, I think, it's unacceptable. |
Re: Mass flight bug - wrong script processing
Would it have also helped to have given your ape four gems--2 for the spell cost, 1 for the level gain, and 1 more for fatigue reduction? That seems much more convenient than having to spend multiple turns forging an item and getting the mage to a lab to equip it, just so he will feel comfortable about casting one spell that he could have cast anyway if he weren't so worried about losing consciousness. And presumably it would work with Storm Power too.
I agree though, it's lame that such an obviously good spell choice would be overriden by a commander who should know better. The spells in this game are so varied and quirky, it seems very natural that big, special-effects like universal flight should get their own special priority determination methods (and maybe they do). For instance if Mass Flight was always given a priority boost when a large enemy army could be seen beyond a wall, then maybe that would overcome the excessive fatigue penalty. Or maybe the excessive fatigue penalty should be reduced when the friendly army is very large (thus meaning the tired-out mage won't be lying unconscious on a battlefield all by himself). And maybe it is, how would I know? http://forum.shrapnelgames.com/images/smilies/happy.gif There are so many details that could go into their spell-scoring system--how interesting that code may be! |
Re: Mass flight bug - wrong script processing
I could not give four gems because Raksha is level 3 air mage and thus can use only 3 gems per cast. So the only option is giving a booster item (Flight has obviously no sense during storm). This means (as I mentioned above) that this spell seems to be uncastable at all for a A3 mage without boosters once Arrow Fend is researched.
As for the battle mechanics, I just think that scripted spells should never be overridden because of "excessive fatigue". They still should be overridden if the spell cannot be cast or if the opponent army is *too weak* (I think, this is a separate discussion topic) but NOT in the case when everything is ok but the non-scripted spell which AI likes very much (Arrow fend in my case with 220322 score) is cast instead of scripted one just because it causes less fatigue. It makes no sense at all in my opinion. |
Re: Mass flight issue
Quote:
1) Front Mage Guard says, "Mage Leader we're winning and the troops of the enemy are now on the run." Mage Leader says, "Let's see I'm done with my script orders... the enemy is retreating so I'll use my last earth gems and summon earth elementals!" Front Mage Guard says, "Why waste those earth gems on elementals which won't even be able to fight???" Mage Leader says, "Because using lots of gems gets me high." ======================= ======================= 2) Main Commander says, "Our troops are starting to fall... what shall we do Mage Leader?" Mage Leader says, "Yikes you're right... I'm casting astral shield on myself and some other self help spells." Main Commander responds, "This won't help our troops and it will make you fall asleep plus astral shield has almost no value for someone with low hitpoints such as yourself." Mage Leader says, "It's all about me." |
Re: Mass flight issue
I once gave a Grand Master (I think thats the MA Marignon unit) some fire gems to cast flamming arrows. After running out of script and while the opponent had routed, he used some remaining gems to summon a fire elemental, whose heat aura managed to kill the Grand Master.
As for the fatigue, I thought it was always capped at 199 no matter how much the calculated fatigue would be? |
Re: Mass flight issue
Yes it is capped, but that is not an issue. Casting Mass Flight would cause 200 fatigue while casting Arrow Fend caused much less so AI decided to override the script.
As for your example with Grand Master, it has nothing to do with battle mechanics - just an unlucky situation) No bug there. |
Re: Mass flight issue
Chief Bodyguard: “Well done, Nature Mage! Your last 5 spell choices were both clever and tactically relevant!”
Nature Mage: “Thank you, Loyal Bodyguard. But rational thought bores me…Touch of Madness!” Bodyguards & nearby archers, in unison: “CHARGE!” Nature Mage: “CHAR…” |
Re: Mass flight issue
1 Attachment(s)
Quote:
|
Re: Mass flight issue
Quote:
Actually, read it more closely. Mass Flight is being punished for extra fatigue, but that isn't what's stopping him from casting it. That just drops the score from 459 to 153, which combined with the 100,000 bonus for being scripted puts it at 100,153. That's below the 179,123 for Arrow Fend, so Arrow Fend is cast. It still would have been less if there wasn't the fatigue penalty: 100,459. The real question is why is Arrow Fend rated so highly? |
Re: Mass flight issue
Quote:
|
Re: Mass flight issue
Yes, you're right. Problem is in extra high Arrow Fend score.
My army was about 800-900 units large (this may be the reason) but the only archers enemy had were two dozens of sprites (this doesn't seem to affect the score). However I still think that scripted spells should never be punished for extra fatigue. And in order to avoid such situations scripted battlefield enchantments should never be overridden at all unless the enemy army is *too weak* and is not worth spending gems on it. Btw... Does all this mean that my mage could cast nothing but Arrow Fend in this situation? It seems so... |
Re: Mass flight issue
Btw... Does all this mean that my mage could cast nothing but Arrow Fend in this situation? It seems so...
|
Re: Mass flight issue
You get a 100,000 bonus for a spell being scripted, so take a look through the log. If there's anything else there above 80,000, he should be able to cast that.
|
Re: Mass flight issue
I know about that.
However, do you think that it is right and everything is ok with this algorithm? Actually, my battle meant nothing and I have so huge potential that all these losses are nothing but a wasp bite, but there's a conceptual problem with this algorithm and I think it's worth modifying it in some way. |
Re: Mass flight bug - wrong script processing
Quote:
About the problem with the algorithm etc.: You keep saying scripted spells should never be ignored in this way, as if that rule should be patched onto the existing system on top of everything else. But it seems like they've already tried to work the rule into the spell priority system by giving some huge point bonus to scripted spells. So like others are saying, it might make more sense to say that the weird thing is the high Arrow Fend score. However, due to the complexity of the spell system, this is surely not a problem that will respond well to addition of big new rules--it's a delicate, fussy tuning problem. There's probably no simple solution anybody's going to come up just by thinking about it; they've got to have access to the code and be able to twiddle with it until it seems to work in all reasonable situations. I'm a programmer, so my fantasy scenario would be to have a server someplace that runs a large number of test battles every time a developer tweaks the spell AI, and makes sure the mages in these battles all still make reasonable decisions. And then every time a thread like this comes up, they'd add another few test battles and then make little changes to the AI until all the tests pass again. |
Re: Mass flight bug - wrong script processing
An solution I've seen around for scripting is creating a player-defined spellbook for each caster so he can only cast a limited portion of list of spells you have researched, and doesn't use unwanted spells randomly.
|
Re: Mass flight bug - wrong script processing
Quote:
|
Re: Mass flight bug - wrong script processing
It doesn't currently exists in Dominions.
What it would be is for example : on the "details" screen of your unit, you would have a spellbook icon. In that spellbook you would have every spell you have researched and a possibility to : - save the spellbook, - load a saved spellbook, - modify the current spellbook by setting whether it should be casted or not. In a even more perfect world, you would have columns for each spellbook where you defined spells to use in different situations (even fight, assassination, easy fight, SC fight...), and possibility to set yourself the chance of spells to be cast (ie : 75% sermon of courage and 25% vine arrow for a dryad in early game). That would be a dream for scripting. |
Re: Mass flight bug - wrong script processing
And an absolute nightmare for micromanagement.
I'd rather have AI fixes. And maybe a configurable blacklist of "never cast unscripted" spells. Used for your whole nation. |
Re: Mass flight bug - wrong script processing
The option to save and load spellbooks could have buttons so you can apply them to every units you control, or all of a specific kind of caster (all with 2N 1D), or all of a certain type (all vampires) to reduce micromanagement...
For me, a "configurable blacklist of "never cast unscripted" spells, used for your whole nation" is to be avoided, because I don't want my 2N mages to cast wine arrow, but I do want my 1N mages to do so. I want my 4N 2E casters to use nature spells, but 2E casters to use earth. A configurable blacklist for the whole nations doesn't let me do that, and is therefore in my opinion, not enough. The solution I propose, however, doesn't prevent AI fixes. So don't choose one or the other, when you can do both. http://forum.shrapnelgames.com/images/smilies/wink.gif |
Re: Mass flight bug - wrong script processing
The thing is, to be competitive you'd have to use the individual spellbooks for almost every fight. And adjust it as you learned new spells.
The most common use for them wouldn't be to ban a few spells you didn't want, but to set a caster to spam one spell repeatedly after his script ran out. Not optimizing spellbooks for every battle would soon be as effective as not bothering to script your mages for battle. And if this huge change was ever put in, (Which it won't be. The devs have shown no interest in making such major interface changes.) you'd be able to workaround all the bugs in the spellcasting AI, so there'd be no pressure for fixes. (And I know it was a typo, but I like the "wine arrow" spell. Damage and confusion.) |
Re: Mass flight bug - wrong script processing
Quote:
The whole point of the spellbook idea, though, is to workaround all the bugs in the spellcasting AI, which in my opinion will never be resolved because there is no way that the AI could choose the spell that reflects best the strategy chosen by a player in a given circumstance. |
Re: Mass flight bug - wrong script processing
Obviously the AI will never become perfect. It will never be "do what I want", especially when "do what I want" isn't the same as "do what I told you"
That's not a bug, that's just the nature of AI. But what started this thread wasn't a complaint of the AI wasn't perfect, it was a specific case of the AI overriding the script, due to what looks like a massive overrating of Arrow Fend. There are similar issues with Astral Shield. These can be fixed as they're found, and may even trace back to the same root cause. Which reminds me. Should this Arrow Fend issue go to the bug list? As for the spellbooks, an easier solution would be to just extend the script or have a last action of Cast Specific Spell repeatedly. That's how the spellbooks would be used 90% of the time. This has been suggested and shot down by the devs many times. And, AFAIK, experienced MP players script all the mages they send into battle. |
Re: Mass flight issue
Quote:
|
Re: Mass flight issue
This has been pretty frustrating for me.
I've had the exact same problem. Arrow fend instead of mass flight, especially in castles. Personally I think any castle battle where you're storming should give a boost to mass flight. Jazzepi |
Re: Mass flight issue
Probably more effective to clamp down the abusive boost to Arrow Fend. Other wise you'll wind up storming a castle planning on Storm + Wrathful Skies and having your Storm overridden by Mass Flight because of the boost.
In other words, I'd much rather have the scripted behavior win, unless it just can't work, than try to tweak the AI to make better choices when it goes off script. The simplest solution to all these problems may simply be to boost the favspell bonus. I wonder what the debug logs look like when the script includes spells that are useless (no valid target or no target in range) or battles that aren't worth wasting gems for. |
Re: Mass flight issue
Quote:
Quote:
|
Re: Mass flight issue
I'll add Arrow Fend to the buglist as purple so it won't be forgotten.
|
Re: Mass flight issue
Edi,
While you're at it, could you add in Astral Shield as a related issue? I dumped some debug info on the Bug Discussion thread here |
Re: Mass flight issue
Done. Looks like I screwed up adding the Arrow Fend, so I added it again and the Astral Shield as well.
|
Re: Mass flight issue
As a temporary workaround, if you can spare another A3 caster and a gem (or A2+2A), you could script an Arrow Fend before your Mass Flight.
|
Re: Mass flight issue
I think that having both in castle storms is worthwhile. As would be to cast all available boost spells.
|
Re: Mass flight issue
How do you imagine flying during storm?)
|
Battle Simulation
I have been thinking that it would be nice to have a "Battle Simulation" that you could enter just to see if the spells that you have scripted will actually be cast. Not sure if this wish would be granted, but it sounds like it would be helpful here.
|
Re: Battle Simulation
Battle Simulator:
http://www.shrapnelcommunity.com/thr...?Number=471188 Use with easyspell.dm or debug.dm for spell access without waiting around for research. You'll need to read the map modding PDF to set up the units/nations you want to test. |
All times are GMT -4. The time now is 12:49 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.