Week 1 Devlog: Player Movement. | Escape from the M'lon Factory


This is the first devlog (and my first ever) of "Escape From The M'lon Factory."


This week, I set out to to create initial basic player movement. The basis of the movement is heavily inspired (cloned) from jetpack joyride. I found this excellent (and informative) tutorial on how achieve this. (I reccomend watching it if you are interested at all!)

(Kwan. 2017)


In order to visualise the playermovement I whipped up some quick and dirty boxes, for greyboxing the game.
The rectangle represents the player.
The White bars on the top and bottom represent the roof and floor.

The Square represents a obstacle (although it has no functionality.)




From this I developed 3 scripts, with a few of my own modifications to be a little bit different, rather then a copy cat.

For the Player:

This script controls how they move, and uses a physics based movement. Alternatively, I could have done one purely based on position (changing the transform, for unity fanatics) but this would not suit the game, as I would like for it to have the feel of weight, mass, gravity and most importantly acceleration. Acceleration will give the player a very easy to understand system they can use to their advantage when dodge obstacles, or if they are lax they may not be able to manage a dodge! (Also you hold down mutiple buttons with little effort to create 8 wayish movement.)

Controls that are used for the player (currently):
Space, when held the player will accelerate upwards until they hit the roof! (reminds me of jetpacks (wink wink))
A and D, when held the player will accelerate left or right, effectively speeding up and slowing down. (I'll expand on this later!)
S, when held this rapidly slams the user down, with acceleration and gravity. Very useful for dodging obstacles!



The game in action. 


For the Map:
This manages the map and how it works. Because the game is an endless runner the map needs to go forever. The tutorial I watched showed a couple of options. Option 1, Scale the floor and roof for a verrrrry long time. This has a few issues and is very impractical, first off it wouldn't be endless which makes it a limited runner! Secondly if I were to add graphics they could potentially be stretched. Also it probably wouldn 't be very good on performance to have a super long map.

The way I'm currently doing it is based on the tutorials solution. There is two sets of map, one where the player is currently on and one where the player is currently located and one where the player was previously. When the player reaches a certain point on the current map, the previous map will be put in front, and the current map will become the previous map. This works well because even if the player speeds up the map will probably be able to keep up.

(How it works.)
For the Camera:
You've probably noticed in the gif, that the character is moving on his own. This is because in runner games, the character more likely always needs to be moving. This a key point in jetpack joyride, so its important here. This achieved by not having the character always move, but the camera which moves a set distance every frame, the player is locked (a child) to the camera so always moves forward.

Peer Review And Feedback:
After putting this together, I was given the chance to have some of my peers test my game and me test theirs. (which is avaliable right now on itch.)
I'll divide it up into what they liked and what they did not, and what can be done.
What they liked:
They liked how the movement felt. I had two comments about how it felt like jetpack joyride. (which is exactly what i'm after!)
They liked how it felt a bit sluggish, as they couldn't have the character instantly respond, so they needed to plan ahead.
Player feels like it has momentum and impact in the scene.
What they disliked:
They felt that despite it being sluggish, the gravity and how much acceleration it took to get off the ground was huge.
It felt very punishing to let go of the space bar.

What can be done:
I'll work on tweaking the values for mass, gravity and thrust/force applied to the character, in that way I can find a sweet spot between sluggish and punishing. A golidlocks zone if you will.

Going Forward:
Next week, the focus is on map development. I will try and get some proper obstacles on the field. Although I see a problem with the physics and obstacles, so I'll see how it goes!

I will also continue to tweak the those values I listed, and get feedback on them as I go!

References:
Will Kwan. (2017, June 23). Cloning jetpack joyride in Unity. YouTube. https://www.youtube.com/watch?app=desktop&v=ofZtyysHp1s

Files

FirstGo.zip 3.1 MB
Apr 28, 2024

Leave a comment

Log in with itch.io to leave a comment.