Others [RELEASED] "Help me, Brave Sir Knight!" - A Godot dev diary (previously just "sharing my great idea")

papel

Member
Game Developer
Sep 2, 2018
453
626
There we go, nearly done. I still need to work somewhat on the iris. There's 3 different eyes and 4 different mouths, not shown below.

1724554568078.png

There's also a "back" face of the shield. I'll probably work on making the actual godot node tomorrow. Might also add a bell collar to her and some other little accessories.

On a completely unrelated note, drawing with polygons within godot is actually kinda fun. Too bad I can't add bones to a polygon without a texture. Also adding shadows is a fucking pain, each has to be a separate polygon, I can't (or don't know how to) simply cast shadows of a polygon some Z levels above over whatever happens to be below. This was for a game jam that I didn't finish in time, but might work after I'm done with BSK

1724554850684.png
 

papel

Member
Game Developer
Sep 2, 2018
453
626
Alrighty, back to work. I possibly finally fixed the fucking jump for good, instead of using delta, I'm now using a Timer node on the player. Testing on my phone yielded good results.

A good chunk of the logic of the cow enemy is working properly, like her moving, stopping and raising the shield. She's still moving while the shield is up, instead of standing still, but that's probably gonna take less than 5 minutes to solve. Animating her is taking my sweet, sweet time, tho. Just found out that, when I invert her graphics so she's moving left, the whole animation breaks. Yay :FacePalm:

Side note, hopefully nobody will look at these eyes and think that they're out of place. I did the trick with polygons there, I think it's a neat result

1734232046780.png

1734232135517.png
 

papel

Member
Game Developer
Sep 2, 2018
453
626
Jesus, Godot's collisions sometimes will refuse to disable! The cow's shield has a static collision that the player can jump on top of without getting hurt. There are many situations where this gets disabled. FOR SOME FUCKING REASON, when the enemy faints, the collision would get disabled but would STILL block the player, EVEN THOUGH IT WAS DISABLED!! Even with debug showing the collision shapes gave it a white outline, which meant it was disabled, but behaved as if it wasn't!!!

The cherry on top? I tried using the "set_deferred" function, but it didn't work at all. Coming back to what I did before, simply setting the collision.disabled = true, magically started working as intended. WHAT THE FUCKING FUCK!?

Ugh, Godot really tries my patience sometimes. What's also testing my patience lately is my shit code. For a change, I went ahead and decided to decouple the logic from the animation (the orc and kobold both have lots of logic that relies on specific animations playing, which is a nice feature of godot). As for actual trouble, getting the sex code to work. Right now, the animation is only playing correctly if the cow dies (as a funny side note, said cow will also disappear/die during the sex), that is, she won't faint for the player to fuck as many times as he'd like. If the cow can faint, the wrong animation is being called. As I said, my own shitty code fucking me.

The lesson i'm taking from this is: learn to fucking define states. I change states (such as whether the enemy is idling, walking, hurt, fainted, being fucked) in several different locations, and that makes my guesswork of "why the fuck is this behaving like this" much harder. To make matters worse, I also have loads of flags that I check outside of the state. I should definitely refactor this piece of shit, but this will be the last enemy I'll add to the game, so there's that. The lesson is: write down, draw on a paper all the states the entity can be in, which states can lead to which, and which ones have priority over which; only have ONE piece of code/function to change states

Anyway, I'm also planning on leaving the cow as a non-moving enemy, only ever changing facing direction. I can't quite remember if that was my original plan or not, but I think it makes sense, shieldwall to mess the player a bit, or open up some shortcuts.

Expect some edits on this post later today, if I manage to fix my shit.

Edit1: Ok, the sex is working, the problem now seems to be Godot. See, the eyes are not a texture, they're polygons. If the cow gets hit, the eyes close and the polygons are set to "visible = false", so they don't show up. So far, so good. However, when the animation is the sex one, the polygons don't show up, even when they're VERY FUCKING CLEARLY SET AS VISIBLE in the fucking debug.

Seriously, there's ONE function that toggles the iris visibility. It gets properly called, it sets the visibility to true, YET THE FUCKING POLYGONS DON'T SHOW UP. It's not a Z-index problem either, it's like the damn polygons don't even exist. It's shit like this that really makes me want to give up using Godot.

With visibility fucked, I tried using Color modulation, setting the alpha to 0 when hiding and 1 to show. Even then the fucking iris/polygon disappears. This ONLY happens in the sex animation and I have double checked it, there are NO keyframes for any of the eye polygons, or even the eye sprite for that matter. The fucking thing is literally disappearing for no fucking reason on this specific animation only.

The immediate fix is freezing the cow's eyes in the closed frame, but seriously, what the fuck

Turns out the problem was, in fact, the fucking Z-order. The iris were NOT set to be relative to the parent's Z, so when sex starts and the Z index gets shuffled around, they were getting stuck under 6 or so layers. Remember to check if the shit that's disappearing is using relative Z ordering so you don't bash your head against the keybaord for 30 minutes like an idiot.

Edit2:
Cow cheeks coming in hot! I'll probably finish by tomorrow
1734660109221.png

Edit3:
I just discovered that I don't need textures/sprite nodes to act as masks, I could have used polygons all this time. This means maybe 500kb of saved space and some 2 or 3mb of VRAM saved when running the big sex scenes. Not a big deal, but something that activates my neurons.
 
Last edited:

papel

Member
Game Developer
Sep 2, 2018
453
626
Speaking of video RAM, I went back and fiddled with one of the big kobold sex scenes, cropping the many 800x800 (2.44MiB each) images down to what they actually have of drawn area. VRAM usage went from ~35MB to ~6MB. Considering these big sex scenes more or less remain in memory at all times (the scene window loads all big sex scenes), and considering that I still need to work on the other kobold scene (currently using ~78MB), we're looking at around 80MB of VRAM being saved just from cropping images. For my game, that should give a performance boost on lower end hardware.

I also experimented with a 256 color PNG instead of a RGBA8, but Godot imports it as RGBA8 anyway, so there's no further performance gains there, unless TGA somehow uses less memory? I don't think so, but I'm not willing to take 10 minutes to find out.

The big animation for the cow is mostly done, still need to adjust some details, like keying the ass and leg movement, adding sound and the cumshots
 

papel

Member
Game Developer
Sep 2, 2018
453
626
Animations are finally done, though I'm wondering whether to add a short tail to the cow or not, as she currently has none.

Next step is making them turn around in place after a given time (3-5s), which should be easy, and adding some cows to the levels.

Fuck me and my terrible level design, btw. I better steal get inspiration from better games. The good part is that, since the player can jump on top of the shield and not get hurt means I can make some better shortcuts