Log In or Create Account
Back to Blog
DEVELOPMENT

5

819
Stamina Mechanic
1 year ago1,258 words
I spent this week making progress with technical aspects of Dreamons, including replacing levels with a mechanic that plays the role of MP or cooldowns in a way I feel plays well with mechanics I already have.



I spent the first half of the week addressing issues related to the dioramas I wrote about ∞ last week ∞. These are made of cube 'tiles' which are generated at runtime via code (rather than using imported meshes made in a 3D modelling program). I'd written that code myself, and I tend to focus on the surface-level aesthetic and conceptual aspects of game dev with little regard for the deeper technical hardware performance stuff; I'm an artist, not an engineer.



I knew that because of that, I'd likely gone about things in a horrendously unoptimised way, so I checked this Stats panel you can bring up in Unity's Game view. I rarely bother with it since the numbers mean little to me, but this time the 'batches' number seemed probably too high, maybe. Not that I had any idea of what it'd typically be. So I googled it. I can't say I found any conclusive answer, though 100-300 came up and seemed reasonable, and 3500 was considered ludicrously high.

With just one diorama on screen, I was getting about 9500 batches!

So I had to essentially recode how the meshes were being generated and figure out how to combine them, which also involved rethinking how colliders (for collision detection) were being generated.




What I ended up doing was combining tile meshes based on their material, meaning now the dioramas are made up of just a handful of larger generated meshes rather than hundreds of tiles with their own separate meshes. The batch count's down to 200-300 (the earlier screenshot of the Stats panel is from after the optimisation), which is, what, like a 98% reduction?

So it's time well-spent, I suppose, though I always feel fairly unfulfilled whenever what I've done would be invisible and/or meaningless to players. (Though I suppose you could say that 'bad performance' would be very visible to players.)



Anyway, that took a while. I also lost some time feeling distracted and then depressed about ∞ the UFO hearing thing ∞ and the internet's apathetic, sceptical, or mocking reactions to it and the fact I didn't have anyone like-minded to share my excitement with. Bleh.

Once those thankfully fleeting dark clouds had cleared up, I wanted to address something related to battles that I've been meaning to revise for a while.


Outdated screenshot!


Previously, characters had a basic Level number, and when they levelled up, they could choose a 'boon' at the end of battle from a grid like this (each character type had their own). I revised how exactly the boons' availability worked a few times, most recently settling on having to acquire all the boons from a row before the next row became available.

If the game is going to be nonlinear, though, and characters only accompany you for single areas (as is the current plan), levels like this just introduce annoying balancing issues. I'd say they only really work when progression is linear. Plus I'd set it up so that I had to specify grids like that for each character type, which would be a fair bit of work.

I'd still like to have some progression, at least for the player character, but it's more likely going to be in the form of stat-boosting equipment you can find, or rewards like skills or equipment for completing areas.

So I removed levels, and could have just left it at that... but that introduced a space in the characters' 'statue' UI displays that bothered me. Surely reason enough to add an entirely new mechanic despite saying previously that I was finished with mechanics tweaking for this project!!


I've also altered how the skills are displayed in the selection menu; previously they were small cards with the name displayed at a 45 degree angle, which were annoyingly difficult to read.


Now, characters have a stamina value, which limits the previously-free usage of skills; the same role filled by MP, PP, cooldowns, etc in other games.

It's been bothering me for a while now that you could just freely use skills with no cost because it makes designing them more difficult (for example, a more powerful skill with no drawbacks would make weaker variations obsolete, which I don't like), and I'd tried a few times to come up with some solution to that, without much luck. This idea came to me from the aether fully-formed the other day, though; I suppose my subconscious must have been working away at the problem in the background or something?

It's fairly straightforward. Characters have a stamina wheel (which resembles the ones from Breath of the Wild and Tears of the Kingdom by coincidence more than intention) with a small number of divisions (probably between 3 and 6 in most cases; it varies by character type). Skills have a stamina cost; probably between 1 and 3. When a character runs out of stamina, they become exhausted.


The two Normies here are Exhausted, as shown by the reddish spiral where their stamina wheel was.


Characters who are Exhausted can still actually use their skills regardless of cost, but all skills they use have their power halved, and all skills used against them have their power doubled. I don't recall seeing anything like this in other games!

Stamina regenerates for all characters 'in the crowd' (that is, not in the two active slots) by 1 point whenever anyone takes a turn.

I imagine its primary use would be to encourage switching, rather than just having the same two active characters spamming the same skills over and over. Some skills would also raise or lower stamina for allies or foes, and foes would likely be programmed to switch out if their stamina had run dry. Meaning you could lower a particularly threatening opponent's stamina to get them to switch out while you tamed their allies to build your party.

Oh, and like Conviction (the HP equivalent), it'd be reset to full at the start of battle.

How well it'll actually work in practice remains to be seen, though. It's implemented and it works (it was easy to add), though I've not had much chance to actually test it yet. From what little testing I have done, I felt it made the battles more interesting, though!



What I want to do next is make a test area/psychepelago, which would follow the previously-described story formula but with placeholder dialogue (so then I don't have to make story decisions first). Then, it'd be wise to have people test that to determine whether the game's even fun to play.

But I know I've said that sort of thing many times before and then it takes weeks or months for things to actually manifest, so... let's see how things go!

(I still really need to get around to the ports of my old Flash games, though, which I'd honestly forgotten about until a few days ago... Maybe I'll try to address the barrier that's in the way of that next week. Though I've been saying that to myself for ages. Damned Avoidant Personality Disorder making me avoid things, or whatever!!)

5 COMMENTS