- Notifications
You must be signed in to change notification settings - Fork 126
feat(scriptcompiler): add SCB to JSON conversion tool #1977
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
base: main
Are you sure you want to change the base?
feat(scriptcompiler): add SCB to JSON conversion tool #1977
Conversation
e4fb489 to 5d53a71 Compare 5d53a71 to ebe3cd5 Compare
Skyaero42 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats the purpose of this conversion tool? When would somebody use it?
It feels very AI-ish, barely any comments and large methods with hundreds of lines of code.
| { | ||
| initMemoryManager(); | ||
| | ||
| const char* gameDir = "C:\\Program Files\\EA Games\\Command and Conquer Generals Zero Hour\\Command and Conquer Generals Zero Hour"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded gamedir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Updated to use our registry lookup, also added the gamedir as an optional command line arg
| return true; | ||
| } | ||
| | ||
| int main(int argc, char* argv[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lacking any comments on how to use this tool and what it does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add comments. I generally get asked to remove them, overcompensated this time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a couple of comments, can add more where helpful
"This will allow us to edit and revision AI scripts in plain text." And yes, I very much used Claude on this one, particularly when going from having round trip go from "This is logically the same" to "This is byte for byte identical." Also getting the initial build to compile (needed to include/stub a lot of stuff to keep it living in the game code), and getting it to run without issue (needed to use the debugger and step line by line to find issues). There was a lot of "here's the diff output, explain the likely causes and propose 3 fixes explaining the tradeoffs of each" over and over - it's a grind for sure, but manually getting byte for byte would have taken forever. My goal was to get the tool to work first, which it does, probably so. From here, I'm happy to refactor and improve it however is best. |
223f08b to 5b4a27f Compare
Adds JSON chunk format support for converting SCB <->JSON. This implementation integrates directly into the game engine's existing DataChunk system rather than being a standalone tool.
Tested round trip for Generals and GeneralsMD tools on SkirmishScripts.scb and MultiplayerScripts.scb, byte for byte identical
Note: Map file support is being implemented in a separate PR to be merged after this one