Indie Dev – Week 11 and 12 Progress

This week I have done two rounds of testing with friends and family members and have used their feedback to make changes to the game.

First Round of Testing

During this round the following bugs/issues were detected:

Problem: Some buildings were spawning duplicates which meant every door had to be opened twice. This was not intended.

Solution: After finding this post on the Unreal forums which referenced this issue it seems that it is a bug which is still ongoing.

ChildActor of my pawn keeps getting duplicated and orphaned – Development / Programming & Scripting – Epic Developer Community Forums (unrealengine.com)

One of the posts gave a suggestion of using static meshes as “dummies” in the editor and spawning the child actors on BeginPlay. Using this advice I created an EditorPlaceholder blueprint for all of my buildings. This blueprint stores the relevant building to spawn as a variable and on BeginPlay will spawn it into the scene before deleting itself. This has led to slightly longer initial load times when the game is started but has completely fixed the duplication bug.

Problem: Zombies were getting stuck on certain pieces of the pavement in the level and were not able to navigate over them.

Solution: This was caused by some of the static mesh pieces not using complex collision and therefore producing inaccurate collisions when the AI was trying to navigate over them. Changing the collision type to “Use complex collision as simple” and setting the static mesh as the collision mesh has completely fixed this issue.

Problem: The noise meter fills up every time you click the mouse when holding the gun, even if you don’t actually fire the gun.

Solution: To fix this the function to increase the noise value had to be moved inside the gun blueprint itself. As the gun contains a couple of boolean checks to determine whether it should be fireable/is currently firing it made more sense to put it here rather than creating new logic inside the player character. This way if the gun passes the checks to perform its firing logic the gun can then tell the player that the noise value needs to increase only when it successfully fires.

Second Round of Testing

During the second round of testing the following issues were discovered:

Problem: World AI spawning system was not properly calculating the amount of zombies currently alive. As a result it would continue to spawn zombies every time its spawning event fired. This was eventually breaking the entire AI system and causing all agents to simply animate in place.

Solution: The way that zombies were being spawned in the world caused the problem here. There were two For Loops which were responsible for spawning zombies. The first one would loop through using a ZombiesToSpawn integer variable as the final loop index, creating a ZombieInfo structure each time and adding it to the ZombieInfo array. The second loop goes through this array and spawns a zombie for each info. However, the spawner had no way of a) telling when a zombie was already spawned in the world and b) telling when a zombie had been killed. Therefore there was two steps needed to solve this:

  1. Create a boolean variable on the ZombieInfo array for IsSpawnedInWorld? which would be checked by the second loop and, if false, would spawn the zombie and set it to true.
  2. Create a function which each zombie could call when it died. This function checks the BP_Zombie array and finds the index of the zombie, then uses this index to remove the ZombieInfo first, then the BP_Zombie from their relevant arrays. This way when a zombie has died its info is also removed from the array.

Problem: When the player dies after capturing a building they respawn inside the building. However, the building does not properly stop reinfesting when captured. ***This issue is still present in the main build of the game

Solution: Unfortunately this was discovered too late to fix before submission. The problem is that a building is owned by a FirstPersonCharacter blueprint variable. However, when the player dies and respawns this variable is null because the FirstPersonCharacter controlled by the player is destroyed and replaced with a new one. There are two possible fixes to this:

  1. Set the PlayerOwner variable inside the CapturableBuilding blueprint to a different type, one which is not destroyed on player death. The first one which comes to mind would be the PlayerController as this remains consistent through player death. This would need to be tested to ensure that it would work.
  2. Don’t destroy the FirstPersonCharacter on death. Instead create a function within the FirstPersonCharacter to reset certain variables on death (health, energy, food, water etc) and then move it to its allocated respawn point.


Leave a Reply

Your email address will not be published.