Open bostrt opened 9 months ago
I tried use palworld-save-tools
but it takes nearly 30 seconds on my M1 max mac.. 🥲
$ time palworld-save-tools Level.sav
Converting Level.sav to JSON, saving to Level.sav.json
Decompressing sav file
Loading GVAS file
Writing JSON to Level.sav.json
palworld-save-tools Level.sav 31.39s user 0.64s system 99% cpu 32.249 total
Maybe some tools like uesave-rs would be faster? But I can't find any working palworld fork of that 🥲
$ uesave to-json -i Level.sav -o Level.json
Found non-standard magic: [92, f7, 33, 07] (��3) expected: GVAS, continuing to parse...
Error: at offset 6981079: io error: failed to fill whole buffer
There is this: https://github.com/DKingAlpha/palworld-uesave-rs but it doesn't seem to work for me.
I'll keep an eye on these and include them once they are functional with Palworld.
I'm still planning on working in a feature branch to demo how the metrics might look once a good enough Level.sav
parser comes around
Example here shows how to parse Level.sav very quickly: https://github.com/zaigie/palworld-server-tool/blob/main/module/structurer.py
I have a local test running (on a laptop) in under a second that pulls a few player properties like name, level, health, etc.
Well, I was able to integrate the Level.sav parsing mentioned in my last comment but performance is still not great. I have a decent sized server with ~100 player saves and a 17MB Level.sav file. I am able to generate a metrics response in ~5s on a decent laptop but its consuming about 2g of memory each time (reading the Level.sav into memory).
The isn't create since metrics gather by Prometheus is 15s by default.
I'll keep looking at ways to optimize.
There's a trove of information the game save files. Look into using https://github.com/cheahjs/palworld-save-tools to parse the game save and reports metrics like:
The current road block is the amount of resources used to parse Levels.sav.