As the procedurally generated dungeons are a complex and crucial aspect of the game, they are bound to be minor and major bugs throughout development, this post will document any findings and fixings of said bugs.

This first visual bug would be caused by the RoomManager gameobject’s collider being too small, as the RoomManager would check if the player was in the room and then change the priority for the camera in that room. If the player moved to the side of the room the RoomManager would no longer detect the player as in the room, causing the player follow camera to have a higher priority.
The second visual bug was fixed by changing the players’ and doors’ sprite renderer’s ‘Order in Layer’ amount. Changing these amounts so that the players’ was higher than the doors’ would fix this bug, leading to the player

Lastly, the third visual bug was also fixed with the same method as the previous visual bug, changing the values of the ‘Order in Layer’ sprites mentioned.

This bug in the LB room was discovered during tests of the procedural room generation, during one of these tests a Whisper had been instantiated when there weren’t meant to be any enemies in the dungeons yet.
However this was a simple fix, as the LB room prefab had been edited and a Whisper was in the hierarchy of the prefab, this was just a matter of deleting the Whisper prefab from the LB room prefab.

When populating the rooms, our Environment Designer Xane had forgotten to move the position of the playerRespawn transform of the Pitfall prefabs (Explained in this Development Post). Therefore, all I had to do was go into each room prefab with a pitfall in it and relocate the playerRespawn transform to an appropriate location, where it would make sense for the player to respawn and not instantly take damage.

After our Environment Designer had implemented the tiles in the Dungeon, I noticed that the closedRoom prefab (which was meant to block off certain doorways) wasn’t appearing. This was because its ‘Order in Layer’ amount was lower than other rooms.


Our Mechanics Designer, Ayse, had developed a potion that would spawn in certain room prefabs, in this commit I populated some rooms with this health potion prefab,


After implementing the Whisper enemy into dungeon (Adding the Whisper prefab into the room prefabs), I noticed that Whisper enemies were backing away from the player through walls. However, this was a simple fix, it was only a matter of adding BoxCollider2D components to the correct wall gameobjects in the room prefabs.
This second bug where rooms were overlapping slightly was also a simple fix, the sizes of the rooms were 20 by 11.5. However, vertically, rooms were spawning 11.25 units away from one another – resulting in an overlap by a total of 0.5 units of distance (Rooms were closer to eachother by 0.25 units of distance each). This was fixed by moving the spawnPoints transforms in each room prefab by a further 0.25 units of distance in the vertical axis.
The third bug was caused by the closedRoom prefab having two different tilesets in the hierarchy with differing ‘Order in Layer’ amounts. Once I had set them to the same amount (being higher than other room prefabs) they would block off rooms properly again.
Lastly, in this commit I also organised the room prefabs in the Assets folder of the project.

When adding the Whispers to the room prefabs, I neglected the fact that the Whispers don’t have a range, therefore, they will always shoot at and move towards the player even if they are in a separate room.
To fix this issue, I used the RoomManager script (the script that would check if the player was in the room in order to move the camera) and checked if the player was in the room before activating the Whisper enemies. This would prevent Whispers from other rooms from shooting at the player before they had even entered the room.

This bug where the Whisper wouldn’t die in the tutorial room was due to it it’s RoomManager reference in its Enemy_Whisper script being empty, therefore its Destroy(gameObject) method wasn’t being called despite its health being equal to or below zero. To remedy this, I added a RoomManager gameobject to activate the Whisper when the player would enter the room and to allow the Whisper to reference it. This RoomManager and Whisper interaction is explained further in this Development Post.

Instead of trying to assign the enemies in the list, I decided to assign them in the inspector via the hierarchy instead, this allowed the list to accurately track how many enemies were present in a room and whether those enemies were defeated or not.


This bug where the player would be pushed off centre was due to the closedRoom prefab, as the entry room had multiple doorways, the rooms that spawned in each of them would instantiate a spawnPoint gameobject in the entry room, they would then collider with eachother and instantiate a closedRoom prefab in the entry room that would exist for a fraction of a second before destroying itself, this system is explained in further detail in this Procedural Room Generation Development Post.
However, as this closedRoom prefab existed in the entry room for a fraction of a second, its BoxCollider2D component would push the player slightly, causing the player to be pushed off-centre. To fix this, I simply replace the closedRoom prefab’s collider component with 4 smaller ones that would act on the walls but not in the centre of the prefab. Allowing it to keep its intended purpose of blocking other rooms, while not pushing the player when the dungeon is being generated.
The second bug where the walls would glitch as the dungeon generated, was simply fixed by altering the some floats in the RoomTemplates gameobject. More specifically the time waited as each new layer of the dungeon was generated, by decreasing this time to 0.01, the dungeon would generate almost instantly, removing the small glitchy visual bug.