Save game remain turns bug

Windows support forum for Eschalon: Book II
Post Reply
atori
Fellowcraft Apprentice
Posts: 42
Joined: May 13th, 2010, 12:20 am

Save game remain turns bug

Post by atori »

Cast "Cat's eyes" L6, then "Gravedigger's Flame" L6. Active spells window shows that that they will be active 298 and 419 turns respectively. Save game, load game. Active spells window now shows 41 and 162. I think it is because save game stores number of remain turns in unsigned byte, so we have overflow here (298 - 256 = 41; 419 - 256 = 163). Possibly bug will show itself with any spell with remain turns more than 255. Please change type from byte to at least 2 bytes integer.
User avatar
BasiliskWrangler
Site Admin
Posts: 3825
Joined: July 6th, 2006, 10:31 am
Location: The Grid
Contact:

Re: Save game remain turns bug

Post by BasiliskWrangler »

Good catch.

Fixed - I will see if it is still possible to get it in the 1.02 update.
See my ramblings and keep up with the latest news on Twitter & Facebook.
User avatar
BasiliskWrangler
Site Admin
Posts: 3825
Joined: July 6th, 2006, 10:31 am
Location: The Grid
Contact:

Re: Save game remain turns bug

Post by BasiliskWrangler »

Nope- version 1.02 was already mirrored before this fix made it in.

This will be in the 1.03 update (probably next week before the Mac and Linux versions go on sale.)
See my ramblings and keep up with the latest news on Twitter & Facebook.
atori
Fellowcraft Apprentice
Posts: 42
Joined: May 13th, 2010, 12:20 am

Re: Save game remain turns bug

Post by atori »

It's alright. At least bug is found and fixed in future patch.
Tpek
Pledge
Posts: 1
Joined: May 18th, 2010, 8:18 pm

Re: Save game remain turns bug

Post by Tpek »

Hi,

First post here.

I just wanted to inform you that this variable size bug exists in other places (that strangely enough do not suffer from it in Book 1). It is in Attributes as well.

For fun I tried cheating and getting an uber-char, so I had its stats boosted a bit (Endurance ended up at 310, the rest at 260), after a save&load, the stats got reduced to 4 and 54 (for the endurance), a stat reduction of 256. So it would seem to be another such overflow.

Was reducing the variable size intentional for this game?
After all, you'd normally expect stats to be stored in 4-byte integers.
User avatar
BasiliskWrangler
Site Admin
Posts: 3825
Joined: July 6th, 2006, 10:31 am
Location: The Grid
Contact:

Re: Save game remain turns bug

Post by BasiliskWrangler »

Well, there was an effort to keep the saved-games as small as possible so that the files were more easily portable, so I use bytes whenever possible.

In the case of the Attributes, it is inconceivable that you would or could ever get a single stat over 256 naturally. A byte works fine for that variable. It is not a concern of mine to be able to save a game that has been hacked or exploited.

The Effects stats was a completely overlooked typo. The effect type was supposed to be saved as a byte (because there are far less than 256 kinds of effects) and the effect duration was supposed to be a integer. Those two variables are reversed in the loading/saving function.

It's all fixed in 1.03.
See my ramblings and keep up with the latest news on Twitter & Facebook.
Post Reply