As a French person I feel like it's my duty to explain strikes to you. - AdrienIer

Create an account  

 
Caster of Magic II Bug Reports!

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.
Reply

Quote:2020-09-12
-Fixed bug : range check error on unit production view
-Fixed crash when AI uses a slider spell on a unit
-Fixed bug "SoM Strategy flag" decreases Enlightenment priority instead of increasing
-Added logging of AI power distribution/global strategy flags.
-Added logging of AI combat spell priority and casting decision
-Added logging of Unit combat spell priority and casting decision
-Fixed bug : In production unit view, the "empty" column shows abilities from previously viewed units instead of being cleared.
-Fixed bug : game crashes when a unit has maximal level/experience
-Enemy units affected by web, confusion, sleep, stasis will not count towards enemy army speed when fleeing.
-AI behavior "do not move from city gate to use a melee attack" is now checked separately instead of sharing an "if" statement with wall of fire rules.
-AI is now allowed to melee through its own Wall of Fire if their unit has a breath/thrown/gaze/first strike ability in addition to when the target has one.
-AI is now allowed to melee through its own Wall of Fire if the target isn't vulnerable to wall of fire (flying, fire, magic immunity, teleporting, merging, high effective defense, low figure count)
-Added logging for AI overland spell selection category priorities.
-Fixed bug : When the AI wants to cast Tree of Knowledge, it casts nothing.
-Fixed a minor bug in how Warp Lightning damage rolls over to the next figure.
-Saving now happens in a separate thread, so autosaves no longer cause a lag spike at the start of the turn.
Reply

I'm getting a crash on a lot of battles. Not sure if it's new to this build or because I'm using an older save? Here's a file: https://ufile.io/2ntdp9fy

On this turn, I've got two different stacks that cause a crash in their battle:
- Take the gargoyles into the neutral village at 30x40 (Arcanus)
- Take the hero stack into the Chaos node at 65x61 (Myrror)

Quote:It costs money, and monthly lol

I want to avoid using any third party stuff.

Nah, I've never paid for Sentry, you'd need thousands of users to break past the free tier. I find it very useful for surfacing bugs we never found in testing. But if you don't want any outside software fair enough.
Reply

Crash in next turn.


Attached Files
.zip   3.zip (Size: 99.79 KB / Downloads: 1)
Reply

Actually, is this build just unplayable for anyone else? I can't start any battles even in a new game. Here are two files, enter any lair/dungeon/whatever with any unit and the game immediately crashes.

https://ufile.io/nkqi6doi
https://ufile.io/ketoumz2

Starting games with different options doesn't seem to change anything. Tried a fresh download / install but same result.
Reply

oh, it's the logging.
Apparently, neutral players don't have a wizard name so trying to log them crashes. I'll fix this in a few minutes.
Reply

Fixed and reuploaded.
Reply

Thanks for the reupload. I think it switched issues; now neutral cities, dungeons, etc can be attacked but wizard settlements cause a crash when attacked. Try moving the hell hounds into the adjacent city: https://ufile.io/bwt2dnde

(edit: not all enemy wizards, as it turns out... just that one, perhaps because he has Wall of Fire up? anyway, I just won't fight that guy in this game)
Reply

(September 11th, 2020, 20:09)jhsidi Wrote: Thanks for the reupload. I think it switched issues; now neutral cities, dungeons, etc can be attacked but wizard settlements cause a crash when attacked. Try moving the hell hounds into the adjacent city: https://ufile.io/bwt2dnde

(edit: not all enemy wizards, as it turns out... just that one, perhaps because he has Wall of Fire up? anyway, I just won't fight that guy in this game)

It's even more specific than that. The problem was the river starting on that particular tile so the tile where the river ended couldn't pick the proper tile graphics because it didn't find a direction where the river continues.

Fixed and reuploading, takes 2 minutes to finish the upload.
Reply

One more for you. I'm having trouble testing, actually. Is it possible the new exception handling is force-closing the application when it doesn't need to? In the older versions where the range check errors would appear, often I could hit enter and the game would continue on. Since the new exception handling + popup, every game error completely ends the game. As a result, any error occurring during enemy wizard turns means the entire game is over and a new one has to be started, since their actions are preset.

Anyway, endturn error ending my latest game: https://ufile.io/slosrqhn
Reply



Forum Jump: