Week 8—Player Movement


Coalesce Player Movement

This devlog will focus on player movement. A handful of other features were implemented this week, but only because it was necessary to create such features to test and experiment with the player movement. This project also implements lighting using URP, but this was not the focus and will be explored properly in a future devlog.

Test Environment

Coalesce is a game that only has a single input; the space button. The only thing this input does is change the mass of the player, which does not actually do anything without an environment that can react to the player's changing mass. For this reason, it became necessary very early in development (before even adding the script to control the player's mass) to create a test pinball machine made from basic shapes.

This pinball machine features a flippers that active automatically when the player is near, a pinball shooter, slingshots, and destructible bumpers. When the ball hits these bumpers at its normal weight, it is given a reflection force using the collision data. However, the impact force is calculated on every collision with these destructible objects, and if exceeds a certain value the object is destroyed. The higher the mass of an object, the higher the collision force (unity works this way out of the box). An example of the ball destroying one such bumper is shown bellow (the ball is heaver when it is glowing).


Basic Player Movement

Controlling the ball only though it's mass is possible. For a simple example, consider the pinball shooter, which is basically just a spring that compresses when the player is heavier. The player can choose when to stop being heavy to launch themselves at different trajectories. Below is an example of the player compressing the launch spring all the way and getting maximum velocity.

The player can use a similar idea to control their launch speed off of the flippers. When the player is heavy, the flippers cannot generate the force required to launch them. By become light on the flippers at the right moment, the player controls their launch angle, as seen below.

It is not easy to control launch angle of the ball using the flippers however, so I do not think that the player should be punished for getting this wrong. My original intention was to add a 'Coalesce meter' which would deplete whenever the player was heavy. This would require the player use the resource wisely, but the game proves challenging enough without such a feature. Instead, it may be prudent to add a timer and reward players for completing levels quickly (level completion will likely involve destroying all the destructible objects in the level).

Also, the player may hold space too long and fall past the flippers into the trough. Should this happen, they will be re spawned in the launch bay without any penalty. This could even be incorporated as an intentional mechanic for players to maneuver themselves into a more favorable position in certain levels.

Iterative Movement Improvement

As the game was using the unity physics engine, I anticipated that the project would require some fine tuning before it was even playable. This was certainly the case, as earlier versions featured a ball that would either fly around the screen so quickly that the player had no control whatsoever, or the ball would be so heavy that the flippers would break when the ball collided with them. Most of the development time this week was spent fine tuning values such as gravity scale, friction, bounciness, mass, motor force, and launch speeds. The game has reached a point where I find the handling of the player acceptable, but where the game is still chaotic and fun.

Leave a comment

Log in with itch.io to leave a comment.