Period: September 6, 2025 Total Commits: 10
Quick Summary of Commits:
-
23:57: Add prompt templates to version control
-
Remove prompts/ from .gitignore - these should be tracked
-
Add blog-post-prompt.txt with game dev blog best practices
-
Add writing-style.txt with Tim’s personal writing style guide
These templates are essential configuration that should be version controlled and shared across the team.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com (b3729a7)
-
23:56: Add blog writer CLI tool for automated dev updates
-
Created TypeScript CLI tool to generate blog posts from git history
-
Supports daily and weekly update generation
-
Analyzes commit history to find missing blog posts
-
Integrates with Claude for AI-powered content generation
-
Includes writing style guide based on Tim’s blog posts
-
Added prompt templates inspired by RimWorld, Factorio, and LoL
-
Configured for TowerStorm as multiplayer PvP tower defense game
-
Added ‘make writer’ command to main Makefile
The tool extracts commit details, generates comprehensive prompts, and uses Claude to create engaging development update blog posts that follow established game dev blog patterns.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com (a4df6b7)
- 23:16: Update CLAUDE.md documentation with replay and recovery systems
Updated documentation files to capture important architectural decisions and implementation details from the recent replay system and game lifecycle improvements:
server/CLAUDE.md
- Added Game State Recovery section for automatic game restoration on restart
- Added Inactivity Detection section for abandoned game cleanup (5min timeout)
- Documented new /api/games/:gameId/history endpoint for replay data
- Added WebSocket event documentation for report_game_end
client/CLAUDE.md
- Added ReplayGameView.tsx to the component directory structure
- Created comprehensive Replay System section with features and implementation
- Documented auto-skip to game start functionality
- Added replay optimization details (compression, caching, performance)
bots/CLAUDE.md
- Added Game End Detection section for match_ended event handling
- Documented Connection Recovery with exponential backoff strategy
- Added details on automatic rejoin and state preservation
These updates ensure future development has full context on how these critical systems work together.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com (0ed0b5f)
- 19:24: Major replay system implementation and game lifecycle improvements
Replay System
- Added new ReplayGameView component for viewing game replays
- Implemented REST endpoint for fetching game history
- Added replay controls (play/pause, timeline scrubbing, speed controls)
- Auto-skip to game start when all players have selected units
- Fixed action type mapping for replay compatibility
- Added detailed logging for unit selections and game flow
Game End Detection & Recovery
- Fixed bot game end reporting via WebSocket
- Added server-side game end handling
- Implemented game state recovery on server restart
- Preserve match duration and state across restarts
- Added inactivity detection (5min timeout for abandoned games)
Bot Improvements
- Added automatic reconnection with exponential backoff
- Enhanced logging for bot decisions and actions
- Fixed bot synchronization during unit selection
- Improved error handling and recovery
Server Enhancements
- Added compression middleware for large payloads
- Implemented game history caching
- Added pagination support for replay data
- Enhanced monitoring service with detailed metrics
- Improved Redis persistence for game state
Bug Fixes
- Fixed TypeError with BigInt/Fixed conversion in GameHUD
- Fixed renderer disposal error (removed non-existent Tower.disposeAllAnimations)
- Fixed InfoPanel props in replay mode
- Fixed multiple useEffect dependency issues causing re-renders
- Fixed minion spawn assignments not showing in replays
Performance
- Optimized replay loading with gzip compression
- Separated render loop from playback loop
- Added caching headers for replay data
- Reduced unnecessary re-renders in replay component
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com (4135f7e)
- 15:56: Add comprehensive monitoring dashboard and improve bot-matchmaker logging
Monitor Improvements
- Enhanced game detail view with full game timeline and player actions
- Added matchmaking queue monitoring page
- Improved games list with better filtering and real-time updates
- Added bot name utilities for consistent naming across monitor
- Extended server API with matchmaking stats and game history endpoints
Bot Matchmaker Logging
- Modified bot-matchmaker to write logs to /tmp/bot-matchmaker.log
- Added bot-matchmaker-alpha target for background execution in alpha environment
- Foreground bot-matchmaker now redirects all output to log file
Server Enhancements
- Added comprehensive game history tracking in monitoring service
- Improved matchmaking event reporting to monitor
- Enhanced game worker monitoring integration
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com (4a47658)
- 04:12: Fix bot synchronization bug in game history replay
The bot client was looking for ‘data.history’ but the server sends ‘data.actions’. This caused bots joining mid-game to miss historical player selections, leading to desync where each bot only knew about their own SELECT_UNITS action.
Changes:
- Update bot client to look for ‘data.actions’ instead of ‘data.history’
- Group flat action array by tick for proper chronological processing
- Skip tick marker entries used for timestamp preservation
- Maintain same replay logic but with corrected data structure
This fixes the “1/2 players have made selections” issue where bots couldn’t see each other’s unit selections.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com (d8ded80)
-
03:30: Add comprehensive logging to diagnose unit selection race conditions
-
Add detailed logging when processing SELECT_UNITS actions from history
-
Log player selections state after history replay
-
Identify missing player selections explicitly
-
Add debug logging when converting SELECT_UNITS actions
-
Fix SimCore to always check selections (remove early return)
-
Add validation that firstWaveStarted requires all player selections
-
Prevent duplicate wave starts with proper checks
-
Call checkInitialSelections immediately after processing SELECT_UNITS
This will help identify why some bots don’t see other players’ selections.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com (7bef8d0)
-
03:22: Fix race condition in bot unit selection synchronization
-
When filtering by game ID, show ALL logs instead of limiting to 100
-
Ensure all players are initialized before processing SELECT_UNITS actions
-
Merge player lists from both matchmaking config and game history
-
Late-initialize players when processing their actions if not already in state
-
Use actual team assignments instead of guessing based on bot’s own team
-
Skip selections from truly unknown players with proper warning
This fixes the issue where late-joining bots would miss other players’ unit selections, causing SimCore to show only 2/4 players selected when all 4 had actually selected.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com (dd6045d)
-
03:11: Implement structured logging system for bots with Pino
-
Created comprehensive logging system using Pino for structured JSON logs
-
Added ILogger interface to SimCore for logger-agnostic implementation
-
Created PinoLoggerAdapter to bridge Pino with SimCore’s logging interface
-
Fixed Pino syntax throughout codebase (object first, then message)
-
Added daily rotating log files with game ID and bot username tagging
-
Created log viewer CLI tool for filtering logs by game/bot
-
Replaced all console.log statements with structured logger calls
-
SimCore now accepts optional logger, defaults to console for client compatibility
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com (32cecd5)
- 01:18: Major bot system improvements and matchmaking integration
Bot Matchmaking Server:
- Created bot-matchmaker.ts that automatically spawns bots every 10 seconds
- Bots randomly join 1v1, 2v2, 3v3, or 4v4 matchmaking queues
- Authenticate via HTTP to get token, then authenticate WebSocket
- Listen for correct ‘ready_check_started’ event and accept within 0.5-2 seconds
- Handle ready_check_failed, ready_check_cancelled, and match_cancelled events
- Spawn game worker threads when match starts
- Pass bot personality from name to worker for consistent play style
- Add ‘make bot-matchmaker’ command that runs on port 4001
Bot Personality System:
- Pass personality from matchmaker through to game workers
- Update ServerBotConfig to include optional personality field
- Update ServerBotAI to accept and use personality parameter
- Log personality preferences when spawning bots
Client Resync Fixes:
- Fix duplicate block 0 processing during resync
- Start processing from block after initial to prevent duplicates
- Process initial block actions separately after initialization
- Group events by block for proper replay in bots
- Catch up to current block after replay if needed
Bot Level Upgrade Fix:
- Replace hardcoded level 5 limit with MATCH_CONFIG.MAX_PLAYER_LEVEL
- Import MATCH_CONFIG from general config
- Allow bots to upgrade all the way to level 10
Bot Termination Fixes:
- Make shouldStop flag public so BotClient can access it
- Check shouldStop after each AI decision and terminate if true
- Send status message to parent before worker exit
- Output gas usage report when game ends
Gas Tracking (Blockchain Mode):
- Track gas used for each transaction in TransactionManager
- Accumulate total gas and breakdown by transaction type
- Output detailed gas report when match ends
- Log gas usage for each transaction as it happens
General Improvements:
- Fix game not ending when last castle destroyed
- Fix initial gold amount from 20000 to 200 in config
- Remove compilation step from bot-matchmaker Makefile target
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com (1b14b60)
Opening
Quick one today. We got replays into a playable state, made game recovery more resilient, and tightened up bot behavior so practice matches feel more consistent. Also stood up better monitoring and logging so we can catch issues faster.
[screenshot: replay viewer with timeline scrubbing and speed controls at 4135f7e]
What’s New
-
Replay viewer is live (first pass)
- Play/pause, timeline scrubbing, and speed controls are in.
- Auto-skip to the real start once all players have selected units, so you don’t sit through lobby noise.
- Why it matters: helps you review openings, wave timings, and counter-builds in PvP without guesswork.
- Note: this is still early. UI is functional, not pretty yet.
-
Game lifecycle recovery
- Server restores active matches on restart and keeps match duration/state intact.
- Inactivity cleanup: matches with no activity for 5 minutes end cleanly.
- Why it matters: fewer stuck lobbies, fewer ghost matches, more reliable end-of-game results.
-
Smarter, more available bots
- New bot matchmaker that joins 1v1–4v4 queues on a cadence to keep queues moving.
- Bot personalities thread through from names to workers for consistent play style.
- Why it matters: easier practice queues and better load for testing PvP flow.
[screenshot: game HUD in replay mode with fixed info panel at 4135f7e]
What Got Fixed
-
Replay and HUD correctness
- Fixed minion spawn assignments not showing in replays.
- Cleaned up GameHUD BigInt/Fixed errors that were throwing during playback.
- Removed a bad renderer dispose call that could crash on exit.
- Replay InfoPanel props corrected to display the right data.
-
Game flow and stability
- Server-side end-of-game handling now authoritative and bots report correctly.
- State recovery across restarts preserves match progress rather than dropping the session.
- Pagination + caching on replay data to prevent timeouts on long matches.
-
Bot synchronization
- Late-join replay desync fixed (bots now read data.actions instead of data.history).
- Race condition during unit selection addressed: ensure all players are initialized before processing SELECT_UNITS.
- Added explicit checks so the first wave only starts after all selections are in.
- Lots more logging to surface when and why selections are missing.
-
Performance
- Gzip compression + caching headers for replay payloads.
- Separated render loop from playback loop to reduce stutter.
- Trimmed unnecessary re-renders in the replay component.
What’s Still Broken
-
Replay polish
- Timeline works, but very long games can still feel heavy on first load even with compression.
- UI needs iteration (keyboard shortcuts, better timeline markers).
-
Late-join edge cases
- We resolved the main race condition, but we’re still watching edge cases where players connect mid-selection in large team modes. The extra logging should make remaining issues easier to spot.
If you see anything odd in replays (wrong unit names, missing events, stalled playback), send a timestamp and match ID. That helps a lot.
[screenshot: multiplayer battle mid-wave while replaying selections auto-skip at 4135f7e]
Under the Hood
-
Monitoring and observability
- New dashboard with per-match timelines, player actions, and real-time queue visibility.
- Matchmaking stats and game history endpoints to keep an eye on throughput and failures.
- Bot matchmaker logs route to a dedicated file for easier triage.
-
Structured logging
- Pino-based JSON logs across bots with daily rotation and tagging by game/bot.
- SimCore takes an abstract logger now, so clients can plug in their own.
- Added a small log viewer CLI to filter by game or bot when we’re tracking down weirdness.
-
Server plumbing
- Compression middleware for large payloads, plus replay caching.
- Redis persistence improvements for game state.
- History pagination to keep endpoints responsive.
-
Systems work for bots
- Exponential backoff reconnects, better error handling, and cleaner termination signals.
- Level cap now respects MATCH_CONFIG.MAX_PLAYER_LEVEL (up to 10).
- In blockchain mode, per-transaction gas tracking and end-of-match breakdowns.
-
Tooling
- A writer CLI now scrapes commit history and drafts these updates using our style guide and templates. Less drift, more consistency.
What’s Next
- Replay polish: likely keyboard shortcuts, better timeline annotations, and faster first-frame rendering for long matches.
- Matchmaking: keep tuning ready checks and failure paths; watch queue times as we scale up bot participation.
- PvP balance: no balance changes today. We’re collecting data from replays to inform early-wave pacing and upgrade timing next.
- UI clarity: pass on the replay UI and HUD to make important info pop during analysis.
Thanks for reading and for the reports. If you hit issues, a short note with match ID, rough timestamp, and what you expected vs. what you saw is perfect.