{"id":15099950,"url":"https://github.com/judah-caruso/wasm-game-engine-test","last_synced_at":"2025-06-17T22:37:20.483Z","repository":{"id":195809579,"uuid":"693720151","full_name":"judah-caruso/wasm-game-engine-test","owner":"judah-caruso","description":"A wasm-based game engine written in Go","archived":false,"fork":false,"pushed_at":"2023-09-23T19:16:51.000Z","size":1089,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T23:07:45.078Z","etag":null,"topics":["assemblyscript","ebitengine","odin","rust","wasm","wazero","zig"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/judah-caruso.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-19T15:19:07.000Z","updated_at":"2024-08-19T08:06:31.000Z","dependencies_parsed_at":"2023-09-19T17:55:12.160Z","dependency_job_id":"f946c8da-9596-45ca-9024-d72518827989","html_url":"https://github.com/judah-caruso/wasm-game-engine-test","commit_stats":null,"previous_names":["judah-caruso/wasm-game-engine-test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/judah-caruso/wasm-game-engine-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judah-caruso%2Fwasm-game-engine-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judah-caruso%2Fwasm-game-engine-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judah-caruso%2Fwasm-game-engine-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judah-caruso%2Fwasm-game-engine-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/judah-caruso","download_url":"https://codeload.github.com/judah-caruso/wasm-game-engine-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judah-caruso%2Fwasm-game-engine-test/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260452247,"owners_count":23011430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assemblyscript","ebitengine","odin","rust","wasm","wazero","zig"],"created_at":"2024-09-25T17:42:00.487Z","updated_at":"2025-06-17T22:37:15.464Z","avatar_url":"https://github.com/judah-caruso.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wasm Game Engine Test\n\nThis repository was created to see how feasible it is to use [wazero](https://wazero.io/) to drive a small game engine (using [Ebitengine](https://ebitengine.org/)). It simply sets up Ebitengine and exports a small api for wasm to import.\n\nIf you're trying to do something similar, hopefully this provides a decent starting point.\n\n![](screenshot.png)\n\n## Installation\n\n- Install the toolchain for the language you want to compile (zig, rust, odin, tinygo, assemblyscript)\n- `cd` into their `[lang]-game` directory\n- run `./build.sh` (this will create a `game.wasm` file in the root directory)\n- run `go run .` in the root directory to start the game\n\n## Some minor benchmarks\n\nBelow are a few grain-of-salt metrics I've gathered for each bunnymark-styled demo. This **isn't** intended to be a direct comparison of performance, more to see how much overhead there is when calling between wazero/wasm and go.\n\nNote: these were ran on a 2022 M2 MacBook Air (8GB)\n\n```\nLanguage  60 Fps Max  60 Tps Max (Avg. Fps)\nasc           22,000      71,000 (14)\nodin          23,000      88,000 (15)\nzig           24,000      83,000 (15)\ngo            25,000      94,000 (15)\nrust          25,000      94,000 (15)\n```\n\nBelow compares this approach to other ways I've tested:\n\n```\nRuntime        60 Fps Max  60 Tps Max (Avg. Fps)\ngo/goja             2,000       3,000 (18)\ngo/gopher-lua      13,000      22,000 (19)\ngo/browser[1]      13,000      49,000 (14)\ngo/wazero[2]       53,000     184,000 (15)\ngo/native[3]       55,000     192,000 (15)\ngo/native[4]       64,000     230,000 (14)\n```\n\n- 60 Fps Max: number of entities before consistent fps is below 60\n- 60 Tps Max: number of entities before consistent tps is below 60\n- Avg. Fps: average fps when tps is passed tps max\n\n1. [Ebitengine Sprites Example](https://ebitengine.org/en/examples/sprites.html)\n2. BrutEngine (my custom wasm engine)\n3. [Ebitengine Bunnymark](https://github.com/sedyh/ebitengine-bunny-mark)\n4. [Gophermark](https://github.com/judah-caruso/gophermark)\n\nFrom my tests, embedding wasm/wazero within a native go application\nperforms better than embedding lua/js or running wasm in the browser.\nHowever, as expected, both still perform significantly worse than native compilation.\n\nKeep in mind that \"bunnymark\" isn't a definitive benchmark and your mileage may vary.\n\n## License\n\nPublic Domain\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjudah-caruso%2Fwasm-game-engine-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjudah-caruso%2Fwasm-game-engine-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjudah-caruso%2Fwasm-game-engine-test/lists"}