https://github.com/styzex/rust_ray
A simple ray casting game engine written in Rust.
https://github.com/styzex/rust_ray
game-development game-engine raycasting raycasting-engine rust rust-crate rust-game-developement rust-gamedev rust-lang rust-library
Last synced: 4 months ago
JSON representation
A simple ray casting game engine written in Rust.
- Host: GitHub
- URL: https://github.com/styzex/rust_ray
- Owner: Styzex
- License: apache-2.0
- Created: 2024-10-29T22:02:18.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-01-17T21:24:46.000Z (5 months ago)
- Last Synced: 2025-03-03T22:09:03.499Z (4 months ago)
- Topics: game-development, game-engine, raycasting, raycasting-engine, rust, rust-crate, rust-game-developement, rust-gamedev, rust-lang, rust-library
- Language: Rust
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rust Ray
A simple raycasting-based game engine written in Rust.
## License
Rust Ray is released under the [Apache 2.0 License](http://www.apache.org/licenses/).
## Dependencies
- glu-sys
- imgui
- libm
- sdl2## Prerequisites
- Run the Visual Studio 2019 build tools installer
- For easy setup, select the Desktop development with C++ workload in the installer.
- For a minimal setup, follow these steps:
- In the installer, navigate to Individual components
- Select the latest MSVC for your architecture and version of Windows
- Select the latest Windows SDK for your version of Windows
- Select the C++ CMake tools for Windows component
- Install the components## Compiling
### Windows
To compile the game engine just run `cargo build` everything should work out of the box.### Linux
#### Debian/Ubuntu
```bash
sudo apt install libsdl2-dev libgl1-mesa-dev libglu1-mesa-dev
```
#### Fedora
```bash
sudo dnf install SDL2-devel mesa-libGL-devel mesa-libGLU-devel
```
#### Arch Linux
```bash
sudo pacman -S sdl2 mesa
```
#### NixOS
Add this to your configuration.nix:
```
environment.systemPackages = with pkgs; [
SDL2
libGL
glu
];
```
Or for a temporary shell:
```bash
nix-shell -p SDL2 libGL glu
```
After that you should be able compile the game engine with this commmand `cargo build` the build.rs will set everything you need for it to compile on linux.### MacOS
To compile the game engine just run `cargo build` everything should work out of the box.
## Planned Features
- Implement a simple 3D renderer for obj models (experimental)
- ImGui or egui debug menu
- Variable manipulation
- Position viewing
- Performance statistics
- A simple level editor
- Baked lighting (experimental)## Implemented Features
- Fake 3D rendering from the raycasting
- 2D rendering
- Raycasting
- Player movement
- Map from a **_*map*_.rrm** file
- Currently only supports maps with the size of 8 blocks
## The custom map file format- The name of the file will be shown in the map selection menu so map if its called map.rrm
- It doesn't support comments
- Any number that is not a 1 or 0 will break it and possibly crash your gamemap.rrm
```
SIZE=8
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 1, 0, 1],
[1, 1, 1, 1, 0, 1, 1, 1],
[1, 0, 0, 1, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 1, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1, 1],
```