A mini-game demo of BonsaiDb + Gooey

Overview

"Minority Game" Demo

CI Status HTML Coverage Report for main branch Documentation for main branch

Why build this?

This repository originally was created for a presentation at the December Rust Gamedev Meetup. @ecton recorded the entire process of creating and deploying the app starting from the Gooey + BonsaiDb example and a fresh Ubuntu 20.04 virtual server.

The deployed version of this repository is available at minority-game.gooey.rs.

The video of the creation through commit b9f80e4 is available to view on YouTube or on Odysee.

What is this?

This demo is an exploration of the Minority Game. Every player has a happiness score that can range from 0% happy to 100% happy. If less than 50% of players elect to go out instead of staying in, the players that go out will have a great time and their happiness will increase. If too many players go out, however, the players that go out will have a bad time and lose happiness. Players that elect to stay in will gravitate towards neutral happiness (50%).

The game also features a "tell" mechanic, which allows players to tell other players what they plan on doing. Players don't have to tell their intentions, and they don't have to tell the truth.

This game can be played in the web browser or natively, and features a minimal leaderboard webpage.

What is this a demo of?

This demo combines two large projects that we at Khonsu Labs are working on: BonsaiDb and Gooey.

How is BonsaiDb being used?

BonsaiDb is providing these features:

  • Storage of player data + Querying for leaderboard statistics
  • All network connectivity, including:
    • TCP connections over port 80/443:
      • Delegates connections to an TcpService, which this example uses Axum to process HTTP requests
      • Provides logic to allow upgrading an existing connection to a BonsaiDb WebSocket, allowing for browser apps to communicate with the database server.
      • Handles TLS-ALPN-01-based ACME certificate acquisition via LetsEncrypt over port 443.
    • QUIC connections (UDP-based) over port 5645:
      • Provides the same API as the WebSockets, but over a superior protocol to TCP + TLS.
  • The main server executable functionality via the built-in cli.
  • Role-based access control: This example doesn't have any roles or multi-user support (yet), but the permissions system is enforcing that clients that connect to the server cannot perform any database operations.

How is Gooey being used?

Gooey's goal is to create applications using as little platform-dependent code as possible. This example was able to only use one set of compile-time dependent code: when building for WASM, the client needs to connect to a different URL because the browser doesn't support non-HTTP QUIC connections.

At the time of building this example, Gooey is incredibly early in development, and the layout utilities included are severly lacking. This example is not meant to be much of a demo of Gooey, but more an ends-to-a-means of being a simple way to show using BonsaiDb both natively and in the browser using the same client library and code.

Open-source Licenses

This project, like all projects from Khonsu Labs, are open-source. This repository is available under the MIT License or the Apache License 2.0.

To learn more about contributing, please see CONTRIBUTING.md.

You might also like...
Conway's Game of Life implemented for Game Boy Advance in Rust

game-of-life An implementation of a Conway's Game of Life environment on GBA. The ultimate game should have two modes: Edit and Run mode which can be

A game made in one week for the Bevy engine's first game jam

¿Quien es el MechaBurro? An entry for the first Bevy game jam following the theme of "Unfair Advantage." It was made in one week using the wonderful B

A Client/Server game networking plugin using QUIC, for the Bevy game engine.
A Client/Server game networking plugin using QUIC, for the Bevy game engine.

Bevy Quinnet A Client/Server game networking plugin using QUIC, for the Bevy game engine. Bevy Quinnet QUIC as a game networking protocol Features Roa

Managed game servers, matchmaking, and DDoS mitigation that lets you focus on building your game
Managed game servers, matchmaking, and DDoS mitigation that lets you focus on building your game

Managed game servers, matchmaking, and DDoS mitigation that lets you focus on building your game. Home - Docs - Twitter - Discord 👾 Features Everythi

A Rust wrapper and bindings of Allegro 5 game programming library

RustAllegro A thin Rust wrapper of Allegro 5. Game loop example extern crate allegro; extern crate allegro_font; use allegro::*; use allegro_font::*;

A refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

Rust library to create a Good Game Easily

ggez What is this? ggez is a Rust library to create a Good Game Easily. The current version is 0.6.0-rc0. This is a RELEASE CANDIDATE version, which m

A modern 3D/2D game engine that uses wgpu.
A modern 3D/2D game engine that uses wgpu.

Harmony A modern 3D/2D game engine that uses wgpu and is designed to work out of the box with minimal effort. It uses legion for handling game/renderi

RTS game/engine in Rust and WebGPU
RTS game/engine in Rust and WebGPU

What is this? A real time strategy game/engine written with Rust and WebGPU. Eventually it will be able to run in a web browser thanks to WebGPU. This

Owner
Khonsu Labs
Khonsu Labs
Solana Game Server is a decentralized game server running on Solana, designed for game developers

Solana Game Server* is the first decentralized Game Server (aka web3 game server) designed for game devs. (Think web3 SDK for game developers as a ser

Tardigrade Life Sciences, Inc 16 Dec 1, 2022
Rust/Javascript interop demo with miniquad

Rust/Javascript interop demo with miniquad

Fedor Logachev 3 Mar 16, 2022
Victorem - easy UDP game server and client framework for creating simple 2D and 3D online game prototype in Rust.

Victorem Easy UDP game server and client framework for creating simple 2D and 3D online game prototype in Rust. Example Cargo.toml [dependencies] vict

Victor Winbringer 27 Jan 7, 2023
2-player game made with Rust and "ggez" engine, based on "Conway's Game of Life"

fight-for-your-life A 2-player game based on the "Conway's Game of Life", made with Rust and the game engine "ggez". Create shapes on the grid that wi

Petros 3 Oct 25, 2021
2d Endless Runner Game made with Bevy Game Engine

Cute-runner A 2d Endless Runner Game made with Bevy Game Engine. Table of contents Project Infos Usage Screenshots Disclaimer Project Infos Date: Sept

JoaoMarinho 2 Jul 15, 2022
A tetris game I wrote in rust using ncurses. I'm sure that there's a better way to write a tetris game, and the code may be sus, but it techinically works

rustetris A tetris game I wrote in rust using ncurses. I'm sure that there's a better way to write a tetris game, and the code may be sus, but it tech

Eric G 3 Oct 15, 2022
A game for the game jam "1-Button Jam 2021"

One click ninja A game for the game jam "1-Button Jam 2021" written in Rust with the Bevy engine. A rhythm game, where you play a soldier that can def

Alex Helfet 7 Apr 12, 2022
A game of snake written in Rust using the Bevy game engine, targeting WebGL2

Snake using the Bevy Game Engine Prerequisites cargo install cargo-make Build and serve WASM version Set your local ip address in Makefile.toml (loca

Michael Dorst 0 Dec 26, 2021
Wasm game of life - A Rust and WebAssembly tutorial implementing the Game of Life

wasm_game_of_life Conway's Game of Life in Rust and WebAssembly Contributing | Chat Built with ?? ?? by The Rust and WebAssembly Working Group About T

Rust and WebAssembly 236 Dec 24, 2022
My first attempt at game programming. This is a simple target shooting game built in macroquad.

sergio My first attempt at game programming. This is a simple target shooting game built in macroquad. Rules Hit a target to increase score by 1 Score

Laz 1 Jan 11, 2022