Code Monkey home page Code Monkey logo

RustCycles

A fast multiplayer shooter on wheels

GitHub License (AGPLv3) CI Audit Dependency status Discord

Total lines Lines of comments

Gameplay

RustCycles is a FOSS third person multiplayer arena shooter that's about movement, not aim. You have to be smart and think fast.

This is just barely a prototype. There's no real gameplay yet, just basic physics and some networked projectiles.

RustCycles is developed in lockstep with RecWars. Even though they are very different, built on different engines, they share the general architecture. Ideas are tested in one game, then ported to the other.

The ultimate goal is to create a fully moddable multiplayer game playable in the browser and natively on Linux, Windows and macOS. RecWars is built in the spirit of everlasting games.

Spectating

Currently RustCycles is the only open source Fyrox game which uses networking. If you're also writing a multiplayer game in Fyrox, feel free to ping me on Fyrox's or RustCycles' discord to exchange notes and ideas.

Multiplayer shooters are large and complex projects and 80% of the code is not game specific. I am looking to collaborate with anyone making a similar game. The plan is to identify generic parts and build RustCycles into a FPS-specific Fyrox "subengine" that provides a solid foundation for first/third person shooters so everyone can focus on the parts that make their game unique.

Building

There are no prebuilt binaries and no web version yet, you have to build the game yourself.

  • RustCycles uses git submodules for its assets. To clone the repo, use git clone --recurse-submodules [email protected]:rustcycles/rustcycles.git. If you have already cloned it without submodules, use git submodule update --init --recursive.

  • If on linux, install dependencies (debian example): sudo apt install libasound2-dev libudev-dev pkg-config xorg-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libfontconfig1-dev

  • After that, just use cargo run.
    • No need to use --release it should run fast enough in debug mode because deps are optimized even in debug mode (see Cargo.toml).

Development

Currently using git submodules for assets because GitHub's LFS has a tiny 1 GB per month bandwidth limit that's not sufficient already with just a couple MB of data and won't scale. Committing assets into the main repo would cause its size to grow irreversibly. A separate repo as a submodule allows us to keep the main repo small without overwriting history. The data repo can then be either squashed or replaced with a fresh one if the history gets too large.

Fast compiles (optional)

You can make the game compile significantly faster and iterate quicker:

Use nightly, lld and -Zshare-generics

  • Run this in project root: ln -s rust-toolchain-example.toml rust-toolchain.toml; cd .cargo; ln -s config-example.toml config.toml; cd -
  • Reduction from 12 s to 2.5 s

Prevent rust-analyzer from locking the target directory

If you're using RA with clippy instead of check, add this to your VSCode config (or something similar for your editor):

"rust-analyzer.server.extraEnv": {
    "CARGO_TARGET_DIR": "target/ra"
}

Explanation: Normally, if rust-analyzer runs cargo clippy on save, it locks target so if you switch to a terminal and do cargo run, it blocks the build for over a second which is currently a third of the build time. This will make rust-analyzer make use a separate target directory so that it'll never block a build at the expense of slightly more disk space (but not double since most files don't seem to be shared between cargo and RA). Alternatively, you could disable saving when losing focus, disable running check on save or use the terminal inside VSCode to build RustCycles.

On linux, use the mold linker

  • ~/your/path/to/mold -run cargo build
  • Reduction from 2.5 s to 2.3 s
  • Might not be worth it for now (you need to compile it yourself), maybe when the game gets larger

Check formatting on commit (optional)

Enable extra checks before every commit: copy/symlink pre-commit-example to pre-commit and run git config core.hooksPath git-hooks. It gets checked on CI anyway, this just catches issues faster.

LICENSE

AGPL-v3 or newer

RustCycles's Projects

data icon data

Assets for RustCycles in a separate repo to avoid polluting its history with large files.

rustcycles icon rustcycles

A fast multiplayer shooter on wheels written in Rust using the Fyrox engine. Free and open source.

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.