Sunday 26 April 2015

Week 30: From a pretty level, to a game!

Time To Shine

This week I finally got my hands on the level and had the chance to properly work on getting it to a playable state. I started off by working on dialogue boxes, particularly those of the dialogue with the white rabbit, which would initiate the first puzzle in the level. For the puzzle itself we wanted the player to explore the lake area a bit, so we decided to have the white rabbit lose his gloves and nosegay flowers and send the players on a quest to find them. For the beginning cutscene I decided to start off by showing Alice and the Rabbit from a third person view. Then after that pat of the dialogue was finished the camera would cut to show a bit of a fly over of the lake. The camera then cut to show the gloves, to at least give the player an idea of whereabouts the gloves are hidden. After that the camera would cut to show the nosegay flowers, before finally cutting back to Alice and the rabbit. This way it wouldn't just be a boring static screen that shows Alice and the rabbit talking and it would also aid the player in completing the objective.

Implementing the actual dialogue boxes wasn't too hard, but I encountered a tiny problem. Currently in UE4 to make other cameras in the scene active (for cutscenes) I used a node called "Set View Target with Blend", which allows for the player's camera to temporarily switch to another one, which worked great. However, the problem with this is that any UMG HUD that the player has displayed on their screen, will not work with this. It will simply disappear. When doing dialogue boxes I used a UMG HUD to display them, so I came into a bit of a problem when they wouldn't show up. Unfortunately. there wasn't an easy way to solve this either and I had do change the blueprints that I had created so instead of using "Set View Target with Blend" I ended up changing the blueprints to be actual pawns that I could then "Possess" instead. This worked great for what I wanted to do, since it would not only allow me to display the UMG HUD, but it would also automatically remove the player's ability to move, since possessing a different pawn would completely detach the player controller from his character. Since I didn't want the player to move during the cutscene anyway this came in quite handy.

This did cause another problem though, which I only noticed on Friday, which was that the HUD for the player was currently created "On Possess", which meant when I ended up possessing the player character agian after the cutscene, it would end up creating another HUD on top of the original one. So I changed it to be created "On Begin Play", which caused it to disappear completely and the reason for that was probably the reason why I originally set the HUD to be created "On Possess". This happened because we start off the game inside a matinee cutscene and not in the character. We only possess the character once the matinee has finished playing. For the HUD to show up on the screen we need to have the player possess the character BEFORE creating the HUD, so when I go back on Monday I'll need to work around that and fix it.

Rabbit (with Quest)

Puzzles!

After I had created the cutscene and dialogue boxes I then focussed on getting the puzzles in the level to work. I had been told by Mark to concentrate on the actual level for now and leave the Dark World and with that the Mad Hatter puzzle out for now, since they still have to actually create and adjust the mood within that level. So I started off with the rabbit's puzzle, which I had mostly finished before anyway, by creating the HUD that shows what items had been collected already. I just needed to add a bit extra to check whether both items were collected and if they were, allow the player to end the puzzle.

After I finished creating the rabbit's puzzle I then went and attached the last key part onto the butterfly script that I made earlier in this project. This was one of our key part puzzles and the player would have to catch the butterfly to get the key part. This took a bit of figuring out, since I wasn't quite sure what I had to do to attach 2 completely different blueprints onto one another. When I finally managed to do it, it ended up not working in the game and the reason for that was that my collectable blueprint was using "Set World Position" to make the key part bop up and down. This ultimately forced the key to stay where it was and just bop up and down instead of fly through the air together with the butterfly. I fixed this by simply disabling the bopping for this particular key part, since it was looking a bit weird anyway (if a part of a key hovering below a butterfly and emitting sparkles isn't weird enough already!).

The next thing I wanted to do was a quick fix for the fountain puzzle, which was moving too low and would allow the player to simply jump straight onto the last platform (completely skipping the level). So I did this quickly by making the platform move less further down, which ultimately made them move slower and therefore making the puzzle easier, but since people were already struggling with it before I thought I might as well just leave it a bit easier anyway. We don't need the puzzles in our level to be too challenging, since we want everyone to be able to play through it.

Finally I moved onto maze, which was one of the first puzzles that I had originally created, however since the beginning of this project the maze itself had moved a bit and therefore it needed to be readjusted and I had to change some things to get it to work. The biggest problem I had with this was a simple stupid error, where Alice wouldn't be visible once I switched into third person. This was just because I thought she wasn't visible though, when actually she was visible, but from the camera angle that I chose she was about 1 pixel in size. This was because I disabled the beginning cutscene (in which Alice grows) for testing purposes and since you had to shrink to get into the maze, the actual Alice model was basically shrunk twice (exponentially!) I also wanted to get the Alice model to face the direction that she was moving in, since the maze controls disabled the mouse controls, so that it wouldn't be too confusing. This was also a bit challenging, since there was several checkboxes that needed to be ticked/unticked in order for this to work and it took me quite a while to find the last vital checkbox. After a bit of googling I eventually found this thread, which outlines all 4 checkboxes that control the camera/character rotation (Massive thanks to doC!).

The Maze
For a quick couple of pictures showing how the maze works, have a look at Mark's blog here: http://markeastlanddmuga.blogspot.co.uk/2015/04/dmuga-week-30-end-is-nigh.html

The Final Challenge

At the end of the week I got as far as working on the final puzzle, however while it is currently playable it is not yet finished. For this puzzle we wanted the player to paint a set of rose bushes from white to red within a certain time limit. I managed to create a timer that would count down the time and display it on screen and I also created the actual function that paints the rose bushes. The only thing that currently is missing for this puzzle is the card guard, which you need to talk to first in order to activate the ability to start the puzzle. I got a manual work around for this that I used to test the actual puzzle, but if you fail the puzzle like this, then where would be no way to retry. The guard itself should not need a lot of scripting though. It will just be another dialogue, for which I can just copy what I have created for the rabbit and then it would just need to set a boolean inside the puzzle to true, which controls whether you can play the puzzle or not.

Hopefully I will be able to quickly implement this during the next week, however our main focus for the next week is to get the Dark World set up, so that I can work on getting the last bits done during the final week afterwards. It's a very stressful time for us all, but we can do this!

Until then, stay tuned~

No comments:

Post a Comment