Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Morituri: A Year in the Making

A topic by HornedXreM created 2 days ago Views: 276 Replies: 5
Viewing posts 1 to 5

Hey everyone! I want to share the story of how I made Morituri and where it all led. Maybe someone will get something out of it. (Though I’m pretty sure just about everyone has written about these mistakes by now. I think I managed to string them all together into one big combo.)

So what kind of game is it? Basically, it’s an arena autobattler with a pretty deep RPG system (or so I like to think), a team to manage, and AI opponents who play by exactly the same rules you do. I went with Godot because the other engines seemed too complicated and honestly a bit overkill for such a simple game.

Right, then. I’d made it through that brick of a Godot manual and watched dozens of videos on YouTube. Time to actually make something. The first prototype took me a few days.

The first Morituri prototype. The UI was all in Russian back then. English came later.

Of course, I wasn’t happy with the prototype as it was. I’d only thrown it together to test the combat system, so I kept going.

Oh, and I forgot to mention the art. I went for a RimWorld-style look because I can’t draw to save my life, and I figured drawing everything in that style would be easy enough. And if all else failed, I could always use AI to generate the assets.

The second Morituri prototype
I messed around in Paint for a bit, but I couldn’t draw anything half decent, so I gave AI a shot after all. I figured out pretty much straight away that it wasn’t going to work for me either. Getting all the assets to look like they belonged in the same game was nearly impossible. Getting it to draw the same piece of armor from three different angles? That was just plain impossible.
The prototype with AI-generated assets

On top of that, I was starting to get frustrated with the performance I was getting out of Godot. Once I added pathfinding and the code that let AI teams pick their gear and manage their finances, turns started taking way too long. Processing a single turn for just nine AI teams took about five (!!!) minutes.

This is what Morituri looked like at the end of the first phase of development.

So what did I have to show for those first few months? The art looked awful (even by my pretty forgiving standards), and the game ran so slowly it was unplayable. At that point I thought, screw it, I’m starting over from scratch. Rust this time, with wgpu for the graphics. I still couldn’t draw, but I knew my way around 3D modeling well enough, so I decided to make the game in 3D.

Getting the game running on this new “engine,” if you could call it that, was a long, painful process. It looked daunting when I thought about the whole thing, but I kept chipping away at it. I made a rule for myself. One day I’d work on the graphics, the next on the simulation and gameplay. And when I say “a day,” I mean about 16 hours, seven days a week.

But I could see it paying off, especially in the simulation and AI. In Godot, a single turn for nine teams had taken five minutes. Now a turn for 49 (!!!) teams took just a few seconds. That gave me a lot of hope. The graphics were coming along too.

Testing lighting and shadows

The simulation and AI were coming along great, but I’d hit a wall with the graphics. I wanted each gladiator to look a little different, but I didn’t have the time or resources to model a separate body and face for every single one. So I decided to write some code to generate their bodies and heads procedurally.

I came to regret that one.

My first procedurally generated gladiators. Yeah, I know they look ridiculous.

Procedurally generated faces. No comment.

This was the best I could get out of my procedural generator.

I sank several months into that generator and still couldn’t get the results I wanted. So I scrapped the whole thing and decided to make the models myself in Blender after all. Thank God the simulation and AI were coming along as well as they were. If those had gone sideways too, I’d have lost my mind.

Around that time, a friend of mine joined the project and took on the UI. Up to that point I’d barely given it any attention, and it was... awful.

What the UI looked like back then

So I got to work in Blender. The 3D engine code was pretty much done by then, which meant I finally had time to make the models. Trouble was, making them was painfully slow. At the rate I was going, the models alone would take forever, and I still had animations, effects, textures... What a nightmare.

Then my friend pointed out the obvious. A 3D game was more than the two of us could handle. If we kept going like this, the game might never see the light of day. We thought it over for a bit and, yeah, back to 2D it was. So out went all the 3D engine code! Out went all the 3D assets!

Luckily, I’d kept the 3D code separate from the gameplay, simulation, and AI right from the start. That made switching back to Godot pretty quick and painless. The setup we ended up with is pretty simple. Godot handles all the graphics and UI, and the custom Rust core does the heavy lifting, from gameplay logic to simulation and AI.

Some early models I made in Blender

A female character model

A male character model

