My Personal Case Study

The theme for the Game Jam (I know it was an App Jam, but not to me) was the three words Guide, Opponent and Restricted. It obvious right from the start that the only thing that this could mean was Hostage Rescue. There was nothing else this could mean. Because of that, all the Personal Case Studies will be variations on Hostage Rescue. Just wait and see…

I started with a Mind Maps and just fired off an email to check that since I was already working on a combat game with Serial Link that I would be able to do this, but the cool fellas at that there Games Academy said it was fine. So, I pretty much just got to it.

Goals

To make an AI that could

  • Have some sense of ‘team’
  • Stack up on a doorway
  • Enter a room
  • Know that the room was ‘clear’

Taking the time

I tracked my time using a combination of my now traditional Nerd Chart and the website Tick Spot, the project management tool I already use. Each time I sat down (or paced around) on the project, I logged the time on Tick and then at the end of the day I would fill in the Nerd Chart. I really like having a visual cue to see where my time is going. Its a really good way to allow yourself to get carried away with something but recognise that is what is going on. You can then, anxiety free (for the most part) says to yourself ‘OK, that thing I was gonna spend one hour a day on is now four days behind, but I’m ahead in other things. I will do the four hours today’. Genius.

Development

Development was very fast really and I was on a roll with it and enjoying seeing just how much I had learned.

Then, when the project reached a sufficient level of complexity, my lack of formal software design skills began to show. This happened because of two reasons. I dont know any and I get very excited and want to just get going. No, I dont think there is anything wrong with that. There might be. There is. Read on.

I could no longer track what went where and which entities were making which decisions and so on. I soldiered on anyway holding what I could in my head and writing little diagrams when I needed to be clearer about what I was trying to do but I began to sense (not in an Oda Mae Brown sort of way…) that I could be working faster and smarter and harder and more completely and with less coffee and with more clothes on and … what the… ?

Then I had an absolutely spiffy idea. I would make a base AI Controller class that would implement an ISee interface. Then I would link the event that is thrown from the AI Perception component (On Target Update, or something like that) to the interface events. Then I would not have to cast to find out what I seed. Well, thats how my daughter says it? Take that Grammerly.

From there, the AI Controllers that descend from the base class like ‘Operator’, ‘Hostage’, ‘Bad Guy’, ‘Creepy Dude’ could just implement the event in the child class and viola! Seeing things! The base class says SeeClearanceNode, Operators love it, Hostages dont care.

It was all working beautifully and I felt very clever and even had a little moment where I thought ‘You know what, I think I could do this for a living’.

But then… sob… something went wrong. Im not sure when it started, but something to do with the Hostage started to just not work properly. I know, poor guys, there are just there so that the Bad Guys can threaten them and their lives are constantly on the line and something in their mind (ai controller) just… broke.

I decided to restart to project as it was obviously Unreal’s problem and nothing to do with my intermediate standard of producing game logic and my severe lack of formal planning. Well, that was the last I ever saw of that project as once I had put it to bed, it refused to get up, like a stinky teenager. It just crashed on start up and said ‘I hate you, life’s so unfair, but you dont understand, I love him!’.

But, I thought, I’m not having this. I am a determined sort of fella so I would have a hunt around and see what I could do. I found out that a lot of the classes that I had created were suddenly orphaned, with no parent class. Looking at the log, the worst offender was the Hostage and as there was a hostage in the level that Unreal was trying to load the moment the editor got that far, it was all very crashy. Another one for you Grammerly. I did manage to use Windows Explorer to copy all the assets over into another project file and open that. Despite the warning that unholy fire would rain down on my meagre household upon opening one of these orphaned blueprints, I did it anyway ’cause I ain’t afraid of nothin’. I then painstakingly recreated the project over the course of about 3 hours only to have it crash that moment I tried to put a ‘Room’ in the level. I still dont know exactly why this happened, but I had learned enough at that point. This was clearly something that I had done and I decided to explore a few things. Before we get into that though, here’s what I did have although I cant show you anything more than was already shown in the YouTube video.

