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

Create an account  

 
Overland berserk

I've changed this spell to be both combat and overland like most unit enchantments are.

I used it today and found out the game crashes at the end of turn if it was cast overland.
I suspected the high attack value causing some sort of an overflow (I used it on a 40 atk hero so it got raised to 80), but using the spell on a spearmen instead still caused a crash. I also suspected the zero defense so I edited a unit to have naturally 0 defense but it didn't crash so that wasn't the reason either.

...actually, nevermind, I found the problem.

I'll leave this thread here if anyone else runs into this.

Berserk sets the unit's defense to -20 instead of 0. Which is obviously not the safest thing to do.

8F87D : EC->00

I suspect the crash is actually caused when my new unit value calculation for the AI takes place, which assumed defense is non-negative, but I wouldn't leave it like that even if the rest of the game doesn't crash from it. It just feels really bad to set a unit's stats to negative values like that, who knows what other incompatibilities it might cause.

As a side effect, it might be possible to raise the defense of the unit through effects that get applied after berserk, I would guess they used -20 to make that impossible but...negative defense really isn't the way to do that.
Reply

very strange. i modified berserker overland in my mod too. The reason: death knight must be beserker to kill skydrake in the node.
And this newer caused negative defence nor crash.
Reply

(October 19th, 2015, 05:59)Asfex Wrote: very strange. i modified berserker overland in my mod too. The reason: death knight must be beserker to kill skydrake in the node.
And this newer caused negative defence nor crash.

At 8F868h in wizards131.exe

loc_99118:
les bx, [bp+arg_0]
mov al, es:[bx+5]
les bx, [bp+arg_0]
mov es:[bx+6Bh], al
les bx, [bp+arg_0]
mov byte ptr es:[bx+5], 0ECh ; '

0ECh = -20, and byte 5 is defense.

Normally you won't notice because doing 0 rolls for defense and doing -20 is the same thing (you can't roll a negative number of times, so it doesn't roll at all).
You can however see the negative defense in the game in one way :
When the defense is set this way, you don't see the greyed out shield icons, instead you see no defense shown at all.
If the unit had 0 defense you would see all of its shield icons greyed out. However, as the number of "grey shield icons" [bx+6B] is set to the amount of defense lost, but effective defense is set -20, nothing appears, even the number of grey shield icons plus current defense stays below zero so there is nothing to display.
Try changing 0ECh to 00h and look at the unit overland to see what I mean.

You don't get a crash because the unmodded game doesn't contain anything that would crash from a negative defense.

However, I use (health)*(defense+4)*4 for AI defensive power ratings. This returns a negative value if defense<-4 so my game crashed from it.

Edit : added a screenshot.
If you see those grey shield icons then the unit has 0 defense.
If not, it has -20.


Attached Files Thumbnail(s)
   
Reply

My best guess is they want to avoid any defense added by others spells.
So -20 + Iron skin gives no shields.
Berserk + Iron skin how much defense gets an unit in your mod?
Only the people crazy enough to think they can change the world of Arcanus and Myrror can do it. rolleye
Reply

Berserk no longer exists in caster of magic.

It's been replaced with bloodlust, which doesn't change the armor value of the target. 

If you're interested I could find where exactly in the death realm thread the discussion was.

As I've noticed you asked a fair bit about caster of magic in your last few posts, I offer my services to answer questions, if you can't find the right part of the caster of magic threads.
Reply

(April 22nd, 2018, 15:29)Nelphine Wrote: Berserk no longer exists in caster of magic.

It's been replaced with bloodlust, which doesn't change the armor value of the target. 

If you're interested I could find where exactly in the death realm thread the discussion was.

As I've noticed you asked a fair bit about caster of magic in your last few posts, I offer my services to answer questions, if you can't find the right part of the caster of magic threads.

Thank you Nelphine.

My interest is in the modding, mainly.

I find Caster of Magic a superb game, Seravy modded it so fine and well it is a new beautiful game.

I've betatested it during is develop and find no bugs.  popcorn

I'm planning to play it this summer.

I'm going to ask you, if needed.  shades
Only the people crazy enough to think they can change the world of Arcanus and Myrror can do it. rolleye
Reply



Forum Jump: