EE_Fixpack icon indicating copy to clipboard operation
EE_Fixpack copied to clipboard

WED files attribute "Unused bytes?"

Open Incrementis opened this issue 1 year ago • 2 comments

This is from https://github.com/NearInfinityBrowser/NearInfinity/discussions/183#discussion-6930180

When manually searching the WED files, two of them can be found in which the attribute “Unused Bytes?” is present. These are:

  • AR1000.WED grafik

  • OH2010.WED grafik

I think they don't cause any problems since I tested AR1000.WED rudimentarily with no errors in the game (but I could be wrong). Interestingly, both “Unused Bytes?” are different sizes (see screenshots).

A superficial explanation I have is that it's a door(s), so theoretically it can be any size? Another question is why “only” these two WED files have this attribute (What causes “Unused Bytes?” and can it be prevented)?

NOTE: The game for the mentioned files is BGEE: SoD

Incrementis avatar Jul 13 '24 19:07 Incrementis

Near Infinity hides some of the structure of WED files when looking at the overview. Vanilla WED files are laid out as follows:

Header
Overlays Array
Secondary Header
Tiled Objects Array
Tilemap Array (Overlay 0)
Tilemap Array (Overlay 1)
...
Tilemap Indices (Overlay 0) Lookup Array – Indexed into by Tiled Object Entries 
TIS Tile Indices Lookup Array (Overlay 0) – Indexed into by Tilemap Entries (Overlay 0)
TIS Tile Indices Lookup Array (Overlay 1) – Indexed into by Tilemap Entries (Overlay 1)
...
Wall Groups Array
Polygons Array
Polygon Indices Lookup Array – Indexed into by Wall Group Entries
Vertices Array

The Unused bytes? sections you are seeing are pointed to by empty Overlay entries via their TIS Tile Indices Lookup Array offset fields. This suggests that at least one of the currently-unused overlays used to be populated, and that the unused data was at one point the overlay's TIS tile indices. It appears that instead of rebuilding the file to remove the unused data, the overlays were simply blanked.

The unused data is harmless and serves no purpose in the final file.

Bubb13 avatar Jul 13 '24 21:07 Bubb13

Thank you very much for the detailed explanation. A rebuild would at least help maintain a clean and consistent state of the files. I'll leave this issue open so the maintainers and developers of this repo can decide whether they want to rebuild the file to remove the Unused Bytes? attribute.

Incrementis avatar Jul 14 '24 07:07 Incrementis

Fixed in https://github.com/CamDawg/EE_Fixpack/commit/f6ab755f982a500046a73e4f11220370bfdc40af

CamDawg avatar Mar 09 '25 14:03 CamDawg