What i was left with

  • Sense of Team and Team Element
  • Dynamically sized Team Elements and Teams using an array
  • Insertion and Extraction zones
  • Rooms that contained a Door and set of Clearance Nodes
  • Team Element stacked on the door
  • Each Operator was allocated a clearance node based on how close the node was to the door
  • The Operators then moved towards the Clearance node allocated
  • If they saw another node that had not been cleared, it would be set cleared in the Room actor
  • Once the Operator saw the node that was allocated to him, he would be allocated another unless all the nodes were clear
  • If the Operator saw a Bad Guy, the Operator stopped, turned to face him and after a delay of 0.5 seconds ‘killed’ the Bad Guy.
  • Killing was just ragdoll the Bad Guy and enable collision on the skeletal mesh and add a little force to the head bone to make it look like he had been shot.
  • The Bad Guys had the same logic only the delay was 1.5 seconds to represent the aiming lead time.
  • If the Operator saw a Hostage, they would inform the Team Element actor.
  • If they were all clear, the Operator would move toward to door until he could see it
  • He would then stop and ask if all the other Operators were in the same state.
  • If they were then the Team game the Team Element its next Room in the array and the cycle began again.
  • Once there were no more Rooms, the Team Element would go to the Extraction zone. Once all the rooms were clear the Hostages would travel from their location to the Extraction Zone.

What one learned from the Humbling project

Oh my God, Version Control.

I have learned the very hard way that version control is cool for kids. I wont go over it all here as I covered some of this stuff in another post. Just know that I know that I know that I need it. No, I’m not trying to kill Grammerly.

UML and proper planning

This one did make me laugh. I promise, and I know I talk a lot of rubbish sometimes, but I promise that I said these words when the complexity of the project started to get away from me a little: ‘I need some sort of diagram language or something, that way I could think all this through and make better mechanical design decisions’. I swear I said that out load without knowing that UML was a thing. So, I have already taken a short course on Pluralsight and know some of the more basic symbols and what they are for. I do need practice with this and I have yet to use it

Design Patterns

I found this guy on the Internet (its this interconnected web of computers the youths are using) who has blown my tiny mind with just how to think like an architect regarding object orientated software design. I feel so much more ’empowered’ as Oprah would say and I have already bought this book – Design Patterns, Elements of Reusable Object Oriented Design. Its a bit dry, like toast, but its very enlightening to someone like me who is keen as mustard on toast but doesn’t have any mustard or toast. Oh, the guys channel is here…

Lets get smart

Goal One: Version Control

I will become skilled with and fully understand Git, LFS, Git Bash and Git Desktop to the point where I can perform all the the basic and intermediate functions the system has to offer. I will know this is complete when I cant find any menu item or Git command that I do not recognise and could not explain in simple terms. This is appropriate as I am already working on projects that are valuable and require multiple development sessions and developers. I will be able to demonstrate how these features work on a live or dummy project. I will start with a course on Pluralsight and re-assess the requirement’s from there. I will achieve this in 4 weeks.

Goal Two: UML

I will learn UML theory and practice that is proportional to the programming skill that I have already. After that I would learn UML so as to represent the more advanced programming theory I would be learning at the time. This is appropriate as I have identified that I wish to be a generalist but with an emphasis on programming so as to be able to make my own games. I will know that this is complete when I can fluently draw UML with as much complexity as I can think with and make minimal mistakes. I will also measure this by making sure that my programming plans and thoughts can be communicated with other programmers using only UML. I will do this by taking a course on UML for beginners on Pluralsight of something similar and would intend to complete this in 2 weeks.

Goal Three: Design Patterns

I will understand each pattern presented in the book ‘Design Patterns’. I will create sample projects to illustrate each of them in action in simple console applications using C++ or C#. This is appropriate because Unreal and Unity are both engines I wish to use and they both use an object oriented approach. Its realistic because I have enough skill with Unreal to quickly create a complex project, but I need help to organise my thoughts and intentions in advance of the execution. This will be a long term goal and I would expect this to be fully completed in 6 months.