logoalt Hacker News

Show HN: Journey – A Custom 2D ECS Game Engine Written in Rust and WGPU

9 pointsby ujjwalvivekyesterday at 11:41 PM3 commentsview on HN

Comments

ujjwalvivekyesterday at 11:46 PM

OP here. "Journey" is my long-term R&D project to understand modern rendering pipelines and system architecture constraints. It's a custom 2D ECS engine written in Rust and wGPU that compiles to WebAssembly.

I intend to keep developing this indefinitely as a playground for graphics programming.

The hardest technical hurdles so far were (but not limited to): 1. The Async Loop: Re-architecting the main game loop to play nice with the browser's requestAnimationFrame (inverting control to avoid thread blocking). 2. WASM DPI Scaling and Pixel Ratios: Handling high-DPI/Retina scaling manually in wGPU so the canvas doesn't look blurry or cropped on mobile. 3. Safe ECS: Fighting the borrow checker to build a System Runner that allows mutable component access without runtime panics.

The submitted link is a peek/dive into the architecture.

Live Demo: https://journey.ujjwalvivek.com Source Code: https://github.com/ujjwalvivek/journey

I am actively looking for others to hop on and work on this! If you've been wanting to learn wGPU, experiment with ECS architecture, or just fix my terrible shaders, I'd love to review your PRs.

Happy to answer questions about the Rust -> WASM pipeline or wGPU witchcraft!

Hammershafttoday at 12:46 AM

On a mobile device I can't interact with the game, consider detecting mobile screen sizes and loading some gifs :)

show 1 reply