Page 1 of 1

Output SVG "screenshot" of [part of] game world

Posted: Tue Jun 10, 2025 2:35 pm
by sparr
My end goal here is to be able to visualize part of the game world mid-tick while debugging another mod, so I don't have to keep mentally processing the positions and directions of entities that are being modified during the run of a script. A convenient side effect would be getting that visualization at any other desired time.

The meat of this mod would be to do find_entities and find_tiles_filtered (and maybe find_decoratives_filtered) to find all the stuff in a given area, then to use the prototypes* to get the paths to the sprites, then assemble and write_file a SVG for all the things in the appropriate positions. Then that SVG could be viewed outside the game for a static view of that part of the game world, drawing images from the game data paths.

* - I think sprite paths aren't available at runtime from prototypes, so this info would need to be passed from the data stage to the runtime stage somehow