GithubHelp home page GithubHelp logo

Traffloat

GitHub GitHub

Simple issues Medium issues Complex issues

API issues Bug issues Documentation issues Feature issues Optimization issues Tooling issues

A 3D traffic, factory, city building, tower defense web game.

Play the game | Rust API docs | Discuss | Report bug

What is this game about?

This game happens in a self-sustaining space colony. The player constructs buildings and corridors in the colony to produce and transfer different resources.

This game is about logistics. Most resources are created from other types with factories. Insufifciency or excess of resources will bottleneck the game.

This game is about traffic. Resources are transferred in different forms (cargo, liquid, gas, electricity, human). Optimize transportation routes to maximize production rate.

This game is about city building. Inhabitants are produced in the colony to boost productivity. Build schools to improve inhabitant skills and unlock new technologies.

This game is 3D. Explore new transportation mechanisms in a genuinely 3D network of buildings. Become a leading architect for 3D cities.

This game is cooperative. Players can join the colonies of other players, or create new colonies and establish trades with existing colonies.

This game involves tower defense. Colonies are attacked by waves of asteroids in the space, which can be propelled or dissolved into raw resources.

Compilation

This project uses Rust nightly-2021-11-17. The toolchain version is automatically installed if you installed Rust with rustup.

This project requites the wasm target for the Rust toolchain. Install it by running the following command inside a traffloat clone:

rustup target add wasm32-unknown-unknown

This project uses just to manage script commands, and trunk to manage WebAssembly and site building. To install these tools:

cargo install trunk just

See the justfile for common commands, in particular:

# Compile the scenario files
just client-scenarios-dev
# Compile the client for production
just client-build

To compile for development mode, use just client-build-dev instead. There is also just client-watch, which compiles the client and start a dev server, and recompiles if files have been modified.

While development build claims to produce "optimized" output, LTO (link time optimization) in release build can further improve performance and reduce file size at the cost of longer compile time. The release build also triggers wasm-opt with optimization level 4, which takes a long time to execute (more than 15 minutes of CPU time).

Contribution

The game is composed of multiple crates:

  • codegen/codegen-raw: Defines procedural macros used in the game.
  • types: Defines standard data types of vectors, units and gamerule definition.
  • types: Defines scenario schema.
  • common: Implements game world simulation.
  • client: Implements a web game client.
  • tfsave-builder: CLI tool to compile scenarios from human-readable TOML files.

Create a thread in Discussions if you would like to contribute and don't know where to start.

Traffloat's Projects

api icon api

Rust API documentation for Traffloat, a cooperative web game of 3D logistics and space city building.

guide icon guide

User manual for Traffloat, a cooperative web game of 3D logistics and space city building.

legion icon legion

High performance Rust ECS library

traffloat icon traffloat

A cooperative web game of 3D logistics and space city building.

traffloat.github.io icon traffloat.github.io

Staging site for Traffloat, a cooperative web game of 3D logistics and space city building.

yew icon yew

Rust framework for building client web apps

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.