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

Add support for 4.x compiled scripts #172

Closed
nikitalita opened this issue Apr 17, 2024 · 8 comments · Fixed by #183
Closed

Add support for 4.x compiled scripts #172

nikitalita opened this issue Apr 17, 2024 · 8 comments · Fixed by #183
Labels
enhancement New feature or request

Comments

@nikitalita
Copy link
Collaborator

Resource Type

No response

Describe the problem or limitation you are having

4.x just added binary tokenization back:
godotengine/godot#87634

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Need to figure out if the new scheme is compatible with our current tokenization scheme and if it would be easy to add the defines to the JSON

@nikitalita nikitalita added the enhancement New feature or request label Apr 17, 2024
@VendorAttestation
Copy link

@nikitalita any ETA?

@nikitalita
Copy link
Collaborator Author

I'm going to be pretty busy the next couple of months, so probably not for a while. Pull requests are always welcome, though.

@EoF-1141
Copy link

EoF-1141 commented Sep 9, 2024

From what I can tell it should be possible to implement this mostly within it's own bytecode_* file.
Since Variants have changed, it will require compat for it.

The zstd decompression would be in the bytecode script regardless.
There are Newline, Indent and Dedent Tokens, but they seem completely unused and instead the info seems to be stored on token_lines and token_columns

I wrote a Python implementation, which seems to work okay so far.
Might try myself at contributing here, the main annoyance is that tokens seem to be handled slightly differently and require more "space handling"

@NiceLookinGuy
Copy link

NiceLookinGuy commented Sep 10, 2024

I wrote a Python implementation, which seems to work okay so far. Might try myself at contributing here, the main annoyance is that tokens seem to be handled slightly differently and require more "space handling"

Is it possible for you to share python implementation? It could compensate for lacking 4.x bytecode support in gdsdecomp for the time it's not implemented.

@EoF-1141
Copy link

Is it possible for you to share python implementation? It could compensate for lacking 4.x bytecode support in gdsdecomp for the time it's not implemented.
It's more of a PoC than a full implementation. Doesn't have all Variants implemented yet (mainly just the few that I came across), and the formatting isn't cleaned.

So I'd just start on the c++ code for gdsdecomp, copying some of the original Godot code and then have people clean up the formatting.
I think ultimately it might actually be better to have a post processor, that cleans up and will always be run after the bytecode_*

@nikitalita
Copy link
Collaborator Author

I actually have a WIP implementation going, but I am not going to have time to finish for a while. If you would like, I can push this to a branch on here and you can start from that.

@EoF-1141
Copy link

I actually have a WIP implementation going, but I am not going to have time to finish for a while. If you would like, I can push this to a branch on here and you can start from that.

Sorry for the late reply. Been pretty busy.
If you want I can take a look and see what I can do there

@nikitalita
Copy link
Collaborator Author

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

Successfully merging a pull request may close this issue.

4 participants