-
Notifications
You must be signed in to change notification settings - Fork 6
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
Revamp unpack
to use position
#99
Comments
nvs
changed the title
Revamp
Revamp Jun 29, 2022
unpack
and pack
in the various file formats. Essentially, support taking and returning position
. This will require removal of the assertion comparing input size to position
.unpack
to use position
nvs
added a commit
that referenced
this issue
Jul 4, 2022
nvs
added a commit
that referenced
this issue
Jul 4, 2022
nvs
added a commit
that referenced
this issue
Jul 4, 2022
Issue: #99 Switching to LPEG should make it easier to properly support the file format. In particular, double quoted lists are now handled properly. Additionally, fewer assumptions regarding values are made. For unquoted values, everything until the EOL is now returned. Within the game files there are cases where trailing comments are not removed. There are cases where they are. How are we supposed to know? For quoted values, both single and double, the quotes are no longer removed. There are cases where some values must be double quoted. Others must be singled quoted. Again, how are we supposed to know? So we make less assumptions, and let the user decide.
nvs
added a commit
that referenced
this issue
Jul 4, 2022
nvs
added a commit
that referenced
this issue
Jul 4, 2022
nvs
added a commit
that referenced
this issue
Jul 4, 2022
nvs
added a commit
that referenced
this issue
Jul 4, 2022
Issue: #99 Switching to LPEG should make it easier to properly support the file format. In particular, double quoted lists are now handled properly. Additionally, fewer assumptions regarding values are made. For unquoted values, everything until the EOL is now returned. Within the game files there are cases where trailing comments are not removed. There are cases where they are. How are we supposed to know? For quoted values, both single and double, the quotes are no longer removed. There are cases where some values must be double quoted. Others must be singled quoted. Again, how are we supposed to know? So we make less assumptions, and let the user decide.
nvs
added a commit
that referenced
this issue
Jul 4, 2022
This issue probably does not need to be addressed. All of the supported file formats are processed as full files. The exception, and what prompted consideration of this change, is W3O support. Its format is a bunch of object modification files shoved together. Instead of adjusting every file format to work in a way that will never be needed, it is probably best to do one of the following:
|
nvs
added a commit
that referenced
this issue
Jul 5, 2022
nvs
added a commit
that referenced
this issue
Jul 5, 2022
nvs
added a commit
that referenced
this issue
Jul 5, 2022
Issue: #99 Switching to LPEG should make it easier to properly support the file format. In particular, double quoted lists are now handled properly. Additionally, fewer assumptions regarding values are made. For unquoted values, everything until the EOL is now returned. Within the game files there are cases where trailing comments are not removed. There are cases where they are. How are we supposed to know? For quoted values, both single and double, the quotes are no longer removed. There are cases where some values must be double quoted. Others must be singled quoted. Again, how are we supposed to know? So we make less assumptions, and let the user decide.
nvs
added a commit
that referenced
this issue
Jul 5, 2022
nvs
added a commit
that referenced
this issue
Jul 5, 2022
Issue: #99 Now attempt to automatically determine if the file format is for Reforged (1.32). This is done by looking at the flags value. If it is a printable character (i.e. greater than `0x20`), then we make the assumption that it is the latest file format. Previously, we required the user to supply a version table. Furthermore, we adjust a few things, including the output format and introducing `position` for `unpack`. This could be considered a breaking change.
nvs
added a commit
that referenced
this issue
Jul 5, 2022
Issue: #99 As with the unit version, we now automatically detect the file format introduced with Reforged (1.32). This is done by looking at the byte that either represents a doodad's flags or skin. If this byte is a printable character (i.e. greater than `0x20`), we assume it is a skin, and thus the latest format. Other changes include support of `position` in `unpack` and adjustments to the output format.
nvs
added a commit
that referenced
this issue
Jul 7, 2022
Issue: #99 Use of LPeg for `unpack` not only improves performance, but arguably makes it easier to understand the logic involved. Plus, it looks nice. Right? Right...? Also support `position` for `unpack`.
nvs
added a commit
that referenced
this issue
Jul 7, 2022
Issue: #99 Switching to LPEG should make it easier to properly support the file format. In particular, double quoted lists are now handled properly. Additionally, fewer assumptions regarding values are made. For unquoted values, everything until the EOL is now returned. Within the game files there are cases where trailing comments are not removed. There are cases where they are. How are we supposed to know? For quoted values, both single and double, the quotes are no longer removed. There are cases where some values must be double quoted. Others must be singled quoted. Again, how are we supposed to know? So we make less assumptions, and let the user decide.
nvs
added a commit
that referenced
this issue
Jul 7, 2022
Issue: #99 Now attempt to automatically determine if the file format is for Reforged (1.32). This is done by looking at the flags value. If it is a printable character (i.e. greater than `0x20`), then we make the assumption that it is the latest file format. Previously, we required the user to supply a version table. Furthermore, we adjust a few things, including the output format and introducing `position` for `unpack`. This could be considered a breaking change.
nvs
added a commit
that referenced
this issue
Jul 7, 2022
Issue: #99 As with the unit version, we now automatically detect the file format introduced with Reforged (1.32). This is done by looking at the byte that either represents a doodad's flags or skin. If this byte is a printable character (i.e. greater than `0x20`), we assume it is a skin, and thus the latest format. Other changes include support of `position` in `unpack` and adjustments to the output format.
nvs
added a commit
that referenced
this issue
Jul 7, 2022
Issue: #99 Format `3` of the map is now supported. The output format for the module has changed as well.
nvs
added a commit
that referenced
this issue
Jul 7, 2022
Issue: #99 We now automatically determine the correct file format in both `unpack` and `pack`. This is done by seeing if the entire input is consumed in `unpack`, and checking for the presence of the new camera values in `pack`. Other changes include support of `position` in `unpack`.
nvs
added a commit
that referenced
this issue
Jul 7, 2022
Issue: #99 Note that the output format has changed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Basically, let
unpack
in the various file formats take an additionalposition
argument likestring.unpack
does. They also need to return the updatedposition
as well. The assertion will be removed. The intention of that particularassert
was to catch updates to file formats or other issues. Unit testing should probably be implemented to catch those issues (cough #53).The text was updated successfully, but these errors were encountered: