Code Monkey home page Code Monkey logo

ballxworld's Introduction

BallX World

A voxel-based sandbox game using Vulkan, SDL2 and Rust.

Screenshot of the game

Building on ArchLinux

Dependencies

Make sure to have the latest Rust (nightly) and graphics drivers with Vulkan support installed and working first.

Other dependencies:

sudo pacman -Syu --needed vulkan-devel shaderc sdl2

Downloading & building

git clone https://github.com/eigenraven/ballxworld.git ballxworld
cd ballxworld
cargo update
cargo build [--release] # Add release if you want a fully optimized build

Running

Running debug build: cargo run

Running debug build directly: ./target/debug/ballxworld

For RenderDoc, set the executable to PROJECT/target/debug/ballxworld working directory to PROJECT, and arguments to -renderdoc

You can adjust rendering settings in the settings.toml file, which should be auto-generated after the first start of the game.

Development

To perform lint checks on the code: cargo clippy [--package bxw_world]

To reformat code before a commit: cargo fmt [--package bxw_world]

To recompile modified GLSL shaders into SPIR-V: make

Implementation notes

Coordinate system

The game uses a left-handed coordinate system, where x+ points to the right, y+ up and z+ into the monitor (towards the back direction).

Voxels with integer coordinates (x,y,z) have an extent of (x-0.5,...) to (x+0.5,...). Chunks are 32x32x32, with the first one having the extent of voxels (0,0,0) to (31,31,31) inclusive.

Calculations between block integer positions, floating point positions and chunk positions are provided in the bxw_world module.

Block orientations

Orientations are internally specified by a pair of vectors right and up, with forward defined as f = -r x u using the standard right-handed vector cross product. Various constructors from other forms are provided, some use extra redundant data to verify the input and return an Option<> rather than an orientation to allow for verification.

The default orientation (id = 0) is right=x+ and up=y+ (front/forward=z-).

Slopes have their triangle sides facing left and right, with the slope being between top and front.

Corner slopes are meant to connect with other slopes with their left and back faces. Their top, front and right faces are the "filler" for a neat finish.

License

The source code of the project is licensed under the GNU General Public License v3.0.

The assets in the res/ folder are licensed under CC BY-SA 4.0 unless specified otherwise in a file located in the same folder as the asset.

ballxworld's People

Contributors

eigenraven avatar

Stargazers

 avatar Grzegorz Uriasz avatar Adam Gąsior avatar

Watchers

James Cloos avatar Adam Gąsior avatar

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.