Killer in Purple 2 is a game in which you play as William Afton, in the town of Hurricane Utah. This game is a sequel to Killer in Purple, and a prequel to Back in the 80's.
Your main goal in this game is to build your own pizzeria, and get a better rating for more customers. The more customers you have, the more kids there are to murder!
Release Date: May 18th 2021
Versions: - v0.0.1 (Alpha 1)
- v0.0.2 (Alpha 2)
- v0.0.3 (Alpha 3)
- v0.0.4 (Alpha 4 | Never Released)
- v0.1
- v0.2
- v0.3
- v0.4
- v1.0
- v1.0.1
- v1.0.2
- v1.0.3
- v1.1 (Graphics Update)
- v1.1.1
- v1.1.2
- v1.1.3
- v1.1.4
- v1.1.5
- v1.1.6
- v1.1.7
- v1.1.8
- v1.1.9
- v1.1.10
- v1.1.12
- v1.1.13
- v1.2
- v1.2.1
- v1.2.2
- v1.3
- v1.3.1
- v1.3.2
- v1.3.3 (latest)
- v1.4 (In Development)
32-bit Versions: - v1.0
- v1.0.1
- v1.0.2
- v1.0.3 (latest)
(Further versions are canceled for 32-bit due to Engine Limitations)
Linux: - v1.1.10
- v1.1.11
- v1.1.12
- v1.1.13
- v1.2
- v1.2.1
- v1.2.2
- v1.3
- v1.3.1
- v1.3.2
- v1.3.3 (latest)
Killer in Purple 2 is my most popular game, and also the biggest alongside Park of Horror.
Killer in Purple 2 has a lot of systems, that all work together, which can get quite complex sometimes, especially as all systems have been coded over the course of 4 to 5 years (2020 - 2025).
For this page, I'll mostly discuss the code of v1.3 and the differences I have made since that version for v1.4 (v1.4 is currently in development).
Okay, let's start with the Door Blueprint, and the Blueprint code might overwhelm you, but don't worry, I will explain what it does, and how I improved upon it.
So below here you can see the entire code for the interaction with a door. But it is a complete mess. This is mostly cause I tried to create a door that is simply switchable between certain Levels by using an Enum. Back when I coded this, I was still experimenting a lot with Enums (a Byte with a name for each index). But sometimes I went a bit too far, and I used this in a hard-coded way.
v1.3:
Enums are a great tool, but the way it was used here is not good. The main reason for that is that all the levels are combined within 1 level (besides the Pizzeria and some specific levels).
This was done to experiment with Level Streaming. However this just made everything messy and clunky as can be seen.
For v1.4 I completely re-designed this system, now, do note, not all functionalities are implemented yet, but every level is now separated again.
v1.4:
This is still quite temporary, but the system is much smaller, and it is not based on Enums anymore, making the process time, and code mess a lot simpler.
As the interaction system for v1.3 was based on Enums, I also made the highlight based on Enums.
v1.3:
For v1.4 I also made this a lot cleaner by, again, not using an Enum, but instead just use a Text variable.
v1.4:
It's a much cleaner and simple solution. Yes it means slightly more work, but it gives me much more control per door, and I don't have to open the Blueprint to edit a popup message.
I might still change this system for a more reusable system, as the highlight system is quite outdated, coming all the way from the Alphas, with some small tweaks.
The shop is one of the biggest features of Killer in Purple 2. And the comparison between the old v1.3 code and the new v1.4 code is an instane difference, as I focused mainly on making the shop as much separated from other systems as I could, as the v1.3 system was mostly hard-coded, and the shop is the main reason I researched Memory Optimization, as the shop loaded Gigabytes of Memory.
v1.3:
v1.4:
There are a couple issues with the v1.3 system which I had to address for v1.4:
- Memory Usage
- Categories
- ShopBase Actor
Firstly the Memory Usage. All the Shop Items were stored as hard class references. Then those classes had the Name, Cost, Description and Thumbnail stored for that shop item.
But the shop doesn't need anything besides that, it now also loads in meshes from those shop items, materials, textures, audio, etc.
V1.4 replaces this system with a shop manager, that has a list of structs. Within those structs are a Name, Description, Cost, Thumbnail and a Soft reference to the Actor Class. When you buy one of these items, it will load that class into memory and spawn it. Meaning nothing unnecessary is loaded into Memory when not needed.
Categories have been almost the exact same since the Alphas, nothing much changed with them, as they seemed to work, but it used code duplication, where each category would cost more and more work.
v1.3 (Inside Shop):
To make this more reusable, and clean up some code from the Alphas, I decided to make a widget base class which does the exact same as the hard-coded category button.
v1.4 Category Button:
Shop Actors were probably the biggest issues, cause I have both just props, and Animatronics. Props are a subclass of AActor, and Animatronics are a subclass of ACharacter.
But they still need the same implementation of code. Back when I first made this system (around v0.1) I had no clue how to solve this issue, so I just duplicated the code in the Animatronic Class.
However, this gets out of hand, cause the Shop needs to cast to both the ShopBase actor and the AnimatronicBase actor.
This caused loads of memory issues, flow issues and general code issues with sloppy code.
v1.4 has a simple fix for this... Components!
Instead of having the code in a ShopBase Actor, or an AnimatronicBase Actor, I made use of an ActorComponent, that implements all the code for placement, holograms, etc.
This component can be attached to ANYTHING, it can even be attached to the bird outside, and the behaviour of the Shop Placement and such will be added onto that.
This makes it extremely flexbible, and prevents me from casting to anything (besides the component) inside of the shop, making the shop completely separated from the rest of the game.
v1.4 Shop Component:
These couple small improvements, make a massive difference, going from unstructured code that took a while to maintain, to easily readable code that can be expanded infinitely.
The memory optimization is also crazy. going from 700MB (This was more in-game, as it could lead to GB's of Memory)...
v1.3:
Going to around 17MB, although some things like Goldie's Jumping animation and some optimizations in a Functions Library still need to be addressed.
1.4:
The Character Creator (Animatronic Creator) was added in the Remaster Update (v1.1) and it was revolutionary, as I had never made something THAT big in a game before.
The creator has a lot of potential, but there are definitely somethings that I do not like about it. Mostly the controls and the view you have. When you are adjusting settings and parts, you HAVE to look at the screen, which prevents you from seeing your changes in real-time.
v1.3:
So for my school assignment in my 2nd year, I decided to go on a quest, to try and improve this system.
First things first was Research, so I sat down with a Game-Designer to work out what makes a good character creator.
After that, I also wanted to do some research with the target audience, that being all the players that had played Killer in Purple 2.
With a lot of feedback I was able to create a list of improvements, some positives about the v1.3 creator, and some extra ideas as well.
After a couple months of work, I came up with this system, it's similar to the old system, but it now locks your camera view, you can move around the character with your mouse (full 360 view) and you can easily save, load, or reset your current character.
Also instead of having to slowly go through each part with arrows, you can now simply click on the part you want to edit, and then change the body part and materials / colors.
It's way easier to control for the player, but definitely also far from done. I still need to add loads of body parts, as one of the main complaints was that there were too few, and I also want to give more control to the behaviour of the character (like difficulty).
This is still an early prototype, so things are bound to change, but so far, I am quite happy with this new system, compared to the old one.
The Neon Sign is used to open / close your pizzeria. And over the years I have changed its functionality, going back and forth.
The first system I made was to open / close your pizzeria, by simply clicking on the sign, turning it from Open to Close. This was very useful to get people out of your pizzeria to build stuff.
The second system only shows when the pizzeria opens / closes (At night it closes, and at morning it opens again). There is no further interaction to manually Open / Close your Pizzeria.
The 3rd and last system that I have designed is a mix of the first two systems. The pizzeria automatically closes at night time, but you can now also manually open / close the pizzeria. If either Manual or Auto is set to closed it will close.
The Jukebox in v1.3 was a complete mess, and one of the worst scripts I have coded in recent games. But it did teach me a lot about what not to do.
The system would load the audio files through open source, which is quite a pain to do, as there is not a lot of control.
v1.3:
For v1.4 I decided to just completely re-code the Jukebox from scratch, as the code was just not reusable. I started by looking into other options to import audio, and found a Runtime Audio Importer that imports audio into the game. This system works a lot better compared to the old one, and is way more optimized and clean, with much more control and options.
v1.4:
The only issue with this system is that the Runtime Audio Importer apparantly has some memory issues, from what I read online, also, if the jukebox starts importing audio, it can not stop until it is done, as it always crashes the game if it does. So I'll have to still look into this, and maybe find a different plugin, or code it in C++ myself.
The player has a lot of code in it, and with a lot, I mean too much. The player handles systems that it should not handle.
Let's go through it step by step, as this was a huge improvement from v1.3 to v1.4.
v1.3:
v1.3 (Shop - Collapsed Graph):
v1.3 (Build Menu - Collapsed Graph):
v1.3 (Input - Collapsed Graph):
v1.3 (Customize - Collapsed Graph):
As you can see, this is extremely messy, it handles too much, like Building the Pizzeria, the Shop, Customization, some input that is not needed. You can see the issue with maintaining this.
For v1.4 I started completely from scratch, just like the Jukebox. Currently a lot of old features are added, but not everything yet, so the blueprint is slightly smaller, but the Shop, Build System, Customization and a lot of Input is already coded in v1.4.
v1.4:
This is the entire Blueprint, no more Shop Systems in the player, that is all handled from either the Shop or the Shop Actors (Components), no more Build system, which is all handled from the Build Menu and the Build Parts, and this is for all the other systems.
The player is completely separated from other systems, making it extremely clean and reliable. There are still some small changed I want to make as the PlayerState is currently set by an interface, this will be replaced with the GameMode, to have a central place to set and get the player state.
Now onto something different, as I can talk hours about the code, but I don't have that much to compare with from v1.4 as it is still in production, and a lot of code is unfinished, so more will be added in the future.
I want to talk more about the Models of the game. Killer in Purple 2's is built upon me learning modelling, this is why I chose a simplistic style, so I could learn modelling slowly.
Every single Animatronic within Killer in Purple 2 is modelled by me, below is a gallery with all the Animatronics.
Freddy
Bonnie
Chica
Foxy
Fredbear
Springbonnie
Toy Freddy
Toy Bonnie
Toy Chica
Balloon Boy
JJ
Puppet
Mangle
Withered Freddy
Withered Bonnie
Withered Chica
Withered Foxy
Shadow Freddy
Shadow Bonnie
(RWQFSFASXC)
Circus Baby
Funtime Foxy
Funtime Freddy
Ballora
Ennard
Twisted Freddy
Twisted Bonnie
Twisted Foxy
Eleanor
Lolbit
Golden Freddy
Animatronics are not the only things to be modelled by me, I have also made some of the props in levels and in the shop
Ballpit
Back in the 80's Building
Camera
Car
Cinema
Factory
Flag
FNaF 4 House
Fredbears Diner
Guitar
Helicopter
Helicopter (Police)
Jukebox
Lamppost
Lighthouse
Neon Sign
Pirate Cove
Star
Train Bridge
Train Track
Vine
Welcome Sign
Williams House
For Killer in Purple 2 I also modeled some Characters, although most characters are made with Voxels (and not by me) there are some.
William Afton
William Afton (Suit)
(The Yellow Rabbit)
Springtrap
Henry Emily