I ❤️ OILBARON.EXE

I’ve been on a weird retro gaming kick lately. I played through full runs of all of Doom and Doom II, rocked out to some Heroes of Might and Magic III, tried playing Tie Fighter but it just wasn’t the same without my old joystick. I also tried command and conquer red alert, the xcom that takes place under water whatever that was called and even loaded up some of the first civ games. Pure nostalgia. I guess I’m an old man now.

There was one shareware game that I had a vague memory of that took me a while to find. Oil Baron was a tile based game I played when I was maybe 14 years old?

OILBARON v1.2: Oil Baron Game For Windows Oil Baron is a board-type strategy game for Windows. Build companies on a grid, trade shares, cause mergers. Play with up to six players, inc. the computer. V1.2 adds right button functionality, new statistics windows, more.

And because it’s a win16 based game I couldn’t get it running without the help of a cool little project that adapts wine to allow running 16 bit windows apps on 64bit windows via emulation. I installed it via this installer https://mendelson.org/otvdm.html. Once installed I was able just to directly run the OILBARON.EXE with no issues. By far the simplest solution vs emularity or other emulators I chased. It

Stock Baron - a web based clone

Anyway this post is not specifically about getting the game to run, but about the clone I built in homage to Al Funk’s little masterpiece. I almost never run Windows and I wanted the ability to play this game from basically anywhere, so I set out to make a web based clone. I targeted TypeScript and HTML with the intention of building a version of the game that was fully portable and ideally runnable offline. I specifically didn’t want a server involved to keep distribution costs at zero as I have no intention of commercializing what is effectively a fan homage.

You can play the end result here: https://stock-baron.com

The Process

I created this clone in the span of an afternoon roughly and have subsequently refined it a few times based on my own desire for little features (configurable games, graphs) and improved playability (stronger bots, less clicks), but the bulk of the project was completed in 4-6 hours which is yet another mind numbing experience with Claude at my side.

Here’s a retroactive log of how I approached it and where I ended up:

Project Log

PROMPT

I’m writing a blog post about this project and want to articulate the work we did in those first two sessions (83 and 79 msgs). Can you provide a bulleted list of steps we took over those two sessions?

Note

I’ve bolded the steps in Claude’s response where we had the most fun.

Claude

⏺ Both sessions covered. Bulleted timeline below — first session more chronological since arc clear; second grouped by theme since broader scope.

Session 1 — (a9d1bba1, 83 msgs)

Bootstrap

  • Generated initial CLAUDE.md from codebase analysis
  • Planned implementation strategy

First playable web build → UX dead ends

  • Got a turn-taking UI working in the browser
  • Hit “how do I end my turn?” — button bar wasn’t visible
  • User shared mockup of always-visible button bar; Claude rebuilt the controls
  • Bug: still forced to click discard before End Turn

The pivotal architectural decision

  • User pulled the rip cord: decouple game mechanics entirely from UI
  • Established the engine/UI split that still defines the codebase
  • Built a CLI that takes a JSON game file + an “encapsulated turn” command — enabling human and agent to test mechanics independent of HTML

Played a full game together via CLI

  • 2-player game, Claude as P1, user as P2, Claude narrating commands
  • Added commands as needed: buying shares, corp comparison view
  • Tier 1 vs Tier 3 merger discussion (growth rate vs bonus payout)
  • Asked Claude to write down its strategy observations as a file for future bot work

Returned to the web UI (now backed by the engine)

  • Hybrid mode: user plays via UI, Claude plays via CLI against the same game file
  • Buy/sell dialog made wider, taller, smaller font; added Sell All / Buy Max
  • Investigated and improved UI sluggishness on buy/sell and chit placement
  • Added a detailed corporation breakdown panel matching the CLI corps view
  • Win screen fix: show total wealth, not just cash

Bug fixes from live play

  • Buy Max ignored share limit → buy as much as legal, don’t error
  • Share limit reinterpreted as per-corp volume, not per-player
  • First three-way merger from one chit placement — state was unreadable
  • Merger modal didn’t pop on host’s own turn
  • Post-merger holdings exceeded volume cap → grandfather excess, allow buys only after sells free capacity
  • Merger modal copy: “Chris, you have XX shares” + show target corp share price
  • Discard wasn’t being used defensively by Claude (intentional gap noted for bots)

