sourcehold / Sourcehold

Open source re-implementation of Stronghold 1
MIT License
253 stars 23 forks source link

Placing buildings #23

Open patel-nikhil opened 4 years ago

patel-nikhil commented 4 years ago

Hi,

I am not sure whether this applies to stronghold, but it may interest you to know that in Stronghold Crusader Extreme buildings are stored in an array with buildings offset from each other by a span of 0x32C. Some things that I do know are stored for buildings within their block are owner, workers, etc.: { "Buildings": { "address": "0x00F9C6CA", "type": "integer", "category": "building", "owneroffset": "0x4", "workersneededoffset": "0xC6", "workersworkingoffset": "0xC8", "workersmissingoffset": "0xCA", "snoozedoffset": "0x1C4", "offset": "0x32C" } }

J-T-de commented 4 years ago

(I got kinda excited and posted it together with my building and unit ids on the Sourcehold discord)

gynt commented 4 years ago

Great! As it looks now, these arrays are simply dumped to a .map file for saving (and some compression). I am looking forward to your updates. Maybe we can, at some point, crosscheck whether the .map file is indeed the same as the in memory buildings array.