Game Jam Devlog! - Making a Reverse Horror Survival Game from scratch in 10 days

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so it looks like it's that time of year again when the pumpkin people return the spooky game jams begin and the spookier midterms start piling up welcome to this special halloween game jam devlog where i attempt to make a reverse horror game from scratch in 10 days for scream jam 2020 let's get started so i decided to switch to notion as a general note-taking application because it's pretty helpful to have a fully integrated system to keep everything in and i'll be using it both to brainstorm hold list databases and for project management i was first considering making the game from the perspective of a trick-or-treater being hunted by monsters but i thought it would be more fun to be the monster so i took inspiration from carrion to create this reverse horror game and then to flesh out the game loop i decided i wanted a portal to open and this portal to be sort of the thing that the game revolved around you can lure people into the portal by using your special abilities which you could then build up and defend sort of like a base building game and then it would be set in a large forest with a central city and a couple of outposts around with small poorly lit roads connecting the city and outputs that you could hide near and ambush unwary people and then drag them back to your portal the top down perspective would be easy to do art for because i could just rotate sprites and make one animation for characters instead of four if i used like a half perspective so just before starting i set up an initial project tracking board in notion just to keep myself on track and to make sure not to lose any good ideas due to disorganization i think it's a good idea to do that and it's also super satisfying to watch as my feature list becomes more and more fleshed out with cool stuff so i'll be using unity for the jam and i noticed that the 2019.4 long-term support edition had a bunch of improvements including every dark mode so i upgraded my out of date version to that and i started poking around at the changes if you're unfamiliar with unity it's kind of going through a rough phase right now with a bunch of rendering pipelines which have caused me and many others no end of grief and i just kind of randomly went with the universal render pipeline because i thought i would need 2d lighting and the urp system supported it all the programming was done in visual studio code with all of my nice color extensions intellisense and time-saving snippets it took a while to get the intellisense set up actually because i wasn't really behaving but the documentation is pretty thorough so i got it working eventually now i started off the actual game development by making a couple of basic prototype e art assets a grass tile for the ground and a normal circle for the player or enemies which i could easily tint different colors it took a bit of fiddling to the player to get the player moving as expected but i had the basics of my game pretty much done after a couple of hours now to create the halloween goers to lure in my plan was to rely on emergent gameplay an idea in game design where you have a couple of simple systems that through interacting with each other create fun and complex behavior so here's how the system worked in my head i'd have a network of houses each with some amount of candy and some enemies scattered around the map enemies would target the closest house stop for a second to collect some candy and go to the next closest house you know like a normal person would do once they visited all the houses they'd go home which would be to a random house they were assigned once they were created and yes this would mean they would be trick-or-treating at their own house but this is kind of just an approximation now this is a pretty straightforward system in and of itself but i wanted to make it more interesting to interact with the whole point of this is sort of to take the human behavior that you experience every day and try to translate that into code and you have to use all sorts of interesting functions to make it happen so then instead of moving as individual units i wanted everyone to form crowds and sort of move together because i thought i'd sort of see that behavior in real life when i used to go trick-or-treating houses too would have a different degree of desirability this would require a partial implementation of the boyd's system which itself was an emergency system that comprises these rules one entities move towards the center of a group two entities move in the same direction as a group and three entities try not to get too close to each other and this is used commonly for some flocking animations or flocking simulations of birds and fish and stuff and as you might expect this resulted in some pretty horrendous code that would end up biting me later because i'm basically producing a check of every entity against every other entity uh 60 times a second and as you can imagine that's not great so for interaction with the player i want to design a whole state machine to emulate what i think this human behavior would look like so if the player got close enough to be cited it would send the ai into a fear state and they turtle off towards the group in a sort of shaky drunken movement movement pattern once they found a group that fear would turn into the fight response and they'd all get aggroed and start attacking the player i wanted there to be some sort of threat and i imagine scaring a bunch of kids and then getting them into a group would inspire them to fight back so after that they'd start attacking the player until they lost interest or the player ran away or they managed to kill the player i've never managed any ai like this before so i ended up using a switch statement to control the transitions and checking every tick and i'm not sure what would be a great way to manage uh a state system like this i know you can use unity's animation system to kind of hack together uh like a finite state machine but a switch statement worked well enough for me and i was pretty happy with that finally there's the astray state which only happens when you approach an enemy from behind when they don't see you and use your luring ability which would just make them follow you and not attack i sort of got this idea from a podcast i was listening to called the old gods of appalachia which you might find interesting if you're into cosmic core but anyways um you could use this ability to pull enemies into the rift thus taking their candy to advance the portal opening because for some reason the force behind the portal really likes candy too and this would end up destroying the enemies too as an added touch i wanted to create some dialogue so you could have a peek into the heads of the people you were eating sacrificing so i set up a huge array with each sort of state having 10 different snippets of dialogue it also served the side benefit of telegraphing the enemy's ai state so all in all it was one of the better ideas in this game i admit that world building isn't really a strong suit of mine and i've never really made a game with a large world actually i rarely make games with any movement at all so this whole thing was a little bit new to me i kind of designed the world a bit haphazardly and randomly and i think one thing i should have done better was to integrate more points of interest as it was way too easy to get lost i made some pretty basic tile sets in a sprite 2 just to flush out the city um marking out roads and corners it was going to be a little bit out of scope to have cards so maybe i should have just made dirt roads but i think it looks okay regardless so making the ai interact with the world was one of the largest problems i ran into making this game it was a pretty big technical challenge and even at the end of it it doesn't work exactly right if you inspect the code you'll see in the console that there are a lot of errors coming up with dictionary references not being found which has to do with something going wrong with my pathfinding algorithm so i didn't want the enemies to just randomly walk in arbitrary directions sort of just walking through fields because normal people tend to stay on the sidewalk or the road and in order to set this up i created a custom pathfinding system by placing nodes all around the world um at the points where streets had intersections and basically and also at the houses and basically enemies would path between uh they would create a path of nodes just going from one node to an adjacent node and try to find a path from one house to another randomly selected house now this is a bit of a complex topic so i have another video going through the pathfinding algorithm that i'm using and i i painted a couple of algorithm visualizations so you might be interested in checking out the more technical side of that and you can see that linked in the description or at the top okay so one thing that this system relied on was having the nodes connected to each other um in a sensible way so nodes at opposite ends of a street would have to be connected to each other and there there was going to have to be some way for each node to know what other node was adjacent to it and one way to do this would be to drag in for each node just specify its nearest neighbors in each of the cardinal directions um but doing that for 80 separate nodes i really really wasn't something i wanted to do so instead i created this system for each node to at the start of the game ping each of its closest neighbors by using a weird sort of searching thing and it auto-generated a network and i got a couple of broken links which i think is where the errors are coming from but all in all it worked better than i expected [Music] i also integrated some fear interactions and vision cones by using a little bit of basic vector maths and i created a system to let the ai smoothly rotate to face the direction they were going which was actually a bigger problem that than you'd expect describing rotations in 3d is a bit of a complicated topic that i'm not going to get into here so let's move on to the next section so in order to make this whole game pretty i had to implement quite a few things lighting was actually really easy to set up and unity's out of the box support for 2d lighting was actually quite impressive once i got the hang of it i attached a light cone to each enemy which would rotate with their motion and added shadow casters to the houses and i had a pretty easy working prototype it looked pretty good i think and the game was starting to come together at least visually i ended up making a couple of big changes to this to the design though because i figured that top down houses looked really ugly and i'd have to make them in perspective because otherwise it's kind of hard to tell that they were houses so this would require me to make four different sprites depending on the rotation angle this also meant that everything needed to be in perspective including enemies so i'd have to paint four different animations per enemy and you can imagine that this might have taken quite a while while designing the trick-or-treater costumes i went super out of scope with coming up with 8 unique enemies which would require 40 different animations for the left right up down and idle perspective animations and while it was quite fun to plan them out and a nice break from debugging probably wasn't really a great idea i spent a while doing the concept art in krita and while i'm not a great digital artist i find it pretty fun to try so player designs were going to be just as complex as the enemies although perhaps a bit less fun than coming up with halloween costumes and i ended up coming up with a few but i also ended up throwing them throwing them all out because they looked bad and they would probably be impossible to implement i ended up making another version sort of at the end um just sort of a big blobby thing with random teeth everywhere you know in the good old lovecraftian style and i i think that worked pretty well [Music] at this point i wanted to develop a ui to expose various bits of the game state to the player like health and the amount of candy they'd collected so far for the rift i drew a couple of components and icons in a sprite and i used unity's ui system to overlay it over the scene and then i moved on to replacing my prototype sprites with final sprites painting in this 32 frame animation in a sprite to control four directional movement in perspective as well as an idle frame i picked the pirate guy because it was the easiest to do um and just required a cute hat which i thought was pretty fun and i got it looking pretty good now this actually took an impractical amount of time so that's why all the enemies are pirates because i didn't really have time to create another sprite set and variably hook them up i thought it would look weird to have only two um weirder i guess to look to have only two compared to having only one so yeah that's why everyone's a pirate so in order for the player to locate themselves in this map that was becoming increasingly hard to navigate i wanted to create a nice mini map in the corner and i tried using a method of taking a cameras output a separate camera from the main one that was high above the player and then projecting that onto the screen um using a render texture which is a thing in unity but it turns out that rendering the scene twice over is a really bad idea combined with the abundance of o n squared or worse pathfinding and voids called calls running every tick so like 60 times a second and then a bunch of resource intensive 2d lighting with like 100 lights scattered throughout the scene my frame rate dropped to around 8 fps and i almost crashed my computer trying to profile the lot needless to say i eliminated the double scene rendering and the whole minimap idea and i applied a bit of optimization to the code unity actually has some nice guidelines to doing this on their documentation and i i cut some expensive functions and i put them on longer timers i chose to compare squares of magnitudes to avoid expensive square roots and i tried to make a bit more use of particle systems and it came to run a lot faster than it was before so the new game loop now revolved around going up to enemies unseen and then using the lure ability to force them into the astray state and then leading them to the rift um i also wanted a bit of a way to combat them so i added a way to like chomp them and uh create some blood spatters but that sort of comes later as they went into the ring of candles the total candy they collected went into the total shown on the ui and it would light up more candles if it passed a certain threshold the rift would also widen which was a pretty cool visual effect i came up with by switching out a sprite mask to make it look like there were stars underneath the rift i probably should have animated that but you know i kinda didn't have time and the game would be one once a large enough amount of candy was collected from the humans or the player ran out of health by being attacked by annoyed children once i'd sprouted the houses from multiple angles i could move on to populating the whole town with houses and lights and also some foliage to make it look a bit more interesting it took a while to paint them all in but it wasn't that bad and you should know that my pathfinding algorithm doesn't actually check the house or at least the sprites but an invisible node underneath the houses and i only place these nodes under some houses to prevent an exponentially more expensive search in the pathfinding and this kind of makes sense because not every house has their lights on during halloween so it kind of does reflect reality a bit better now looking at this became kind of dull so i created a bit of nice foliage and a sprite a couple of bushes and random grass and trees and stuff to add a bit of variety i'm not sure that you can tell that there are two grass sprites but i thought it might have helped and this also was useful in letting me create a nice border for the map so it didn't run on forever well after doing this navigation became increasingly impossible so i also designed a compass thing in a sprite in order to replace the resource burning mini-map and i gave it a needle to point at the rift and one at the closest enemy this is kind of inspired by minecraft's compass so yeah there's that i made an invisibility and flash-on-hit effect with the shader graph but that took a lot of blood sweat and tears i think i learned a lot about how shaders work but it's kind of hard to know with them because it's really different from the way i'm used to thinking it seems worth looking into though for future games there are a couple things i did to polish up the game it turns out that post processing doesn't work at all with the 2d renderer so yay me i spent a bit too long figuring this out because a combination of plugins kind of messed everything up but i did learn a new trick with the line renderer component which lets you draw lines of varying length and color between points i came up with a way to draw lines between the player and any enemies in the range which was a cool visual indicator and i think a nice effect which was surprisingly easy to implement i'm definitely going to be using this more in the future in order to expand the dialogue snippets i gave to the enemies i added a sort of scrambling function and i planted some variables inside the strings that they would speak and i had it sort of extract random words from a couple of lists to multiply the amount of unique snippets i also randomly thought of putting the player on a timer to make the game much more challenging because it was kind of impossible to lose before while i did increase the pressure on the player to beat the game in a limited amount of time and made everything a lot less overpowered it also had the side effect of disincentivizing exploration in this big map that i spent so long creating and it was pretty hard to think of a game mechanic in order to fix this while the fact that enemy spawns are random made it sort of that you could deplete sections of the map and be forced to travel further to find targets i couldn't really think of a good game mechanic that would force exploration so i just scattered various power ups around the map these are fun to sprite and easy enough to implement and i also made them drop from various enemies as well as a blood spatter after death unlike the last time i did this i expended a lot more effort making music and sounds for the game i tried using bosca coil a very cool free piano roll editor but i found it a little bit too limiting [Music] and i resorted back to my guitar along with a shiny new daw traction waveform i spent a little bit of time working with traction before and i recorded a couple of interesting loops on the guitar i ended up picking the first one i came up with and i think if i were to do this again i might actually want to do the whole piano roll thing uh using lmms which is another free daw but that'll like likely show up in a later video i also downloaded some excellent sound effects from open game art and some ambient noise to really fill out the auditory experience so the final two days were a frenzy of building in ui like a end screen to tell you how long you spent playing in a short snippet of text explaining the outcome of your game i also spent some time coming up with a nice main menu uh for the player to interact with with a credits and tutorial that would come up and i created a nice text based tutorial with variably hidden panels after that a a simple particle system and parallaxing backgrounds completed the main menu and i was almost done all right so there's only a bit less than an hour left before this gap before this jam is over and i have a couple of minor fixes to make after doing a little bit of play testing um the difficulty is a bit messed up and i think i'm going to increase the amount of hurting uh and also i'm going to try to incentivize going further away from the house in order to explore more but i don't know and maybe also expanding the simulation we'll see the last and one of the most interesting things i think i added to the game was the simulation mode a god mode like state where the player could simply observe the ai in action i realized that while this game was reasonably interesting i thought the ai might have been the most interesting component and i really spent a massive amount of the programming time on this game just developing the ai i found it pretty fun to just watch them walk around to different houses chatting amongst themselves getting spooked and running amok and with all the resources i put into it i think exposing some controls to the player to interact with the ai directly was a really good idea i added an extra control to toggle god mode and also to change the number of enemies in the scene so you could fully populate the city at the cost of some frame rate and watch 60 independent ai entities wander the town on halloween night and with that i created a web playable build of the game although this took a couple of tries and i fixed up the rest of the errors most of them anyways and created some marketing material in inkscape finally i published it to the game jams hitch.io submission and it was done after around 40 hours of work and 10 days of waking up early and sleeping late creating pixel art and code snippets between lectures and crunching on weekends before midterms instead of studying to finish the game the video recordings of my work alone take up 15 gigs which is quite a bit more than i've made for i think any other video and you can check out the game and play it for free on hdio which is linked in the description it would be great if you want to subscribe in order to check out more of my content and be updated when i release new stuff which focuses on game development and motion graphics only a tiny fraction of you are sub to the channel and i'd love to see more people join this community so have a safe and happy halloween everybody and i'll see you in the next video a month from now bye [Music] you
Info
Channel: Wintermute Digital
Views: 24,334
Rating: undefined out of 5
Keywords: devlog, gaming, Unity, Game jam, coding, art, horror game, simulation
Id: Nzv_qlfgGuI
Channel Id: undefined
Length: 23min 49sec (1429 seconds)
Published: Sat Oct 31 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.