So there we were. The gameplay was more or less ready, most of the mechanics we’d planned for the demo were in place, and we had exactly zero art assets. We could fix that part, though. A few months later, we had a game you could actually play (more or less), and it finally looked the way we’d pictured it.

I did have to learn to draw a bit, of course. It helped that my friend was already pretty handy with 2D art. Neither of us is an artist, but I think what we’ve got now looks pretty decent.

The current UI and one of our gladiators

I’ll leave it there for now. I picked that art style because I thought I could get away without learning to draw. One 3D engine and a lot of very questionable gladiator faces later, I ended up learning anyway.

I’ll keep this thread going as a devlog. I’ve still got stories to tell from that first year, and I’ll also post about what we’re working on as Morituri takes shape.

Thanks for reading! If you give the game a go, I’d love to hear how your first fight goes.

You can give the latest build a try here: https://hornedxrem.itch.io/morituri

Thanks for writing this up, the 3D detour and back is the kind of story people rarely admit to in public. Keeping the simulation separate from the rendering from the start is what saved you there, and it's a good lesson for anyone reading. Going from five minutes for nine teams to a few seconds for 49 is a wild jump. Are you using gdext to talk to the Rust core from Godot, or did you roll your own bridge over GDExtension? Also the line about learning to draw anyway made me laugh, I think every solo dev has a version of that. Good luck with the demo, I'm curous how the devlog continues.

Thanks for reading! Yep, we use gdext and built our own API on top of it specifically for Morituri.

(1 edit)

So, after that little look back at how Morituri came together, I’d like to talk about how the AI actually plays the game. Let’s follow one AI club through a day and see how it makes each decision, from drawing up a budget to sending its fighters into the arena.

Part 1. Where the money goes

Every in-game day, all 49 AI clubs draw up a budget. They share one neural network, but each club feeds it its own numbers. How much money is left in the treasury once the bills are paid? How many fighters are fit to enter the arena? How many days until the next match?

For anyone who likes the numbers, the network has 512 inputs, four hidden layers of 512 neurons each, and five outputs. Each output scores one budget category. A softmax function turns those scores into shares that add up to 100%. That gives each club a budget for the day, including how much of its available cash to hold in reserve.

Part 2. Who makes the roster?

Next up is the roster planner. It has its own neural network, again shared by all the AI clubs. This one has 512 inputs and four hidden layers of 384 neurons each. It takes in information about both the fighter and the club evaluating them. The question is how useful this particular fighter would be to this particular team.

The network evaluates the fighters already on the roster, the ones on the transfer and slave markets, and the recruits available for hire. Naturally, the club knows more about its own people. On the slave market, for example, it can’t see a fighter’s skills before buying them. It doesn’t even know whether they’re fit to fight.

The roster planner takes those ratings and works out who to keep, who to hire, and who to replace. It weighs what each fighter brings to the team against what they cost to hire and what they’ll want in wages.

Now say our club has a match tomorrow. It’s one fighter short, and there’s barely anything left in the recruitment budget. What does it do? The planner checks what the club owns. It can sell spare gear from the warehouse or sell a fighter on the transfer market, then use the proceeds to bring in someone ready to fight. There’s a catch, of course. If the fighter it sells could have fought tomorrow, that’s one more spot the planner has to fill.

Part 3. Getting everyone dressed

Right, we’ve got a team. Only one problem. The fighters are naked.

This is where the equipment network comes in. It rates the gear a fighter already has on, the items in the club’s warehouse, and anything suitable on the market. Those ratings go to the equipment planner. Trying every possible combination of gear would take a while, so it puts each fighter’s kit together in stages.

  1. First it picks a fighting style. There are five options. A fighter can use a single one-handed weapon, wield a weapon in each hand, carry a weapon and shield, use a two-handed weapon, or fight at range. The choice depends partly on which weapons are available and which ones the fighter knows how to use.
  2. Once it has a style, the planner picks the main weapon, then a second weapon or shield if needed. Armour comes next, then a helmet. A ranged fighter can also get a backup weapon for when someone gets a little too close.
  3. Consumables wait until just before the fight, when the club knows who’s actually going into the arena. The planner checks what’s in stock and decides which extras are worth buying for those fighters.

