I'll build a polished 3D procedural island battle simulator inspired by Bad North. Let me start by exploring the project structure.
React 19.2 is in use, so I'll install Three.js with React Three Fiber v9 and drei v10 (which support React 19). Let me install these packages.
The tool doesn't accept version ranges. Let me install the latest versions by name (latest fiber v9 and drei v10 support React 19).
Let me verify the installed versions to confirm React 19 compatibility.
React 19 is confirmed with compatible Three.js packages (fiber v9, drei v10). Now I'll build the simulator. Let me start with the foundation: a seeded RNG utility and shared types.
Now the core: the rule-based island generator. This implements the Bad North generation grammar — radial silhouette with coherent harmonics, layered elevation, stepped plateaus, defensible highlands, and intentional coastal landing zones.
Now the navigation system — A* pathfinding with elevation-aware costs, 8-directional movement with corner-cutting prevention, height sampling, and connectivity utilities.
Let me fix the unused import.
Now the battle simulation engine — squad formation, navigation, engagement, and combat until elimination.
Let me remove the unused parameter.
Now the 3D components. First, the terrain mesh builder — it constructs the stepped diorama with grass tops, sandy beaches, and rocky cliff faces using vertex colors and correct flat shading.
The R3F v9 JSX intrinsic types need proper setup. Let me verify the correct TypeScript configuration for R3F v9 with React 19.
I found the fix. With React 19's JSX transform, I need to declare the R3F intrinsic elements in the react/jsx-runtime module. Let me check the tsconfig first.
jsx: react-jsx confirmed. I'll add the module augmentation so R3F's intrinsic elements are recognized across the project.
The fix is in place. Now let me create the water shader and the decorations (trees, rocks, the defensible keep tower, banners, and invasion boats).
Now the units component — renders the soldiers, drives the battle simulation each frame, handles formation movement, combat animation, death, and HP bars.
Now the Scene that assembles lighting, atmosphere, terrain, water, decorations, and units with orbit controls.
Now the main App with the Canvas and polished UI overlay — title, controls, live battle status, island intel, and victory banner.
Now let me update the page title and then build the project to verify everything compiles.
The build succeeded. Let me make a couple of refinements: fix a TypeScript type usage for cleanliness, and adjust the camera for a more intimate diorama framing.
Let me rebuild to confirm everything compiles cleanly after the refinements.
The build is clean. Now let me improve color fidelity — since vertex colors are treated as linear by Three.js while string-based material colors are auto-converted from sRGB, I'll convert the terrain vertex colors to linear so the island matches the decorations and units in brightness (important for the faithful diorama aesthetic).
Let me review the Units component once more to verify the ref handling and per-frame logic are correct.
The per-frame logic and billboarding look correct. Let me rebuild to confirm the color conversion edit compiles.
The build is clean. Let me do a final review of the battle simulation logic to ensure the fight resolves correctly.
The implementation is complete and building cleanly. Let me verify the final file structure is all in place.
I've built Islebound, a polished 3D procedural island battle simulator faithful to Bad North's diorama aesthetic. The project builds successfully. Here's what it delivers:
Rule-based map generation (src/island/generate.ts)
Not noise — a deliberate spatial grammar:
- Coherent coastlines — a radial silhouette modulated by a few low-frequency sine harmonics, producing organic lobes and bays (no per-pixel jitter).
- Stepped elevation — a "coreness" ramp rising toward the island heart, plus a plateau term and gaussian hills, then quantised into terraces for the signature Bad North plateaus.
- Defensible highlands — the tallest central plateau is scored as the Keep (defenders spawn there, marked by a stone tower + banner).
- Intentional routes — the widest beach farthest from the keep becomes the landing zone (with beached invasion boats), the natural invasion corridor.
- A connectivity pass keeps a single coherent landmass (no stranded fragments).
Valid navigation (src/island/nav.ts)
A* with a binary heap, 8-directional movement, elevation-aware costs (climbing is costly → routes favor ramps and flat approaches), diagonal corner-cutting prevention, bilinear height sampling, and a water-safety clamp so units never enter the sea.
Cohesive squads & battle (src/sim/battle.ts)
Two squads of three (red attackers from the beach, blue defenders from the keep). A squad formation anchor advances in a wedge toward the enemy; units break formation and engage the nearest foe within range, trading blows (HP, cooldowns, hit flashes, death animations) until one side is eliminated.
Diorama rendering (src/three/*)
- Terrain built as a single flat-shaded mesh with grass tops, sandy beaches, and rocky cliff faces (vertex colors converted to linear for brightness consistency).
- Custom GLSL water shader with gentle waves and sun sparkle.
- Low-poly soldiers with banners, swords, billboarding HP bars; pine trees, rocks, the keep tower, and boats.
- Warm directional sun + hemisphere fill + fog + ACES tone mapping + soft shadows, viewed through orbit controls.
UI (src/App.tsx)
A Generate New Island button (plus seed display), live battle status with per-side HP, an island survey panel, terrain legend, Routes/Orbit toggles, and a victory banner — all in calm glass panels over the diorama.
Every reset reseeds the generator, rebuilding island, navigation, placement, and the battle into a fresh, strategically sound, and visually distinct map.
Files built: src/lib/random.ts, src/island/types.ts, src/island/generate.ts, src/island/nav.ts, src/sim/battle.ts, src/three/Terrain.tsx, src/three.d.ts, src/three/Water.tsx, src/three/Decorations.tsx, src/three/Units.tsx, src/three/Scene.tsx, src/App.tsx, index.html