Rules / design discussion

  • Long thread on real-world stock trading parallels: cap volume at company level, allow blocking via ownership, no hidden portfolios, charge a configurable bid/ask spread to make round-tripping costly. Spread implemented as a flag.

Wrap

  • Add .gitignore (build artifacts, game files), commit everything

Session 2 — (988888ce, 79 msgs)

Rename

  • Project rebranded “AI Baron” / “AI Empire” → “Stock Baron” across the repo

Architecture pivot to fully client-side

  • Reviewed current backend/file model
  • Settled on three modes: offline vs bots in localStorage, P2P invites with no server, CLI agents joining via data channel
  • Chose manual copy/paste WebRTC SDP → zero server dependency (clunky UX accepted as the price)
  • Built the store-layer abstraction so browser and CLI share the engine

Bot system

  • Claude tested the CLI end-to-end by playing both sides
  • Added a replay log (initial state + ordered actions) to enable mass simulation
  • Improved bot buying efficiency
  • UI: buy-max button + custom numeric input
  • New game form gained a bot strategy picker
  • Built three bot tiers (simple, strategic, aggressive); kept older variants so tournaments could measure improvements
  • Fixed aggressive-bot buy/sell loop that prevented turn end
  • After user dominated a full game, analyzed win.log.json to identify weaknesses
  • Merger regression: decision modal not appearing in some cases — fixed

Peer-to-peer multiplayer

  • Host/peer invite-code flow built (base64 SDP exchange)
  • Claude joined a hosted game from the CLI as a peer
  • Played QA turns with the user
  • Honor-system fixes: mask other players’ chits on broadcast, mask corp-creation dialog details for remote peers
  • Turn-end detection: switched to push notifications via the data channel
  • Bug: UI still said “host’s turn” + showed own chits after ending — fixed with proper masking that keeps the opponent’s turn visible but hides their chits
  • Noted reconnection limitation: drop = new game (deferred)
  • Claude was holding cash defensively — user corrected the strategy

Deploy + visual identity

  • Bought stock-baron.com on Cloudflare, created chriswhitmore/stock-baron repo
  • First Cloudflare Pages static deploy → live at stock-baron.com
  • Theme system added on a side branch so it didn’t block fixes
  • Built the Windows 3.1 theme (font, raised tiles, white cell labels, weight tuning)
  • Dropped the “hacker” theme to keep theme count maintainable

Layout + ergonomics overhaul

  • Auto-scale game area to canvas; scroll only when minimum size exceeded
  • Vite bound to non-localhost for LAN testing
  • Cell-letter toggle for visual scanning
  • Newest chit always rightmost; unplayable chits shown disabled (coords still legible)
  • Right-side panels become scrollable when board claims space; gap fills when board is maxed
  • Place/Discard pill toggle next to chits; single-click chit ops with Undo
  • Hover-over-chit highlights the matching board cell
  • Buy/sell modal rebuilt: fields pre-filled with max, clear button to override, disabled action buttons for unavailable transactions, live recalculation as cash changes

Wrap

  • CLAUDE.md updated to reflect P2P + bot strategies, everything pushed

Tell me if want me dig into any phase deeper specific anecdotes.

The act of playing a game I had just made (cloned) against an AI was surreal. The AI as usual was padding my ego and complimenting my strategy with full on sycophancy, but at the same time was making genuinely insight observations about my strategy that it was then able to bake into the more deterministic bots that ship to the client.

Here’s what the CLI version of the game looks like. I have an alias to the typescript program called “sb” and every sb invocation reads the game state, presents the board and waits for your input. The game commands are the same commands that can be used in the web version of the game if you prefer staying on the keyboard as I do.

stock-baron ❯ sb new