Now suppose a dagger turns up on the market tomorrow and it’s 1% better than the old one. Are we really going shopping again? This is where the planner uses a bit of hysteresis. For a normal gear swap, it compares the fighter in their current kit with the same fighter in the proposed kit. The upgrade has to improve the fighter’s estimated combat power by at least 10% to justify the switch.

Part 4. Who goes where?

We’re almost ready to send the team into the arena. One more neural network gets a say. It rates each available fighter on three things. How quickly can they deal damage? How much punishment can they take? And how well can they support their teammates?

The lineup planner uses those ratings to pick who fights and where to put them across three lanes. Scouting matters here. If the club has scouted an enemy lane, the planner uses what the scouts actually saw. If a lane is still hidden, it has to estimate how strong the opposition might be.

The planner tries several lineups and looks for the one that gives the team the biggest advantage overall. Say we’re already comfortably ahead in the centre. Putting another strong fighter there might look impressive, but that same fighter could do a lot more for us on a flank.

And that’s how an AI club gets from counting its coins to stepping into the arena. After all that, the rest is almost anticlimactic. If there’s a match that day, the AI plays it. It gets feedback from the fight and from the turn as a whole. If learning is enabled, the game ends the turn by updating the weights of whichever networks have gathered experience. Their next decisions already reflect what they’ve learned.

On my AMD Ryzen 7 5700X3D, all of that takes about 10–12 seconds per turn for all 49 clubs.

In my previous posts, I talked about the mechanics that are already in the game and how they’ve changed over time. Now it’s time to talk about what I’m working on for the first big patch.

1. Stratagems

Right now, I’m working on a system that lets you pick an opening stratagem for each lane before battle. There are three lanes in the game. When your fighters win their lane, they move over to a neighboring one to help their teammates. An opening stratagem lasts for the first 30 seconds of the fight, or until the enemy breaks through that lane.

I’m planning nine opening stratagems for this patch, with more to come as development continues. For now, I’m testing three:

  • Shield Wall. Cuts movement speed by 50% but doubles the chance of blocking with a shield.
  • Barrage. Increases ranged weapon range by four tiles and reload speed by 30%.
  • Furious Charge. Gives every fighter in the lane one charge of the Charge ability and reduces their dodge by 20. Charge lets a fighter close the gap fast. The target then makes a physical resistance saving throw. If they fail, they’re stunned for three seconds. The charge also deals blunt damage equal to 10 times the charging fighter’s Toughness.

Both the player and the AI can also pick one endgame stratagem. These are pretty powerful buffs that kick in on the 31st second of the fight. There’ll be nine in the patch, but I’m testing three for now:

  • Running on Empty. Clears all fatigue from your fighters.
  • Grit Your Teeth. Removes 50% of their current pain.
  • Last Push. Doubles crit chance and increases attack speed by 20%, but your fighters can no longer block or dodge.

2. Reworking how the AI prepares for battle

Previously, the neural net rated each fighter on three criteria, and the planner used those ratings to put together battle plans. With the new system, I had to rework that a bit. Okay, quite a bit.

Now the planner comes up with up to 200 plans first, then sends them to the neural net to score. The net picks the best one for the fight. Each plan includes the lineup, the opening stratagems, and the endgame stratagem.

Up to 180 of those are practical plans the team can pull off with what it already has. Up to 20 more are hypothetical: maybe the team doesn’t have the right kind of fighter, or it’s missing a consumable. If the net rates a hypothetical plan higher than every practical one, the planner asks the AI quartermaster to take a look. The quartermaster checks whether the club can afford to make it happen and whether it’s worth the expense. If it gives the go-ahead, the club buys the gear or hires the fighter it needs, and the plan is ready for battle.

3. New fighter backgrounds

Most of the new backgrounds are music-themed:

  • Bard. Available to humans and elves. Bards start with the Musician perk, which lets them use musical instruments as “weapons” (more on those below). They can also pick perks from the Musician group when they level up.
  • Minstrel. Also available to humans and elves. Minstrels start with Musician and Song of Courage. For five seconds, the song boosts the morale of allies in the lane every second by half the minstrel’s Charisma. After those five seconds, the fighters start losing 10% of that bonus per second.
  • Troubadour. Another background for humans and elves. Troubadours start with Musician, Song of Solace, and Song of Focus. Over five seconds, Song of Solace removes a total amount of pain equal to the troubadour’s Charisma. Song of Focus boosts the dodge of allies in the lane by the same number of points.

