feat: Add WebAssembly version of IsoCoaster at /coasterwasm#366
feat: Add WebAssembly version of IsoCoaster at /coasterwasm#366
Conversation
- Create full Rust/WASM implementation of the game engine - Implement core data structures (Tile, Building, Guest, Coaster, Tool) - Implement isometric coordinate system matching original (64px tiles, 0.6 height ratio) - Implement sprite loading with red background filtering - Implement terrain rendering (grass, water with texture, paths, queues) - Implement coaster track rendering (straight, curved, slopes, loops, supports) - Implement train animation and physics - Implement guest rendering with walking animation and colors - Implement guest AI with BFS pathfinding and decision making - Create Next.js page at /coasterwasm with sidebar and game controls - Update next.config.js for WASM support The WASM version provides visual parity with the original game while running core game logic in WebAssembly for improved performance. Co-authored-by: andrew <andrew@anysphere.co>
|
Your pull request is now ready for review with Assert. Stop waiting for your code to break. Ship with confidence using Assert. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: andrew <andrew@anysphere.co>
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 322 seconds. |
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 333 seconds. |
Co-authored-by: andrew <andrew@anysphere.co>
Co-authored-by: andrew <andrew@anysphere.co>
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 340 seconds. |
Co-authored-by: andrew <andrew@anysphere.co>
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 338 seconds. |
Co-authored-by: andrew <andrew@anysphere.co>
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 336 seconds. |
Co-authored-by: andrew <andrew@anysphere.co>
Co-authored-by: andrew <andrew@anysphere.co>
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 360 seconds. |
Co-authored-by: andrew <andrew@anysphere.co>
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 323 seconds. |
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 311 seconds. |
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 303 seconds. |
Co-authored-by: andrew <andrew@anysphere.co>
Co-authored-by: andrew <andrew@anysphere.co>
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 504 seconds. |
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 456 seconds. |
Co-authored-by: andrew <andrew@anysphere.co>
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 513 seconds. |
|
@cursor fix the vercel build |
|
The Vercel build is now fixed. Here's what I changed: Changes made:
The Vercel build should now succeed since it will find the pre-built |
- Remove wasm/pkg/ from .gitignore to commit pre-built WASM files - Make wasm:build script skip if wasm-pack not found but pkg exists - Commit pre-built WASM artifacts for deployment environments Co-authored-by: andrew <andrew@anysphere.co>
| canvas.style.height = `${height}px`; | ||
|
|
||
| // Create game instance | ||
| const game = new wasm.Game(canvas, 50, dpr); // 50x50 grid |
There was a problem hiding this comment.
Game constructor has ambiguous same-typed arguments
Low Severity · Bugbot Rules
The Game constructor takes two consecutive number arguments: grid_size and pixel_ratio. At the call site new wasm.Game(canvas, 50, dpr), these values could be accidentally swapped without triggering the TypeScript typechecker. The rule team-569 requires using an object with named args for functions with multiple arguments of the same type to prevent inadvertent argument reordering.
Additional Locations (1)
Triggered by team rule: No ambiguous args at callsite in typescript
| if (animationRef.current) { | ||
| cancelAnimationFrame(animationRef.current); | ||
| } | ||
| }; |
There was a problem hiding this comment.
WASM Game instance not freed on unmount
Medium Severity · Performance Issue
The cleanup function cancels the animation frame but does not call free() on the WASM Game instance stored in gameRef.current. The Game class exposes a free() method to release WASM memory. Without calling it, memory for the game grid, guests, and coasters remains allocated. In browsers without FinalizationRegistry support, this memory is never freed. Even in modern browsers, the finalizer runs non-deterministically. Navigating to/from this page repeatedly causes memory to accumulate until page refresh.
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 546 seconds. |
Co-authored-by: andrew <andrew@anysphere.co>
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 530 seconds. |
- Prevent path/queue overlap and charge bulldoze cost - Ensure train cars trail the lead car and validate loop continuity - Guard isometric render loops against index underflow Co-authored-by: andrew <andrew@anysphere.co>
- Accept cols/rows via named object in wasm bindings - Update coasterwasm loader callsite and regenerate pkg Co-authored-by: andrew <andrew@anysphere.co>
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 487 seconds. |
Co-authored-by: andrew <andrew@anysphere.co>
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 458 seconds. |
Co-authored-by: andrew <andrew@anysphere.co>
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 556 seconds. |
Localization Complete! ✅This PR has been successfully localized! 📋 SummaryLocadex has analyzed your changes and automatically localized your translatable content. Files internationalized (2)
Translation files updated (8)
Configuration files updated (2)
🔗 What happened?
Localization completed by Locadex in 450 seconds. |
| did_remove = true; | ||
| break; | ||
| } | ||
| } |
There was a problem hiding this comment.
Bulldoze tool incorrectly removes neighboring track pieces
Medium Severity · Logic Bug
The bulldoze tool has a fallback that clears coaster track from neighboring tiles when the clicked tile has no track. If a user clicks on empty grass adjacent to a coaster track, the code iterates through neighbors and deletes the first track piece found. This causes unexpected track deletion when users click on tiles they didn't intend to modify.




The WASM version provides visual parity with the original game while running core game logic in WebAssembly for improved performance.
Note
Medium Risk
Introduces a new Rust/WASM build pipeline and client-side runtime loading; main risk is bundling/runtime failures (WASM import/webpack config, environment differences) rather than data/security concerns.
Overview
Adds a new WebAssembly edition of IsoCoaster served from
/coasterwasm, including a new Next.js client page that dynamically imports the generated WASM module, loads sprite sheets/textures, and drives the render/tick loop while wiring UI controls (tools, speed, stats) to exported WASM APIs.Introduces a full Rust crate under
wasm/(game state, tiles, buildings, tools, coaster track structures) plus committedwasm-packoutput inwasm/pkg/for deployment, and updatesnext.config.js+ npmpredev/prebuildscripts to enable async WASM and build (or fall back to prebuilt artifacts). Documentation and.gitignoreare updated accordingly.Written by Cursor Bugbot for commit 57f2ccd. This will update automatically on new commits. Configure here.