top of page

Unity Development Part 13

  • kw4u19
  • May 25, 2021
  • 6 min read

Updated: May 27, 2021

This development took place across week 11 and 12.


My aims:

  • Build up background scenery with Emilia - once the fixed structure is complete, open project to Molly for lighting implementation.

  • Make panpipe puzzle functional

  • Lanterns switch after each puzzle

  • Implement Gust of wind animation



General changes I made today


At the moment, when the player dies at any point in the game, they re-spawn quite a way back at from the position they fall from, and the camera takes a long time to catch up to the player. Therefore, I have increased the camera speed to five so this is a little faster but it is also worth thinking about adding in some more checkpoints.



Background beauty


Below is a short clip - a walkthrough of the game as it is right now. The first four puzzles are functional and their assets are all implemented. What is left to put in is the panpipe puzzle, the gust of wind animation and the lantern system. Then of course the UI, sound and lighting that is all being worked on still this week. Now, Emilia and I are going to build up the surrounding beauty.










Our expectation: The background should be built up with mountains, clouds and Japanese architecture (buildings and Torri gates). We have realised that we do not have enough time left this week to implement parallax scrolling so we ill do our best to build up an immersive world with dimension, without that feature.


The process of build up the background

I had already imported all necessary assets into unity so we were able to get started straight away with moving assets into the scene, beginning with clouds and blossoms set to a low opacity. We had variation in clouds, of both size and opacity to create some dimension throughout the level.


To incorporate the huts and Torri gates, we had to surround the base of them with some cloud coverage to make it look as though they were also floating high above on platforms like the path of the player. The mountains were positioned so it looked as though they were peaking our from the clouds in the background sky painting.


To get a better visualisation in the scene manager, we duplicated the sky background and placed it at the appropriate elevation for each part of the level. That way we could see the boundaries of the screen the player would be seeing to could place the assets where the cut-offs would not be visible. This was a tedious process and it was quite difficult to manage, having to switch between the scene manager and the game over and over.


I realised that I could in fact re-tint some of the clouds by changing the colour of the sprites in the inspector, so I was able to add to the scenery with more variation in cloud colour which helped to make it look more natural as some of the whiter clouds contrasted too harshly against the orange sky.


To test the details we put into the scene, we played through the game a few times and picked out spots where the assets had been places poorly. An example of this is shown above where the Japanese hut is not standing on anything and it just looks a bit ridiculous.


Reflection


Using low opacity assets to make up the background details was not the original plan for the vertical slice. We were going to build up the background with more refined detail and greater world. That was going to be my role for the art side of the project but as I got unwell halfway through this project and then took on the full responsibility of the Unity development, there was not time for me to also work on the background and other members of the team had too much on their hands too.


The alternative method we found for building up the environment has worked well and I think it is suggestive of the world having spiritual connections and of course in the games design document the setting is described to be inside a spirit world so the design is still appropriate I would say.



Panpipe puzzle


The expectation: The player approaches the eagle and realises that they cannot pass so must use some intuition to work out why that is and what they need to do. The player must turn back and interact with the panpipes using the gust ability. This will cause a pan flute tune to play, which in turn will cause the eagle to fly away, clearing the path.


As shown in the first image above, the path was blocked by putting in an invisible box collider. I named that "EagleBarrier". In the script, I have written instruction so that on the instance the player presses the "r" key within the trigger box that is on the panpipes, a tune will proceed to play. In turn the Eagle animation will begin where it take-off and flies. The eagle has a vector2 applied to it so it flies out of frame. Then the box collider barrier destroys itself.


Here is the script split into four parts:


1. When the player enters the trigger box on the panpipes, touching panpipes is true.
















2.In the if functions for if the player presses the "r" key, and if TouchingPanpipes is true.

Play the music note animation.

Start the coroutine for EagleFliesAway.

Destroy the invisible barrier.

Switch on the lantern.














3. To the coroutine!

Wait two seconds.

Play the eagle animation.

Set PanPipeSuccess to true.









4. When PanPipeSuccess is true, transform the eagles position.









The script for this puzzle was incredibly difficult to work out but once again when I began actually documenting the process, the pieces all clicked together in my head. I really am learning a lot from these sessions and I'm happy with how much I am progressing despite how slow that progress is.



The Lanterns


The expectation: The respective lantern switches on after each puzzle is solved. This will be written into the script that the puzzle is on.


The way I have done this is by referencing the sprite renderer for each lantern in the script and then inside the function where the effect of completing the puzzle is established, added a piece of script that switches the sprite (of the off lantern) on the game object to a sprite (of the on lantern) that is in the asset folder.


For the boulder bridge puzzle:

A public variable has been set for each of the lanterns. Once the function for filling the gap is established, the sprite render switches out one for the other.







Gust of wind


The gust of wind animation plays once the player has pressed the "r" key to use the ability. IT is a swirl of wind that moves ahead of the player.


Unfortunately once I imported the animation in and set it up, making it a child of the player object, it does not move as it was supposed to in the demonstration Molly showed. This is because the sprite splicer in unity cuts the frames automatically and does not account for the space around the drawing.


To solve this, Molly could send me the individual frames of the gust animation and that way we would be able to show how the gust does move across the horizontal axis. As I am now working on the last few features in unity, I do not think we have time for this to be refined and it is not detrimental that is isn't fixed.


Here is the script:


As you can see in the script, I added a coroutine before the animation for the gust of wind begins. This is because two animation now play upon pressing "R". Firstly the player motion with the staff, and then the actual gust that is created from the staff movement.















This video clip shows what the two animations look like in-game:

The video shows how they animations are still out of sync. The clouds move away before either animation has played despite how I have added coroutines to both the gust animation scripts and the cloud movement script. I think this may be because I am putting the lines of script in the wrong places but I will ask James for clarification when I next speak to him.



Reflection


Now all five of the puzzles have been completed and the lantern system is in and working, I am feeling a lot better about the project. There is not much left to do now, just adding the last few features and the doing some health check ups.


Next Steps


This week I will have my last development surgery with James and will finish putting the final features into unity. I am confident that it will all be finished before the deadline with time to show the full walkthrough of the game to the girls beforehand.


During the development surgery, I will ask James for guidance on the parts I do no yet understand how to do including putting in the UI, most importantly the start screen, and the sound effects.



Comments


bottom of page