Dwarves and orcs will get their own musical backgrounds, with more aggressive abilities focused on disrupting enemies rather than supporting allies.

4. Two new types of “weapons”: lutes and drums

  • Lute. A fighter “armed” with a lute doesn’t attack enemies. Instead, every four seconds, they restore morale to an ally equal to half their Charisma and reduce that ally’s pain by an amount equal to their full Charisma.
  • Drums. Every three seconds, the drummer “attacks” an enemy. The target makes a saving throw against their mental defense. If they fail, they’re stunned for three seconds.

Both instruments will come in common, rare, and epic versions.

5. A new bard-themed skin for light armor

6. Sound and music

The game is finally getting combat, weather, and arena sounds, plus a soundtrack.

And that’s about it! That’s what I’ve got lined up for the first patch. No firm date yet, but I’m hoping we can get it done in a couple of weeks.

Today I want to talk a bit about how characters work in Morituri. Let’s start with the basics: health.

Health, wounds, and stamina

There’s no single HP bar. Every body part and organ has its own HP. Which part a hit lands on is random, but some perks make certain body parts more likely to get hit.

Losing an arm or a leg won’t kill a fighter outright, but it’ll hurt like hell and cause heavy bleeding. And that limb is gone for the rest of their probably rather short life. Destroy the torso, the head, or a vital organ like the brain or heart, and the fighter dies. Losing both lungs is fatal too.

Fighters also have a blood supply and a pain threshold. Taking damage leaves a wound, and different types of wounds cause different amounts of pain and bleeding. The less blood a fighter has left, the worse their stats get. If their blood drops to zero, they die. If their pain goes over their threshold, they pass out.

So there are a few ways to take someone out of a fight: destroy a vital body part, make them bleed out, knock them unconscious through pain, or break their morale. There are a few more, but we’ll leave those for another day.

Every action costs stamina, too. The less a fighter has left, the less effective they are.

Attributes

Base attributes depend on the character’s race. Humans, for example, start with a base of 5 in every attribute, with a random variation of up to 2 points either way so they don’t all come out the same.

  • Strength depends on the fighter’s arms: the less HP their arms have, the lower their Strength. It mainly affects melee damage.
  • Agility depends on their legs and mainly affects dodging.
  • Constitution is the main defensive attribute. It determines how much HP each body part has, how much blood the fighter has, and how much pain they can take before passing out.
  • Wisdom depends on the brain. It affects how well the fighter can do certain jobs at the club and how much XP they earn.
  • Intelligence also depends on the brain. It determines how many skill points the fighter gets when they level up.
  • Perception depends on the eyes and mainly affects ranged accuracy and critical hit chance.
  • Charisma depends on the head. It matters for some jobs at the club, and at the start of a fight, the fighter with the highest Charisma gives every other teammate a morale boost equal to their Charisma score.

Skills, perks, and traits

With a few exceptions, you can’t raise attributes by leveling up, but you can improve skills. Right now, the game has Ranged Combat, Acrobatics, Concentration, and separate skills for Light, Medium, and Heavy Armor.

Starting skills depend on a character’s background, with a random variation of up to 20% either way. When fighters level up, their Intelligence determines how many skill points they get, and you can spend those points wherever you like. They’re also offered three perks from the pool, and you get to pick one.

Fighters have innate traits, good or bad, as well as preferences for weapons and armor. Give someone gear they don’t like and they’ll take a small morale hit.

The social system

Every gladiator is a sensitive soul with a personality of their own. Each fighter has 20 personality scales, from quiet to talkative, tactless to tactful, and so on.

At the end of each day, a fighter picks a random teammate to talk to. How it goes depends on how similar they are across all 20 scales, as well as their Wisdom, Intelligence, Charisma, and traits. There are five possible outcomes: a conflict, an argument, an ordinary chat, a good conversation, or a great conversation. Each outcome can bring the two closer together or make them like each other less.

A team of friends fights much better than a team where everyone hates each other. And if two fighters really can’t stand each other, things can turn into a brawl. Sometimes a fatal one.

That’s about it for how characters work. Thanks for reading! If you’d like to try the early alpha, you can grab it here: https://hornedxrem.itch.io/morituri