To begin I needed an idea which was do-able within the deadline but that would also work to my strengths and give me skills I wanted to learn. Originally I was going to a maze game using the mouse to navigate a simple maze but felt it was too simple and boring so I created a mind map to come up with some ideas and benefits to them.
I chose to do a game based on the Trials series by RedLynx which involves a player controlling a motocross bike, to traverse obstacles and reach a finish line within a time limit. The player can gain 'faults' by having the character hit the ground or an obstacle. This forces the player to go back to a checkpoint and gain a 'fault' point which reduces their final score.
I felt this idea could show of my environment creating abilities whilst showing that I can learn to create a simple vehicle controller and an obstacle course.
I created a quick level and basic control to get the project started. The up and down keys move the bike go forwards and backwards but it the feel of the movement needs a lot of work. Using a box collider for the bike causes trouble when trying to get up the obstacle. Overall though it works.
I decided to download the bike model created by DJSMOOTH22 (2014) from the previous session and this week I'll be following tutorials to rig it myself. I plan to make the wheels move along the x axis as the bike moves and also give it some suspension.
The bike model isn't great quality and so I've merged and grouped all the meshes to ensure the only meshes are front and back wheel and the body. Both wheels have the centre set in the middle of themselves to ensure the wheel spins properly.
I've used wheel colliders from the wheels of the bike which allow for rotation. This also has set up for suspension but this will need to be researched.
After attaching the wheel colliders and playing, the bike bounces around unnaturally which I will need to fix. But when freezing certain axis, I can see that the movement works.
With the help of Renaissance Coders (2018) and Unity3D (2019) I was able to fix the problem of the bike bouncing around and to create code to ensure the bike moves properly and the wheels spin.
Unfortunately a new bug arose where the wheels would move and spin but the body would continually rise and become unattached to the wheels as the wheels could ride away.
I was able to fix this bug by having the wheel colliders separate from the wheels themselves. I then adjusted the suspension and was able to get the result of the lower picture on the left with working suspension.
I spent a long time fine tuning the wheels and body of the bike. Changing various values such as mass, suspension distance, wheel centre and acceleration. I found a good place for the bike to be in, it can flip over with the acceleration but when I add rotation to the rigid body, I presume the player will counteract this as this was part of the challenge in the original Trials games.
To add rotation, I plan to just add force to the rigid body on the x-axis rotation with an exposed rotation amount parameter. I will want to refine this at a later date to give a better feeling of control.
After doing this I added some more of the construction site modular kit I have made and gave the bike a test run. I feel it's a good start but the bike needs fine tuning more to stop it rotating uncontrollably and the speed needs to be capped as it can flip the bike if the wheel has been in the air for an amount of time.
I've managed to fix a bug where the bike would lean slowly and eventually fall over to the point where it could not be used. This was fixed by constraining the bike to the Y rotational axis.
I have also begun to add a lot more to the environment. I have used single sided meshes for my modular pieces and instead of editing the meshes, I am using planes that are out of sight to ensure light isn't coming through one way.
I'm also adjusting the bike to be lighter as I want it to feel more floaty. I feel this will allow the player to feel more in control when adjusting for landings.
I have introduced a simple code to allow the camera to follow the player without rotating. This has made the game far less jarring and allows me to adjust the location of the camera relative to the player, whilst in play.
I have made a dark interior for when the player travels through the pipe. I have decided to leave the face normals the wrong way round as I feel it works well as the player can see the path as well as themselves.
I have also further adjusted the bike by introducing an RPM limit on the back wheel. This prevents the bike's wheel from accelerating really fast when it's not on the ground.
I have set up a simple checkpoint system with help from my tutor. The latest checkpoint is saved and using the space key, the player is able to transport back to the last checkpoint.
At first, the values of the bike velocity and angular position were not reset but I have been able to do this by setting all velocity settings to Vector3.zero.
When using this feature, the timer will not reset. I have set it so that if the player resets before hitting the first checkpoint, the scene reloads to reset everything. The player is also be able to do this using the R key to restart the track at any point.
I have added more to the track and plan on adding one last area. After this jump is the second checkpoint. There is a 3rd checkpoint then the finish.
I have finished the track but the last area needs it's scenery finishing. I've also made some changes as shown in the images on the left. The first is replacing the floor in this area with gravel. Secondly instead of the player climbing stairs, I have placed a plank of wood as the stairs were too difficult.
I've also updated the checkpoints to look better and have the sign spin when the player hits the checkpoint.
I've decided to add the controls here to allow the player to play around with the controls on the screen.
I've also created a main menu that starts a countdown and flies the camera to the start when starting the game. This has forced me to re-write how the first check point works as I cannot reload the scene.
I have created a start and finish banner for the environment.
I've also implemented sound for the bike using a looping engine sound by Kristiangrundstrom audio (N.D.) and having the speed of the rigid body affect the pitch.
I also changed the audio source settings to be 3D as I felt it adds to the main menu, being able to hear the bike engine rumble in the distance.
Added functionality to more of the menu buttons. I created a confirm option when attempting to quit the game and also ensured when in the menu or pause menu, the bike cannot move.
I moved on to create a finish with a high score section which then takes the player back to the menu.
I also produced a small looping song to go with the game. The volume of this and the bike engine can now be effected with their corresponding sliders in the options menu.
I have ensured the high score updates with the players score. The total score is an int in which faults are multiplied by 10000, minutes are by 100 and seconds are not multiplied. This is to ensure faults is more important than time and is also done as simply as possible. The only issue with this is, it would create issues if the player took longer than 99 minutes or received more then 99 faults. To counter this I will put a maximum cap in place for them.
I have also made an area at the end for the player to see the result from the run they've just completed. The high score is also shown on the main menu.
Ive changed all of the UI to custom fonts and colours. I feel like the UI is still basic but due to time constraints I feel this is good for now.
I've made a simple character called 'Beany'. I've decided to go for a small stylized character and I have ensured the player cannot drive if 'Beany' hits the ground. I was able to do this by checking if his collider hits anything other than a checkpoint trigger.
Due to the pandemic, I have been limited in testing my games on multiple PCs but have sent it to my tutor to play in which he found that the acceleration was far too high. This happened to be the same bug I discovered with the bike leaning and so the fix was to place it in fixedUpdate() and increase the power of the bike.
Another piece of feedback given was that he instinctively pressed R to return to checkpoint when it is restart race. I chose these controls based on the original game so I will change them so both reset to checkpoint and set 'Enter' to restart the race. I have also put a restart button in the menu to allow for another way to restart the race.
I have increased gravity and changed values for bike handling as I feel it handles better but this has caused the secret star to become inaccessible so I have added some metal girders to climb the obstacles.
I'm happy with the game I've made. I've learnt that making a simple vehicle controller isn't overly complex with Unity's tools but the vehicle handling could be improved.
The loss condition of falling could be made more responsive as I feel there isn't enough of an impact and it feels quite unexpected.
Overall I've made a fairly good trials like game with room for improvement.
DJSmooth22. 2014. Pitbike. [Online]. Available at: https://www.turbosquid.com/3d-models/bike-pitbike-3ds-free/803024. [Accessed 5th January 2021].
Renaissance Coders. 2018. Unity3D How To: Driving With Wheel Colliders. [Online]. Available at: https://www.youtube.com/watch?v=j6_SMdWeGFI. [Accessed 6th January 2021].
Unity3D. 2019. Wheel Collider Tutorial. [Online]. Available at: https://docs.unity3d.com/Manual/WheelColliderTutorial.html. [Accessed 5th January 2021].
https://docs.unity3d.com/ScriptReference/WheelCollider-rpm.html
https://answers.unity.com/questions/1109479/how-to-reload-a-scene-using-scenemanager.html
https://www.kristiangrundstrom.se/engines/ - Engine Sounds
https://answers.unity.com/questions/226259/get-first-certain-numbers-from-a-string.html - getting specific characters from string
https://www.1001fonts.com/tracion-font.html - Title Font
https://www.1001fonts.com/share-tech-font.html - OTher Text Font