drey7925 / perovskite

(yet another) rust-based voxel game
Apache License 2.0
6 stars 0 forks source link

&🧊 Perovskite

Perovskite is a 3D voxel game engine inspired by Minetest.

It is written in Rust, with two goals:

At this time, it is not a playable game.

As this is a learning project, I may spend time on silly things that may not be useful to players or improved gameplay, if I think I can learn something from doing so. Likewise, I may use design patterns inconsistently (or make other inconsistencies) to increase the breadth of my learning. If there is enough interest or need, I can refactor and clean up code later.

Why the name?

Naming Rust projects after oxide minerals is fun. Unfortunately, all the cool oxide minerals are already used for really cool rust projects, or could otherwise cause confusion.

Perovskite is a cool mineral that inspired artificial structures with a bunch of cool aspirational applications.

What's the current state?

It is possible to define blocks and dig them. Inventory support is mostly present. There's a furnace and a crafting mechanism. Game content (i.e. all the blocks you'd expect) is not yet present.

Entities are under active development, but are not yet stable. The entity system is currently focused on autonomous movement, and low-latency player control will be added in the future.

I intend to wrap the engine-specific behaviors in a lightweight API that makes it easier to define game logic. That API is still not stable, but I intend to make that API more stable than the low-level engine API.

At the moment, the network API is not yet stable - the client and server must be built from the same code. The intent is to stabilize the API to a reasonable extent later on, but having an unstable API allows for faster feature iteration.

How is it different from similar voxel games?

The limitations:

The benefits:

How do I play it?

Server

First, build and run the server:

$ cargo build  --features= --bin perovskite_game_api --release
$ target/release/perovskite_game_api --data-dir /path/to/data-directory

The default server port is 28273.

The following --features can be used to do performance debugging of the server:

--release is recommended.

At the moment, the render distance is hardcoded at the server, using constants in src/network_server/client_context.rs.

Use Ctrl+C to exit, and Ctrl+C a second time to force quit. At the moment, there are some deadlocks that cause graceful shutdown to hang.

Client

Then, build and run the client:

$ cargo build --features= --bin perovskite_client --release
$ target/release/perovskite_client

The only supported feature is --features=tracy, with similar behavior to the same feature on the server.

To reach a client on the local machine, use grpc://localhost:28273 as the server address.

Default keybinds

These can be adjusted in the settings file, whose filename is printed in the log when the client starts up.

What are the requirements?

It runs on Windows and Linux. Mac is an open question due to issues involving Vulkan libraries.

Aspirationally, I'd like the game to be somewhat playable in single-player with only one or two CPU cores and a very basic GPU.

I'm not quite there yet, and it's possible that I'll drift further away from this goal as I add features. I tend to test with a fairly powerful laptop and a high-end GPU. I aim for the following performance goals:

What's on the near-term roadmap?

Tons of stuff, in no particular order, and not yet prioritized. Everything in this list is a maybe, depending on my available time and mood.

What are the stability guarantees?

None at the moment. I test with either the latest or almost-latest stable Rust version, on Windows x64.

perovskite_server's API can change in breaking ways. perovskite_game_api (as well as anything it re-exports by default) should be reasonably stable once it's written. I intend to re-export some unstable APIs behind a feature flag.

Code style

Who is behind this?

I work on low-level infrastructure at a major hyperscaler and produce this game in my free time. You can find me on discord as drey7925.

Note that this project is not endorsed, sponsored, or supported by my employer or any affiliates.