OpenLoco / ObjectEditor

A modern implementation of 'LocoTool' for dat file parsing
7 stars 3 forks source link

Ensure zeroed fields are zero #38

Closed duncanspumpkin closed 2 months ago

duncanspumpkin commented 9 months ago

I'm unsure if many locomotion objects rely on object packing into saves to function but this is something that rct2 players used a lot. (There were some popular objects in the rct2 community that violated the following and it caused much annoyance) For object packing to work all object header fields that are populated on load must be zero. For example the string id is usually offset 0 in an object header these are populated on load. Therefore they must be zero. I would suggest having a warning on objects that violate this.

LeftofZen commented 9 months ago

my tool implicitly writes 0s to all these fields when it saves the objects, and otherwise skips them when loading them. i agree having a validation check to see if other users' objects have abused this is good, will add it when i get the time

LeftofZen commented 2 months ago

Interestingly, none of the objects I have have any errors, which is good to know.