Skip to content

Conversation

@bobtista
Copy link

@bobtista bobtista commented Dec 11, 2025

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

@bobtista bobtista force-pushed the bobtista/data-chunk-json-converter branch 3 times, most recently from e4fb489 to 5d53a71 Compare December 11, 2025 23:14
@bobtista bobtista force-pushed the bobtista/data-chunk-json-converter branch from 5d53a71 to ebe3cd5 Compare December 12, 2025 14:46
@bobtista bobtista marked this pull request as ready for review December 12, 2025 14:47
Copy link

@Skyaero42 Skyaero42 left a 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";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded gamedir

Copy link
Author

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[])

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

Copy link
Author

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

Copy link
Author

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

@bobtista
Copy link
Author

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.

"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.

@bobtista bobtista force-pushed the bobtista/data-chunk-json-converter branch from 223f08b to 5b4a27f Compare December 16, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants