Great stuff, lines up a lot with what I'd care about as an ex-gamedev and spending a bit of time with Rust. One minor point: > First class code hot-loading support would be a huge boon for game developers. The majority of game code is not particularly amenable to automated testing, and lots of iteration is done by playing the game itself to observe changes. I’ve got something hacked up with dylib reloading, but it re…
Lua is great and generally the right tool for this sort of thing. As an alternative, though, there are several Rust-based scripting languages that attempt to expose some of the power of the type system, etc., while being more amenable to dynamic loading, REPL, etc: http://libs.rs/scripting/
Making a Game in Rust
51–60 of 125 posts
Re: Making a Game in Rust
#52It would be nice to have a minimal gameish program as a example for people learning Rust. When I teach kids javascript I start with an etch-a-sketch. It's aided by a simple library to hide the mechanics of the HTML canvas element, context, etc. This allows it to be small enough that they can view it all in one go and build upon it. print("Draw with the arrow keys"); var cx=320; var cy=240; function update() { // the…
Otherwise rust-sdl2 is batteries included, there may be more ceremony than html5 canvas but it's easy to hide behind a simple interface. It has many simple examples.
But, like with C++, as long as the language doesn't come with a standard graphics library, I doubt the "official" books can really use graphics apps as a learning tool.
Re: Making a Game in Rust
#53I would love to read a detailed explanation of the packaging process for iOS and Android.
Re: Making a Game in Rust
#54I would love to read a detailed explanation of the packaging process for iOS and Android.
The five platforms support is bloody impressive.
Re: Making a Game in Rust
#55> The include_* macros are great for “packaging”. Being able to compile small assets directly into the binary and eschewing run time file loading is fantastic for a small game. For C/C++/etc devs looking for something similar, BFD objcopy supports an "-I binary". It will emit an object file with _binary_objfile_start, _binary_objfile_end and _binary_objfile_size symbols. But I have got to say that making it a languag…
Agreed. I code in C# and there's facility for bundling assets into the binary but they're handled at the project file level and not the C# file level, and this means the keys to access this binary content is not available as a compile-time constant. You're still just passing strings around and hoping they match. Having first-class language support for resource files looks fantastic.
Re: Making a Game in Rust
#56Earlier quoted context omitted.
Now I have to rewrite my arcade game emulator in rust just so I can use that to load rom images...
include_bytes! is for compile-time inclusion of files though, not for runtime.
Re: Making a Game in Rust
#57Re: Making a Game in Rust
#58I would love to read a detailed explanation of the packaging process for iOS and Android.
Re: Making a Game in Rust
#59It would be nice to have a minimal gameish program as a example for people learning Rust. When I teach kids javascript I start with an etch-a-sketch. It's aided by a simple library to hide the mechanics of the HTML canvas element, context, etc. This allows it to be small enough that they can view it all in one go and build upon it. print("Draw with the arrow keys"); var cx=320; var cy=240; function update() { // the…
For simple pixel access and no primitives, https://github.com/emoon/rust_minifb is very compact and neat. Otherwise rust-sdl2 is batteries included, there may be more ceremony than html5 canvas but it's easy to hide behind a simple interface. It has many simple examples. But, like with C++, as long as the language doesn't come with a standard graphics library, I doubt the "official" books can really use graphics apps…
The MiniFB code does seem to be a good starting point for this sort of thing.
Re: Making a Game in Rust
#60Earlier quoted context omitted.
Really? How do they know what the representation of the object code was before compilation? Seems like if they had a whitelist it would be difficult to enforce.
The biggest problem I faced with Rust and macOS/iOS is related to Apple's requirement for bitcode on all submitted code to the App Store for Watch and appleTV applications. This internal Rust discussion focuses on it for more details: https://github.com/rust-lang/rust/issues/35968 This gist is that Apple is requiring bitcode, but isn't giving easy access to the LLVM version they use for their own tools. This means th…