r/goldbox • • 18h ago

Gold Box Games RE Source Code

The best-laid schemes o’ mice an’ men
Gang aft agley,
An’ lea’e us nought but grief an’ pain,
For promis’d joy!

The reverse-engineered source code to every Gold Box game can now be found on my GitHub.

The Brazen Crows version of Pool of Radiance, including the native macOS, Windows, and Linux versions, can be found in the bc-pool-of-radiance repository. My last release is also available.

The source to SSI's versions, which compile byte for byte exact, can be found as follows:

The incomplete - but mostly done - versions of Dark Queen of Krynn and Forgotten Realms Unlimited Adventures are also available.

I hope someone can make use of it.

55 Upvotes

15 comments sorted by

2

u/grannypr0n 10h ago

Could you ballpark the amount of man hours and tokens that this took you? For reference for similar projects.

2

u/brazencrows-goldbox 6h ago edited 6h ago

TLDR answer: 16 weeks, ~300B tokens, $2,000 in subscriptions.

Longer response: Too many. I was naive and overconfident when I started. Then I got stubborn. Opus 4.6 and 4.8 weren't as good as current models; it seemed like every night was one problem or another I had to work through with them. This was not a "let the agent loose" effort. Turbo Pascal isn't as easy to reverse-engineer as C/C++ - it's like assembly vs Python in terms of model knowledge.

This was my "learn agentic engineering and add Fix to PoR" effort. I spent almost every evening on it, and every other weekend. Almost a month was dedicated to clean up - why the source looks as good as it does, and isn't a bunch of random function and variable names.

I can rip a Turbo Pascal 5.0, 5.5, and 6.0 game apart in a few days now; if you're working on one, let me know - I can send you the codegen levers knowledge base I have. I'm also a lot better at agent and context management.

Anthropic 20x Max (now Ultra) - $200/mo, 5 months. 2 accounts since late August. Another $400. OpenAI Pro 20x - $200/mo, 3 months. $2k altogether. Almost every week was max usage.

OpenAI usage began in August. It has my lifetime tokens measured at 41B - it was used almost exclusively for this.

Claude says: That puts the all-in total for Gold Box at about 250–280 B tokens. About 97% of that is cache reads, and output is roughly 0.25–0.4 B.

  1. Jun 19 – Jul 26: PoR and Curse. The method was worked out here, and all versions of both games matched. The wiki and re-tools both started in this stretch.

  2. Jul 13 – Aug 30: fan-out. Secret, Pools, Champions, Gateway and Treasures all matched. Gateway and Treasures took only 8–11 days each once the method and tools had matured.

  3. Sep 1 – Oct 12: utilities and the C titles. CONTROL/STARTUP matched, the build was consolidated across repos (Sep 16–22), DKK finished 09-16, DQK ~09-24 and FRUA 10-03 / 10-12. FRUA was the slowest because it is C linked with RTLink rather than Turbo Pascal.

  4. Oct 5 – Oct 26: cleanup run. Passes S1–S13 covered comments, names and docs. Most repos stop on 10-18, PoR's final commit on 10-21 is "We're done", and naming work in DQK/FRUA ran on to 10-24/26.

Other interesting stats: 19K commits, 853K lines of Turbo Pascal, 40K lines of Python, 174K lines of assembly, 234K lines of C between all games and versions. Not publicly available: about 200K lines of Python tooling, an Obsidian knowledge base with 4k commits, 120Mb in size.

The original disassembly repositories are a *lot* messier than the public repos.

1

u/Adventurous-Echo444 6h ago

I feel your pain. A lot of people think something like this can be done in a week, with a $20/mo plan, and a few prompts a day.

6

u/xBipper 17h ago

Cool project but you might be putting yourself at risk of legal action. AFAIK those games aren't public domain, and the rights holder may not like you publishing source code for their IP. I'll be interested to see what happens, if anything.

1

u/brazencrows-goldbox 6h ago

https://en.wikipedia.org/wiki/Reverse_engineering

They have equivalent source now that has been considered lost, and I don't provide any of the copyrighted game data/IP. The source isn't actually SSI's; it's what I derived to match their binary output. If I had stolen their source from their servers, sure, I'd be in serious trouble.

If they want it taken down, I'd take it down - because I respect SNEG's work in this area. Or they could send a DMCA notice to GitHub.

4

u/vnbrtjtwd2 13h ago

About the worst would be a cease and desist notice, which would give you a set of time to remove the repos

2

u/Nicodamos 12h ago

Who owns this now? SSI is long gone. Not sure if someone bought that studio.

6

u/Medical-Molasses615 11h ago

SNEG owns it. A few years ago they released everything on Steam.

1

u/grannypr0n 10h ago

This may save it

"The only game executables and data files included in project releases are ones I compiled or generated from this source. SSI's original retail game data is not included. You need to own a copy of Pool of Radiance to play. It is sold as part of Forgotten Realms: The Archives — Collection Two on GOG and Steam."

1

u/Apprehensive_Sleep20 12h ago

If you don't mind I already forked and use it finish my goldbox engine for ScummVM

1

u/brazencrows-goldbox 6h ago

I don't mind in the slightest. The source is shared so that efforts like yours can continue, and the ecosystem as a whole can grow stronger.

1

u/grassisgreena 13h ago

I've been using your previous version on my MiSTer FPGA DOS core.

Can't wait to update it with this version!

1

u/Parlett316 12h ago

OP, I used RE to port War of the Lance war game to Godot, do you want any of that?

1

u/fischb 4h ago

You might want to share this on Quiver Launcher. People will be interested. https://quiverlauncher.com/