This Month in Rust GameDev #36 - July 2022
Welcome to the 36th issue of the Rust GameDev Workgroup's monthly newsletter. Rust is a systems language pursuing the trifecta: safety, concurrency, and speed. These goals are well-aligned with game development. We hope to build an inviting ecosystem for anyone wishing to use Rust in their development process! Want to get involved? Join the Rust GameDev working group!
You can follow the newsletter creation process by watching the coordination issues. Want something mentioned in the next newsletter? Send us a pull request. Feel free to send PRs about your own projects!
- Game Updates
- Engine Updates
- Learning Material Updates
- Tooling Updates
- Library Updates
- Other News
- Requests for Contribution
Rust GameDev Meetup
The 18th Rust Gamedev Meetup took place in July. You can watch the recording of the meetup here on Youtube. Here was the schedule from the meetup:
- RustConf Arcade Cabinet - @carlosupina
- Blackjack - @setzer22
- Dotrix - @lowenware
- Graphite - @GraphiteEditor
The meetups take place on the second Saturday every month via the Rust Gamedev Discord server and are also streamed on Twitch. If you would like to show off what you've been working on at the next meetup on August 13th, fill out this form.
Rust Game Ports Officialization
64kramsystem's Rust Game Ports project has been officially adopted by the Rust game development working group.
The project is intended to be a reference for Rust game development, helping developers, especially newcomers, to understand how to use Rust game libraries, and design Rust games in general.
Devs are invited to explore and contribute! There are ports for all the levels and interests 😄
Ferris 3D Got Released!
@RayMarch created a 3d model of Ferris the Rustacean for the Rust community!
The model is now available for free here on github!
It was released into the public domain so you can use it however you like, even commercially!
Tokyo Rust Game Hack Event: Aug 12th
The team at tonari.no is back with the second edition of the Tokyo Rust Game Hack event!
For this edition of the Game Hack event, we're dragging you back through the mists of time, to the earlier days of arcade games. We've built a Bevy-powered, simple reimagining of classic Bomberman, with a modern twist. Players don't participate by taking turns on an arcade stick. Instead, we will provide a crate that defines the character's interaction with the world through a Player trait. By simply implementing that trait and compiling to a wasm target, you'll be able to upload your character to the game, live. Adapt your strategy on the fly and bomb your way into the scoreboard!
The player template repository is open sourced ahead of time so you can get a nice headstart.
If you decide to come please sign up on the event's page. You can participate physically or online, see the full announcement for the details.
Way of Rhea
Way of Rhea is a puzzle adventure with hard puzzles and forgiving mechanics being produced by @masonremaley in a custom Rust engine. You can support development by checking out the free demo and wishlisting on Steam!
Way of Rhea was selected to be part of PAX Rising online! It was also shown off in the June Steam Game Festival. Other recent updates:
- Kotaku mentioned Way of Rhea in an article about fascinating upcoming indie games
- Lost In Cult, a gaming journal, announced preorders for a new edition of Lock On containing a card game containing a card with a character from Way of Rhea featured
- Mason posted a video interview covering why he became an indie dev, among other things
- Work has begun on puzzles for the final level of the game. This area combines the puzzle elements from all previous biomes for a final set of challenging puzzles.
- A weather system with rain and snow was added to the game
- More progress was made on the unreleased Linux platform layer
- More wildlife was added to the game
- Some logging and editor improvements were made
Flesh by @im_oab is a 2D-horizontal shmup game with hand-drawn animation and an organic/fleshy theme. It is implemented using Tetra. This month's updates include:
- The game has BGM.
- Support global leaderboard.
- Integrate steam SDK using steamworks crate.
- Add new enemy types for the 3rd area.
- Add squeezing effect when the enemy gets hit.
The server and clients are able to smoothly handle over a thousand balls rained from above
CyberGate (YouTube, Discord) by CyberSoul is a new multiplayer project that aims at procedurally generating distinct universes and gameplay experiences. CyberGate is the name of the main world where universes can be created and accessed by quantum portals.
- Bandwidth became 16 times smaller by implementing entity prioritization + other techniques.
- Interpolation and Jitter prediction makes entities way smoother.
- Automatic and Reliable Spawn and Despawn of entities.
- Many other features and optimizations to do with rapier 3d physics, wgpu renderer, and quinn (quic) protocol.
Join the Discord server to participate in tests.
Botnet is an upcoming programming-based multiplayer game, where you write scripts (compiled to WebAssembly) to control robots. Coordinate your network of bots to gather resources, build new industry, and expand your control of the server!
This month was primarily spent on BotnetReplayViewer - a visual program to watch matches and inspect entity data.
Additionally, the antenna structure was added. Building an antenna gives you control over the bay (room) it's in, letting you build additional structures, and increasing the total number of bots you can control. Bots can also use antennas to store resources.
Interested in contributing? Head over to the Github discussion page and suggest some ideas!
Re-Rolling! by @mystalice is a top-down 2D survival shooter where you fight off a horde of rats using weapons you randomly rolled.
The game was created for GMTK Jam 2022 in 48 hours and was heavily inspired by 20 Minutes Till Dawn.
Re-Rolling! was made with Bevy using heron for physics, bevy_egui for in-game UI, and a handful of other helpful crates and plugins. You can browse the source on GitHub.
Robo Instructus: 3 Years Old
In 2019 the programming puzzler Robo Instructus was released on Steam & itch.io.
This month Alex Butler wrote "Robo Instructus: 3 Years Old" about how well the game did in the last year & to date: Sales by platform/country/OS, player feedback, reviews & game updates.
a Simon Arcade gameplay with cheats enabled
Based on Simon (Original), made with Bevy, the goal of this game is to push buttons in the correct order, in an ever-increasing sequence.
This game was made to fit with the Rust Arcade Cabinet and was showcased at RustConf Portland on August 5th 2022.
New cave systems to explore
Veloren is an open world, open-source voxel RPG inspired by Dwarf Fortress and Cube World.
In July, Veloren released 0.13! You can read the full blog post that includes a trailer for the release party, and information about the new features in the release. This release party set a new record for most players on the server at once, going from 195 to now 277! This version brings modular weapons, real-time weather, cliff towns, cave biomes, level of detail trees, and much more.
Other than the release party, July saw lots of work getting done. The translation system is undergoing an overhaul. Work is being done on the Scrolling Combat Text system, which gives some visual indicator to how much damage or healing you're taking. Though is going into how to better handle server-side physics to reduce latency.
July's full weekly devlogs: "This Week In Veloren...": #179, #180, #181, #182.
Agma by @TuckerBMorgan is a 3D game built in the Storm Engine that is based on games like Lost Ark and Diablo. The author has been writing about their experience with changing how they approach working on personal projects here. It is built using a custom UDP-based networking stack, a custom ECS, and a custom-skinned mesh renderer to maximize what the author could learn.
Seamless transition between planet and space views
Combine&Conquer by Martin Buck is a WIP strategy game about automation similar to Satisfactory or Factorio. This month's updates include:
- Audio support, a new space view, colonization of planets, inventory overlay, and better notifications.
- New textures for structures, info box, updated overlays and modles.
Bytellation shared the first video devlog of a WIP ecosystem coding game "Life Code":
The game is intended to run in the browser and will be written in Rust which will be compiled to WASM. I'm using a very new and not yet matured game engine called Bevy. I will be creating the art and models in the game using Blender.
Bevy-shaped mountains in a Bevy-based Witcher 3 terrain texturing tool built by rmemr
Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open source forever!
Bevy 0.8 was a massive community effort. You can check out the full release blog post here, but here are some highlights:
- New Material System
- Camera-driven Rendering
- Built-in Shader Modularization
- Spot Lights
- Visibility Inheritance
- Upgraded to wgpu 0.13
- Automatic Mesh Tangent Generation
- Renderer Optimizations
- Scene Bundle
- Scripting / Modding Progress
- ECS Query Ergonomics and Usability
- ECS Internals Refactors
- Reflection Improvements
- Hierarchy Commands
- Bevy UI Now Uses Taffy
Discussions: /r/rust, Hacker News, Twitter
Dims (Twitter, Discord, YouTube) is a pre-alpha collaborative open-world creation platform. Users can hop in sessions and build a game together, allowing everyone to bring out their inner game-maker.
In July, development continued to make great strides. Some of the highlights include:
- Continued work on the audio system, including in-game graphs of attenuation and other audio-related functions
- The introduction of an intent system that allows for user actions to be undone and replayed arbitrarily
- A complete UI facelift using Material UI icons and a new design language
- A new scripting system using WebAssembly + WASI and Rust as a guest language (look forward to an article on this soon!)
- The beginnings of a shared asset database that lets you and your team easily share assets amongst each other and with other projects
- Various infrastructural and rendering fixes, including more accurate PBR
Want to try Dims out for yourself? Come join the Discord to be notified of future public tests, see the latest features before everyone else, and to talk to the devs personally.
godot-rust (GitHub, Discord, Twitter) is a Rust library that provides bindings for the Godot game engine.
The last few months have been a bit quieter around godot-rust. A lot of this can be attributed to developers exploring the GDExtension API, the successor of GDNative for Godot 4. At this point, a lot of the foundation is still being built, however, some more concrete plans are outlined in #824. Further updates will be posted in that issue or on Twitter.
Nevertheless, several improvements have been integrated to godot-rust since 0.10, with version 0.10.1 on the horizon. Some notable examples:
- GDScript utility functions like lerp, ease or linear2db (#901)
- Property support for standard collection types (#883)
- Methods for Rect2 and Aabb (#867)
WASM 3d CPU Rendering On a 2d Fantasy Console?
Gamercade (Discord, Github) by @RobDavenport is a WASM-powered fantasy console focused on building multiplayer neo-retro games.
After over half a year in development, Gamercade and related tools are ready for pre-alpha testing. This includes the console itself, as well as the editor.
Gamercade's killer feature is the ease of developing multiplayer games. The console is able to simplify networked game development process in the best way possible: build a local multiplayer game, and get full online play for free!
The WASM Api features powerful but simple built-in features like input, 2d graphics, random number generation, and more. Limitations do exist, but are flexible, such as resolutions up to 1920 x 1080, and a maximum of 256 color palettes with up to 64 colors each.
The community around the project is small, but is looking to expand. Come on over to the [subreddit][Gamercade-Subreddit], or hang out and chat on Discord, where the developers interact with members and post updates daily. The project is newly open source and looking for contributors, suggestions, as well as awesome game demos.
Discussions: /r/rust_gamedev, /r/fantasyconsoles
Learning Material Updates
Sand Fall With Compute Shaders in Rust
@hakolao published a tutorial about creating cellular automata sand fall simulations with compute shaders.
Typically, cellular automata sand fall is done with the CPU due to the two-way relationship between the cells on a grid. This article shows a way to tackle sand fall creation using compute shaders to achieve massive parallelism.
Additional to compute shaders, this tutorial is a great introduction to the Vulkano library. It also works as a good base for learning how to create simple graphics pipelines. You will also get to use Bevy and Egui.
Pathfinding in Rust
Pathfinding in Rust: A tutorial with examples is an article with examples of how to use the pathfinding crate to do breadth-first, Dijkstra's, and A* search. It links to the gregstoll/rust-pathfinding repo which has working code for all of these.
Creating Mountains From Planes with Vertex Shaders and Bevy
Creating mountains from planes with vertex shaders and Bevy
@chrisbiscardi published a video about using the new Material shader APIs in Bevy 0.8 to transform the vertex positions in a custom mesh plane using a vertex shader.
What's in a wgsl fragment shader? ft Bevy
What's in a wgsl fragment shader? ft Bevy
@chrisbiscardi published a video that introduces the new Material APIs in Bevy 0.8. It covers AsBindGroup, uniforms, and using Perlin Noise in a fragment shader to render different colors onto a cube in a variety of ways.
Rusteroids is a tutorial recreating a clone of Asteroids in Rust, using SDL2 and the Specs library.
New episodes are released weekly and added to the playlist. The most recent video shows how to safely create global state to store global values, such as the high score. The most recent code has been released for Windows, on Itch.io (with other platforms coming soon).
You can subscribe to the YouTube Channel, to never miss an episode, or follow @ecatstudios on Twitter!
RuggRogue Source Code Guide
@tung has been working on a simple web-playable roguelike RuggRogue inspired by the Rust Roguelike Tutorial and documented the source code structure in a guide:
If you want to learn about the source code, you'll also want to check out the RuggRogue Source Code Guide: a 23-chapter technical web book about the ideas, algorithms and structure of the code. It covers topics such as rendering, event handling, game states, the hand-rolled field of view and pathfinding calculations, game balance and more.
Discussions: /r/roguelikes, /r/rust
NES Bundler in action
NES Bundler is a NES ROM packaging tool by @tedsteen. Did you make a NES-game but none of your friends own a Nintendo? Don't worry. Put your ROM and configuration in NES Bundler and build an executable for Mac, Windows or Linux. What you get is a single executable with
- Simple UI for settings
- Re-mappable Keyboard and Gamepad input (you bundle your default mappings).
- Save/Restore state
It's early days, but the key features are there, and work is ongoing to make it more mature!
Blackjack by @setzer22 is a new procedural modeling application made in Rust, using rend3, wgpu, and egui. It follows the steps of applications like Houdini, or Blender's geometry nodes project and provides a node-based environment to compose procedural recipes to create 3d models.
The focus for the past few months has been on evolving Blackjack from a proof of concept into a usable application. Its current status is not yet production ready, but it can now be used to build complex procedural models editable inside a game engine thanks to its new engine integration system.
Some of the new features include:
- A better data model for meshes, based on groups and channels.
- Game engine integration with Godot, more engines coming soon.
- Introduce Lua as an extension language.
- Add many new nodes: Extrude along curve, Copy to points...
- Add experimental support for L-Systems.
- Reworked Look & Feel
A talk about Blackjack's vision and a tour of its features was shared at the start of July in the Rust gamedev meetup. Interested developers are encouraged to check the project out on GitHub and post on the Discussion boards!
bevy_shadertoy_wgsl and GLSL2WGSL
bevy_shadertoy_wgsl is a Shadertoy clone for the Bevy game engine, where the GLSL shader language is replaced by WGSL. It already comes with a dozen examples and plenty more to go. Feel free to add your own shaders to the list!
Plus, GLSL2WGSL is a new translator tool that should help migrate the vast majority of GLSL code to WGSL.
The above GIF showcases the new additions to the examples for bevy_shadertoy_wgsl: two shaders originally written in Shadertoy by @leondenise, and translated to WGSL with the help of GLSL2WGSL. The first part is a reproduction of Joe Gardner from the movie Soul, and the second part is a lightweight fluid shader.
Graphite (website, GitHub, Discord, Twitter) is a free, in-development raster and vector 2D graphics editor that will be based around a Rust-powered node graph compositing engine.
July's sprint focused on editor-centric refactors upgrading stopgap measures to more robust systems.
- Making a splash: The default document is replaced by a welcome splash screen following a refactor allowing for zero open documents.
- Modifying for Macs: Input handling supports the nonstandard modifier keys on Mac keyboards, including labels in the UI.
- Setting a high bar: The menu bar cleans up actions and supports new ones like "File" > "Import". Displayed hotkeys are based on the actual key mapping source, varying by OS.
- Keeping organized: The editor codebase is restructured to cut away technical debt and create consistency for new contributors and better docs going forward.
Open the Graphite editor in your browser to give it a try and share your creations with #MadeWithGraphite on Twitter.
Nintendo Switch Will Be a Tier 3 Target in Rust 1.64
The pull request by @jam1garner that adds a no_std support for the aarch64-nintendo-switch-freestanding target was merged this month after a lengthy legal investigation. This is the first step towards working on incrementally adding support for the Nintendo Switch. Check out this Twitter thread for more details about the changes.
And btw, speaking of Nintendo targets: the std support for the Nintendo 3DS (armv6k-nintendo-3ds) was also merged this month!
bevy_godot is an in-development library that offers a familiar Bevy environment inside of the Godot Engine. bevy_godot currently features Scene Tree integration, collision detection, spawning Godot scenes from Bevy, and included examples to demonstrate the API. The upcoming update will feature Godot signal events, Bevy assets integration, and a full implementation of the Dodge the Creeps example game.
bevy_godot is looking for contributors to help grow the library to fit all Godot Engine game development needs.
hecs is a fast, lightweight, and unopinionated archetypal ECS library.
Version 0.8 marks a breaking change to most methods that
previously took a generic type parameter
T: Component, replacing them with
methods taking type parameters which must be references to component types
instead. This resolves a long-standing footgun where users accustomed to writing
&T in queries might write
world.get::<&T>, interpreted by rustc as
referencing the valid component type
&'static T, resulting in code that
compiles but fails to access the intended component.
bevy_mod_wanderlust (GitHub) by @PROMETHIA-27 is a character controller plugin for Bevy engine.
Inspired by this excellent video, it is implemented on top of Rapier physics and highly customizable. Wanderlust includes a variety of settings to target many different character controller types, including 2D/3D platformers, spacecraft, and first/third person games.
Lyon (GitHub) by Nical is a collection of crates providing various 2D vector graphics utilities, including fast tessellation algorithms, easy to integrate in typical GPU accelerated rendering engines.
Lyon made its symbolic 1.0.0 release reflecting the stability of the project. Highlights in this release include:
- Initial support for variable line width in the stroke tessellator.
- An efficient algorithm to query positions at given distances along a path.
- Improved support for specifying custom endpoint attributes in paths and algorithms.
- And more. You can read the announcement blog post here.
Demo using renet and bevy
Renet by @lucaspoffo is a network library to create games with the Server-Client architecture.
Built on top of UDP, it has its own protocol to send and receive reliable messages more suited for fast-paced games than TCP. Some other features are:
- Connection management
- Authentication and encrypted connections
- Communication through multiple types of channels:
- Reliable Ordered: guarantee ordering and delivery of all messages
- Unreliable Unordered: no guarantee of delivery or ordering of messages
- Block Reliable: for bigger messages, such as level initialization
- Packet fragmentation and reassembly
Renet comes with bevy_renet, a plugin for the Bevy engine, and also with renet_visualizer, an egui interface to visualize network metrics.
VirtualBox, gl2 as the only GPU acceleration available
miniquad is a safe and cross-platform rendering library focused on portability and low-end platform support.
This month OpenGl 2.1/GLESv2 PR got merged, adding support for old android phones, virtual machines, and just old computers. While the PR itself is quite small, it solved a very old design issue: compatibilities proposal. Fixing this issue opened the door for both lower-end backends, like gl1, and higher-level backends. Metal is the next in line.
model courtesy of Samuel Rosario, rendered in bevy
bevy_mod_fbx is a pre-alpha library to load FBX (Autodesk Filmbox) files into bevy 0.8, based on fbxcel-dom. It currently:
- Loads geometry and meshes
- Loads mesh attributes such as color
- Loads default material diffuse textures, normal maps, and emissive maps
- Loads the custom Maya PBR materials, including all material textures
- Load the scene tree and translate it to bevy's hierarchy
Planned features include providing a basic Lambert/Phong shader to better handle more standard materials, loading animations and skinned mesh skeletons/rigs.
The project is poorly tested and is looking for testers. It will soon be available on crates.io.
shame lets you author shaders and pipeline layouts in a single seamless piece of rust code. It offers:
- a simple and lightweight setup,
- type checks from input assembly all the way to fragment output,
- (re)generate different shaders/pipelines based on runtime parameters,
- shader hot reloading,
- examples using wgpu!
A Discord channel for questions/feedback is linked in the Github readme.
A visualization of a simple NPC behavior tree
bonsai-bt by @Sollimann is a Rust implementation of behavior trees.
A Behavior Tree (BT) is a data structure in which we can set the rules of how certain behaviors can occur and the order in which they would execute. BTs are a very efficient way of creating complex systems that are both modular and reactive. These properties are crucial in many applications, which has led to the spread of BT from computer game programming to many branches of AI and Robotics.
shades and shades-edsl
@phaazon has published a detailed article that introduces shades and shades-edsl - two Rust crates to write shaders by writing pure Rust:
- The shades crate provides all needed types and other building blocks
- while shades-edsl provides a proc-macro EDSL for transforming regular Rust code into the API from shades.
This crate provides an EDSL to build shaders, leveraging the Rust compiler (rustc) and its type system to ensure soundness and typing. Because shaders are written in Rust, this crate is completely language agnostic: it can in theory target any shading language - the current tier-1 language being GLSL. The EDSL allows to statically type shaders while still generating the actual shading code at runtime.
fdg by @grantshandy is a force-directed graph drawing framework.
The goal of this project is to provide a force-directed graph framework and algorithms for Rust, as well as 2D and 3D visualizers that work on the web and desktop. It sits on top of petgraph and manages the positions of your nodes.
You can view all the examples online here.
The project consists of three parts:
- fdg-sim - the underlying force simulation framework that handles your dataset's positions based on a physics engine of your choice (or creation).
- fdg-macroquad - a visualizer that uses macroquad for rendering.
- fdg-img - a SVG visualizer for your graphs.
- Other game updates:
- Hydrofoil Generation devs shared a bunch of screenshots and videos with a new boat.
- @epcc10 shared a few videos about Idu getting a better water rendering and physics and better interaction with soil.
- Felix Windström shared a couple of Paddlepunks updates: a wizard leveling up their walls, and increased the active time on witch's doritos.
- Legend of Worlds released their first devlog.
- The Bounce Up! block breaker game shared a video preview of the practice mode.
- Theta Wave is now is now playable in the browser on itch.io. Give it a try and let the author know what you think!
- Fish Folly posted a couple videos of their new AI and the falling over mechanic.
- Punchy v0.0.2 and v0.0.3 were released, featuring scenes, egui UI, AI, playable web build, new enemy variants, controller remapping, and throwable bottles.
- Other tooling updates:
- annelid is a speedrun timer with autosplitter for fxpak/sd2snes written using egui.
- unitypacker is a tool for creating .unitypackages from the command line.
- Other learning material updates:
- @PhaestusFox released a bunch of Bevy tutorial videos covering: gamepads, touch input, bevy 0.8 update & migration, and hierarchy.
- The "Learn WGPU" tutorial was updated to wgpu v0.13.
- KyleMayes has ported vulkan-tutorial.com to vulkanalia.
- bevy_roguelike is a project that implements reusable Bevy ECS systems and components for writing roguelike games.
- Other library updates:
- wgpu v0.13 and naga v0.9 bring the newest WGSL spec support, improved presentation and pipelining, and lots of performance and correctness improvements. The devs also decided to make the DX12 backend default on Windows and are looking for testers.
- bevy_pancam is a 2d-camera plugin for Bevy that works with orthographic cameras.
Requests for Contribution
- 'Are We Game Yet?' wants to know about projects/games/resources that aren't listed yet.
- Graphite is looking for contributors to help build the new node graph and 2D rendering systems.
- winit's "difficulty: easy" issues.
- Backroll-rs, a new networking library.
- Embark's open issues (embark.rs).
- wgpu's "help wanted" issues.
- luminance's "low hanging fruit" issues.
- ggez's "good first issue" issues.
- Veloren's "beginner" issues.
- A/B Street's "good first issue" issues.
- Mun's "good first issue" issues.
- SIMple Mechanic's good first issues.
- Bevy's "good first issue" issues.
That's all news for today, thanks for reading!
Want something mentioned in the next newsletter? Send us a pull request.
Also, subscribe to @rust_gamedev on Twitter or /r/rust_gamedev subreddit if you want to receive fresh news!
Discuss this post on: /r/rust_gamedev, Twitter, Discord.