Unnamed Snake Game Devlog 3

Hello and welcome to the third month of development on this unnamed snake game. I got a good amount done over the last month, although it may not look like it as much of the work is behind the scenes and runs in the background. Over the last month we haven’t had much time to work on this game again. Kelly has been through multiple terms at grad school and has been trying to start working on her Etsy again, as well as start making some YouTube videos and pump up her Instagram. I have been trying to push Sole through the final stages of development before the October 11th release date. I have also been trying to pull together with my Senior Project team to get our prototype finished for our advisors. I have also been taking some time over the last couple days to learn Unreal Engine.

Anyway, over the last month we have accomplished the following tasks on the game. We have added some placeholder sound effects, got a basic HUD together with a score, timer and multiplier. The pickups class was created and the pellet class was modified to use it. Fixed bugs regarding the order in which things were instantiated and referring to each other. We got some pellet art in so now it is a cute forest beetle. Adjusted coloring, created an Enemy Manger to spawn enemies overtime, the rate at which enemies appear increases as you eat pellets. The tile class was updated so that tiles are now aware of the tiles adjacent to them. Lastly, some prefabs were updated and colliders were resized. Wow, that was actually more than I thought it was, we had a productive month!

HUD:

Screenshot of the game with the new HUD.

Screenshot of the game with the new HUD.

In this screenshot above you can see that in the top left I have added a timer that counts up, this will be used to see how long you can last or how quickly you can win (if you reach max snake length). In the top right there are two numbers, the top number is your score, this is calculated based on your actions in game, eating a pellet is 100 points, while killing a slime is 200 points, however, these point values are multiplied by the multiplier shown below the score. The multiplier goes up 1 for every pellet you eat and for every enemy you kill, it goes down by 1 point every 10 seconds that you don’t kill an enemy or collect a pellet. This is working for now, of course these numbers will need to be tweaked and balanced as game development progresses.

The Pellet:

Image of the first version of the forest beetle. The current art for the pellets in the game.

Image of the first version of the forest beetle. The current art for the pellets in the game.

The pellet artwork has changed to represent a beetle, currently we are thinking of switching up the color palette per each world in the game, and in different worlds there will be different beetle designs. Also, the pickup class was created and this pellet now inherits from that class. This was a nice first step to creating other kinds of pickups that will give temporary or permanent powers to the snake. Along with this, we have started looking for more references on which direction to take the art style, we still have not settled on anything, but I like the direction everything is heading!

Tile Awareness:

One of the primary building blocks that I worked on over the last month was the spacial awareness that each tile has of the spots next to them. As every tile has a collider that can tell if it is occupied or not, it is incredibly important for me to know where I can spawn enemies into the game and if they will be able to complete their walk cycle from the position they are spawned at. To develop this, I created code that will run when the tiles get initialized to shoot a raycast up, down, left and right of itself and look for other tiles. If it finds one, it saves the reference to it, this way we can look later to see if the tile above the current tile is occupied, and then we can look to see if the tile to the right of that tile is occupied, and so on. If there is no tile found in that direction, it is assumed that the player cannot go there and nothing can be spawned there, it is basically the same as an occupied tile.

Along with this development I created another version of my GetOpenTile function, this used to return an unoccupied tile from the game. Now I have another version that takes a list of directions, Direction being an enum I set up that all of the movement is based on. It will loop through each direction, and based on which direction it is at in the list, it looks to the tile in the corresponding direction. If the function determines that you cannot complete the path of directions from the current tile, it will look for a new tile and test that one. Who knows if this is performant, but we will see I guess!

GIF of some gameplay showing the new pellets, enemy spawning and the spawn telegraph, an X that shows where an enemy will spawn next.

GIF of some gameplay showing the new pellets, enemy spawning and the spawn telegraph, an X that shows where an enemy will spawn next.

Enemy Spawning:

Using the new code for the tiles, we are now able to create enemy spawning functionality that will spawn enemies in places they can actually move. Which is awesome! I have also created functionality to spread out the spawn rate so the beginning of the level is easier than the later parts of the level. I have set an animation curve that is set to the number of pellets needed in order to spawn an enemy, it starts at 10 and works its way down to 3.

A curve that represents the number of pellets needed to spawn the next enemy.

A curve that represents the number of pellets needed to spawn the next enemy.

In a script I increment through this curve whenever a threshold is hit. At the start, it evaluates the curve at 0, gets the value and waits until that many pellets are collected. Once that happens, it moves up the curve 0.1 and looks to see how long until spawning another enemy. This is a really easy way for us to change up the spawn rate of enemies. In the future I would also like to create curves that update in a similar way that will indicate the chances of a second enemy spawning at the same time or something along these lines. I have not figured out how I am going to deal with which kind of enemy to spawn, but I imagine I may link this in a similar way in which more difficult enemies spawn at later parts of the level. The other nice part about this is that I can easily customize each level to have different rates.

Looking to the future:

I know that this is boring, but I really need to get a titlescreen and pause screen together. Really, for right now, I only NEED a pause screen in order to put out a demo. But I would love to have a full product that has a start screen that you can refer back to. We would also love to get original snake art into the game, and this is pretty much a requirement for us in terms of putting out a demo. Also, I don’t know if you noticed, but the floor is just a green image, it would be cool to get tiles in with art on them or something. Also, to better realize the game and get a true vertical slice of what we would like to deliver, we should really implement a power up as well and some kind of way of cutting down your tail to make it shorter. If we could get all of these things together by next month, it would make for quite the demo.