> [email protected] cli
> tsx src/cli.ts game.json new


        A   B   C   D   E   F   G   H   I   J   K   L
  1    .   .   .   .   .   .   .   .   .   .   .   . 
  2    .   .   .   .   .   .   .   .   .   .   .   . 
  3    .   .   .   .   .   .   .   .   .   .   .   . 
  4    .   .   .   .   .   .   .   .   .   .   .   . 
  5    .   .   .   .   .   .   .   .   .   .   .   . 
  6    .   .   .   .   .   .   .   .   .   .   .   . 
  7    .   .   .   .   .   .   .   .   .   .   .   . 
  8    .   .   .   .   .   .   .   .   .   .   .   . 
  9    .   .   .   .   .   .   .   .   .   .   .   . 
 10    .   .   .   .   .   .   .   .   .   .   .   . 
 11    .   .   .   .   .   .   .   .   .   .   .   . 
 12    .   .   .   .   .   .   .   .   .   .   .   . 

Corps: (none active)

Player 1 (Human) $6000 cash:$6000 | (no shares)  ← current
Player 2 (Elon) [bot] $6000 cash:$6000 | (no shares)
Player 3 (Sacks) [bot] $6000 cash:$6000 | (no shares)
Player 4 (Chamath) [bot] $6000 cash:$6000 | (no shares)

Phase: place_or_discard | Round 1 | Turn 1 | Chits left: 116
Your chits: [H1] [H3] [G7] [E11] [E1] [K9] [G1]

Game saved to game.json

Next turn after placing my first chit and the bots auto-playing their turn (sb place G7 then sb end):

> [email protected] cli
> tsx src/cli.ts game.json end

(ran 8 bot actions)

        A   B   C   D   E   F   G   H   I   J   K   L
  1    .   .   .   .   .   .   .   .   .   .   .   . 
  2    .   .   .   .   .   .   .   .   .   .   .   . 
  3    .   .   .   .   .   .   .   .   .   .   .   . 
  4    *   .   .   .   .   .   .   .   .   .   .   . 
  5    .   .   .   .   .   .   .   .   .   .   .   . 
  6    .   .   .   .   .   .   .   .   .   .   .   . 
  7    .   .   .   *   .  OA  OA   .   .   .   .   . 
  8    .   .   .   .   .   .   .   .   .   .   .   . 
  9    .   .   .   .   .   .   .   .   .   .   .   . 
 10    .   .   .   .   .   .   .   .   .   .   .   . 
 11    .   .   .   .   .   .   .   .   .   .   .   . 
 12    .   .   .   .   .   .   .   .   .   .   .   . 

Corps: OpenAI($7.50, 2 tiles)

Player 1 (Human) $6000 cash:$6000 | (no shares)  ← current
Player 2 (Elon) [bot] $6000 cash:$6000 | (no shares)
Player 3 (Sacks) [bot] $6000 cash:$6000 | (no shares)
Player 4 (Chamath) [bot] $6140 cash:$65 | OA:810

Phase: place_or_discard | Round 2 | Turn 5 | Chits left: 112
Your chits: [H1] [H3] [E11] [E1] [K9] [G1] [F1]

A new corp (OpenAI has been formed!)

You get the idea. This mode made it really easy for me to play against Claude once it understood the game, then later allowed for running massively parallel simulations to test the various incarnations of the bots against each other.

None of this ground breaking… but I have never built a game and keep in mind we’re doing all this within the first four hours. 😱

It’s been super fun and was one of those projects where I hit same level of flow state that I used to get when coding directly, just at a higher level order. In the past I would have dreamt up backlog items for myself to create a CLI version, or to make a test harness for bot faceoffs. If I was lucky I’d get to those things days or weeks later if I got to them at all. In this case I had a tight enough implementation and testing loop that I never had to put anything my todo list, I simply implemented as I went and it was a completely joyful experience of just building whether I was typing the code or not.

Outside of architectural decisions like engine separation, and strictly sticking to client side only I STILL haven’t looked closely at the code (three weeks later). Maybe I’ll hit the limits of maintainability, or more likely the models will continue to improve and I’ll direct the required refactors, new test suites or repackaging required when I get there. We’ll see!