Polishing and adding Disaster Levels (Week 5)

July 04 – JULY 11

This sprint I spent all of my time on the disaster levels. I improved the UX for moving, implemented new levels, and made the game playable start-to-finish.

Improving Movement UX

As I already mentioned in the last post, there was some issue with the drag direction, compared to the node layout. During this sprint i made it so that you supply the swipe function with a horizontal and a vertical vector, and it calculates the direction from those. If we wanted to rotate the camera, I would need to calculate those two vectors first, but for the time that feature was not planned.

I also made some fine-tuning improvements to the movement behaviour besides that:

  • You now had to click on the player, in order to move it, no longer anywhere in the level
  • There was now a minimum distance the mouse had to travel to recognize the move
  • The figurine movement was now Tweened between the two nodes.
  • You could “save up” moves

Saving up moves was probably the most subtle of the changes, but made it feel so much better. Let me explain what I mean by that.
When you declare a move by dragging your figurine, the move is executed as soon as you let go of it. However there is a delay until you’re allowed to declare another move. First the movement tween needs to finish, then potential moving NPCs need to move, and finally the flood rises.
This turn simulation takes about a second all together. If the player was to try and declare a movement during this second, it would simply be ignored, and that felt bad as a result.
With the saved up moves, if the player declared a movement while the turn was still simulating, the move would be stored in a list, and executed after the current turn had finished simulating. If you were fast enough, you could store two movements, so you swipe three times, before the character starts moving the second time.

Creating New Level Behaviour

Andreas created the design for levels one (to go before the previous level) and three in this sprint, and I had to implement them. He also came up with the new behaviours during the week, so I was blocked in this for a while, while waiting for him to finish. It timed relatively well though, because I focused on the UX and some other things first.

Implementing level 1 took me around five minutes, after all it was just a tutorial to teach the player the controls.

level1
Level 1 final (without art assets)

Level 3 took me a lot longer, since it was bigger, and it also had a lot more functionality.
In level 3 we introduced switches, which could switch off distributionBoxes from a remote location, and screwdrivers which you could use to switch off and protect you from a distributionbox on the node you’re moving to.
The Switch could be clicked to use it, while the screwdriver was a pickup, which could only be used once. Both of them would be interacted with by clicking.

That meant I had to:

  • Create Interactable Behaviour
    • Multiple Objects placed on the same node without colliding
      • Make sure the objects are positioned in a way that they do not collide with the clickbox for the player figurine
      • For this I made 5 “slots”, one in the center, and one in every cardinal direction of the node, and defined which object goes on which slot.
    • Object can be clicked
      • Clicking Switch has immediate effect on level
      • Clicking Screwdriver removes it, and has effect later in the level
    • Distribution box enemy can be “deactivated” so it doesn’t hurt the player
    • Objects needed to be highlighted as clickable when you’re on their node
      • The highlight was implemented by tweening the scale
  • Build the Level, which included (as previously)
    • Placing Nodes according to the design
    • Connecting each node with their neighbours
    • Placing enemies and interactables in the level
    • Placing Flood, and make it appear after a certain number of turns
    • Make sure every interactable is hooked up to the level info, which is queried by the gamemode to simulate the turn.

All added up, the result looked something like this:

level3
Level 3, functionality complete, no assets.

In this gif you can see the player picking up the screwdriver and use it to disable the first enemy. Later you see them click the switch, which disables the connected enemy box. At the end, I tried to show off saving up the moves, but as it is very subtle, it’s easier to get if you play it yourself.

Game Flow

The final task for this sprint was to connect the game from start to finish.
I made another datatable which contains the sequence in which the levels are played. When the exit node of one level is reached, the next in the sequence is entered, and after the final level, the player is returned to the world map.

1 thought on “Polishing and adding Disaster Levels (Week 5)”

Leave a Reply

Your email address will not be published.