squadmc-maps
squadmc-maps copied to clipboard
Question: Calculating map sizes in PS
I'd like to contribute, but I have precisely 0 idea on how you go about making accurate map size calculations for Post Scriptum, is there a resource for the methodology available somewhere?
I'll let @Endebert answer properly, but i had to analyse this part of the calculation in Endebert's code.
Short answer : the SDK maps are already proportional in pixels to their real size in game, you have to calculate the ratio between your canvas where you draw the map and the image file.
For my fork of this project (https://github.com/sh4rkman/MSMC) i drawed a 250px*250px canvas, and applied to every distance calculated the ratio 250/map.height
I managed to find a slightly more consistent and accurate way in Post Scriptum (seeing as the SDK isn't out yet and the map image files are all 4096x4096) with training mode + commands
- Go into training mode
- Switch to the map you want to measure
- Unlock all kits and grab a sapper kit for your faction (anything with a placeable explosive charge)
- Enable god mode and slomo x5 to make the trip a little quicker and prevent the minefields from killing you
- Run to one corner of the map, drop your charge as close to the corner as possible
- Open the log at
AppData\Local\PostScriptum\Saved\Logs\PostScriptum.log
- The explosion event will be in the logs with X/Y/Z coords, and the default in Unreal is
1 unreal unit = 1cm
(however in one of the maps so far it's been2 unreal units = 1cm
but common sense can help you figure it out) - Do it in the opposite corner, measure the distances between the axes on these two points to get a rough estimate then use a little more common sense to get a reasonable rounded value
It's extremely labour intensive, but without the SDK it seems like it's the only way. As for incorporating heightmap data I don't think that's really doable as it stands, whether or not it has any meaningful impact I've yet to test.
Thanks for wanting to contribute! Here's my methodology:
- crop screenshot of fully zoomed out map with grid on:
- count pixels of fully displayed 100m blocks
- now you know
x*px = y*100m
- now you know
- extrapolate to full image width
- do the same for height
- put the data in mapdata.json
Of course, this isn't perfect. In this example, 1px = ~3,601m, so the estimated map size might be off +-4m, which I think is acceptable.
Now heightmaps are a different league, and can only be extracted with the Squad SDK. But we don't have that for Post Scriptum (I think; I don't own the game), so no height offsets for that game unfortunately.
@sh4rkman nice fork!