Basic Level Blocking Devlog
Hello and welcome back to my devlog's :) This time I will be discussing some basic level blocking for Don't Get Caught by the Cat.
Each level of the game will be a procedurally generated tile based maze with, at this stage, an exit/door and a key. To generate the maze I used the Depth First Search algorithm. Here's how the algorithm works.
step 1: create a grid of nodes that have 4 walls
step 2: pick a starting node and mark it as visited
step 3: choose a random direction and check it won't take us out of bounds or to a visited node, if it does, repeat the step
step 4: destroy the wall in between the nodes
step 5: mark the new node as visited
step 6: go back to step 3
This looks great but there's one problem, eventually we will run into a node where all of it's neighbors have been visited. To escape this we can backtrack through the maze to the nearest node with unvisited neighbors and start the algorithm again from there.
As I wanted to create a tile based world with a wall being its own tile, instead of each node having 4 walls I made it so each node is either a wall or a floor. Here's the algorithm working in unity.
Now that I had the maze generation working it was time to start giving it some character. Each maze serves as a floor of the humanoid cat Clawdius' enchanted castle. I wanted the castle to entice the player and make them feel like it's something they want to explore by portraying the sense of unfamiliar nostalgia and adventure I spoke about in my concept devlog. With these very vague instructions in hand, Sara Hollingsworth (my mum) got to work creating wall and floor tiles with pixel art. Once the tiles were a created I added them into the game.
Feeling pretty good about the design of the level I asked my girlfriend to come and have a look at it, quickly I realized it wasn't as great as I thought it was as she asked,
"Where are the walls?"
The walls looked too much like a red brick path, so I started looking for ways to give them more depth. I came across some pixel art that used an angled top-down perspective to give the illusion of depth in a 2D world:
- https://github.com/TeamPorcupine/ProjectPorcupine/issues/1081
With this inspo art, I once again put my mother to work to create a new wall sprite that can be used when the tile above it is a floor. I also changed the position of the collider on these walls so that the player could overlap them. Here's the result:
My next step was placing objects within the maze. To make placement consistent and manageable, I decided that objects would be placed at dead ends. I was able to write a method to find all of the dead ends pretty simply by checking how many surrounding walls each floor tile had. From there I made it so the key would be placed on the floor tile and the door would be placed on the angled wall.
Playtesting feedback was largely positive regarding the concept, artwork, and generation. However, I ran into issues with the wall colliders:
"Cool concept, love the animations and music, only issue I ran into was the clipping on corners, but apart from that very impressive work done in a week"
"It's so great that this maze is procedural -- I remember you making that, but just had to confirm I didn't imagine it"
To fix the clipping I grouped the walls under a single game object that used a composite collider and set the composite operation of the walls collider to merge. In doing this, I realized that by messing around with the size and offset of the colliders of the angled walls I had moved them out of line with the regular walls collider. To fix this I made a method that changes the size of a collider without affecting the offset. This change will be included in my next upload of the game.
I also received helpful feedback about improving depth perception:
"Also, love that you've se up your tilemap colliders to do this:"
"But I definitely want it to also do it behind the wall too, so not stop here:"
To implement this, I’ll decrease the wall’s Order in Layer based on its transform.y position and dynamically update the player's Order in Layer as they move horizontally around the map, as suggested by my teacher Ian.
Another way that I plan to improve the levels is to make the maze imperfect through the removal of certain walls. This means there will be multiple possible paths to reach a certain point. This is necessary for gameplay, as when I add Clawdius to chase the player they would likely become trapped in dead ends too often and grow frustrated with the game.
Dont Get Caught By The Cat
Status | Prototype |
Author | theDinonugget |
More posts
- Player Movement Devlog7 days ago
- Game Concept Devlog24 days ago
Leave a comment
Log in with itch.io to leave a comment.