Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old September 27, 2018, 17:08   #1
shirish
Rookie
 
Join Date: Aug 2018
Posts: 22
shirish is on a distinguished road
Could we have the .save file in a format which is easy to read.

Currently the .save file is a mess . It is just a data file through which it's impossible to know, what if anything is wrong.

Code:
~/games/angband-t4nk074/lib/save$ file Shirish 
Shirish: data
Code:
$ cat Shirish 
SaveVNLAdescriptionShirish, dead (Quitting)xxxrng�K�����&�ޕPzd'�̸�"l*IӶ7���,`��0�չ	��H�����k���?�]xݧ5 �5W�Sam�G"
                                                                                                                     &�n�T&��w���}	H����tc��W&��EUD<G�x`�Qл�)���G�A�s�ԲǶ܋d���X�-options���(nonerogue_like_commandsuse_soundshow_damageuse_old_targetpickup_alwayspickup_invenshow_flavorsshow_targethighlight_playerdisturb
Wouldn't it be nice/better to have the save game as a .json or some readable file format. It would make it easier to understand what sort of info. the save file has and you can at least try to understand what went wrong if you want for analysis.

Right now, don't think there's a way to do that unless there is some specialized tool that can read that stuff .

Having it in some sort of json, xml format would make things lot more simpler and also extensible if need be.

There is possibility I may be missing something obvious, if it is, would be glad to be pointed out.

I am willing to test and give feedback if anybody is prepared to do something like that.
shirish is offline   Reply With Quote
Old September 27, 2018, 18:15   #2
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,859
Donated: $40
takkaria is on a distinguished road
To be honest I think it would be a lot of work for limited use. The savefile code is pretty straightforward, and quite extensible already. Debugging what is going on in it isn't that hard. The savefile also stores a lot of binary data and it would be really inefficient to encode it in a text-based format like XML or JSON. I'm not sure what actual advantages it would offer.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old September 27, 2018, 18:22   #3
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,017
Donated: $40
Pete Mack is on a distinguished road
Well it lets you cheat more easily. More seriously, json does not make sense for a language without first class objects (like C or C++) where you can't serialize objects via reflection. You would have tk write your own serialization code, which pretty much defeats the purpose.
Pete Mack is offline   Reply With Quote
Old September 27, 2018, 18:25   #4
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,552
Derakon is on a distinguished road
Having a human-readable file format would be preferable, all else being equal, to the current binary format. Human-readable files are easier to debug, inspect, and of course modify. But someone would have to implement it.

shirish: if your goal is modifying the save file, a lot of common operations (like editing stats, experience level, and equipment) can be done via the debug commands. I'm not aware of good documentation for them, but this portion of a Let's Play has a few examples.
Derakon is offline   Reply With Quote
Old September 27, 2018, 19:03   #5
shirish
Rookie
 
Join Date: Aug 2018
Posts: 22
shirish is on a distinguished road
Quote:
Originally Posted by Derakon View Post
Having a human-readable file format would be preferable, all else being equal, to the current binary format. Human-readable files are easier to debug, inspect, and of course modify. But someone would have to implement it.

shirish: if your goal is modifying the save file, a lot of common operations (like editing stats, experience level, and equipment) can be done via the debug commands. I'm not aware of good documentation for them, but this portion of a Let's Play has a few examples.
Cheating is a good side effect but for me, it is more of how to retain character information and progress before death. From what I recall of my playthrough several years ago, it is/was easy to die i.e. permadeath.

The save file as it is hard for me to know what level I am, what quests are there (if there are any) , my armor and various bits of information. Having such information is and would be gold in an easy to read manner.

It might also tell if there are any 'secrets' in any room I am or are left or something like that.

It would make it also easier for people to share save files and exchange info. (copy and paste) rather than having to write each and everything.

I do hope it makes sense.
shirish is offline   Reply With Quote
Old September 27, 2018, 21:40   #6
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,859
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by shirish View Post
Cheating is a good side effect but for me, it is more of how to retain character information and progress before death. From what I recall of my playthrough several years ago, it is/was easy to die i.e. permadeath.

The save file as it is hard for me to know what level I am, what quests are there (if there are any) , my armor and various bits of information. Having such information is and would be gold in an easy to read manner.

It might also tell if there are any 'secrets' in any room I am or are left or something like that.

It would make it also easier for people to share save files and exchange info. (copy and paste) rather than having to write each and everything.

I do hope it makes sense.
I think a savefile is very unlikely to have most of that information that you want to see in a human-readable way anyway. Remember that a savefile is a thing that exists for the game to be able to restore itself after it is shut down. Your equipment list would just be a ton of different numbers referencing other places (the gamedata files). The dungeon layout wouldn't be saved in a way that was understandable, neither would what monsters there are or where they are. The files themselves would also be many megabytes in size, or they would be stored compressed for efficiency, in which case you'd have to uncompress them first. (I know because years ago someone did start implementing a more human readable key-value store for savefiles and this is what happened.)

I wonder if what you want is a better way to choose between different saved games that gives you an indication of a given savefile's current status before you load it? Or maybe an autosaved character dump alongside each savefile that gives you the kind of information you want in a human-readable format?
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old September 28, 2018, 01:52   #7
shirish
Rookie
 
Join Date: Aug 2018
Posts: 22
shirish is on a distinguished road
Quote:
Originally Posted by takkaria View Post
I think a savefile is very unlikely to have most of that information that you want to see in a human-readable way anyway. Remember that a savefile is a thing that exists for the game to be able to restore itself after it is shut down. Your equipment list would just be a ton of different numbers referencing other places (the gamedata files). The dungeon layout wouldn't be saved in a way that was understandable, neither would what monsters there are or where they are. The files themselves would also be many megabytes in size, or they would be stored compressed for efficiency, in which case you'd have to uncompress them first. (I know because years ago someone did start implementing a more human readable key-value store for savefiles and this is what happened.)

I wonder if what you want is a better way to choose between different saved games that gives you an indication of a given savefile's current status before you load it? Or maybe an autosaved character dump alongside each savefile that gives you the kind of information you want in a human-readable format?
the latter info. would be quite nice, thank you.

Interestingly though, could you share some more info. or point out to threads about the human-readable save file initiative which was done ?
shirish is offline   Reply With Quote
Old September 28, 2018, 02:32   #8
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,859
Donated: $40
takkaria is on a distinguished road
Quote:
Interestingly though, could you share some more info. or point out to threads about the human-readable save file initiative which was done ?
I'm afraid not, it was done years ago on an IRC channel for which logs are unlikely to still exist.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old September 28, 2018, 18:08   #9
shirish
Rookie
 
Join Date: Aug 2018
Posts: 22
shirish is on a distinguished road
that is a pity
shirish is offline   Reply With Quote
Old September 28, 2018, 19:23   #10
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,859
Donated: $40
takkaria is on a distinguished road
Also, if you're on Linux you can get some basic information about what savefiles you have with ./angband -l (I think, anyway).
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Reply

Tags
json, savegame


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
cannot read file '64x64.png' ZenDragon Vanilla 3 August 27, 2013 17:18
Save File failure CyclopsSlayer v4 2 June 8, 2012 16:43
where is the save file?? mlevin77 Development 3 March 15, 2012 12:40
Save File Debugger Sirridan Development 13 August 25, 2011 14:42
can't load save file. anti-save scumming feature? unbuttered_toast Vanilla 4 May 21, 2010 18:57


All times are GMT +1. The time now is 17:36.


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