Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old January 10, 2020, 03:16   #11
eastwind
Apprentice
 
Join Date: Dec 2019
Location: Mexico, undisclosed location
Posts: 79
eastwind is on a distinguished road
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);
looks like, unlike everything else, the values displayed for these two skills (disarm phys and magic devices) depend on the depth you're on when you check them - so if you took the dump on your original character at level 41 your skill would be 41/5 = 8 percent less vs in town.
eastwind is offline   Reply With Quote
Old January 10, 2020, 03:23   #12
eastwind
Apprentice
 
Join Date: Dec 2019
Location: Mexico, undisclosed location
Posts: 79
eastwind is on a distinguished road
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.
eastwind is offline   Reply With Quote
Old January 10, 2020, 06:24   #13
DavidMedley
Swordsman
 
Join Date: Oct 2019
Posts: 421
DavidMedley is on a distinguished road
Quote:
Originally Posted by eastwind View Post
looks like, unlike everything else, the values displayed for these two skills (disarm phys and magic devices) depend on the depth you're on when you check them
Yep, that's it!
DavidMedley is offline   Reply With Quote
Old January 10, 2020, 06:29   #14
DavidMedley
Swordsman
 
Join Date: Oct 2019
Posts: 421
DavidMedley is on a distinguished road
Quote:
Originally Posted by eastwind View Post
shouldn't be too hard to fix turns resting
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.
DavidMedley is offline   Reply With Quote
Old January 10, 2020, 06:31   #15
DavidMedley
Swordsman
 
Join Date: Oct 2019
Posts: 421
DavidMedley is on a distinguished road
It's "little endian." (another tip for posterity)
DavidMedley is offline   Reply With Quote
Old January 10, 2020, 17:51   #16
eastwind
Apprentice
 
Join Date: Dec 2019
Location: Mexico, undisclosed location
Posts: 79
eastwind is on a distinguished road
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).
eastwind is offline   Reply With Quote
Old January 11, 2020, 01:47   #17
DavidMedley
Swordsman
 
Join Date: Oct 2019
Posts: 421
DavidMedley is on a distinguished road
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.)
DavidMedley is offline   Reply With Quote
Old January 11, 2020, 02:23   #18
Diego Gonzalez
Adept
 
Join Date: May 2007
Posts: 122
Diego Gonzalez is on a distinguished road
Changing the savefile format to plain text... Could be useful? Or wise?
Diego Gonzalez is offline   Reply With Quote
Old January 11, 2020, 05:03   #19
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 9,016
Derakon is on a distinguished road
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.
Derakon is offline   Reply With Quote
Old January 11, 2020, 16:54   #20
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,946
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by eastwind View Post
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.
Both Angband and UMoria had that feature. Most Angbands probably still do - but it was lost from V with a rewrite of the savefile code maybe around 3.2.

Quote:
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).
That definitely wasn't Angband
__________________
takkaria whispers something about options. -more-
takkaria is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Restore Lost Life DavidMedley Vanilla 18 December 6, 2019 19:46
Whatever happened to 'restore artifact'? Gram Vanilla 71 December 1, 2015 14:06
Is there a way to Restore my Game? Bombadil Vanilla 4 September 30, 2012 18:26
How to restore lowered stat? rythin Vanilla 21 August 28, 2010 15:26
Drained stats, how to restore? Zambaku Vanilla 2 January 3, 2008 12:22


All times are GMT +1. The time now is 05:39.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.