{"id":13733254,"url":"https://github.com/uggla/planetoid","last_synced_at":"2025-08-19T03:06:31.709Z","repository":{"id":36969350,"uuid":"367714348","full_name":"uggla/planetoid","owner":"uggla","description":"Planetoid is a toy project to demonstrate and learn several technologies. The goal is to create a little multiplayer asteriod game clone.","archived":false,"fork":false,"pushed_at":"2023-03-06T06:58:05.000Z","size":2728,"stargazers_count":10,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T06:41:50.052Z","etag":null,"topics":["quarkus","rust","wasm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uggla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-05-15T19:28:23.000Z","updated_at":"2025-01-29T12:24:32.000Z","dependencies_parsed_at":"2024-01-06T09:58:18.767Z","dependency_job_id":"b3e0b03e-919f-4fb6-9406-8577e65e8c26","html_url":"https://github.com/uggla/planetoid","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fplanetoid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fplanetoid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fplanetoid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fplanetoid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uggla","download_url":"https://codeload.github.com/uggla/planetoid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248581352,"owners_count":21128154,"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":["quarkus","rust","wasm"],"created_at":"2024-08-03T03:00:40.122Z","updated_at":"2025-04-12T14:33:05.613Z","avatar_url":"https://github.com/uggla.png","language":"Rust","funding_links":[],"categories":["Games"],"sub_categories":["Games: On top of macroquad"],"readme":"# Planetoid\n\n[![Planetoid](https://github.com/uggla/planetoid/actions/workflows/planetoid.yml/badge.svg)](https://github.com/uggla/planetoid/actions/workflows/planetoid.yml)\n\nPlanetoid is a toy project to demonstrate and learn several technologies.\nThe goal is to create a little multiplayer [asteriod](https://en.wikipedia.org/wiki/Asteroids_(video_game)) game clone.\n* Server-side is composed of 2 parts:\n    * A server based on a [Quarkus](https://quarkus.io/) application. The goal of this application will be to:\n      * Show games in progress and terminated with participants and winner.\n      * Allow users to authenticate and add comments to a specific game.\n      * Launch workers to allow several games in parallel, each with individual players.\n    * A worker based on a [Quarkus](https://quarkus.io/) application using websockets derived from the chat example. The goal of this application is currently to:\n      * Pass game messages between clients.\n* Client-side is a [Rust](https://www.rust-lang.org/) application using [macroquad](https://github.com/not-fl3/macroquad) framework. It was also derived from the asteroid example but refactored in a more object-oriented code. It can be compiled as:\n    * A native application that will use websockets ([tungstenite](https://github.com/snapview/tungstenite-rs)) to share game data. Only Linux has been fully tested so far, but it should run on Windows/MacOs as well.\n    * A wasm32 application that can be run in a browser. Currently, websockets are not implemented, but the game can be played in solo mode.\n* Deployment on [Kubernetes](https://kubernetes.io/) for the server and the required infrastructure to capture metrics ([Prometheus](https://prometheus.io/) / [Grafana](https://grafana.com/)) as well as authentication ([Keycloak](https://www.keycloak.org/)) and persistance ([Postgres](https://www.postgresql.org/)).\n\n\nThis project is in an early stage, so many features are missing and need to be implemented. However, as stated initially, the goal is not to propose a real game but a demo to explain and share these technologies.\n\n\n## Targeted infra overview\n![infra](images/infra.png)\n\n## Project current status\n* Clients (native and wasm) can be built and run. Wasm can only run solo mode.\n* Worker allows playing a multiplayer game:\n    * Native client can share the game with a spectator. A spectator is another native client started in the spectator mode.\n    * Multiplayer game. A native client can be run as host, and several guests can connect to destroy asteroids together.\n* Server is a WIP. It is currently just exposing two tables with hibernate/panache and a couple of API routes.\n\n\n## Authors\n\n- [@Uggla](https://www.github.com/Uggla)\n\n## Game controls\n* `Right` and `left` arrow keys to turn the ship right and left.\n* `Space` key to shoot.\n* `F` key to display fps.\n* `Esc` key to quit the game.\n\n## Demo\nAn online demo can be played [here](https://planetoid.uggla.fr).\n\n*Note:*\n* *only solo mode is available online.*\n* *loading the game can take time.*\n\n## Screenshots\n\nNative application:\n![App native screenshot](images/planetoid_native.jpg)\n\nRunning the wasm application into Firefox:\n![App wasm32 screenshot](images/planetoid_wasm32.jpg)\n\nMultiplayer game:\n![multiplayer game screenshot](images/multiplayer_game.jpg)\n\n\n## Binaries\nBinaries are available here:\n[Binary releases](https://github.com/uggla/planetoid/releases)\n\n## Run Locally (mainly for development purposes)\n\n1. Clone the project\n\n```bash\n  git clone https://github.com/uggla/planetoid\n```\n\n2. Go to the project directory\n\n```bash\n  cd planetoid\n```\n\n### Worker\n\n1. Install OpenJDK 11 following the instructions [here](https://adoptopenjdk.net/installation.html#) or install it using your distribution package manager.\nEx on Fedora\n\n```bash\n  dnf install java-11-openjdk-devel\n```\n\n2. Install maven \u003e 3.6 following the instructions [here](https://maven.apache.org/install.html) or install it using your distribution package manager. Ex on Fedora:\n\n```bash\n  dnf install maven\n```\n\n3. Go to the worker directory and run the worker in dev mode\n\n```bash\ncd worker\nmvn compile quarkus:dev\n```\n*Note: Maven will download a lot of dependencies from the internet*\n\n### Client\n\n#### Native client\n1. Install Rust following the instructions [here](https://www.rust-lang.org/fr/learn/get-started).\n\n   *Tips: the rustup method is the simplest one.*\n\n2. Install required library for macroquad\n\n* Ubuntu system dependencies\n```bash\napt install pkg-config libx11-dev libxi-dev libgl1-mesa-dev libasound2-dev\n```\n\n* Fedora system dependencies\n```bash\ndnf install libX11-devel libXi-devel mesa-libGL-devel alsa-lib-devel\n```\n\n* Windows system\n```\nNo dependencies are required for Windows or MacOS\n```\n\n3. Go to the client directory and run the native client\n```bash\ncd client\ncargo run\n```\n\n#### Wasm32 client\n\n1. Follow the above instruction of the native client.\n\n2. Install basic-http-server\n```bash\ncargo install basic-http-server\n```\n\n3. Add the wasm32 compilation target\n```bash\nrustup target add wasm32-unknown-unknown\n```\n\n4. Go to the client directory and run the native client\n```bash\ncd client\ncargo build --target wasm32-unknown-unknown\n```\n\n5. Serve the files and open the browser\n```bash\nbasic-http-server\nxdg-open http://127.0.0.1:4000\n```\n\n\u003c!-- ## Installation --\u003e\n\n\u003c!-- Install my-project with npm --\u003e\n\n\u003c!-- ```bash --\u003e\n\u003c!--   npm install my-project --\u003e\n\u003c!--   cd my-project --\u003e\n\u003c!-- ``` --\u003e\n\n\n## Native client usage\n```\nPlanetoid 0.1.0\nPlanetoid is an asteroid clone.\n\nUSAGE:\n    planetoid [FLAGS] [OPTIONS]\n\nFLAGS:\n    -d, --debug      Debug mode (_ (error), -d (info), -dd (debug), -ddd (trace))\n    -g, --god        God mode\n        --help       Prints help information\n    -s, --solo       Solo mode, do not connect to network\n    -V, --version    Prints version information\n\nOPTIONS:\n    -h, --host \u003chost\u003e    Host [default: localhost]\n    -m, --mode \u003cmode\u003e    Network mode [default: host]  [possible values: host, guest, spectator]\n    -n, --name \u003cname\u003e    Player name [default: planetoid]\n    -p, --port \u003cport\u003e    Port [default: 8080]\n```\n\n### Examples\n#### Running in solo mode\n`cargo run -- -s`\n\n#### Running in network mode with a spectator\nOn the first terminal:\n`cargo run -- -m host -n Planetoid`\n\nOn the second terminal:\n`cargo run -- -m spectator -n \"Planetoid spectator\"`\n\n#### Running in network mode, debug and as god\n`-dd`: debug, allows to see messages sent to the web socket.\n\n`-g`: god mode, player ship cannot be destroyed.\n\n`-n`: player name (default: planetoid)\n\n`cargo run -- -m host -dd -g -n Planetoid`\n\n#### Running in network mode with host and guest\nOn the first terminal:\n`cargo run -- -m host -n Planetoid`\n\nOn the second terminal:\n`cargo run -- -m guest -n \"Planetoid guest\"`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuggla%2Fplanetoid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuggla%2Fplanetoid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuggla%2Fplanetoid/lists"}