OwenGHB / angband-webclient

Browser client and webserver for playing Angband and variants
http://angband.live
GNU General Public License v2.0
18 stars 7 forks source link

Game information #5

Closed OwenGHB closed 2 years ago

OwenGHB commented 7 years ago

It would be desireable to display some information about games on the list of active games, such as character race, class, level and depth. Parsing this information from the game output itself would probably be rather involved, and it strikes me that a better way to do this would be to watch savefiles for changes and extract information from there. For Vanilla, this is quite easy - savefiles contain a header block starting at byte 36 with a utf8 encoded description of the character containing exactly this information. I don't think this header has a fixed length in bytes, but it always followed by the letters rng so it should be quite easy to determine when the description ends. For other variants, the shortest path might be to copy small amounts of code from the games themselves and compile them into small executables that the server could run when it notices a change in the file contents.

ghost commented 7 years ago

Not bad ideas all around. I would probably try to avoid needing to compile binaries if possible as that adds an extra layer of complexity to working on the software. It also adds a build process that doesn't exist now. I think reading the save files directly would be better.

OwenGHB commented 7 years ago

The difficulty is that only Vanilla savefiles contain this header information encoded as text, and there's demand for other variants besides. To keep things javascripty one would basically be copying the logic from the games loading functions to extract the relevant information, which seems more complicated than the compiled savefile reading executable.

OwenGHB commented 2 years ago

This was also fixed years ago (thanks Exo, wherever you are) so I can safely close it