Progress update- fancy hierarchical state machines (Patreon)
Content
Last week I showed a diagram of the various states needed in the game, and this is a continuation of that.
The main thing I've managed to do this week is implement that diagram into actual code. This is a case of needing Real Programming (tm) to accomplish, because I'm making a custom version of a hierarchical state machine. I'm proud of being able to pull stuff like this off now, though it's a little dry to talk about.
So a normal state machine is when you have say, a character, and you want them to swap between doing various things. So they can be running, jumping, or standing still. They can't do more than one of these at once, so you can make a state machine with those three states. The machine will execute jumping code while jumping, running code while running, etc etc. It will also run transition code to go from run->jump or jump->standing, etc.
This is one of the extremely useful core concepts of game code that you'll inevitably run into if you try to make any kind of game.
So I was using this concept for the player in SHF3, to track what you're doing in any given moment (like holding a toy, p*netrating a character with a toy, grabbing a character with an empty hand, etc). But I ran into an issue:
Like, sometimes I just need to know "is a toy in the player's hand right now?" and sometimes I need to know "is the player holding onto a toy that is about to p*netrate a character, but hasn't touched the character's p*ssy/lips yet?" Technically the second scenario is a subset of the first. They overlap. You can't have that in a proper state machine cause they aren't separate states.
The solution
After researching how people handle problems like this, I found that you can nest states inside of states. Holding a toy is an umbrella state that contains using a toy to p*netrate or touch a character. We can now get as specific or as general as we need to.
I dove into writing my own version of this idea (the hierarchical state machine) and it's gone really well. At first I did the noob programmer approach of looking up tutorials and whatnot to try to get my head around the problem. I found a few versions of these out there that I could've copied, but they were all built for slow-running things like apps and websites, or were wayyy overkill. In a game, they'd have bad performance.
Finally, I realized that I was doubting myself far too much. I thought I was too dumb to make this work properly without help. When I pushed through those doubts, though, it turned out not to be so hard after all. Self-doubt sucks. But at least I've got a pretty smart little hierarchical state machine now that can tell me exactly what the player is getting up to in any given moment. Thank goodness.
Community interaction
I'm also contemplating a few things about how I approach running/handling the community around my games. Streaming and running a discord, while fun in some ways, kind of feel like a distraction from my actual goal. I just wanna quietly make l*wd things, honestly. I want and need input and interaction with my community, but that's different from socializing with my community. I'm putting this out here now but haven't made any decisions yet. Just wanna let y'all know that it's on my mind.
... and that's all for now!
I'm still quite drained from having a lot of IRL things to handle along with work on the game, so please excuse the lack of enthusiasm and timeliness in these posts recently. I'm doing my best to make time boundaries for myself so I don't burn out.
I tend to measure my worth based on the results of my efforts, and therefore want to work as hard as possible in a desperate attempt to "earn" a feeling of self worth. It's self-destructive and leads to stress that destroys my productivity.
Lately I've been learning that working fast isn't about doing more things in less time. It's about doing less things. And respecting your own needs and limits. And doing so, ironically, leads to accomplishing more anyway.
This is a lot to handle from an emotional perspective. Genuinely is therapy material. Creatives fall victim to this nonsense so often, it feels like.
Anyway, I'm excited to use this hierarchical state machine as the logic behind prototyping penetration mechanics! It's coming together quite well so far. Thank you all for the support in making this a reality. I feel immensely lucky to have your support as I grow as a person, a programmer, and a l*wdness creator.
<3