Save game remain turns bug
Save game remain turns bug
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.
- BasiliskWrangler
- Site Admin
- Posts: 3825
- Joined: July 6th, 2006, 10:31 am
- Location: The Grid
- Contact:
Re: Save game remain turns bug
Good catch.
Fixed - I will see if it is still possible to get it in the 1.02 update.
Fixed - I will see if it is still possible to get it in the 1.02 update.
- BasiliskWrangler
- Site Admin
- Posts: 3825
- Joined: July 6th, 2006, 10:31 am
- Location: The Grid
- Contact:
Re: Save game remain turns bug
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.)
This will be in the 1.03 update (probably next week before the Mac and Linux versions go on sale.)
Re: Save game remain turns bug
It's alright. At least bug is found and fixed in future patch.
Re: Save game remain turns bug
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.
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.
- BasiliskWrangler
- Site Admin
- Posts: 3825
- Joined: July 6th, 2006, 10:31 am
- Location: The Grid
- Contact:
Re: Save game remain turns bug
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.
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.