In accordance with my project plan, my first port of call at the beginning of my project was to work on the core level mechanics with the most important of these beings the purchasable doors and debris and the repairable windows/barricades, as well as also setting up a points variable in the first person character, as well as a crude health system. Points are gained by shooting/killing zombies, with 10 points awarded for shooting them, 60 for killing them, 100 headshotting them and 130 for melee killing them.
Before getting into the level mechanics, I’ll show off the blueprints within the player character.
The way the purchasable door/debris blueprint works is that when the player enters the collision box a widget is created with the prompt “Press F to buy door for (price)”. The price of the door is an integer variable which can either be set to be 750 points, 1000 points or 1250 points. A series of branches checks to see what the door price is and displays the corresponding widget on screen. If the player has enough points to open the door, they can press F and the corresponding amount of points will be deducted from their amount. This will cause the door to move upwards on a timeline. Once a door is opened it is open permanently.
(Above) BP_Door in game (Above) BP_Door’s blueprint. (Above) BP_Door’s UI widget in game.
In all iterations of Call of Duty: Zombies, the way the repairable window/barricade works is that zombies will spawn behind the window, which is fully barricaded with 6 poles at the start of the game. If the zombie is not killed it can tear down all the poles, at which point the window is fully open and the zombie will enter the map. Once poles have been torn down they can be repaired by the player, who will gain 10 points for each pole repaired.
As I began developing this asset before I had any AI to spawn behind it, I decided to just work on the player interaction for now, and would come back to this asset to finish once I had access to AI enemies. As such, at the beginning of the game the blueprint is set to set all of the poles visibility and collision to none. When the player enters the collision box a widget is created prompting them to “Hold F to repair window”. Upon pressing F the poles have their visibility and collision turned on one by one until all 6 are “repaired” at which point the widget is removed from parent. While this works fine for now, the blueprint for it quite messy and inefficient. It also doesn’t work as intended as the player only has to press F once to repair the whole window rather than holding it, so this is an asset that I’m going to go back to soon.
Perk-A-Cola’s are an important part of the Call of Duty: Zombies experience, and well before the beginning of the project I’d had the idea to recreate a perk system in UE4 just to see if I could. The result was a fully functional “Juggernog” perk. A play on the word “Juggernaut”, Juggernog increases the players health, meaning that rather than dying in 2 hits from a zombie, it takes 5. The blueprint for this starts of very similarly to the door and window in that once the player enters the perk machine’s collision box a widget is created, displaying the prompt “Press F to buy Juggernog for 2500”. Upon pressing F, branches are checked to see if the player has equal to or more points than the 2500 required, and whether or not they already have the perk. If true and false respectively, a custom event within the player character blueprint is called increasing the players health from 0.4 to 1. This also effects the players health regeneration blueprint, which checks on event tick if the players health is still is designated maximum amount, steadily increasing it if its lower than max after a delay after taking damage.
A second perk was created shortly after Juggernog was implemented as I figured it’d be easy enough to add. Stamin-Up increases the players sprint speed and stamina, as well as decreasing the cool down on stamina regeneration. Although we don’t as of yet have a stamina system for the player, setting their sprint speed to be higher for longer once the perk is purchased was simple enough to add. The blueprint works almost identically to Juggernog’s, and will be updated once a stamina system is implemented, although this as well as all other perks will be done my collaboration partner, as it falls under the umbrella of player mechanics more so than level mechanics.
While much of this week was spent working on level mechanics, I also wanted to begin conducting environment tests with the modular kit I was to use in order to get a better understanding of how best to use it, especially as it was quite a large one. After studying some of the example maps that the modular kit came with, I went about creating a decent sized room that could act as the starter room of the map I was to make. Starter rooms in CoD Zombie maps traditionally have 4-5 windows and 2 doors, and typically set the theme visually for the rest of the map. With this in mind I opted for a medium sized rectangular room with 4 windows strewn around each corner and side of the room, with 2 doors at either end giving the player 2 choices of path to go down. I also opted for one side of the room to have a large window to show off the space skybox, which wasn’t added until week 2. The lighting, although not final for now was added as a result of playing around to see what could work well going forward, as temporary lighting for the level was needed anyway given how dark it the modular kit/skybox are. It mostly consists of spotlights, with some point lights being used for some of the wall pieces. I wanted to keep it dark and creepy but have everything be perfectly visible for the player.