The problem with the healthbar before is that when the health would be reduced, the health bar would disappear from the screen. To look into this bug, I created a GUIText that would print the health to the screen. Sure enough, the health went down to the current value but the health bar still disappeared. I then printed the value of the healthbar width to the screen, and when health decreased, the width value went from 225 to 0.
I printed the formula (health / maxHealth) to the GUIText next, which went from a value of 1 to 0. From this, I could tell that the problem was caused by this conversion. By changing the type of health and maxHealth from integers to floats, this solved the problem.
I have also changed the health system so that instead of health decreasing passing through a waypoint, that colliding with a tree deduces it instead. However, I was unable to implement it so that every tree in the track reduces damage (since they are not gameobjects) but I have placed one tree in the track (tree sticking out on inside of first corner) since this tree is a gameobject.
Monday, 26 April 2010
Wednesday, 21 April 2010
Waypoints Fixed
Found out the problem with the waypoints, quite a silly mistake on my behalf actually. The lines:
That's what happens when you copy and paste code though. I also took this time to update the waypoints so that it doesn't work if you drive the wrong way round the track. New code is written below:
if(other.gameObject.name == "Waypoint_1"){Should have been:
Waypoint1Col = true;}
if(other.gameObject.name == "Waypoint_1"){
Waypoint2Col = true;}
if(other.gameObject.name == "Waypoint_1"){
Waypoint1Col = true;}
if(other.gameObject.name == "Waypoint_2"){
Waypoint2Col = true;}
That's what happens when you copy and paste code though. I also took this time to update the waypoints so that it doesn't work if you drive the wrong way round the track. New code is written below:
if(other.gameObject.name == "Waypoint_1"){
Waypoint1Col = true;
}
if(other.gameObject.name == "Waypoint_2" && Waypoint1Col == true){
Waypoint2Col = true;}
if(other.gameObject.name == "Waypoint_0" && Waypoint1Col == true && Waypoint2Col == true){
Waypoint0Col = true;}
if(Waypoint0Col == true && Waypoint1Col == true && Waypoint2Col == true){
NoLaps += 1;
Waypoint0Col = false;
Waypoint1Col = false;
Waypoint2Col = false;
}
Tree Colliders Fixed
Took me a while but I have finally fixed the tree colliders so that the dune buggy can crash into them. At first, I thought the problem lied with importing the terain from another project into my OverDrive project. Even though 'Enable Tree Colliders' was checked, the collision would not be detected.
Turns out the reason it didn't work is the prefab that was used to place the trees didn't contain a collider to begin with. Instead of using the 'Thin Tree' prefab, I needed to use the 'Thin Tree Collider' prefab located in another folder.
Turns out the reason it didn't work is the prefab that was used to place the trees didn't contain a collider to begin with. Instead of using the 'Thin Tree' prefab, I needed to use the 'Thin Tree Collider' prefab located in another folder.
Thursday, 15 April 2010
Results from Testing
After giving the game to 5 test users to do some black box testing, the results were mostly as expected. The main issues that users had were with the steering and camera issues, as well as the timer increasing at the 30 second mark, and being able to drive straight through the trees.
There were also problems which were brought up which I did not know about, such as the steering on the car messed up if the player was to drive off the road into the trees. Another problem was that the lap would increase even if all of the waypoints were not driven through.
I have the next couple of weeks to try and address these problems, which will be documented in the blog. The full results from testing can be seen in the final report.
There were also problems which were brought up which I did not know about, such as the steering on the car messed up if the player was to drive off the road into the trees. Another problem was that the lap would increase even if all of the waypoints were not driven through.
I have the next couple of weeks to try and address these problems, which will be documented in the blog. The full results from testing can be seen in the final report.
Wednesday, 7 April 2010
Testing
Now that the menu is done, I can begin the testing stage of production. Unfortunately, there are some parts that had to be cut from the game due to lack of time but if testing goes well then there may be time to go back and implement them.
For black box testing, I will be getting several test users to play the game, and bring up any problems they may encounter.
For black box testing, I will be getting several test users to play the game, and bring up any problems they may encounter.
Tuesday, 6 April 2010
Added Points
The original idea of the game was based on scoring points to win a race, and not finishing first. To reflect this, I have quickly implemented a points system for Speed and Style. The player can get 500pts by taking the shortcut over the river (passing through the shortcut waypoint) or by driving at a speed of over 75 mph (+1 point per frame).
Was quite easy to do but the while implementing the speed based points, the game would crash while running the while() loop. Was fixed by replacing if with an if() look. Since there are no AI racers, I am unable to implement scoring for 'Aggression'.
Was quite easy to do but the while implementing the speed based points, the game would crash while running the while() loop. Was fixed by replacing if with an if() look. Since there are no AI racers, I am unable to implement scoring for 'Aggression'.
Friday, 2 April 2010
Menu
Carrying on with the main menu screen, I came across a nice tutorial on the internet that makes use of the GUILayout function to make navigational buttons.
http://www.unitylabs.net/tutorials/user-interfaces/game-start-screen
Using the tutorial as a guide, I created a new scene for my title page and imported the background image using the same method as the HID image.
http://www.unitylabs.net/tutorials/user-interfaces/game-start-screen
Using the tutorial as a guide, I created a new scene for my title page and imported the background image using the same method as the HID image.
Thursday, 1 April 2010
Cutback
In order to try and make up for lost time, I am making the decision to cut back on the main menu.
Instead of the original idea of having multiple menus such as controls and settings, I will just have the one title menu with an option to either start playing the game, or quit. Since unity has an option to choose the game resolution and quility settings outside of the game, this will not need to be made.
Instead of the original idea of having multiple menus such as controls and settings, I will just have the one title menu with an option to either start playing the game, or quit. Since unity has an option to choose the game resolution and quility settings outside of the game, this will not need to be made.
Subscribe to:
Posts (Atom)