top of page

Objective 4

Use software development processes to analyze a project problem, and to design, build, and test a corresponding software solution.

Mascot Heroes1.PNG

Mascot Heroes

    When I came onto the project, there had not been an Android build for the game, it needed some restructuring, but most of all when I built the game and tested it on an Android device, it would immediately crash. At first, I thought it was a building issue, so I tested out different ways of building it, but they all still resulted in a crash. So, I went ahead and worked on the main menu some more and added in additional things to the game management script while keeping the issue in the back of my mind. After about a week I started adding things into a test scene to try and figure the problem out. I worked my way through all the things that were supposed to be in the game all the way until I got to the player character, at which point the app crashed.

    Once I figured out that it was the player prefab that caused the entire thing to crash, I started testing it with a copy of the prefab so I could keep the original intact until I found the issue. I started off with deleting all the unnecessary data and slowly adding in more and more until I came across the crash again. This didn’t take too long as once I added the goat character back into the copied prefab it crashed. So, I tried the goat by itself, and it worked fine until I added in another character. I tried combinations of all the other characters and even all the characters except the goat and it worked. The goat, or some component on the goat, was the issue. At this point I disabled all the components on the goat and started adding in each component until the app crashed again. Didn’t take an extremely long time until I discovered that the goat’s animator was the problem. Looking at it I saw that there were a lot more frames added into that specific animator than all the rest, so I tried to only activate the animators based on what character was using them and it worked until the goat was loaded in, at which point it crashed again. Then, I tried to delete animators when they weren’t being used and add in the animator and the appropriate files, but this caused an immediate crash. I eventually came across resource loading/unloading so I decided to do this. I wrote into the code where it would load the resources, being the character animators, and adding it to the character animation for the character that was loaded while unloading the resources right afterwards. When switching characters, it would make the animator null and load the resources so it could grab the selected character’s animator and unload the animators again. This allowed the player to use all the characters at once, at the cost of performance due to brief pausing in the game.

    We decided that to limit the pausing we’d try to consolidate as much of the code into as few scripts as possible and to limit the player to only characters that make sense for the level while putting the animator fix into the to-do for the game. I am unsure if they ever fixed the animator but the solution we put together did work.

Project Purgatory.PNG

Project Purgatory

    This was my first attempt at making my own game and was after my semester at the University of Advancing Technology (UAT), so I had little to no knowledge behind this. As a result, I used the basic movement systems that are packaged with Unity as well as a free asset for AIs. I quickly came across some issues. The movement system had a jumping mechanic, which I didn’t want or need, and a sprinting mechanic, but no limit which would make it slightly easier, and the AI system worked for the containing assets player and enemies but had to be modified to work elsewhere. I also wanted to add in some fake walls so that the player could hide from the chasing AI, and a health system so the player could die. So, I loaded up a test scene with all the assets I was planning on working with and slowly changing the scripts and prefabs so that everything would mesh better.

    I changed the AI script to auto-populate a list of waypoints to use those to move around and made it so if it sees the player or a “trail” the player left behind it would follow them at a faster pace until it caught up to them or lost track of them for so long at which point it would go back to patrolling. The giving up chase was difficult to figure out and I eventually learned of coroutines and used one of those and set a Boolean to determine whether the creature should be searching for the player or just going back to its normal patrol. This ended up resolving the issues I was having with the AI tracking the player.

    For the player I ended up writing the stamina and health codes into the movement controller, as well as creating an auto-adjusting user interface so the player could monitor how much health and stamina they had. This was difficult as I had no idea what I was doing at the time and ended up following some YouTube tutorials and adjusting as needed. Next was the issue of how it interacted with the pause menu I had created. The pause menu I used didn’t completely stop the game but slowed the time of it down to where it would take years before a second passed as if I didn’t the entire thing froze up and you couldn’t un-pause it. This raised some issues though as if there was sound playing then the sound would play infinitely, and the health and stamina meters would recharge while it was paused. I solved the audio issue by going through forum posts and documentation and learning that I could simply pause all the audio in the scene through one of the audio commands. For the health and stamina issue, it was simply adding in a Boolean check to the game manager telling the game if it was paused or not and flipping it anytime the game was paused or un-paused, then putting all the script codes update function a check to see if the game was paused or un-paused and halting everything that needed to be halted.

    The fake walls were somewhat easy enough to do as I simply had to play around with the OnTrigger functions to see which would be most appropriate to use and when to use them. I wanted it where if the player was being chased then the creature would follow and/or attack them wherever they hid. This meant I had to use OnTriggerEnter for the fake walls to turn off the collider for so many seconds and then turn it back on. Since I wanted the player to be able to see out of the alcove, I had to use the OnTriggerStay to see if the player was still in the hiding spot so the mesh isn’t rendered and as soon as the player left the mesh would be rendered again.

​

​LINK REMOVED!!! WILL USE VIDEO EVENTUALLY!!!

Top Down Wave Shooter.PNG

Top-Down Wave Shooter

Name to be determined and image will be updated when finished.

    When I first set up the game, I remembered an issue I was going to have that I had in UATanks, which I will eventually fix now that I know what to do, and that is the ammo colliding with the entity that shot it. If the player shot the ammo and the players ammo hit them it would stop or get knocked off course, depending on what I was testing. I could not figure out how to keep it from interacting with the entity that shot it. Then my professor went over layers and how you could make it so objects on the same layer didn’t interact with each other. I figured out that this was what I needed but then the new problem arose, how to make sure I don’t have duplicates of items made. I ended up learning that you can set layer names through code, so I wrote some code that checks to see if the entity that fired the ammo was either a player or an enemy. Once I started testing it, I found that it was the solution I needed as the created ammo had the same layer as the player and didn’t interact with the player but would still interact with the enemies. This allowed me to have one ammo type that is shared between both the player and the enemies. I plan on adding this to UATanks down the road to make it better.

​

​​LINK REMOVED!!! WILL USE VIDEO EVENTUALLY!!!

©2019 by Michael Henson. Created with Wix.com

bottom of page