Code Monkey home page Code Monkey logo

rust-game-ports's Introduction

Rust Game Ports

Official host of games ported using Rust game libraries.

This project is intended to inform and help developers in the area of actual game programming with Rust and Rust game engines.

If you're a developer planning a contribution, it's crucial to read the Contribution Infos section.

Summary

The completed ports are:

Game Part of Source Language Source Libraries Port Libraries Tested on
Boing Code the Classics Vol. 1 Python PyGame Zero ggez 0.7 Linux
Catacomb II (SDL) - C SDL 2 Rust-SDL2 0.35 Linux
Cavern Code the Classics Vol. 1 Python PyGame Zero Macroquad 0.3 Linux
Soccer Code the Classics Vol. 1 Python PyGame Zero Fyrox 0.26 Linux
Rusty Roguelike Hands-on Rust: Effective Learning... Rust bracket-lib, Legion bracket-lib, Bevy (ECS) 0.7 Linux
Rusty Roguelike Hands-on Rust: Effective Learning... Rust bracket-lib, Legion Macroquad 0.3, Legion 0.3 Linux
Bunner Code the Classics Vol. 1 Python PyGame Zero Macroquad 0.3 Linux

Contribution Infos

Contributions are welcome!

Since this project is intended to be educational above all, it's important for the candidate ports to constitute proper examples ๐Ÿ˜„

In this section you'll find some suggestions to start a port, and the low and high level guidelines. Feel free to skip the first, but don't underestimate it! ๐Ÿ˜‰

Choosing and implementing a port

Devs motivated to implement a port are advised to be very careful with what they choose ๐Ÿ˜„

While some ports are straightforward, for example Rust+immediate mode library ("IML") -> Rust+IML, other types of port can be subtly challenging:

  • Dynamic language+IML (e.g. Python+Pygame -> Rust+ggez) are challenging for many reasons:
    • It's difficult to understand the exact structure/state of the classes/instances
    • Globals may be used
    • Numeric types can be difficult to ascertain, and the descriptions may be buggy (e.g. a number may accept negative values, while being described as accepting only positive ones)
  • IML -> Retained mode library are very time consuming, as they require a full redesign, an example can be porting a Rust game from ggez to Fyrox
  • Object oriented -> ECS is another time consuming one, since it requires a full redesign

For beginners, a good starting point is to take a Rust+IML project, e.g. Boing, and convert it to another IML, e.g. Macroquad.

More adventurous devs can start from a Python/PyGame source, and port it to Rust+IML.

Committed devs can perform ports that require a redesign (e.g. Fyrox Framework to Fyrox scripted).

It's not advised to perform a port that requires a language translation and a redesign

Low-level requirements

These are the low-level requirements for candidate projects (they will be automated, so they don't need to be actively take caren of ๐Ÿ™‚):

  • include a license in the port workspace (can be easily copied and edited from other similar projects)
  • work on stable Rust (this is because they ubiquitous Rust Analyzer has some open issues with nighly Rust)
  • be formatted according to cargo fmt
  • be linted according to cargo clippy -- -W clippy::correctness -D warnings
  • not have any unsafe code (it's not necessary for idiomatically ported games)
  • not use any highly unidiomatic Rust (e.g. globals)

High level guidelines

High level guidelines are under discussion. Generally speaking, ports should be performed according to the intended design of the game library used, since ports are meant to be examples for Rust game development. You'll be famous! ๐Ÿ˜Ž๐Ÿ˜‚

Screenshots

Boing:

Boing

Bunner:

Bunner

Cavern:

Cavern

Rusty Roguelike:

Rusty Roguelike

Soccer:

Soccer

Catacomb II:

Catacomb II

Port notes

Boing/ggez

A very straightforward port ๐Ÿ™‚

This port suffers from one (Winit) bug:

  • corruption when running on fullscreen (reported here).

Cavern/Macroquad

Another very straightforward port ๐Ÿ™‚

This port suffers from two Macroquad bugs:

  • the music starts with a delay (reported by another developer here);
  • on Nvidia cards, on Linux, CPU runs at 100% load (reported here).

Only the stable part of the library is used (the experimental scene API is not used).

Rusty Roguelike/Bevy ECS

The ECS part of this game, originally Legion, has been ported to Bevy (the graphic/input library used is still bracket-lib).

A mini book, "Learn Bevy's ECS by ripping off someone else's project", is based on this project.

Soccer/Fyrox

This port required a redesign, in order to move to a scene graph.

The port suffers from one Fyrox bug:

  • at least one sound plays with a delay (reported here).

Rusty Roguelike/Macroquad

The graphics portion of the Rusty Roguelike has been ported to Macroquad. The ECS used is still Legion, and the pathfinding is from bracket-lib).

Bunner/Macroquad

A straight port from PyGame Zero to Macroquad of this infinite frogger like game.

Catacomb II/SDL 2

This is an exact port of the source codebase, performed in two stages - first transpiling to unsafe Rust via C2Rust, then manually converting to safe Rust.

Since the objective was testing such type of port, the result is not idiomatic Rust; nonetheless, the code is still 100% safe, and the Rust-SDL2 library is properly used. More details are provided on the port project repository.

In order to play this game, the game datafiles are required; a pack with all the Catacomb games currently costs just 4$ on GOG.

rust-game-ports's People

Contributors

64kramsystem avatar cdsupina avatar ollej avatar ryanlambie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rust-game-ports's Issues

CI: Add caching for Clippy checks

The Clippy job is currently slow, since it requires some amount of compiling, and it's not cache.

Add caching, and verify that it improves the job.

Add remaining checks to CI

Add the remaining checks to the CI, listed in the README:

  • include a license in the root workspace
  • ensure that the source project is present
  • (extra): workspace name ($source-$engine)

Lagging issues with bevy

Have you noticed a weird lagging issue when moving around in the bevy port? It seems to be linked to the camera movement where the monsters are basically being rendered twice. Here is a gif of it happening Lagging

Port Boing and/or Cavern to Tetra

Although Tetra is in passive maintence, it is still a very valuable library, since it's backed by SDL, and it's very likely the only fully reliable Rust game library (Winit is not reliable, in particular, due to X11 bugs).

Porting Boing and/or Cavern should be an easy task.

Fix boing-ggez speed issues

With the 0.9.3 ggez release, boing has now speed issues:

  • on Linux, it's excessively fast
  • on Windows, it's somewhat faster than it used to be (although, it has never been tested on such platform)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.