Freelance Felons
About the Project
After a partially successful attempt at making a GTA style demo in UE4 using its blueprint system, I decided to give it another go in Unity to try and learn a more widely accepted language: C#. Not only was this my first attempt to create a game in Unity rather than just make a player that runs around, but it was also my first attempt to integrate any form of storytelling too. One of the most valuable lessons I learnt in this project, which I tried to apply to most of my future projects was scope and scale, both of which were astronomical in this project considering my minimal Unity experience. This lead to lots of working but extremely unpolished or unfinished mechanics, including a retrospectively awful player controller, a lighting system that randomly broke when I was trying to record and much more. I would also like to note that this project was heavily based on a video series made by Jimmy Vegas on YouTube, which is also where I got some of the assets. The rest of the assets were acquired through a combination of Mixamo, scouring google and the map, which came with a system ai traffic system, that a friend sent to me.
Development Overview
Pedestrians
Whilst my Scene did come with an AI traffic system it was missing a huge factor that could bring lots more realism to the city setting and that’s pedestrians. Whilst they are useful just to populate the pavements and bring a bit of life to the city, they also give a target for the character to shoot with the loot-able pistol. If they spot the player aim their gun at them, they will scream and run away, and if shot a couple of time will collapse to the floor. However, they also have a custom AI system that I designed that allows them to wander around the city with realism and decision making rather than set, predetermined routes. To do this I used Unities Navmesh system and its inbuilt cost system, as well as lots of hand-placed destinations for them to go towards. Each pedestrian starts by being assigned a random destination to go to, before using the Navmesh to plan a route however this system will prioritise the cheapest route it can find. Therefore I assigned the cheapest setting to all of the pavements and a much more expensive setting to the roads with some carving Navmesh obstacles strategically placed, and a slightly less expensive option to the crossings. This leads to an AI system that will find the quickest route to it’s randomised destination, favouring pavements with the occasional crossing and only walking in the road where absolutely necessary.
Drivable Traffic
As mentioned earlier the scene I acquired came with premade traffic AI that moved car models that I had to find and configure around the map with the ability to stop at lights and some right of way logic. However something it didn’t have, which is a staple of any GTA game, is the ability to hijack a driving vehicle and proceed to drive it yourself, with the ability to then get out and start walking around again leaving the car there. This was achieved using Jimmy Vegas’ tutorials, where he taught me to use the vehicle mechanics built into theĀ Unity Standard Assets to drive the some vehicles that I found online. When the player enters a trigger box on a car door and presses F on the keyboard, it calls a function that enables the cars camera, enables control of the vehicle and disables the player. This allows the player to drive the car around freely, and when they decide to exit they just have to press F again. This sets the Player active again, disabling vehicle control and the vehicle camera too. Whilst this was made following a tutorial, it did require me to apply the instructions to a different setting, in a very different Unity version and on different cars. Whilst this seems very simple now, at that time this was all very difficult and created lots of problems for me to practise my troubleshooting with, and ultimately help me build up my resilience when learning new skills, however basic, in a game engine.
Storytelling
Finally, something I am very happy I tried to incorporate into this project, although under the instruction of Jimmy Vegas, as some form of storytelling. This included cutscenes, objective locations, objective pop-ups and in true GTA form, text messages. Whilst these were all used very sparingly in this game, this project taught me the foundational knowledge of how to approach these tasks that at the time seemed very daunting. For example I really like the effect of the text messages telling part of the story, and that is made from a couple of images on the canvas, being set active one by one in an IEnumerator with some sound effects playing and some waits to add more realistic timing. And with this simple foundational knowledge, I could time camera movement in animated cutscenes with sound effects and tell most if not all of the story in a GTA demo.