Hyper Drone Racer Log
Julian Whatley
2021
Intro
Just a quick note about what this logbook is about:
As a Masters student in Game Design at the University of Plymouth, I worked on my Final project in a Team of 3 and have documented the process as best I could below. Links and resources will be at the bottom of the page, followed by references and an email form for you to ask any questions.
Originally it was only 2 us working on the project, but later expanded to 3 people, so naturally I took lead role with the project as the only programmer.
Links
Here you can find the links to download the project files, the game, and the Game Design Document.
Hyper Drone Racer available on Itch.io for download
15th June 2021
Had meeting with Dave today about what idea we’re working on. We decided to go with a drone racing style game, using an endless runner style mechanic, in a low poly city. We’ve discussed how and what obstacles will be in the city to add a challenge to the game, and how the mechanic will work. We’ve settled on having check points that the player and AI will need to go through in order to add more time to the countdown clock. Once the clock reaches 0 then the game is over, and the score is judged on the amount of check points the player has entered.
We’ve discussed how the countdown clock may work and have suggested having diegetic UI in the form of a battery indicator depleting instead of a clock counting down, and every time the drone goes through a check point the drone gets recharged by a wireless tesla charging coil.
We’ve also suggested having a man in a van following the drone to controlling. Multiple vans (AI), or one large truck with all the AI drone controllers.
Set up a URP Unity Scene with Collab turned on and invited David and am setting up a prototype based on a 3D flappy bird game I worked on in December 2021.
17th June 2021
Refined drone controller, but have realized it may not work as intended, I also set up a ray cast from the front of the drone to detect if it collides with something.
I’ve come up with a quick dirty solution for when the drone goes out of bounds. When the drone approaches the edges/floor, a warning will appear saying “warning drone crash imminent.” and if the drone goes too high then it will say “warning drone almost out of range.”
Created a Camera Follow Script with SmoothDamping.
Testing out my LowPoly Tree and Leaf pack v3 (Still yet to be approved on Unity Asset Store)
22nd June 2021
Importing new city block that David created as a prefab, making sure the scale is correct on my prototype. City 1 now scrolling, will probably work on new spawning system though. Dave and I discussed having a more optimized city, as the city asset Dave downloaded is very unoptimised.
We will likely still use the buildings from the asset, but will create our own floor.
25th June 2021
Placing buildings on new floor, via script. I will likely create a random script which will only work on enable. And will pick random buildings to place on the allocated spots on the floor.
30th June 2021
Working on getting the random spawner working, the idea is to get the buildings to spawn at a location, but not overlap with another building.
1st July 2021
Skill sharing workshop, I was tasked with creating a skill that I can share to the entire class as a presentation that people could follow along with, so I did a live presentation of creating an endless runner with an easy to understand movement script, spawn script and a set active false timer script.
The narrative for the live presentation is as follows:
This can be approached in 2 ways
set up a 3D scene, make a platform tile prefab, for example a road, but can be roof tops to hop across, basically a foundation. Then duplicate it as many times as you want but ideally 3 times, have a plain empty one, then for the other 2 add some obstacles like so.
Then create a GameObject and call it StartPointPlayArea or something similar.
Create a StartPoint (position them ideally at 0, 0, 0) for the first method we can position the start point about 3 tiles in front of the camera.
Now for the first method of doing it, a much easier way I think but less control.
Set up 4 scripts called:
Spawner
PlatformTile
SetActiveFalseTimer
CityMover
Starting with Spawner, add the script to the StartPointSpawner then write this:
Then in the inspector, drag the StartPoint over from the Hierarchy and drag the prefab platform tile you made into the game object cityblocktile or what ever you named it.
The fun part is setting the start time btw spawn.
But next we go over to Platform Tiles and attach this script on to the platform tile prefab, This script basically picks a random platform tile with or without obstacles. (ignore the startpoint and endpoint, I was experimenting)
Add the obstacles like so. And that’s done.
The next script, set active false timer, is exactly what it says. onEnable it’ll start a countdown (wait for seconds) in this case 15 seconds then destroys the object. We attach this script to the PlatformTile
I don’t recommend using instantiate and destroy as your game can take a performance hit, look into Object Pooling, but for now, this should work like this absolutely fine.
Next is CityMover, or what ever you called it. Basically, you can move the platform tiles automatically. At a certain speed. Using one line of code in Update. And that’s pretty much it. Just experiment with it, add different types of obstacles etc. and yeah. I played around making a 3D flappy bird haha.
The second method allows for far greater control over the speed and spawning.
Basically this one takes the camera and checks if the platform tile is still seen on the screen, if it’s not, then it set active to false and snaps the endpoint to the startpoint on the furthest tile from the camera.
And as you can see, theres no need for the city block mover script or the set active timer script, as the new spawner script does all the object pooling.
I’m also working on a random building spawning system, so every tile that spawns will be unique.
5th July 2021
Continuing the BuildingSpawner script and getting the buildings to place correctly.
BuildingManager and BuildingSpawner scripts nearly complete, Buildings randomly spawn upon start of application, but dont randomise everytime a tile moves.
7th July 2021
Making folders on the onedrive so my team can share their work there, and so I can have 2 more backups of the project. I will upload once at the end of the day.
9th July 2021
In meeting with David talk about the checkpoints, and what they should look like, while I quickly make a temporary van prefab with driving animations.
Making a barrier for when the player gets too close to the buildings, floor and ceiling(to high).
12th July 2021
Working on new out of bounds system using a intersection shader. When the player gets near the boundary it will be visibly clear.
I’m also having a look at creating a Outline shader for the screen. The shader will detect edges and draw a black outline on it.
14th July 2021
Added a Boolean to disable outline post fx.
20th July 2021
Create a To Do list.
Todo List:
Create out of bounds scripts that pause game and say game over, try again, and do the animation event for the drone when it comes into contact with one of the colliders.
Create script for Drone going through checkpoints to recharge depleting battery. (Battery can simple be run on a timer script that counts down, and every time the drone goes through a checkpoint it’ll just add an int value to the timer.)
Create or adapt a way for the checkpoints to be randomly placed.
Create a sound manager script
22st July 2021
Continuing from yesterday.
Added checkring obstacles and disabled colliders on them and set tigger box as trigger.
3rd August 2021
Recovering from Covid, Now playing catch up with the team, and getting the check points working properly.
Check points work and charge the drone.
4th August 2021
Creating a function to check which checkpoint the player has gone through.
Check point system now in place.
5th August 2021
Checkpoint holograms, battery percentage text, post fx, tilting drone when strafing up down left and right.
https://youtu.be/UknQhkx4axs Latest version 😀 Changes include battery percentage indicator text, Holographic checkpoints (dave is working on a model to make it fit more in the game world.), Drone now tilts when steering left right up or down.
6th August 2021
Worked on the holoshader a little more to make it fit the game world, and am now working on a gameover screen which will show stats.
Pause Game with no pause screen, GameOver with stats screen now complete.
10th August 2021
Working on more stats to be shown on gameover screen. Add code to play the sounds. Once drone UV is done, add vfx to body of drone for each time the drone goes through a checkpoint.
11th August 2021
Continuing on yesterday’s task of getting more stats shown on screen.
12th August 2021
Class discussions/group scrums
Continuing to work on getting more stats shown.
Tasking David to write up a To Do list in Trello.
16th August 2021
David is going to import the new buildings,
I’m going to get some placeholder UI working to show more stats on the game over screen, and have a placeholder pause screen. Added press space to start text mesh pro text.
17th August 2021
Changed some of the checkpoint colours, gave David some guidance on what or how to layout some building blocks and what colours to use. Continuing to optimise code, by moving the score/renaming score to distance score into the game controller. This way I can show the distance travelled on the Game over screen. I also put the dronecontroller update into an if statement to check if the game has started so the user can’t trigger a game over before the game has even started.
Added a blur shader to left wall to see what it would look like.
18th August 2021
Blending the blur shader as the player gets closer to the walls.
New issue: distance is calculated from the centre of the object not from the edge of the object.
19th August 2021
Changed the wall shader again to something like the electric field around the drone when charging.
I’ve redownloaded the project from the cloud to the fastest m.2 NVMe PCIe4 Drive in the world in the hopes to stop the Hold on messages which appear for as long as 30 minutes.
New Shader and Post FX when out of bounds
20th August 2021
Creating a Score Multiplier System.
score + scoreValue + distanceScore * scoreMultiplier. The scoreMultiplier will change depending on what checkpoint the player goes through.
Score Multiplier system almost finished!
I created a visual indicator that appears on the player every time the player goes through a checkpoint. X2, x4, x6 and x8.
Disabled all but one floor tile model on the obstacles so then we can use X empty obstacles. Ready for the tutorial when I get round to doing it, which will be shortly.
Microstutters happen often if I try to spawn the city block tiles either side of the main spawner. Will look into garbage collection to see if that’s the cause!
I created a fake fog shader graph because the built in fog was causing lighting issues making it look like the screen was pulsing.
I removed all the rigid bodies and turned all the colliders into triggers, and added a rigid body to the player, and left a collider on it.
Changed how the score system works:
GameController.combinedScore = ringScore * combo;
GameController.totalScore += GameController.combinedScore;
GameController.totalScore += (GameController.distanceScore / 500);
gameController.scoreText.text = “Score = ” + GameController.totalScore.ToString(“0”);
21st August 2021
Going to create a settings screen on a pause menu, a start screen and a loading screen, with persistent saving for settings.
But first I’m going to add a Miss checkpoint object using something like an X when you miss.
Now moving all the score data over to a save system which will save the high score every 3 seconds.
A little bug, that can be easily fixed, is with the score being updated twice if you clip the sides of the checkpoints. A solution would be to hide the trigger boxes on that checkpoint as soon as it touches a check point, e.g., if player misses, then hide all trigger boxes. And have them all slightly different depths until a more permanent solution is available.
Now working on a start scene with a settings panel prefab.
Some Very Heavy optimisations to the code. Temp Settings when paused. Inputslider default is set to 0.5 and saves locally.
For some unknown reason I can’t save the HighScore.
22nd August 2021
Optimised some more code and made a simple loading screen which fakes the loading time, as the game loads super quick due to little assets, it gives the player enough time to read the tips on the loading screen. I used ShaderGraph to make the clouds animated. Optimised the ScoreManager to work correctly in adding the score. And now have a score shown on the screen when playing.
Van Now slowly moves towards drone on X axis, Am working on tilting the van!
Van now tilts.
Tomorrow I will work on a sound manager and add simple effects.
23rd August 2021
Changing some of the richtext gradients
Just had an issue with David organising some files and deleting the wrong file, so I told him to click on collab and revert the file change back to the file that’s in the cloud.
Working on curved world shader.
Writing up a sound manager which can be accessed on any script.
Disabled curved world shader because it was causing problems with the imported models as they were imported sideways etc.
24th August 2021
Now actually working on a SoundManager
Then will look into getting the checkpoints and obstacles spawned in time with the music like in beat saber.
Sounds effects added for comedic purposes.
obstacles and checkpoints now sync with music. All gameobjects correctly rotated in Prefab!
25th August 2021
Fixed the ObstaclesSpawner script, stopping spawning the obstacles and checkpoints once the music ends even if the music property is ticked on loop. I simply reset the lastTime, timer and deltaTime variables to 0. Then I took the traffic lights prefabs and created a new nested prefab which allows to have a traffic light crossing spawn in.
I added “It’s Loading now” sound effect to the loading screen.
I added an Audio mixer and applied it to the Audio Sources in game to allow me to code a volume slider for the settings menu.
Volume slider now controls volume of game and saves the value to player prefs meaning the player can come back to the game at a later date and it’ll remember the last value it was set at.
Added a random function to assist in picking the Very nice and shame audio rarely over the normal dings and dongs.
Stopped the obstacles moving towards the player when on loading screen.
Found a bug where the hard checkpoints wont spawn.
26th August 2021
Fixed a few bugs and made the hard checkpoints rare to spawn.
27th August 2021
Fixed issue with music playing before even pressing space to start.
Importing mountains and clouds designed by Xianzhi.
Audio visualiser currently being worked on.
Checkpoints now bounce to the beat of the music.
28th August 2021
Music now has intro, and loop. So every time you start the level the intro will play, then it will auto transition to the loop and loop.
Crowds now spawn at correct height and rotation.
Tagged all the Obstacles so I can do Object pooling with them
Tweaks to buildings now scale to sound. Tweaks to boundaries. Tweaks to crowd’s scale.
30th August 2021
The enemy drones now move slowly towards the X and Y axis of the player
Moved mountains around,
Tried working on menu system that can be interacted with via controller.
31st August 2021
Made some big changes but think it may impact framerate. Duplicated the street while in play, then made a prefab of it and shifted it backwards. So now it looks like the city extends further.
Wrapping up the GDD and proof reading.
1st September 2021
Working on GDD, Menu background music, Start Menu Art. For some reason, at random, it just stops working, both the miss and enter code seems to stop for one or 2 blue checkpoints. Extremely random. Will investigate it later.
2nd September 2021
Working on a trailer.
Tried out Occlusion Culling.
3rd September 2021
Continuing to work on a trailer.
Script for Trailer:
Camera pans down from billboard and zooms towards van and then up to drone.
Welcome to the 6th Annual Hyper Drone Tournament where 100s of competitors race their drones across the city. Let’s here you make some noise for our contestants today who have been coached by the amazing team behind Auran Star, last year’s winner.
Camera then cuts, and goes to gameplay footage of drone flying through checkpoints and avoiding obstacles to the beat of the music.
For those new here, the rules are simple: Contestants enter the back of our dedicated racer van and control their drones into the local airspace.
Zoom into Battery on Drone!
Using a specialised battery power sourced from our sponsor; the Aurian Army, they must traverse their way down the road.
Checkpoints entered to beat of music.
Don’t worry about signal distances, as the van will make sure to keep within a safe distance to your drone. Holographic Checkpoints must be passed through to gain additional battery to keep you in the field.
However, if you crash into anything within the road you’ll end your run, where our voting panel will determine a final score for the performance.
Looks like the first contestant is about to start.
Are you ready?