![]() |
#11 |
Apprentice
Join Date: Dec 2019
Location: Mexico, undisclosed location
Posts: 79
![]() |
See ui-player.c line 889/890 (in 4.2.0):
Code:
skill = BOUND(player->state.skills[SKILL_DISARM_PHYS] - depth / 5, 2, 100); panel_line(p, colour_table[skill / 10], "Disarm - phys.", "%d%%", skill); |
![]() |
![]() |
![]() |
#12 |
Apprentice
Join Date: Dec 2019
Location: Mexico, undisclosed location
Posts: 79
![]() |
Seems to me shouldn't be too hard to fix turns resting and such if you've already been hex editing the save file - just take the number, convert to hex, byte swap it, and look for those four bytes. Or you can dig through the 'load.c' code and set a break point where the value is loaded from the save file and just change it on the fly, then save again.
|
![]() |
![]() |
![]() |
#13 |
Knight
Join Date: Oct 2019
Posts: 941
![]() |
|
![]() |
![]() |
![]() |
#14 |
Knight
Join Date: Oct 2019
Posts: 941
![]() |
Agreed. Just didn't seem worth it. I tried to hex edit Max Exp - that seemed worthwhile - but I couldn't figure it out. I don't remember anything that I actually successfully hex edited in the end. I successfully hex edited AU at one point, just to prove I could, but the debug commands already do that very well.
|
![]() |
![]() |
![]() |
#15 |
Knight
Join Date: Oct 2019
Posts: 941
![]() |
It's "little endian." (another tip for posterity)
|
![]() |
![]() |
![]() |
#16 |
Apprentice
Join Date: Dec 2019
Location: Mexico, undisclosed location
Posts: 79
![]() |
A long time ago, in a galaxy far far away, I was able to successfully hex edit a save file for a game that might have been Angband, or Moria, or something else.
One of the things I recall was that the save file had a checksum built into it, so that if you edited a single value you needed to recalculate the checksum and modify that as well or the loader would puke on you. But I don't know if that was Angband or if that feature is still present. Even further in the past, I remember a save file where I tried and tried to find the value I wanted to edit, to no avail, finally having to compare two save files made a turn apart where all I did was drop money (I think I was trying to hack myself some free money). The problem was about a dozen values changed in that one turn (timers and what not), and I had to go through those by process of elimination until I figured out where the field I needed to touch was. And even then the hex value stored at the magic offset didn't make any sense. Until *finally* I twigged to the fact that the game had been written in Basic, and all the values were stored as floating point, because that's how numbers got represented internally in Basic. *And* of course the floating point values were stored byte-swapped (aka little endian). |
![]() |
![]() |
![]() |
#17 |
Knight
Join Date: Oct 2019
Posts: 941
![]() |
I didn't notice any checksum in this. I just couldn't find the Cur Exp value in the save file, and didn't want to bother with things like resting turn count or history. (I know that wasn't the main point of your tale.)
|
![]() |
![]() |
![]() |
#18 |
Adept
Join Date: May 2007
Posts: 170
![]() |
Changing the savefile format to plain text... Could be useful? Or wise?
|
![]() |
![]() |
![]() |
#19 |
Prophet
Join Date: Dec 2009
Posts: 9,024
![]() |
It'd certainly be nice to have a human-readable save file. But it'd be a lot of work for something that's rarely actually useful. It'd also bloat savefile size and save/load times somewhat, though I doubt it'd be noticeable on modern computers.
My guess is that if someone were to present it as a fait accompli then it'd be accepted into the codebase, but I'd be surprised if any of our regular contributors thought it worth the effort. |
![]() |
![]() |
![]() |
#20 | ||
Veteran
Join Date: Apr 2007
Posts: 1,947
Donated: $40
![]() |
Quote:
Quote:
![]()
__________________
takkaria whispers something about options. -more- |
||
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Restore Lost Life | DavidMedley | Vanilla | 18 | December 6, 2019 20:46 |
Whatever happened to 'restore artifact'? | Gram | Vanilla | 71 | December 1, 2015 15:06 |
Is there a way to Restore my Game? | Bombadil | Vanilla | 4 | September 30, 2012 19:26 |
How to restore lowered stat? | rythin | Vanilla | 21 | August 28, 2010 16:26 |
Drained stats, how to restore? | Zambaku | Vanilla | 2 | January 3, 2008 13:22 |