Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WED files attribute "Unused bytes?" #104

Open
Incrementis opened this issue Jul 13, 2024 · 2 comments
Open

WED files attribute "Unused bytes?" #104

Incrementis opened this issue Jul 13, 2024 · 2 comments

Comments

@Incrementis
Copy link

Incrementis commented Jul 13, 2024

This is from NearInfinityBrowser/NearInfinity#183 (comment)

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

@Bubb13
Copy link

Bubb13 commented Jul 13, 2024

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.

@Incrementis
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants