#Rewriting a C++ game engine in Rust

5 messages · Page 1 of 1 (latest)

dire sinew
#

Premise
I approached Rust recently, and I just started exploring the language, rustc and cargo.

I worked on a C++ game engine for some time, with an indie team in which I am the only engine developer. The development stopped for external reasons and now that we are ready to restart, me and the rest of the team are considering the possibility to rewrite it in Rust. I know, it sounds crazy, and it probably is.

Basic needs
Everything we do is designed to be cross-platform in order to be, one day, portable to consoles, WASM, Android, or others, and we aim at this kind of flexibility also if we switch to Rust.
For now we are developing with a game project in mind, and the internal game demos we produce for test purposes are running on a platform-agnostic code-base backed by SDL2 and OpenGL -> our wannabe engine.

Avoiding The XY Problem - https://xyproblem.info/
As far as I understand, in order to write Rust code really "cross-platform", we should go with no_std development, so that we can really compile our code against every existing target, including Tier 3. Is this correct?
(https://doc.rust-lang.org/nightly/rustc/platform-support.html)

I would like to use the official std when compiling on Tier 1 targets and I imagine myself in the far future writing my own necessary components (allocator?) for those platforms that we decide to target belonging to Tier 3 (for example, let's imagine to be the first one to write Rust code for something like Nintendo Switch). Is there a standard/recommended way to deal with this?

We are doing this for passion and fun, we are not (yet) in hurry and we heard suggestions like "just use Unity or Unreal" a gazillion times, but we still would like to try this out!

Thank you everyone!

raw estuary
#

I'm not majorly familiar on the topic

#

But it's probably worth taking a look at the other rust game engines, too, for a frame of reference

fierce surge
#

I don't know whether you need no_std or not, but if you're going to use that, I'd recommend no_std plus extern crate alloc; so that you can still use things like Vecs and so forth (https://doc.rust-lang.org/alloc/) with the default or your custom allocator.