Sunday, 15 July 2012

Nearly done!

Not quite though...

There is still no stopping the timer, I cant quite work out how to stop the timer on trigger at the end of each level. I have tried multiple different coding approaches but nothing seems to fix it. 

Scoreboards are not in place yet either, I might put this in at a later date and get some other functions working to the way they should.

Fixing the movespeed, turnspeed and jump height for the player character is really easy using the unity game engine. You just select your object and change the slider vars on the side bar. It is really that simple... I was fiddling with these settings for a little while to get the character to behave properly for the levels.


The Is Grounded option is to say whether or not the player is on the ground. If the player is on the ground, the player may use the jump key. This was to fix an issue where the player could continuously jump throughout the levels without the need to use the platforms. 

The moving platforms were greatly slowed down so that it was easy enough for beginner players. If more levels were to be added, the speed of which the platforms moved would vary greatly and offer difficult resistance. 

A problem I cannot get rid of, is this: 


Whenever the player jumps onto the moving platform in the third level at a weird angle or lands funny, this happens.. It stretches the character model along some axis by some amount. I have no idea what causes this, I have no idea how to fix this. :(



Fallout catcher!

Lerpz... Helped a lot here. 

In the 3D adventure game tutorial, which was for weeks 1-5 of this module there was a section on the fallout catcher. Now, what this fallout catcher does is when the character falls off the level, it will trigger something and the player with spawn again in a safe location on the level. 

You have to make an object trigger underneath the level, that covers all sides and is big enough so that if the player decides to run off somewhere and jump to hell they spawn back up top without hassle. 


Now when you fall off the level, you get spawned back at the start.



Connecting the levels

Lets get to it... There is only three

This is theory should have been really simple, considering there are only 3 levels in my game, plus a start menu and end menu perhaps. Still, nothing too crazy. 

I started off creating a menu screen for the game, only a simple one but enough to serve its purpose. In the coding for the buttons, it is relatively easy to change level using a button. So once this was set up time to test! But it didnt work, why oh why, the code im sure was correct. You need to build the project, or at least set up the build properties if you want multiple levels before you can go testing the multiple level functions of unity game development. 

This was easy to over come and here is the menu:


The Play Game button is highlighted because if you hover over the block with your cursor, it will change the colour of the block to indicate you have selected. This is such a simple way to make an effective 3D main menu for any game type. 

Connecting the other levels together after the main menu, was not as simple as I had hoped. As before I had used triggers to set up hint boxes for the player, I was going to use this approach to make a trigger that would pop up a message box telling the player the level had been completed and they may advance. Once the player clicked the button to advance, I could initiate the level transfer. It could have been done so that the player instantly went to the next level upon completion of the level, but this gave the user limited input in deciding how long to play for. 

The info boxes with buttons in are only active if the player steps onto the trigger, the minute the player leaves, the box saying the level is completed with disappear. This allows players to complete the level, then roam about it for future hi-score attempts. 

Bugs!

Maybe not all bugs, but stuff that needs improving!

Ahh noooo. So far here is what is not currently working to the standard I want it to.

- Moving platforms are moving way too fast for the player to be able to land safely on them.
- If the player manages to get on the platform, sometimes it bugs out majorly and adds another cube on top or another side.
- When the character falls off the level, they just fall and fall. Not good.
- The levels are too easy because of the player variables, will need tweaking.
- Once you complete a level, it does not go to the next level. I must sort out the finish level trigger pad.
- There is still no menu or end screen.
- There is no timer for the levels, to see how quickly you managed each one.
- There is no scoreboard at the end of each level.

Over the next few weeks I will be fixing these issues one by one and reporting back here to inform the web of my wonders.

GUI

This part of the exercise I found quite difficult and took me quite a bit of time to work out how to place the boxes and such precisely where I wanted them on the screen in-game.

I wanted 4 stationary positions for the players HUD, 1 in each corner of the screen. Then for the info boxes, I wanted them to pop up where the player would be able to read with ease and not interfere with anything else going on that was needed to look at.

This was achieved by using small GUI components on the screen, tucked away in the corner to give the player a feel like they are really in the game, yet still in a game. The info boxes were done by placing trigger pads on the floor where the info was meant to be accessible, using a script to detect whether the player was in the trigger or not would display the message or not.





I managed to re-use the code that I built and learnt from this in each of my levels with little problems, it was a great task.


Level Design!

Now for my levels...

For this project, I decided that I would build 3 levels. On the first one it would be a simple tutorial-like level, with instructions on how to play the game when you first start using pressure pads or triggers of some sort. 


The second level would then introduce the moving platform idea to the player, with another help box on the start of the level indicating that yes the platform is moving and you must account for this.


The final level I did was going to then incorporate a higher level of difficulty to the moving platform, speed and area to land on plus have the challenge of moving around a full level instead of some blocks placed in front of each other. 






Character design!

Creating my game character

I made a cube to be the player controlled character. I attached a simple move script that I wrote. The script at first was basic WASD functions, forward, backward, turn left and turn right. Getting the jump to work correctly took a little bit of fiddling with code but it was delt with in no time really. 



After I had the basic movement functions down, I decided that I wanted a way in which to look around the character like you have in many of games now a days. This was quite tricky to code for me, I have never attempted anything like this and thus thought it would be a great addition to my game. There were a few problems in setting it up but once it was done it really gave the player a better advantage to judge gaps and moving platforms.

Jumping seems a bit too easy on the player but I can change the variables at a later date.