Puppeteer
Emperor
Um, wow, I've been banging on this a few hours tonight. Let's see if I can remember what I've accomplished. (Git repo updated.)
So it's still not very close to a Windows executable, but I'm getting very close to being able to chain some commands together and perhaps make a web service out of it. Somebody with Python on Windows might be able to make a map from an uncompressed save like an autosave with something like "python svg.py path\to\autosavefile.SAV".
Some random notes because I'm very disorganized at the moment and need to put this stuff somewhere:
Overlay terrain 0x04 I think is flood plain
Overlay terrain 0x0a is a volcano
2nd WRLD section 2nd integer (offset 0x04) is map width
2nd WRLD section 6th integer (offset 0x18) is map width
So it's inching closer to being useful to others. I have an idea of how I want it to work as a web service for showing maps for online saves (e.g. posted to a SG and the players aren't posting many screenshots). There is interest in this; what do you want if you could run this on your PC? You want a web page, an SVG?
Currently it makes an SVG that appears to be a big black rectangle until it's put on a web server and opened with the web page which applies the colors via CSS. That has some advantages, but it makes the SVG a bit useless as a standalone graphic. I could put the colors inside the SVG to make it useful standalone, but then it's more difficult to style it after-the-fact.
Also, now that I can make it open arbitrary saves (compressed ones by piping through blast) I am not even sure what to put up and what not to. I probably need to code it so it doesn't always use the same name for the map, and maybe make the browser where it can pick from more than one. For now I'll post some screenshots. (will post and then edit lest I lose all this typing)
Afterthought: I haven't thought about rivers in a while. That's pretty important to have on the map. I may want to start looking into where the river info is stored.
- Can read any uncompressed game file now!
- Layout change with Bootstrap
- Added a "Redraw" button as it turns out Webkit browsers (Chrome/Safari et al) don't always redraw when you expect! et tu, Chrome? It's a hack, but it redraws.
- Fixed IE map height...was that today? Seems like longer ago.
- Now searching for first WRLD section and then reading the next two WRLD sections, the second of which has width and height so I don't have to hard code the size anymore. Seeking to the first WRLD is still a bit of a hack, but it works!
- Changed "svg" front end to take a filename or stdin, but it will choke on an compressed SAV. I'm currently using dynamite (in most Linux distros) to decompress files or blast (zlib contrib) to decompress in the pipe to stdin. (However, autosaves are not compressed!)
So it's still not very close to a Windows executable, but I'm getting very close to being able to chain some commands together and perhaps make a web service out of it. Somebody with Python on Windows might be able to make a map from an uncompressed save like an autosave with something like "python svg.py path\to\autosavefile.SAV".
Some random notes because I'm very disorganized at the moment and need to put this stuff somewhere:
Overlay terrain 0x04 I think is flood plain
Overlay terrain 0x0a is a volcano
2nd WRLD section 2nd integer (offset 0x04) is map width
2nd WRLD section 6th integer (offset 0x18) is map width
So it's inching closer to being useful to others. I have an idea of how I want it to work as a web service for showing maps for online saves (e.g. posted to a SG and the players aren't posting many screenshots). There is interest in this; what do you want if you could run this on your PC? You want a web page, an SVG?
Currently it makes an SVG that appears to be a big black rectangle until it's put on a web server and opened with the web page which applies the colors via CSS. That has some advantages, but it makes the SVG a bit useless as a standalone graphic. I could put the colors inside the SVG to make it useful standalone, but then it's more difficult to style it after-the-fact.
Also, now that I can make it open arbitrary saves (compressed ones by piping through blast) I am not even sure what to put up and what not to. I probably need to code it so it doesn't always use the same name for the map, and maybe make the browser where it can pick from more than one. For now I'll post some screenshots. (will post and then edit lest I lose all this typing)
Afterthought: I haven't thought about rivers in a while. That's pretty important to have on the map. I may want to start looking into where the river info is stored.