Making the Game: Stuff to Kill, Stuff to Get
Hello and welcome back to another post about Robotrooper: Simulation's development. Today I want to share with you two new interactables I added into Robotrooper's world - the hostile Turrets and the valuable Activation Cores!
Turrets first appeared in the previous Robotrooper game. However, I was determined to make them and the player's interactions with them a bit more interesting this time around. This is of course where the shockwave gun comes into play. The key to defeating turrets in Simulation is using the shockwave to redirect their fire back at them (or another turret in the room).
Oh, and you have to defeat them to actually make progress! This is because Cube Keys in certain rooms are now inactive until the room is cleared. More on that later.
What You Give Is What You Get
Turrets first appeared in the previous Robotrooper game. However, I was determined to make them and the player's interactions with them a bit more interesting this time around. This is of course where the shockwave gun comes into play. The key to defeating turrets in Simulation is using the shockwave to redirect their fire back at them (or another turret in the room).
Oh, and you have to defeat them to actually make progress! This is because Cube Keys in certain rooms are now inactive until the room is cleared. More on that later.
Implementation
Turrets are initially inactive. They are activated when the player triggers the checkpoint they are tied to. This is usually the checkpoint for the room they're in. The turrets assigned to the checkpoint are looped through and if they aren't already active or were already deactivated, they "activate".
Upon activation, the turret's hitpoints are set. This is so that the value is reset whenever the player dies and the turrets get reactivated. Then, the turret rises from the ground and its muzzle extends forward. This is, of course, just lerping between two positions using a timeline.
Every Tick, while active, the turret will turn to face the player with its muzzle, shooting its projectiles every 2-3 seconds. The hardest part of this setup was by far finding the correct transform for the projectile. Don't get me wrong, it wasn't hard to set up, but it was not nearly as straightforward as the rest of the nodes. For the rotation (of the projectile and the turret), I first Find the Look At Rotation the turret to the player. I don't want the turret to turn completely, so I break the resultant rotator and get its Yaw output. This is fed into a Make Rotator node, which in turn branches off into a CombineRotators Node (where I combine it with an offset to make the turret face the player with the muzzle) and a Rotate Vector node. The rotated vector in question is an offset that, when combined with the location of the muzzle, will get the final location of where the turret's projectile will spawn.
The turret has a Damage Event as well of course, which is only triggered when it is hit by one of its own projectiles. Once its health depletes to 0, the Deactivate Event is triggered... it's basically the reverse of the Activate Event. It's all fairly straightforward, really. There's also a Reset Event, triggered from the Cube Key the turret is tied to.
As for the turret's projectiles themselves, they react differently depending on what they collide with.
- If they hit Robotrooper, they trigger his Lose A Life Event.
- If they hit a shockwave projectile, their direction is changed to be that of the shockwave's.
- If they hit a turret, it's Damage Event is triggered.
- And as for anything else... well, they just cease to exist, really.
What You Get Is What You See
Let's move on to Activation Cores. These are simple, but flashy collectibles that Robotrooper has to collect in order to progress, as they are also needed to activate a Cube Key sometimes.
Their blueprint is incredibly straightforward. Their Event Tick keeps 'em spinning by use of a AddWorldRotation node. They are collected by coming in contact with the player, at which point they turn invisible (Set Visibility node) and get marked as collected. Their Reset Event simply makes them visible and marks them as uncollected.
In Other News
- I finalized the level map for the game! And, as you can probably tell, I found a new home for the moving platform from my previous blog post!
- I also finished most of the map (safe for the end room) in-game.
- Cube Keys, if inactive, now track progress towards their activation. This is reset whenever the player dies. Cube Keys also trigger the Reset Events on the Turrets and Activation Cores needed to activate them.
That's it for this update. Thank you for tuning in. See you in my next blog post!











Comments
Post a Comment