(August 28th, 2024, 19:02)GMBarak Wrote: On the next turn, Lo pan, invincible army of 8 Berzerkers and 1 Gladiator cleared a minimum 3 behemoth tower near Lo Pan's capital, how?
attaching before and after in the link, no modes were used.
AI vs. AI or AI vs. neutral is resolved by strategic combat. It's different than the tactical combat for player battles. In the new games score modifier, you can choose for player battles to be resolved by strategic combat as well if that's what you really want. Strategic strength for berserkers is pretty huge -- due to the high figure count, thrown, attack strength, and hit points.
What I am saying is that there is a bug in the strategic combat calculation.
(August 28th, 2024, 19:02)GMBarak Wrote: On the next turn, Lo pan, invincible army of 8 Berzerkers and 1 Gladiator cleared a minimum 3 behemoth tower near Lo Pan's capital, how?
attaching before and after in the link, no modes were used.
AI vs. AI or AI vs. neutral is resolved by strategic combat. It's different than the tactical combat for player battles. In the new games score modifier, you can choose for player battles to be resolved by strategic combat as well if that's what you really want. Strategic strength for berserkers is pretty huge -- due to the high figure count, thrown, attack strength, and hit points.
What I am saying is that there is a bug in the strategic combat calculation.
It's not really a bug... The formula is what it is. If you try to fix it here -- it will likely break other cases.
The behavior is basically the same as since original master of magic.
That's why I suggested if you want even playing field -- use strategic combat for player combats as well.
Oh. And I looked at your save... 3 of the berzerkers are elite -- and resist magic...
The defenders are 3 behemoths -- and 2 bears... Even with tactical combat -- the battle could be winnable with the casting support from the wizard. It seems resist magic helps against petrify spell.
(August 29th, 2024, 18:07)mshih Wrote: Oh. And I looked at your save... 3 of the berzerkers are elite -- and resist magic...
The defenders are 3 behemoths -- and 2 bears... Even with tactical combat -- the battle could be winnable with the casting support from the wizard. It seems resist magic helps against petrify spell.
No it's not winnable, because berzerkers elite 9 attack 40% to hit does only 3.14 damage on average on a 15 defense behemoth and will lose 3 figures (half unit) in each of the behemoth retaliation. not to mention that on the start of the battle 3 berzerks will be eliminates by petrify (barbarians low resistance) please don't make stuff up.
I can post a part of log.txt about this combat. You can get it by entering debug mode before end of turn.
I have vague understanding how this strategic combat works. I can guess that regen and 15 def that behemoths have are not even important for that calculation.
It's just a completely different set of rules you can not use advanced damage calculator and expect the same results. Also according to the log behemoth don't cast spells it just has weak magical ranged attack because army 2 is obv berserkers with that insane antifly damage
Code:
Stack of 9 units moves from 1,19,22 to 19,20
Post Processing movement
Move is not shown/visible to the human player
Stack arrives to 19,20 plane :1
Stack initiates combat!
Entered combat at X=19, Y=20P =1
Army #1
MELEE=5733,10942909029
ANTIFLYMELEE=0
MISSILERANGED=0
MAGICRANGED=1700,35329222626
OTHERRANGED=0
HP=194,268547841878(Invis :0,Flying :0,Miss.Im. :0,Mag.Im :0)
SAVEORDIE=0
POISON=0
RANGEDSAVE=0
RANGEDPOISON=0
AMMO=4
Casting Buff = 0
Casting RBuff = 0
Casting DD = 0
Casting Curse = 0
Casting Summon = 0
Casting Global = 0
Casting Antifly = 0
Army #2
MELEE=0
ANTIFLYMELEE=14956,8625604659
MISSILERANGED=0
MAGICRANGED=0
OTHERRANGED=0
HP=183,107641229275(Invis :0,Flying :0,Miss.Im. :0,Mag.Im :0)
SAVEORDIE=0
POISON=0
RANGEDSAVE=0
RANGEDPOISON=0
AMMO=0
Casting Buff = 3
Casting RBuff = 5
Casting DD = 4
Casting Curse = 4
Casting Summon = 4
Casting Global = 4
Casting Antifly = 0
Combat turn 1 player 1
Army deals 10,2687122126167 Magic Ranged damage
Combat turn 1 player 2
Casting uses 40*Range MP
Buff = 28
Buff Ranged = 17
Damage = 35
Curse = 0
Summon = 17
Spellcasting Buff grants 22,814738630199 HP
Spellcasting Buff grants 3,28698161646721 HP
Spellcasting Ranged Buff grants 1,7 % ranged attack strength
Spellcasting Damage deals 2,8 damage
Spellcasting Curse deals 0 damage
Spellcasting Summoning grants 3,4 HP and 163,2 attack rating
Combat turn 2 player 1
Army deals 10,1207088712897 Magic Ranged damage
Combat turn 2 player 2
Casting uses 20*Range MP
Buff = 30
Buff Ranged = 17
Damage = 34
Curse = 0
Summon = 17
Spellcasting Buff grants 1,72997946352832 HP
Spellcasting Ranged Buff grants 0,85 % ranged attack strength
Spellcasting Damage deals 1,36 damage
Spellcasting Curse deals 0 damage
Spellcasting Summoning grants 1,7 HP and 81,6 attack rating
Combat turn 3 player 1
Army deals 10,0488215340738 Magic Ranged damage
Combat turn 3 player 2
Casting uses 20*Range MP
Buff = 29
Buff Ranged = 17
Damage = 35
Curse = 0
Summon = 17
Spellcasting Buff grants 1,61472955539696 HP
Spellcasting Ranged Buff grants 0,85 % ranged attack strength
Spellcasting Damage deals 1,4 damage
Spellcasting Curse deals 0 damage
Spellcasting Summoning grants 1,7 HP and 81,6 attack rating
Combat turn 4 player 1
Army deals 9,97481986341035 Magic Ranged damage
Combat turn 4 player 2
Casting uses 20*Range MP
Buff = 28
Buff Ranged = 17
Damage = 35
Curse = 0
Summon = 17
Spellcasting Buff grants 1,5031044673132 HP
Spellcasting Ranged Buff grants 0,85 % ranged attack strength
Spellcasting Damage deals 1,4 damage
Spellcasting Curse deals 0 damage
Spellcasting Summoning grants 1,7 HP and 81,6 attack rating
Army deals 0,958656616505234 Melee damage
Army deals 31,0965424195768 Antifly Melee damage
Combat turn 5 player 1
Army deals 27,6697687894686 Melee damage
Combat turn 5 player 2
Casting uses 1*Range MP
Buff = 26
Buff Ranged = 18
Damage = 36
Curse = 0
Summon = 18
Spellcasting Buff grants 0,0602449940396151 HP
Spellcasting Ranged Buff grants 0,045 % ranged attack strength
Spellcasting Damage deals 0,072 damage
Spellcasting Curse deals 0 damage
Spellcasting Summoning grants 0,09 HP and 4,32 attack rating
Army deals 0,824172855744824 Melee damage
Army deals 26,3726228419273 Antifly Melee damage
Combat turn 6 player 1
Army deals 22,8098332201196 Melee damage
Combat turn 6 player 2
Army deals 0,702592934052402 Melee damage
Army deals 22,4821993736033 Antifly Melee damage
Combat turn 7 player 1
Army deals 18,6777623339247 Melee damage
Combat turn 7 player 2
Army deals 0,603037586144587 Melee damage
Army deals 19,296537987198 Antifly Melee damage
Combat turn 8 player 1
Army deals 15,131193713291 Melee damage
Combat turn 8 player 2
Army deals 0,522385994832112 Melee damage
Army deals 16,7157759729444 Antifly Melee damage
Combat turn 9 player 1
Army deals 12,0589510874625 Melee damage
Combat turn 9 player 2
Army deals 0,458109929559823 Melee damage
Army deals 14,6590127401184 Antifly Melee damage
Combat turn 10 player 1
Army deals 9,36472714801458 Melee damage
Combat turn 10 player 2
Army deals 0,408194492548989 Melee damage
Army deals 13,0617737809597 Antifly Melee damage
Combat turn 11 player 1
Army deals 6,96406454977537 Melee damage
Combat turn 11 player 2
Army deals 0,371074956669356 Melee damage
Army deals 11,8739895522056 Antifly Melee damage
Combat turn 12 player 1
Army deals 4,78170837917503 Melee damage
Combat turn 12 player 2
Army deals 0,345587715062377 Melee damage
Army deals 11,0584259171056 Antifly Melee damage
Combat turn 13 player 1
Army deals 2,74924709636722 Melee damage
Combat turn 13 player 2
Army deals 0,330933804906005 Melee damage
Army deals 10,5895169461056 Antifly Melee damage
Combat turn 14 player 1
Army deals 0,8029680004152 Melee damage
Combat turn 14 player 2
Army deals 0,326653861880123 Melee damage
Army deals 10,4525634873502 Antifly Melee damage
Lo Pan spent 151 mana!
Defenderlossrate Neutral=1
Attackerlossrate Lo Pan=0,665310891749846
Defeated : Neutral's Behemoth died in battle!
Defeated : Neutral's Behemoth died in battle!
Defeated : Neutral's Behemoth died in battle!
Defeated : Neutral's War Bears died in battle!
Defeated : Neutral's War Bears died in battle!
Winner : Lo Pan's Berserkers died in battle!
Winner : Lo Pan's Berserkers died in battle!
Treasure found by Lo Pan
Thanks for posting the logs, I still don't understand how they reached such an absurd damage value for the berserkers which obviously have no connection to how a real battle would ensue. And This is why I am saying that this indicates a bug. The AI can win battles that are not even remotely winnable had it been a real battle.
Strategic combat has always been a big flaming mess, and it's especially detrimental because the AI makes a lot of decisions based off how units are weighted in that combat mode. I really do hope that Seravy or a fan project eventually figures out how to just quickly run tactical battles for the AI, instead of relying on these haphazard formulae.
1.5.6:
1. All invisible units are visible on Cartographer, but not on the overland map. It is not user friendly to check Cartographer before every tile move as I scout. And it is super important to know if there is an enemy unit on the tile I am moving to or not. This should be consistent. Show it on both or neither. Reproduce from HiddenUnit.sav
Bright Green AI (Merlin) has unit displayed on the Cartographer. But that unit is not visible on the overland map.
Another example. Invisible unit shows up on Cartographer, but not on overland map. Reproduce from InvisibleUnit.sav. Invisible unit just N of my hero, W of Blue town
Since I accidentally attacked that invisible unit I lost a game I was winning.
2. Wraith Form spell is displayed to cost 50mp, but it costs 55mp to cast in my turn 1. Battle casting is also 11 and not the displayed 10mp.
3. See attached saves from 2 consecutive turns.BeforeTrollMove.sav, AfterTrollMove.sav Dark Green AI (Freya) has town Rotwood on Myrror North. You can explore it with Efreets. It has 5 Shadow Demons and 4 Troll Magicians defending it. Next turn it has 5 Shadow Demons and 3 Troll Magicians, and 1 Great Lizard defending it. Also, 2 of its Troll Magicians who have 2 Movement Points are now 3 tiles S of that town. Apparently no other Troll Magicians in the area, no boats, no Wind Walking, no spells, no events, etc. So how did they make 3 moves in 1 turn? My hypothesis is that this AI built 1 more Troll Magicians that spawned to the South and Summoned a Great Lizard in the same turn that instead of spawning outside it displaced one of its existing Troll Magicians also to the South from inside the town. If this is intended feature then it would be good to apply the same rule to human players. Human players get the new Summon outside of town if full. Not inside. I think it would be better if humans and AIs played by the same rule on this issue and in general they should play by the same rules as much as possible. I understand that due to AI weakness some rules were made to help it play better that the humans do not get, such as the AI can see the map, but humans cannot.
4. Scouting 2 is displayed on Draconian Spearmen and Swordsmen, but not displayed in the town when they are being produced. It should be displayed. There are many more units that need to be added since they have it, but not displayed.
5. Current spell description of Disenchant Area: “Attempts to dispel all enemy curses”… But it does not work on Corruption nor Raise Volcano spells. Please add these to this spell’s description.
6. Minor UI bug: after Discipline was dispelled the unit’s speed is displayed as -1. Reproduce from DispelDiscipline.sav by attacking the Chimera and Troll on the West
7. There is incomplete description about items. For example a Staff Attack +1 only applies to ranged attack but not melee, while a ring’s Attack +2 applies to both melee and ranged attack. Stating melee, ranged, or all attacks would make it clear to users what they apply to.
1.5.7:
8. My Pandora Box summoned Efreet. It was still able to cast Disrupt. That spell no longer exists in 1.5.7
9. Terror caused -10% to hit to my units with Death Immunity. Bug or intended feature? It was surprising.
10. Overland tiles look like Grassland, but Surveyor says River. It also cost 2 movement points to step on it so it is River. See screen shot and save file RiverGrassland.Sav
If I step on it, it temporarily becomes visible. Then changes back to grassland display later.
11. I cast Raise Volcano on my own Outpost. It destroyed its Smithy and gave me control of the Outpost allowing me to buy buildings there. Reproduce from RaiseVolcanoOwnOutpost.sav
12. Food production bug. Apparently related to Wild Game tile. Reproduce from FoodBug.sav See town 13Jan. 1 Forest with Wild Game = 4.5, 1 Nature Node = 2.5, 1 Grassland = 1.5, 4 Forests = 2, 1 Hill = 0.5, 12 Shore =6, 1 Volcano =0.
Sharing with other towns: 1 Forest with Wild Game = 2.25, 1 Nature Node = 1.25, 3 Forests = 0.75, 1 Shore =0.25
Granary + 5 Max pop. Town’s current max pop should be: 4.5+2.5+1.5+2+0.5+6-2.25-1.25-0.75-0.25+5 17-4.5+5=17.5. But the game shows 16.
There are other examples in the same save file for other towns.
From version 1.05.07, for some reason, "CITYONTILE( (GETSTAT(U,SPlane,0),(GETSTAT(U,SOLX,0),(GETSTAT(U,SOLY,0) )" return different value from "CITYONTILE(U)" especially when using inside "FOR U=1 TO MAXUNIT();" and "NEXT;". It end up that "CITYONTILE( (GETSTAT(U,SPlane,0),(GETSTAT(U,SOLX,0),(GETSTAT(U,SOLY,0) )" return correct value while value from "CITYONTILE(U)" sometimes return false positive as this lead to trigger of script outside the city.
C=Cityontile(combatP(),combatX(),combatY());
Code:
IF (C>0) THEN {
IF (ISBUILT(C,BWitchesConvent)>0) THEN {
FOR U=1 TO MAXUNIT();
IF INCOMBAT(U) THEN {
IF (CITYONTILE( (GETSTAT(U,SPlane,0),(GETSTAT(U,SOLX,0),(GETSTAT(U,SOLY,0) )=C) THEN {
IF (GetStat(U,SOwner,0)=A) THEN {
LUCK=RND(30);
RE=GETSTAT(U,SResist,0);
IF (GETENCHANTMENTFLAG(U,EncResistMagic,0)>0)
THEN { RE=RE+5; }
IF (GETENCHANTMENTFLAG(U,EncBless,0)>0)
%AND ( (LUCK=0) %OR (LUCK=2) %OR (LUCK=4) %OR (LUCK=7) %OR (LUCK=8) %OR (LUCK=9) )
THEN { RE=RE+4; }
IF (GETENCHANTMENTFLAG(U,EncMagicImmunity,0)>0)
%OR ((ISHERO(U)) %AND (GETHEAB(U,HACharmed)>0))
THEN { RE=50; }
IF (LUCK=0) %AND (RE<12) %AND ((FANTASTIC(U))=0) THEN { SETCOMBATENCHANTMENTFLAG (U,EncRust,1,1); }
IF (LUCK=1) %AND (RE<14) %AND ((GETSTAT(U,AIllusionImmunity,0))=0) THEN { SETCOMBATENCHANTMENTFLAG (U,EncVertigo,1,1); }
IF (LUCK=2) THEN { SETCOMBATENCHANTMENTFLAG (U,EncWeakness,1,1); }
IF (LUCK=3) %AND ((GETSTAT(U,ANoncorporeal,0))=0) %AND ((GETSTAT(U,AMerging,0))=0) %AND ((GETSTAT(U,AFlying,0))>0) THEN { SETCOMBATENCHANTMENTFLAG (U,EncWeb,1,1); }
IF (LUCK=4) %AND (RE<10) %AND ((FANTASTIC(U))=0) %AND ((GETSTAT(U,ADeathImmunity,0))=0) %AND ((GETSTAT(U,AIllusionImmunity,0))=0) THEN { SETCOMBATENCHANTMENTFLAG (U,EncMisfortune,1,1); }
IF (LUCK=5) %AND ((GETSTAT(U,ANoncorporeal,0))=0) %AND ((GETSTAT(U,AColdImmunity,0))=0) %AND ((GETENCHANTMENTFLAG (U,EncImmolation,0))=0) THEN { SETCOMBATENCHANTMENTFLAG (U,EncFrozen,1,1); }
IF (LUCK=6) %AND ((GETSTAT(U,SRanged,1))>0) THEN { SETSTAT(U,SMaxAmmo,0,0; }
IF (LUCK=7) %AND (RE<15) THEN { SETCOMBATENCHANTMENTFLAG (U,EncWarpAttack,1,1); }
IF (LUCK=8) %AND (RE<15) THEN { SETCOMBATENCHANTMENTFLAG (U,EncWarpDefense,1,1); }
IF (LUCK=9) %AND (RE<15) THEN { SETCOMBATENCHANTMENTFLAG (U,EncWarpResist,1,1); }
IF (LUCK=13) %AND (RE<12) THEN { SETCOMBATENCHANTMENTFLAG (U,EncBlackSleep,1,1); }
}
}
}
NEXT;
}
}
Compare to this version that end up trigger outside city which it should not
Code:
IF (C>0) THEN {
IF (ISBUILT(C,BWitchesConvent)>0) THEN {
FOR U=1 TO MAXUNIT();
IF INCOMBAT(U) THEN {
IF (CITYONTILE(U)=C) THEN {
IF (GetStat(U,SOwner,0)=A) THEN {
LUCK=RND(30);
RE=GETSTAT(U,SResist,0);
IF (GETENCHANTMENTFLAG(U,EncResistMagic,0)>0)
THEN { RE=RE+5; }
IF (GETENCHANTMENTFLAG(U,EncBless,0)>0)
%AND ( (LUCK=0) %OR (LUCK=2) %OR (LUCK=4) %OR (LUCK=7) %OR (LUCK=8) %OR (LUCK=9) )
THEN { RE=RE+4; }
IF (GETENCHANTMENTFLAG(U,EncMagicImmunity,0)>0)
%OR ((ISHERO(U)) %AND (GETHEAB(U,HACharmed)>0))
THEN { RE=50; }
IF (LUCK=0) %AND (RE<12) %AND ((FANTASTIC(U))=0) THEN { SETCOMBATENCHANTMENTFLAG (U,EncRust,1,1); }
IF (LUCK=1) %AND (RE<14) %AND ((GETSTAT(U,AIllusionImmunity,0))=0) THEN { SETCOMBATENCHANTMENTFLAG (U,EncVertigo,1,1); }
IF (LUCK=2) THEN { SETCOMBATENCHANTMENTFLAG (U,EncWeakness,1,1); }
IF (LUCK=3) %AND ((GETSTAT(U,ANoncorporeal,0))=0) %AND ((GETSTAT(U,AMerging,0))=0) %AND ((GETSTAT(U,AFlying,0))>0) THEN { SETCOMBATENCHANTMENTFLAG (U,EncWeb,1,1); }
IF (LUCK=4) %AND (RE<10) %AND ((FANTASTIC(U))=0) %AND ((GETSTAT(U,ADeathImmunity,0))=0) %AND ((GETSTAT(U,AIllusionImmunity,0))=0) THEN { SETCOMBATENCHANTMENTFLAG (U,EncMisfortune,1,1); }
IF (LUCK=5) %AND ((GETSTAT(U,ANoncorporeal,0))=0) %AND ((GETSTAT(U,AColdImmunity,0))=0) %AND ((GETENCHANTMENTFLAG (U,EncImmolation,0))=0) THEN { SETCOMBATENCHANTMENTFLAG (U,EncFrozen,1,1); }
IF (LUCK=6) %AND ((GETSTAT(U,SRanged,1))>0) THEN { SETSTAT(U,SMaxAmmo,0,0; }
IF (LUCK=7) %AND (RE<15) THEN { SETCOMBATENCHANTMENTFLAG (U,EncWarpAttack,1,1); }
IF (LUCK=8) %AND (RE<15) THEN { SETCOMBATENCHANTMENTFLAG (U,EncWarpDefense,1,1); }
IF (LUCK=9) %AND (RE<15) THEN { SETCOMBATENCHANTMENTFLAG (U,EncWarpResist,1,1); }
IF (LUCK=13) %AND (RE<12) THEN { SETCOMBATENCHANTMENTFLAG (U,EncBlackSleep,1,1); }
}
}
}
NEXT;
}
}
For some reason condition as simple as this does not works in COSpell.CAS. At first I think this file does not load about when I test other spell (focus magic, I make it top up MP when combat cast) it is working just fine.
IF (SP=SBuddingSpearmen) THEN {
MASTERVARSET HOSTGOBLIN = 0;
MASTERVARSET HOSTGOBLIN = HOSTGOBLIN + (ABS(Caster+999999));
}
The spell is combat summon.
when I use spell number ID (286) instead of master variable, result is the same. give negative result as if condition does not trigger. Mastervarset is working elsewhere, not sure why it is not working here.
Edited: It seem that combat summon spell is not working in COSpell.cas. I think it is a bug and should be report here anyway.