Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rustcycles/rustcycles

A fast multiplayer shooter on wheels written in Rust using the Fyrox engine. Free and open source.
https://github.com/rustcycles/rustcycles

foss foss-game game game-3d open-source-game third-person-shooter tron

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

        


RustCycles


A fast multiplayer shooter on wheels


[![GitHub](https://img.shields.io/badge/github-rustcycles/rustcycles-8da0cb?logo=github)](https://github.com/rustcycles/rustcycles)
[![License (AGPLv3)](https://img.shields.io/github/license/rustcycles/rustcycles)](https://github.com/rustcycles/rustcycles/blob/master/LICENSE)
[![CI](https://github.com/rustcycles/rustcycles/workflows/CI/badge.svg)](https://github.com/rustcycles/rustcycles/actions)
[![Audit](https://github.com/rustcycles/rustcycles/workflows/audit/badge.svg)](https://rustsec.org/)
[![Dependency status](https://deps.rs/repo/github/rustcycles/rustcycles/status.svg)](https://deps.rs/repo/github/rustcycles/rustcycles)
[![Discord](https://img.shields.io/badge/-Discord-7389d8?logo=discord&label=&logoColor=ffffff&labelColor=6A7EC2)](https://discord.gg/cXU5HzDXM5)

[![Total lines](https://tokei.rs/b1/github/rustcycles/rustcycles)](https://github.com/rustcycles/rustcycles)
[![Lines of comments](https://tokei.rs/b1/github/rustcycles/rustcycles?category=comments)](https://github.com/rustcycles/rustcycles)

![Gameplay](https://github.com/rustcycles/rustcycles/assets/4079823/5411df7a-6d31-482b-b3a0-ab3256f5280e)

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](https://github.com/martin-t/rec-wars). 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](https://spicylobster.itch.io/jumpy/devlog/337996/everlasting-games).

![Spectating](https://github.com/rustcycles/rustcycles/assets/4079823/f6ad566c-54f0-49c0-9a2a-5019e908f09e)

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):

```json
"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](LICENSE) or newer