Journal Entry 2


Date: 4. 5. 2023

Activity:
Started working on Project C

Notes:
Soo... it's been a long week. I mostly worked on coding and putting Bety's animations together in unity. I made a pretty great player controller with all the stuff you might want in a platformer like this. It has coyote time, it has a different jump  based on how long you hold the button for, it has a jump buffer and all the fancy stuff. I also made a script that handles the player's attacks. Currently, most of the attacks are triggered by animation events so they're in sync with the animations. I find it slightly awkward, having to make many simple public methods that aren't called anywhere in the actual script and are all just called from the animations but I like that this way, I have much more control about the timing of the attacks through the animations. At first, I didn't really like how slow the basic attack was but then I tried to freeze the player controller mid attack (inspired by dark souls :)) and that made if feel so much better. I really like the controls of this game now. I might just have to slightly tweak the move speed and jump height but the feel is there.

I had a lot of trouble with the spear throw. It wouldn't stick into walls as I wanted it to, it would collide with the player and move slightly off-course and a whole bunch more annoying stuff. Many of the issues were caused by unity's physics system and so I eventually decided to discard it (at least for the spear throw). I disable the spear's collider when throwing it and I don't use the rigidbody to move it - I just use the good ol' transform.Translate(). I know it's kinda bad practice but I feel like I know enough of what I'm doing to be able to justify it. I multiply the speed by Time.deltaTime to ensure a consistent speed at all framerates and I cast a ray in the direction of the speed to check for collisions before I move the spear. That's how I make the spear stick into the walls without a collider and how I ensure it always sticks into the wall at the right point - the tip. Then, I finally enable the collider to make the player able to stand on the spear. I find that this is very consistent and works really well. I also made a small script that allows the player to fall through the spear after pressing down+jump, which can be reused later for any fall-through platforms.

I also spent a lot of time setting up the player's animator. Since I can't draw (and animate) and never wanted to get assets online, I never really worked with a fully animated player character. I have to say, it's a lot of work getting the animator to do what I want it to do without being a spaghetti-like mess of connections. Currently, the player has like 12 different animations and it's really hard to manage all the connections. What helped a lot, is that I split the state machine into 2 sub-state machines, one for when the player has the spear and for when they don't. The most annoying thing about the animator is that, by default, a transition is set to have exit time and a transition duration of 0.25. I hate that. None of our animations have a transition duration of anything other that 0 and only a few transitions have exit time. Maybe you can change the default somewhere that I don't know about but still, it's annoying as hell and of course, sometimes you just forget to uncheck "has exit time" and then it doesn't do what you want it to do. I hate it.

I also started working on enemies. I first made a static box that the player can break just so I could test the player attack script. Then I made a slime enemy that currently just jumps around and does nothing.

My plans for next week are:
a solid enemy system - I want an easy way to setup a patrol path inside the editor
actual enemy ai
player health and death
ladders
the ability to recall the spear
that's about all that I can think of off the top of my head but I'm sure something else will come up

Invested hours:
I genuinely have no clue but it was over 10

Files

Development Build 28 MB
May 04, 2023

Get Project C - Recall

Leave a comment

Log in with itch.io to leave a comment.