#!/usr/bin/env python3 """Seed Wax resource cells into an OpenRA map.bin (format 2, no height data). Layout (engine Map.cs SaveBinaryData): u8 fmt, u16 w, u16 h, u32 tilesOff(17), u32 heightsOff(0), u32 resOff; tiles = w*h*(u16,u8) column-major (i*h+j); resources = w*h*(u8 type, u8 density), same order. Usage: seed_wax.py cx,cy,r [cx,cy,r ...] (circular blobs, density scales down toward each blob's edge; type byte 1 = Wax ResourceIndex) """ import struct, sys path = sys.argv[1] data = bytearray(open(path, 'rb').read()) fmt, w, h = data[0], *struct.unpack_from('