One week of Unity
Bellevue Racing is my first 3D game. I've thought about making videogames for a long time, but the last time I tried out Unity the download size and cumbersome editor made me wrinkle my nose and back out. This time I toughed it out, and I'm glad I did. Yes, the editor is cumbersome.
And yes, the size of 3D assets is absolutely ridiculous (113 MB just for four trees?? No wonder video games are so large!). But I persisted, thanks to a wonderful mentor: The Unity essentials course! This was a blast. I love interactive courses, and the combination of text and video allows you to hop between whatever learning medium suits you best. The course is also a lot of fun because you can take the tutorial instructions and just run with it. After learning how to apply textures I started painting everything I could think of. I've always loved sprays, graffiti, and collages. I think you could make a videogame just based on that.
After going through the course, I felt like I had enough knowledge to try making a game. (keyword: try!) I decided to remake the drive from highway 5 to Bellevue as a racing game. But I hit a roadblock in the very first step - getting a motorcycle. I was surprised to find that vehicles were not built into Unity, so I went on a silly side quest where I downloaded a car from the marketplace and tried to turn it into a motorcycle by removing two of the wheels and flattening it.
This worked far better than you might expect
Then I switched tactics, starting off with a simple car model and adding movement to it. It immediately sunk through the floor.
Sigh
I switched tactics again. I followed my programming instincts and searched Github for a open-source implementation. No luck. I quickly learned game-dev is very much unlike programming in that if you want something there is a decent chance you will have to *gasp* pay for it! This might not sound strange, but the open-source world I used to reside in operates on much different rules. Anyways, I found prebuilt motorcycles for sale in the Unity store, ranging from $10 to $25 to $60. Vehicles can actually be quite complex, so people charge a premium for them. I chose this one due to low price and the built-in ragdoll. Ragdolls make crashes so much more entertaining.
Sure enough, I had a fun time setting it up. Just a slight error with the code and my motorcycle would launch off into space like a rocket!
This is one of the things I love about game dev, the bugs are fun and can make you laugh out loud. In another error I had the car sunk through the road, and in yet another error when I turned left the car started flipping upwards! I now have sympathy for the makers of Cyberpunk 2077 upon their notoriously bug-ridden release. There are many things you take for granted, like gravity or solidity of objects, that are not always true in game development. Couple that with the complexity of everything that's going on and you have a recipe for ridiculousness.
I got the motorcycle driving, so next up was an actual road for it to ride on. I installed the low poly road pack and tiled out a simple straight road with a curve and a loop-de-loop. Early tests were promising - it was difficult, but with just the right speed and just the right angle I could drive the motorcycle around the loop without crashing. Banking my motorcycle around the curve was also fun.
Now came the part I actually cared about - replicating the drive to Bellevue. Ironically, I'm not a big fan of driving. I'm not into cars. Driving in real life usually stresses me out, not to mention the creeping existential dread that I will eventually crash. In the virtual realm, driving games can be fun, but I'm such a filthy casual that I consider Mario Kart the best driving game of all time.
However, certain drives do hold a charm, and the drive to Bellevue is definitely one of them. Historic buildings, city skylines, bridges, tunnels, lakes, boats, and forest pass you by as you navigate the twists and turns and straightaways of the Highway 5 and 90. It was my first drive in Washington and immediately made me fall in love with the state. How could you not, when your drive is a glide, and you fly what seems like mere feet above the giant sparkling Lake Washington, with Mount Rainier in the background?
So that was my inspiration. I set about making the first memory of the drive, the Old Rainier Brewery. I whipped up a rough outline of the building, created the fabulous neon red "R" sign with the spline tool, and then just left the building untextured and moved on. There's a concept called "greyboxing" that professionals do, where you just do a rough outline of the map first and save the finer details for later. This allows you to change the map without having to redo dozens of hours of art and detail work. I wish I could say I was purposely applying this technique... but I was just being lazy. But hey, it still counts, right 😁?
I can see why this technique comes in handy. At the early stage of your game, you probably will be changing details of the map. For example, at first I had a bunch of poles to navigate your way around.
This wasn't fun, so I removed most of the poles in favor of a single line of poles across the road. This way with careful aiming you could blaze by at high speeds right between the poles, a thrilling experience. Compare that to slowing down and carefully navigating the poles, one is more fun than the other. As an added bonus, the new poles act as a signal for when to start turning for the upcoming turn.
Point being, you will probably have to rework major details of the map. This happened to me again with the roads. I threw away the roads from the low-poly road pack and switched to the MB Road System, which allowed me to create the roads as one continuous piece. It just took a bit of learning to use, but it was well worth it. The roads were much easier to create. They looked better too. I paved a road through the poles, through the tunnel, and above the waters of Lake Washington, which I created with the lowpoly water pack. Finally, I created a massive ramp and fireworks at the end.
This brings me to the last problem I faced: scripting. When the player reached the end, how would I trigger the fireworks and game end screen? The Unity tutorial said it was simple: check the "Is Trigger" box, whereupon physics will ignore the object, and add a script with a `OnTriggerEnter` function. However, the player would always collide with the box, despite the "no physics" claim. I suspected this was something to do with the internals of the Motorbike Physics Tool, but this lead me to another problem: because the Motorbike Physics Tool code was not open source, if I looked at the code and then happened to make something similar to that code, there could be copyright issues. I avoided the code and worked my way around the problem with a hack. I moved the fireworks trigger upwards and gave the player a giant invisible immaterial hat far above the head. Whenever the hat collided with the trigger, the trigger would fire, and because the hat was so far above their head, it wouldn't collide with anything until the very end. If you don't understand, don't worry, because I don't understand either. Important thing is I got it working. You could dodge the pillars, learn your bike around the curve, apply nitro in the tunnel, and end with a bang as you complete the giant jump! This was a lot of fun to create, and I hope you enjoy it.
---
Was this a good amount of progress for the first week of someone learning Unity? Try the game out and let me know what you think!
Bellevue racing
very short racing game in the pacific northwest
Status | Prototype |
Author | jugglingallyourcats |
Genre | Racing |
Tags | motorcycle, Singleplayer |
Languages | English |
More posts
- Bellevue Racing - My first Unity Game!Jan 07, 2025
Leave a comment
Log in with itch.io to leave a comment.