Object Editor 5.1.0
Introduction
Whilst on the surface there is not much functional change, this version of the editor includes a total rewrite of the DAT object parsing logic, as well as fully decoupling the DAT format from the editor/UI itself. Long story short, I am no longer limited by the DAT format in the UI and I can now make any and all changes to the UI, including to object definitions themselves! This is a massive step towards supporting a new object format; indeed it basically makes it possble now! But before that officially happens, there are still plenty of changes that need to happen in the database and object service to support this.
What's Changed
- Aforementioned huge rewrite of DAT handling logic. If you want to see how much work it involved, just check out the PR. The other neat thing is that this uncovered at least 3 bugs, 2 of which are fixed (and the 3rd is mentioned at the bottom of the page):
- RoadObjectFlags was missing
unk_08
as part of its enum definition - it is there now and you can set it. - BuildingObject had a bug in its save code, where elevator sequences were corrupted because it was writing uint16_t-typed values instead of uint8_t. This affected the two buildings with elevator sequences, which were BLDCTY28 and BLDCTY29.
- Additionally, the hex viewer for objects was removed, since objects in the editors memory are no longer in the same memory format as actual DAT objects, making this feature prohibitively expensive to maintain. If you truly want to view objects in raw hex, you can easily load the object in the editor, click "Export as uncompressed DAT" (which will save the file as a DAT file with no encoding on the bytes) and then put that file into your favourite standalone hex editor. The benefit is less code to maintain on my end, and more features for the user (since a proper hex editing program will have many more features than I can possible add to the editor). If you want semantic info, you can use something like Kaitai Struct to create a parser for the loco hex data.
- By @LeftofZen in #199
- RoadObjectFlags was missing
- Add "open folder" for tree view items. This is just a little UI shortcut to open the folder to the item you have selected. It's useful when your object folder has many nested folders. On Windows, this will even highlight the file in window explorer! If anyone knows how to do this on Linux/Mac, let me know. By @LeftofZen in #190
- Add API support for adding and querying missing objects. No user-usable features yet, but this is essentially backend work to implement a cool feature to mark objects in scenarios/save games as "missing" if the object service doesn't know about the object. This will allow us to start looking for actually-missing objects, recreate them if necessary, and otherwise start keeping statistics for this kind of data. By @LeftofZen in #195
- Audio importing has been improved, with the main feature being you can now import MP3s into the game music files, making custom tracks extremely easy to make now. By @LeftofZen in #197
- Multiple image table viewer improvements, including
- importing images should now work when the image filenames have leading zeroes
- fixing a memory leak and otherwise overall improved performance
- the offset pixel actually updates/moves when you change the offsets
- added buttons to center or zero all image offsets
- the zoom level wont wildly jump around when you animate the image table, and the zoom level is also preserved across images
- the preview pane is separate from the properties pane, which also now has a scroll bar. it's just easier to use now
- by @LeftofZen in #202 and #203
Known bugs
- The 3 industry objects with animated effects (COALPS, FACTORY, OILREFIN) may not save correctly. They fail in a unit test and I cannot see why it fails, however this bug has existed since the start of time so nothing is new here, just that I know about the issue now.
- Given the massive rewrite, it's likely I've missed some properties not saving in the UI - if you find any changes you make are not saving, let me know asap.
Full Changelog: 5.0.1...5.1.0