Devtober Postmortem


I participated in Devtober this year and now that Hallowe'en is upon us, it's time for the post jam postmortem.  Spooky!

Origin story

This development arc for me actually started about a week before the jam when I downloaded the latest beta of Aseprite wand was playing around with it's new tools for tile creation.  It was so much easier than the old method where you're endlessly cutting and pasting and exporting trying to get the pixels to line up and I quickly created both an overworld and a town tile set.  It was around that time I was thinking of writing my own RPG and set up my account on itch.io.  I then started browsing through the available jams and saw Devtober was about to start and I thought - hey this with fit perfectly with the game I have in mind.

Art

The artwork in this game is all pixel art and made entirely in Aseprite.  This is partly to fit in with the SNES era look I was going for, but also because it's a lot faster to create and animate artwork in a program like Aseprite.  Which is not to say pixel art does not come with its challenges - trying to pack so much detail into blocky pixels really pushes your design skills.  But at the same time it can help by forcing yo to simplify broad areas into single colors instead of creating a lot of detail.  I found myself thinking about my color theory lessons a lot to get my sprites to reflect the forms I wanted.

Another big reason for choosing this art style was (as I noted above) to explore Aseprite's new tile editor tools.  They make creating and editing tile sets so much easier and even fun to do.  I found I could spend most of my time thinking about how the tiles looked rather than fretting over the tile borders so that they can blend together seamlessly.

Music

The sound track currently consists of three pieces, a forest theme, a cave theme and a boss fight theme.  These were all composed in Musescore and took about a day each.  I decided to go with Musescore because I like that it represents your music as traditional music notation which makes it so much easier to comprehend what's going on in your composition as a whole.  While I do like using a piano roll editor for tweaking fine details, to understand anything more than two bars long or across multiple parts, you really need the expressiveness traditional notation gives you.  It provides a brevity and an expressiveness not unlike written language that gets lost in the forest of blocks the piano roll editor gives you.

That said, Musescore 3.6's sound library is not the best.  While a lot of this should be fixed in Musescore 4.0, that is not likely to be released for another few months.  (Full disclosure: I'm also an independent contributor to Musescore and wrote most of it's current piano roll editor.  So I'm not against piano roll editors in general, I just like to use them along side traditional notation).

Musically, I'm mostly self taught.  I had some piano lessons as a child and played tuba in high school but most of what I know of music came from watching YouTube videos and listening to video game music.  Nobuo Uematsu I feel was particularly influential - I love his work and have some piano collections of his I like to play.  Best of all, a lot of the SNES era of video game music is available in MIDI format so it's possible to open it in music editors and see just how the orchestration works on a technical level.

Code

This project was my first big project using the Godot engine with C#.  I started this project using GDScript but switched to C# when I started writing state machines and realized I would need to use classes to encapsulate my different states.  While it is technically possible to do this in GDScript, duck typing just makes it a miserable experience.  My background is in languages like C++ and Java so C# is a natural fit while Python-like languages I hate with a passion.  The only reason I was using GDScript at all was that I thought that C# projects would not export to Android (turns out they can).  Anyhow, the switch to C# also paid off later when I started using coroutintes.

I've used Godot previously for a 3D RPG I was designing (still under development).  Dragon Down allowed me to further explore this engine and see what it's capable of.  I quite like both the engine and the development environment.  It provides most of what you need without getting in the way too much.  I've not pushed it to do anything performance critical, but then for the sorts of games I'm designing I shouldn't need to-the-metal efficiency.

The biggest challenge programming wise was figuring out how to create the AI for the game characters.  I started out with a classic state machine using an enum to track the state and determine what happens for every character each game frame.  I found this made for fragile and hard to manage code as my multiple enemy classes quickly became very long.  (Personally, I hate having any one code file be more than a few hundred lines long).  To fix this, I decided to make each state be its own class and every time the AI changes state, it would create a new state object and assign it to a current state variable.  Not only does this help break the code into manageable chunks, but it lets each state have its own memory space that just gets disposed of when the state changes and the state object is deleted.  In the old system all the different states were storing data in a single class which led to an incestuous mess.  The only drawback of separating the states is I had to make a lot of fields on the AI object public which I would not have done otherwise.  I'm not sure if there's a good way to avoid that.

The other big programming challenge was my introduction to coroutines.  Coroutines are a special kind of iterator where each time you call them they run until they hit their next 'yield' statement.  This lets them act like threads that can be directed; unlike true threads which run on their own, coroutines take a step only when you tell them too.  This makes them extremely useful in a real time environment where they can be called from the update loop.  You can specify a series of actions that need to play out over time in a coroutine and then just keep calling your coroutine object each frame.  I used this to create scripts the could be used to direct the AI characters in cut scenes.  Essentially I have each character enter a special 'passive' state where they do nothing at all and then started a coroutine that directs their actions while in this state.  Then when the script was over, I switch them back to their idle AI state.

Combat

The combat routines are probably the thing I've been having the most trouble with and I'm finding is more art than science.  I've come up with a few variations on "wander around randomly", "run up to the player if they're close by" and "attack and run away".  What I have works, but doesn't feel as smooth or as fun as I would like.  One way I tried to fix this was to add a hit/evade/attack/defense RPG mechanic into the damage calculation which helped a bit but I'm still not sure it's quite there.  If nothing else it lays the ground work for implementing leveling up or having equipable items later on.

To Do

Dragon Down is not complete by any means.  I'd still like to implement an item system and have equipment the user could wear to change their stats.  I might also add a leveling up system, although I am a little wary of that too.  I feel leveling up is the reason why a lot of the older RPGs are really grindy as it rewards spending a lot of time doing repetitive tasks rather than playing well.  

A magic system would also be a useful addition.  I've already created magic points for the main character, but at the moment there is nothing to spend it on.  In RPGs, magic basically means creating spells that can act as artillery, healing or buffing.  Shouldn't be too hard, but it will depend on getting items working first.

One of the biggest things this game needs is a decent story.  The current story is more of an after thought as most of my effort went into making the AI, combat and artwork.  I think I'm far enough along with the engine that I can start thinking about telling a proper RPG tale.  Of course that will take a lot more story, artwork and level design but I think that feature wise the engine has most of what it needs at this point.

Inspiration

This work was inspired in large part by the wonderful games of the 16 bit era.  Legend of Zelda: A Link to the Past and Secret of Mana are probably the most direct sources of inspiration, but games like Chrono Trigger, Final Fantasy, Breath of Fire, Lufia and others played a big role too.  There were so many amazing artists, musicians and programmers from back then that set a really high standard and paved the way for what games would become.

Files

html5.zip Play in browser
Oct 31, 2021

Comments

Log in with itch.io to leave a comment.

(+1)

Interesting to read about RPG development, since I'm making one as well! I've followed you.