Hobby Game Dev & Progress

Making Of / 23 June 2021

Hello!


It's been a couple of months since I took a break from programming, however I'm back to it and actually decided to reboot my own project and make sure the foundation is actually better and less messy. There were a couple of decisions for this:

  • I went to fast into programming detailed game-mechanics (free climbing system with IK, Physics based ropes swinging)
  • The Foundation was bad. The walking, running, jumping all felt kind of crap
  • The foundation for some of the programming was bad

Here are some old gifs of that:


Onto the new

So I went back to basics and made sure the locomotion went from Basic UE4 

but I had to do some update to my character, so I redid the skeleton, rigging and skinning
(it's definitely not a fun part of this whole thing)


To this below, which generally allows the user to move around more smoothly. I also have an aiming mode so the character can strafe and aim. Later on I'm intending this mode for stuff like a rope-hook or something like that or throwing things.


With the basic "feeling" of the locomotion in I had to deal with the biggest issue I had in the last iteration of the project which was that my movement states or any state for that matter was handled by either UE4 Enums or by pure boolean checks. Making new functionality really messy.

https://gameprogrammingpatterns.com/state.html

Here is a good read if you like this kind of stuff, but essentially it boiled down to, whenever I made a new function for my character I had to manually ensure that the player couldn't access other functions whilst doing something else. Example, not sprint  when jumping in the air. This meant that generally I spent a lot of time just bug-fixing things.

The solution for this is to make sure that when a character enters a state , he's accessing functionality that only exists in this state , the easiest way to do this is to use a Finite State Machine. The main issue is that UE4 doesn't actually support it natively, so you have to rely on kind of a messy workflow using Enums, which work but it's a bit annoying to get a good overview of what you're doing.


So I got to work and actually got my hands wet with a code plugin called Logic Driver Pro and with the help of a kind soul (Alzahel) on discord I started to learn how to work this plugin since it's definitely not a plug and go type solution, however when understood it's pretty straight forward.

My character now enters the right state (as shown on the preview visualisation) allowing me to run certain function upon entering, In the state and when the state is exited. Which is perfect, whilst making sure the transitions to other states are limited. Extremely powerful and very helpful.

After this I decided I kind of disliked looking at the gray character so I made sure I brought over the cel-shading and my eye-tracking solution from the previous project.


That's pretty much it for the last few weeks of work, if you're interested in this stuff then you can always follow me on my Patreon to get more insights , check out my livestream on twitch where I stream Art and will eventually move over into more game-development as I go ( I want to hit a good foundation before I start streaming game dev stuff).

oh and if you have any questions just ask em below! 

Until next time!
Warping out

//Chris Radsby