Quote:- By the way, have you considered using an automated reporting tool for bugs? Here's the one I use: https://sentry.io/welcome/ ... Very convenient for debugging, especially as you scale to more users, as it'll show the exact code implicated and the software takes care of the annoying bits like finding an internet connection. The drawback is that I don't know if you could find one that already has the SDK for the language you're using.
It costs money, and monthly lol
I want to avoid using any third party stuff.
Either way these things only report crashes and those are the easiest to find anyway. A few more months and there won't be any of them left.
They won't help finding the real problems like misbehaving AI or incorrectly enforced game rules.
Quote:- AI units standing inside a Wall of Fire will attack units outside of it. However, it seems like the unit being attacked does not take fire damage when this happens. I think this behavior should be considered a bug, as the AI's melee units always attack anything adjacent, so you can wipe them out without ever dealing with the wall of fire by just walking up to the wall and not attacking.
The AI should only attack through the wall of fire if their unit has First Strike, Fire Breath, Thrown etc, abilities that give advantage for attacking first.
...except, that rule only applies if the unit has to move at least one tile to do the attack. (they can only move inside the walls either way unless they were set to "leave wall" strategy but then they should be ignoring the wall anyway)
I'm not entirely sure what the purpose of this restriction was. To trick the player into believing the AI won't attack and then surprise them when next time the units do have a breath attack? But why limit it to cases where the unit has to move?
Maybe because letting the player "park" their units directly next to the AI is too easy to abuse?
I mean, the turn you don't need to move, you can melee twice. The turn you need to move, often you can only do it once, AND if the enemy is attacking you even have to have 1 move remaining to step away.
So assuming you have a unit not particularly hurt by the flames (or can cast bless/resist elements/etc), it's to your advantage if the enemy won't attack so it's safe to stand on the adjacent tile, regroup your units, and possible do a coordinated attack of multiple hits on the same enemy plus one more unit moving into the emptied tile.
Actually, I think the "doesn't need to move" rule is there to guarantee the AI won't step away from the city gate to try hitting someone coming from the sides or back of the city. So that's an important condition.
But I think we could do better if we added another rule, possibly "don't attack if the enemy unit is very vulnerable to Wall of Fire and the enemy wizard doesn't have any of Bless, Resist Elements, Elemental Armor, Magic Immunity.", and the unit doesn't have first strike/thrown/breath?
Edit : Actually yes, the 1 distance is for not leaving the gate but why that and firewall behavior is in one rule instead of being two separate rules makes no sense. I'll split them up.
...this is ridiculously complex but as long as it works better, why not.
Code:
if GD.baseunits[u].aistaybehindwalls and not range and (w=defender) and
insidewalls(u) and not insidewalls(t) and HasWallOfFire and
not Gd.units[t].firststrike and (Gd.units[t].firebreath<=0) and (Gd.units[t].thrown<=0) and (Gd.units[t].lightningbreath<=0)
and (Gd.units[t].doomgaze<=0) and (Gd.units[t].deathgaze=GazeNone) and (Gd.units[t].stoninggaze=GazeNone) and
not Gd.units[u].firststrike and (Gd.units[u].firebreath<=0) and (Gd.units[u].thrown<=0) and (Gd.units[u].lightningbreath<=0)
and (Gd.units[u].doomgaze<=0) and (Gd.units[u].deathgaze=GazeNone) and (Gd.units[u].stoninggaze=GazeNone)
and not GD.units[t].flying and not hastelemerge(t)
and not GD.units[t].fireimmunity and not GD.units[t].magicimmunity
and (((edt*GD.units[t].Defendchance) div 100)<=2) // max 2 damage blocked from average of 3 dealt
and (livingfigures(t)>=3) // must have 3 figures or more
Quote:- Web should adjust the movement of units in battle when calculating flee. For example, I web a Great Drake; it's the only monster. When I flee, I lose my entire army because it has 4 move. But it actually had 0 move because it was webbed. ... actually this might be a bit overpowered as a strategy, but it's also a logical extension of the game mechanics, so I feel like it shouldn't be overlooked. Maybe the enemy could be considered to have 50% of its move speed when webbed and the army is fleeing?
It looks like CoM II was changed to use the "combat max moves" variable instead of the overland moves for enemy units, so speed modifiers should apply. Unfortunately spells that prevent units from gaining movement at the start of a new turn aren't modifying max movement speed so we need to add them as a special case.