designing alpha 0.1.1
Last month, I developed a fun little incremental game using the Turbo engine to be published on CoolMathGames.com. As small as the game is, it is also my largest project using the Turbo engine, so I wanted to write a small overview of my process for anyone else interested in checking out Turbo! In this dev log, I cover my concepting, development and some Rust patterns I learned about, and super helpful Turbo API.
Why Turbo?
For anyone reading who doesn't know what Turbo is, Turbo is a lightweight 2D game engine designed for fast development and easy, out-of-the-box multiplayer functionality. While I knew this project would be a singleplayer experience, I still opted to use Turbo for its rapid development capabilities (hot-reloading on save is a huuuge benefit and time save) and its straightforward API.
Ideation
After researching my target audience and possible game genres, I settled on one that I find engrossing and within scope for this month-long development cycle; an incremental game. Buzzing with ideas, I turned to my sketchbook to map out game screens and break down core features.
I honestly loved all of these ideas, it was hard to narrow down which I would pursue! I even spent time sketching in engine for one idea before committing, and I'm glad I did because I realized it would likely become out of scope despite being very interesting to me from a design perspective (will be coming back to this project).
After considering my options and exploring these ideas, I chose the space research themed game as I had the best understanding of how I could develop it within scope. The theme also aligned with my target audience, and as a fan of sci-fi I thought it was an interesting or thoughtful application of an incremental model. My last steps before beginning development was to create a draft of that incremental model in excel, determining what formulas would be used to simulate the growth of resource gathering and spending.
Development
With an outline for the game in writing, I set off to develop its core features. I started by defining what the points of interest (POI) would need; universal functionality wrapped inside of a Rust trait that I could then implement for any POI I would create. I created a trait with dynamic typing so that I could ambiguously pass any POI into the same functions, which then would downcast the POI to the specific structs that implemented them if necessary.
I didn't end up using this functionality, but it was a good lesson in dynamic typing. I did, however, use the rest of the trait's framework for every POI in the game, which would passively produce resources over time and have unique upgrade logic to be overridden in each structs implementation of POI.
The next most important feature I worked on was an event manager to facilitate progression gates and trigger unlockable conditions. Going back to my original sketch of this idea, I knew that progression would happen in stages, so the event manager was my solution to broadcast those stage changes globally.
The EventManager processes events in the Turbo go! loop, and broadcasts the event to any subscribed receivers. So, in the code examples above, on the left is the EventManager's process function, queuing cutscenes relative to the event triggered and calling on the handler's designated function when the event is broadcasted. On the right is the subscribed functions in the Turbo go! loop, and below is an example of what that functionality looks like.
The result works, although reviewing my own code now I see many ways to clean up this functionality, such as moving the handle_event function into the POI trait and implementing the Event enum to automatically return cutscenes rather than hardcoding them into the EventManager's process_events function. More work to be done!
This is my earliest visualization of those systems; POIs that draw from unique upgrade trees stored in constant, static vectors. This was the foundation needed to test my incremental economy, and build out more dynamic visuals. Being able to playtest the system that had been theoretical up to this point was an amazing feeling, and I pretty much never stopped tweaking the economy after every playtest.
There's a lot more to the structure of this project I won't delve too deeply into here, but if you're curious to poke around yourself I've made my Github repository public for anyone to look at themselves. It isn't 100% commented, but still has useful patterns to learn about!
Github: https://github.com/jauntybot/turbo-incremental
Visual Fidelity
Now that a bulk of the development work is done, I started to work more on the visual identity of the game. A lot of time spent in Aseprite drawing space stations, refining color palettes, and redrawing my screen mockup sketch from my ideation phase. While there are many sprites in the game that are made outside of engine, there is work to be done in engine to compose them. The asteroid field is generated with random sprites following a programmed arc, and the nebula storm and the scene's dynamic vignette are fully visualized using Turbo's path! and circ! macros -- no exported sprites whatsoever!
The result is nice, though I feel as though the visual fidelity is the lesser developed half of the game up to this point, and something I definitely want to continue honing in on!
Alpha 0.1.1
One final step to release was integrating Turbo's newest local storage API. Up until this point, the game would restart itself every time it was launched, meaning no progress could be made from one session to another. Turbo's local storage API made exceptionally quick work of fixing this problem. Simply serializing the GameState into a vector of bites and calling local::save() is all it took for the game to save between launches. I added an autosave function to do this every 15 seconds or so, and the expense is completely negligible. I had never had an easier time setting up a save system in a game engine before, seriously Turbo rocks for this!
I'm really happy with how the game has progressed up until this initial launch, and I plan to add more content and polish to it in the coming month. If you're curious to learn more you should join the Turbo discord channel and chat with me or other Turbo devs!
Thanks for reading this lengthy post, have a good day! :)
Exo-Observation
Observe, collect resources, and build science facilities orbiting fascinating exoplanets.
Status | In development |
Author | jauntybot |
Genre | Simulation |
Tags | 2D, Casual, Clicker, Idle, Incremental, Indie, Pixel Art, Sci-fi, Space |
Leave a comment
Log in with itch.io to leave a comment.