Not a great week!
This week I set off to start making a game with SUGAR!
The only ‘essential’ sub-system missing from SUGAR is audio, so that part of the game will have to wait. But the rest of the game should all be doable with SUGAR as it is now! This is a great way to test everything I’ve been implementing so far, but also to get ideas on what I should improve and/or add to the engine!
Sadly, what actually happened is that I got really put off by the game-making workflow when working with C++.
Lua, the programming language used in Pico-8 and Love2D, is extremely flexible and very easy to work with. It’s a very straight-to-the-point language, with a simple syntax which you can just write on with barely a second thought. Lua tables in particular, the unique data structure/array/map hybrid, are an incredible element that can be replaced only through a multitude of different data structures in other languages.
C++ on the other hand is a much more complex language. It can be flexible, but you have to bend it first. To me, it certainly feels very rigid and it’s difficult to be sure that anything I’m doing will work and I would never believe that I’m doing it in the best way possible. And of course, no Lua tables in C++. So far, handling data in C++ always feels like a puzzle of what actually works, which structure is the most adapted for what I want and what are its limitations.
Of course there is a trade-off, which is that the compiled program from C++ is faster and, arguably, the source files are in better order and easier to go through. (especially for bigger projects) And maybe I will get along a lot better with C++ in time. Coding the engine was its own kind of thing, but all those problems I just enumerated really appeared to me as I tried to make a game, and I’ve only been doing that for a week.
But I can’t say I didn’t consider adding Lua scripting to SUGAR. This is just an idea though, not a decision to make on a whim. I can definitely see the appeal, but I also anticipate there would be a lot of background work to make it happen. So for now I’ll keep on working with C++ and try to get used to it.
This reflection mainly came after making a game in about 1h30 on Sunday evening with my partner, in Pico-8:
TamaCakes is two-player game where you have to eat more cakes than the other player. It’s very simple but also it was made in a very short amount of time and every line of Lua in it was written almost instinctively.
After a whole week of constantly feeling put off from working on my C++ game, this experience was very refreshing (and something I will definitely do again) and made me see the problem I was facing: C++ is a very different language from Lua and I have only little experience with it.
By the way, you can check out the source for TamaCakes there. Save the content of the page in a ‘.p8’ file and load it in Pico-8, it should work. It’s a simple game but it’s pretty fun and maybe some of you would like to learn from the structure of it!
And here’s the game that I’ve been making in C++. It doesn’t look very advanced because [a] I had a hard time working on it and [b] I had to make an object system to store, update and draw the game entities. (player, enemies, smoke particles, etc) I also had to fix a few tiny things in the engine but nothing major, which is good.
The game itself would be a simple top-down brawler where you hit enemies in the face until they go flying away, hopefully to fall on other enemies and creating combos that way. There’ll be roguelike elements and the arena will change at certain points. You’ll be able to play alone or with a friend. (once SUGAR has controller support anyway) For now I am calling this project ‘Melee’ but that is like to change.
It should be fun!
That’s all I have for this week though! Hopefully next week I can tell you how I’m starting to get along with C++! I also need to resume my search for how to handle audio in SUGAR…
But the focus for next week will be the game! I really want to have something resembling gameplay as fast as I can, especially now that my object system is up and running! If there’s time, I’ll be taking a shot at audio and/or controller support!
Thank you to all my Patreon supporters, because I couldn’t be writing posts like this one without you! Here are the names of all the 3$+ supporters:
Ryan Malm, Joseph White, Austin East, Marcin Majewski, Zachary Cook, Jefff, Riccardo Straccia, HERVAN, Andreas Bretteville, Bitzawolf, Alan Oliver, Paul Nguyen, Dan Lewis, Christian Östman, Dan Rees-Jones, Reza Esmaili, Thomas Wright, Chris McCluskey, Joel Jorgensen, Marty Kovach, Cole Smith, Giles Graham, Tim and Alexandra Swast, Sasha Bilton, berkfrei, Jearl, Dave Hoffman, Finn Ellis, Egor Dorichev, Jakub Wasilewski, amaris, Brent Werness, Anne Le Clech, Jeremy Bouin, Jesse Bergerstock, Jacel the Thing, Pierre B., Sean S. LeBlanc, C Oakreef, Andrew Reist, vaporstack
Have a great week everyone!