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

[v2.0.0] Investigate §-VObs #29

Closed
lmichaelis opened this issue Nov 4, 2022 · 2 comments
Closed

[v2.0.0] Investigate §-VObs #29

lmichaelis opened this issue Nov 4, 2022 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@lmichaelis
Copy link
Member

lmichaelis commented Nov 4, 2022

These VObs are empty though they seem to be related to zCCSCamera keyframes. ZenLib calles them zReference but does not use them anywhere. Reverse-engineering of the original game binary might be required.

Leads:

  • Looking through the Gothic II binary, zCArchiverBinSafe::ReadObject@0x51fb50 contains a check against 0xA7 at 0x51fbde
  • Error at 0x51fc63 contains string "D: zArchiver(::ReadObject): objRef, illegal object index: "
@lmichaelis lmichaelis added this to the v1.1.0 milestone Nov 4, 2022
@lmichaelis lmichaelis removed the help wanted Extra attention is needed label Dec 29, 2022
@lmichaelis
Copy link
Member Author

I believe I understand now how they are supposed to work since I had to use them in the new save-game parser here:

https://github.com/lmichaelis/phoenix/blob/224514412fbb72d0739a1f7ae19380a739889a26/source/vobs/misc.cc#L233-L254

It looks like these are actually references to other VObs in the same archive. Their index field contains the index of the object being referenced. Basically, any object within the archive can be referenced this way.

Implementing this fully, as originally intended, in phoenix would require additional memory overhead since we'd have to (at least) store the start position of each object in the VOb. We probably wouldn't be able to fully implement them anyways since the original archive implementation was tightly integrated in the game engine so this kind of reference would actually be able to grab a fully initialized VOb pointer and put it right there.

This means, the only real way to handle these is to save the object indices only where required and then use the references on a case-by-case basis. This means we need to find where §-VObs are actually used and make sure we're parsing them correctly (looking at you cs_camera).

@lmichaelis lmichaelis modified the milestones: v1.1.0, v2.0.0 Jan 29, 2023
@lmichaelis lmichaelis changed the title [v1.1.0] Investigate §-VObs [v2.0.0] Investigate §-VObs Jan 29, 2023
@lmichaelis
Copy link
Member Author

Hm it looks like this feature is not generally used within most archives. For now, it looks like we don't need to worry about supporting this in general.

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

No branches or pull requests

1 participant