Aaron McLeod

LD 39

I'm in, sorta

Not fully committed yet, but I am looking to try to make something. I am going to be building the game in Rust using glutin & gfx-rs. I plan to pull some common components and systems from my in progress game: https://github.com/agmcleod/agile_archer. Such as transforms, animation, etc.

MacOS port for my game & postmortem

Was able to get a MacOS port working last night, you can find the link on the game page here: https://ldjam.com/events/ludum-dare/39/energy-grid

Postmortem

I decided to use Rust for my game, pulling over some previous components and systems like transform and animation.

Main crates used:

  • gfx
  • specs
  • glutin
  • rusttype
  • rodio

There were many things to figure out how to do though during the weekend. To name the major ones:

  • Rusttype/drawing fonts, I spent about 7 or 8 hours on this on Saturday
  • Audio. Was quicker to figure out, but still not happy with how i've structured it either.

The font & audio pieces proved difficult due to the async nature of specs. Specs is really awesome, I enjoy the API, and how quickly it runs. But being async and requiring things like Arc for shared data proves an issue when you start needing instances of types that implement gfx::Factory (a trait type that defines how to create things like textures), or wanting to store Rodio Decoders in components. Decoders are used to create play instances after reading the audio file.

I don't see these as flaws in the libraries or anything, but something that I haven't figured out yet. I worked around these problems by keeping an external glyph cache of text, so the text component could dictate when its contents changed. My main render loop outside of specs would then read that string and build the glyph data, or re-use the previous if one for that string had already been created.

I'm excited to back port a lot of these learnings into my on going project, refactor some of the ideas, and see what I can make better.

I think Rust is in a pretty good spot for working on smaller games, though you definitely need to be willing to figure things out. Be willing to dive in to both documentation & code.