I have quite a bit of free time on my hands until the next semester starts (in a few days...), and this leisure time has allowed me to continue working on my game a lot more than usual! I made quite a bit of progress that makes this game prototype feel slightly more polished and I'm really happy to share it here and now.
Collectibles are now attracted by the player once they're within a certain range (specified by a spherical CollisionShape3D
) and are collected once they get close enough to the player – which is to say, once they collide with another, smaller spherical CollisionShape3D
. The first try didn't work out amazingly, as the collectibles didn't want my character to intrude on their personal space though...
I fixed that issue, and lowered the attraction velocity to test, but that resulted in a spooky haunting effect.
Here's another demonstration of that! I played around with PhantomCamera's dampening, which makes the haunting effect more evident. Also something I only came to notice then: my player jumps INSANELY high. Like 8x their height. This will be fixed later.
After tweaking the speed, I got some nice attracted collectibles.
One issue still remains though: when moving, the collectibles don't attract all the way into the player, therefore they don't get collected and fly next to the player until they stop moving.
I learned that lerp()
was at fault (no offense!) – lerp()
would work perfectly fine if the player were standing still, but since the player – and therefore, the target position – is moving, lerp()
calculates a speed that cannot overcome the difference between the collectible position and the player.
I overcame this issue by increasing the weight of lerp()
on every frame, thus increasing the speed linearly. This resulted in a very smooth attraction transition.
I finally implemented enemy health – they can now take damage from weapons and die. But it felt so hollow without any impact. I wanted my rockets to explode. So I started working on that.
I first implemented a fairly basic particle effect using cube meshes. Not exactly photorealistic, but it gets the message across.
I struggled EXTREMELY with getting the rockets to collide with the floor and walls. Oddly enough, they collided perfectly fine with the enemies! I was particularly confused because both the walls/floors and the enemies were types of body
nodes, thus using the same piece of code to register a collision.
I looked up the issue online, to no avail, really, until I stumbled upon a thread about a completely different problem where someone advised to change the physics engine. I am, in fact, using a different physics engine – Jolt. So I figured, I'll go into the settings, and I'll change it, just to see what happens.
I briefly checked out Jolt's settings page... and then I saw something.
"Areas Detect Static Bodies." This setting was OFF by default. This could actually apply, I figured, because my rockets are Area3D
s and the walls/floors are StaticBody3D
nodes. I turned it on, and... my issue was solved. Slightly frustrated, but more so amused and relieved, I continued work, happy that my code was fine and my solution worked.
I introduced an exported property that allows for setting the amount of collisions a projectile may experience before it despawns, thus allowing, for example, for the rocket to explode through a wall! I might use this in the future for the v3 rocket laucher.
One day after that, I was motivated to create a more convincing explosion. I watched a YouTube tutorial, and ultimately got something that looks quite nice:
Interesting observation: in Godot, you can use the "RAW" tab when picking a colour to set values above 100%. The explosions, for example, use red values between 300% and 500%, which, with my WorldEnvironment
light setup, produces a glowing effect that's just perfect for explosions!
I also messed up my lighting setup in configuring this, which results in my character being extra shiny and the N5 Blaster to glow excessively, but that's ok, we can fix that later.
In a strange coincidence, Masahiro Sakurai released a video about particle effects and the "right level of detail" just one day after I had started working on my explosion particle effects. Interesting video, by the way – I was not aware of how important scale is when designing VFX.
Anyway, I got to work on camera shake! Through a tiny bug that has already been fixed, I briefly got to experience something resembling a camera shake in my game while I was firing a rocket. I thought that was super cool, so I looked up camera shake and implemented it.
The tutorial I followed (a 2D tutorial, btw) used a strength value of 30. I figured that'd be too much, so I set it to 20, just in case.
...I later set down the strength value to about 0.35.
I also implemented distance fade for the camera shake strength! The strength now depends on how close the player is to the explosion origin. An explosion far away won't shake the camera, but one close up has much more impact!
I had a random burst inspiration recently while I was on the bus, and once I got home, I started modelling it. Introducing: a weapon that is unfinished and has no (finalised) name yet, but I'm still fairly proud of:
I'm thinking this could be a blaster of types, maybe similar to an N5 Blaster upgrade – two-handed. Though I think it should be separate from the N5 Blaster. It could also be a flamethrower, though I want the flamethrower to look a bit different, especially at the gun barrel.
I quite like the bolt at the back as well as the yellow gunmetal-ish colour of the bolt and the gun barrel. The body is far from finalised – I still have to figure out a fitting one. I do like the cutouts in the shape, however, so I'll probably keep them for the final body shape.
I also worked quite a bit on the camera, specifically how it moves! This is the main thing that, in my opinion, makes the current build feel just a bit more polished than the previous ones – relatively speaking, of course.
The camera now moves quicker and more smoothly in and out of the precision aiming mode, for example:
The level overview camera also moves in a much cooler way, using a quint transition type instead of the previous linear transition. I think using quint improves the look significantly.
Look at how smoothly the camera follows the player, even when the player jumps up a platform or falls down from one!
The camera now sticks to the ground briefly when the player jumps, but it returns to the player once the player exceeds a certain height above the jump origin or falls lower than the starting point.
Also notice how, at the end of the video, I struggle to jump up the (admittedly massive) wall, but ultimately make it. Why is that? It's because I:
Of course, obligatory I accidentally turned my game into a first-person shooter, again. This view of the N5 Blaster actually reminds me of Metroid.
I'm really happy with my progress. As a bonus, here's an overview of my current testing level Unity.