Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old January 11, 2020, 16:59   #21
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,947
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by Derakon View Post
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.
Someone (Elly) once did produce something a lot closer to a plain text save file format with key=value pairs or similar. Back in 2010 or whenever it was, it made the savefiles huge and loading them noticeably slow. I rejected the patch for performance and file size reasons - it seemed like a bad tradeoff. Might be different now!
__________________
takkaria whispers something about options. -more-
takkaria is offline   Reply With Quote
Old January 11, 2020, 18:48   #22
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,736
Donated: $40
Pete Mack is on a distinguished road
Tak--
In concert with a compression library, human-readable save files might work. It is IO that is slowest, tho decimal-binary conversion still remains a hog.* Xml machine-encoding schemes are a possibility; they are widely used as a compromise between human readability (ASCII), schema conservation (XML), and performance in both disk and CPU.

Here is one written in C.
http://exip.sourceforge.net

The most elegant, though, would be to use the existing parser model to read and write the save file.
You'd have to flatten the various lists--one for dungeon architecture, other for monsters, objects, inventory, and player stats.

As a matter of fact... maybe i should give it a try.

* even in CPU-heavy apps, decimal conversion takes something like 50% of processor time.
Pete Mack is offline   Reply With Quote
Old January 11, 2020, 20:44   #23
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,947
Donated: $40
takkaria is on a distinguished road
I don't really see the value in re-engineering the savefile code. It would add a load of weight and complexity to achieve the same result, and the advantages (which are minimal) don't seem worth it. But I'm not in charge anymore
__________________
takkaria whispers something about options. -more-
takkaria is offline   Reply With Quote
Old January 11, 2020, 21:16   #24
Diego Gonzalez
Adept
 
Join Date: May 2007
Posts: 170
Diego Gonzalez is on a distinguished road
Another approach could be to modify the wr_byte and such functions to write readable representation of the data. We could write # comments in the savefile to separate the big sections if someone needs to locate something in the generated code. Its a compromise solution.
Diego Gonzalez is offline   Reply With Quote
Old January 11, 2020, 21:55   #25
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,736
Donated: $40
Pete Mack is on a distinguished road
Tak--using parse models is a lot more robust to code changes. In essence, the read and write parts of the savefile share schema logic.
Pete Mack is offline   Reply With Quote
Old January 11, 2020, 22:05   #26
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 8,332
Donated: $60
Nick will become famous soon enough
A large part of the savefile is byte encoding of dungeon levels, which have no relationship to the parser. I'm with takkaria on this one - I can see it might be an advantage to have human-readable savefiles, but it would be a large amount of work and it's low on my priority list.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old January 13, 2020, 01:57   #27
eastwind
Apprentice
 
Join Date: Dec 2019
Location: Mexico, undisclosed location
Posts: 79
eastwind is on a distinguished road
Besides, there ought to be some things only a wizard can do. Union rules and all.
eastwind is offline   Reply With Quote
Old January 13, 2020, 10:14   #28
Sideways
Knight
 
Join Date: Nov 2008
Posts: 557
Sideways is on a distinguished road
Quote:
Originally Posted by takkaria View Post
I don't really see the value in re-engineering the savefile code. It would add a load of weight and complexity to achieve the same result, and the advantages (which are minimal) don't seem worth it. But I'm not in charge anymore
It could be worth it if the human-readable savefiles were also less prone to being broken by updates to the game. (Not that human-readable code would be the only way to achieve that; but it might be a way.)
__________________
The Complainer worries about the lack of activity here these days.
Sideways 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 03:08.


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