top of page

PROGRAMMING AND CODE

Here you can see some of the code that I have created. I will briefly explain what problem I was aiming to solve, followed by some snippets of the code I used, and a video to display how the code works.

Xtreme Labs Audio System

When I was faced with the challenge of the Audio system in Xtreme Lab Safety, there were quite a lot of variables to think about. Especially thinking about the difference in audio, where it came from, how loud it had to be, etc.

SoundController_01.PNG

I solved this by creating prefabs for each type of audio. I realized that SFX, Ambiance and VO (Voice Over) needed each of their presets in order to make the script shorter and more efficient.  I also made a list which held an array of AudioClips inside of it. Each array was to cater to different things, such as the collisions of the beakers when they were empty, half or full. The reason for it being arrays is that we recorded so many Sounds to add some sort of randomness to the audio files being played.

Click this button to go to the list of Audio that was recorded and implemented:

SoundController_02.PNG
SoundController_03.PNG
SoundController_04.PNG

After loading all the audio files, they can be used anywhere in the game using the "PlayRandomSound" and "PlaySpecificSound" methods. Here, the different arrays are sorted to use the correct Prefabs/Presets, followed by being played. Both of these methods are called from other objects. The soundcontroller is always easily accessible from the GameManager, which all the objects are given access to at the start of a scene being loaded.

SoundController_06.PNG
SoundController_07.PNG

In picture #1 is an example of the beakers in the game playing random audio based on how full of liquid these beakers are. Picture #2 depicts a misc object script, which uses an enum to set the object, and play random sounds based on that. This works for both grab, and collision noises, solving the problem quite efficiently. Here is a video showing full Gameplay, with audio and everything.

Aerial Rumble Playerinfo

PlayerPlane_01.PNG
Playerplane_02.PNG

Creating the multiplayer game Aerial Rumble gave us quite a lot of trouble for organizing and keeping track of each player's score, number of kills, deaths, etc.

This simple script allowed us to easily do this, and since it is a class, it is accessible from anywhere by any script. And all of the variables can be set using the Public Void methods that way. This is a video of one of the older versions of Aerial Rumble showing the kills and score changing in-game:

Borders Guardsmen AI

The AI for the guards turned out to be a bigger issue for our game, Borders, than we initially realized. Today, I would probably be able to write this script much more clean, as well as make it more efficient and reliable. However, it did its job, and I was happy to get it working.

GuardController_02.PNG
GuardController_03.PNG

The guard needed only 2 states. These states we turned into "Patrol" and "CheckArea". Using Unity's built in NavMesh and NavMeshAgent, I could simply program the behavior of the AI to lead them from one point to another, as well as linking the animations to them using different variables in the script.

GuardController_01.PNG

The guard functionality can be seen briefly in the Trailer for Borders.

© 2023 by CREA8ME. Proudly created with Wix.com

  • Facebook Clean Grey
  • LinkedIn Clean Grey
  • Twitter Clean Grey
bottom of page