The making of the game




The theme was "Everything is a resource" and admittedly my idea for the game was very ambitious. But lets start at the beginning.
I had originally planned for the game to start with a cut scene of a news report that is hijacked by a robot for his evil master.
The idea for the game was that you can create machines from parts you find on the junk yard behind your house. These crafted machines could be sold for money which then in turn allows the player to buy more complicated plans for other machines. This junkyard would be layered with items so that there would be sufficient amounts. To add difficulty I wanted to have some form of guard at the junkyard that would attempt to stop you from taking items, but then the question came: everything is a resource, so how could the guard be a resource. Following this I decided that the guard would have to be a robot for one as the idea of the story is that robots are controlling planet earth and for the other as this could allow my idea on how to turn the guard into a resource. The idea for this was that I could have a special item buried in the trash which would be used in a special machine with which the player could "hack" the guard robot and command him to help you pickup trash.
The matter of deciding on using Unity was actually decided by the following thought process.
Whilst I would have preferred to use Godot or no engine at all my idea for the game would have required easy use of physics and as neither of those would provide that I decided that Unity will be my best bet.
Day 1
I started with the obvious first step of creating a new project and thinking of a title.
I started of by making the house the player would be in. This will only be an outside version and I would make a dedicated inside version. As the art style I had decided to use for the game was supposed to resemble a cartoony look I had decided that I would first model the houses in standard low poly and the bevel all edges by a tiny margin and finally create a normal flipped duplicate that is entirely black and slightly bigger. Unfortunately I had beveled the edges before texturing which made that process significantly more tedious.
Both as I was at this point not to experienced in writing my original notes and because I started work on the first day late I only have this to talk about on the first day.
Day 2
I started the second day by making more assets, mainly for collectibles and making a fence to surround the future junk yard.
As this is pretty much my first time seriously doing anything with Unity most things that it is capable of I had never really experimented with so I imagined that for making the junkyard I should try using the terrain system.
Now the only terrain system I have ever had any experience with before was the terrain system of Roblox Studio which widely differs from the unity one.
After some experiment and realizing that I would need to turn down the strength drastically I managed to create a shape I was decently happy with and now wanted to swap out the gray checker pattern for a more appropriate material.
I for the first time started using material maker (a tool recommended by the game jam) and through a combination of different fractal noises for color variation and height maps managed to create a result I was decently happy with.
After way to much struggle I managed to apply the material to the entire terrain which I am pretty sure should also be possible to only apply it to certain areas but whatever.
My original idea for the map was more or less that the player would be separated from from the junkyard through a wall which had small stepping stones over which one could jump.
To accomplish this idea I now started making a wall in blender accompanied by the most silly graffiti possible.
However as I had made this graffiti in an external program I was not able to just download a version without background which I would have needed so I had to manually remove the background which took ages.
Now to add some difficulty to the game concept my idea was to have patrolling robots at the junk yard which would kick you back to your house when they found you so I started modeling such a robot.
Now it has to be said that I am horrible at animating usually as I don't really do it often, so I usually have animations that look completely wrong, however the walk animation I made for this robot just baffled me, as it look for my standards tremendously good.
Day 3
The third day followed with me starting and completing work on a system to be able to pickup items.
Now because I am so bad at coding in Unity and because I didnt really put much effort into the system, to be able for a object to be pickupable the following conditions must be met:
1. Both the main and outline mesh prefab must be unpacked and parented directly in a object prefab
2. For both of these meshes and the object prefab the tag must be set to CollectableObject
3. The object prefab must have either a mesh collider or a box collider. It must be using a box collider if the mesh collider is concave
4. The object prefab also needs a rigidbody component on which the linear dampening property is set to 2 so that it falls slower
5. the spawn truck spawnables list needs to also contain this object prefab
6. the list of objects that can be picked up which is attached to the camera must also contain the object prefab
I am pretty sure there are also some more conditions that I forgot but if the object does not meet 1 of those and a few more criteria then it is not pickupable
Next I wanted to start work on something that would spawn the junk items on the floor so the junkyard could be covered in them.
And this is where I ran into the first major roadblock.
I had originally made a very crude and insufficient test just to see how that would go. For this test I had 100 items that would even have their rigidbody component removed.
And despite this minimalistic original test which for reference wouldnt even have been remotely close to what was needed the framerate was already unbearable.
It was clear I could not realize the idea with this way.
After some thought the idea came to me that perhaps instead of the items being on the junkyard in the first place there could instead be a grabage truck visiting the junkyard in certain intervals and be dropping of some random items where perhaps the chance of them being something specific could be weighted. To adress the possible issue that the player might be afk and the truck would come a numerous amounts of times and the trash would pile up my idea was for there to be a trash incinerator power plant with a conveyror belt leading from the truck into the trash incinerator.
Upon looking at images of trash incinerators it actually seems that there is no specific shape or such they need to be so I can probably just make anything with chimneys, modules and stuff.
I took vague inspiration from this image:
It continued work on the fourth day by making 4 different cloud models and a script that makes them pass over the sky and always generate new ones after deleting the oldest ones.
I just wanted to do that because I knew I would be making that at some point but already had a decent idea on how to.
Next up I made a conveyror belt model and script so that it can actually transport items.
Just a quick script so the waste disposal removes trash that goes into it.
Next I wanted to make some particles for fire in the waste disposal. But because I had no clue on how particles work in Unity and because I didnt want to spend an entire day trying to do that I just ended up using a free asset pack.
I also used the same asset pack for the smoke from the chimneys.
Time to fix a bug with the player camera where when you look to far down or up (specifically so far that you would be looking on the other side) then it inverts the controlls.
Easy just 4 lines to clamp the angle between 70 and -70. Is what I thought. You see despite those changes the bug still happens and I am entirely clueless as to what might fix it.
Next up I made the garbage truck that would be delivering items to the junkyard. The reference image I found for this I actually followed more closely:
And after I made a waypoint system for the garbage truck to be following because from the start I knew that I want to have the garbage truck be doing a 180 into the position where it unloads the trash.
Because the original house model I made was just to small on the inside to fit anything in I next up made a teleporter to effectivley make the house a tardis.
For now i just have a small gray platform as where the house will be.
On this day I am quite all over the place so I only now actually get to distributing the waypoints for the truck.
At this point I had realized that my original idea of making a small city around the players house was just not managable in the rest of the given timeframe so instead I just decided that the player has 1 lonely house in the middle of a big forest that for some reason has a junkyard next to it.
To make a forest I obviously need trees, so i made 4 different models however two are just variants of one.
As I already said, on this day I was kind of all over the place so next I made a skybox.
It was just as easy as picking to shades of blue one for the top on the for the bottom and for all surrounding sides a gradient between the two.
That itself was easy however it kind of looked like a inverted cube with those texture as for some reason it had litteral shadows on the corners.
Next up I started hiding where the garbage truck actually goes. For this I tried using Unitys tree tool however I did not manage to make it work Until I resumed attemepts one day 5 when and after immense struggles I actually managed to make it work.
Now currently the robots where just statically sitting in place and not at all a threat to the players, so next up I started giving the robots a patrol route. This I thought and for once was correct would only be a slightly modified version of the trucks waypoint system.
And after a bit of finageling with the unity animator component I also managed to make it play the walk animation.
So now I actually needed to make a run animation and I tried, really often and in multiple different ways, but I for the life of me couldnt make anything even looking half way decent.
But the I had the idea: Its a robot, so I can just make his walk animation be his legs working like pistons.
So I made that and it actually looked decent.
Now after some slight frustration at the lack of intuity in the unity animation system I asked AI, and surprisingly after only a bit of correcting it managed to make a close to flawless setup in the animator that would transition and everything. AI is improving.
Now of course it is nice to have a boolean that can be flipped to make it start using the run animation however if nothing causes that and if he just continues his usual path then it is rather meaningless, so I implemented a detection and chase system. This will need some more working however now I have more important things to do.
Such as making it so the robot can be flipped removing all of its chase and patrolling components (this is achieved when the robot under any circustance rotates over 60 degrees on the x axis).
Now a robot chasing you is of course rather interesting, but only untill the point where it catches up with you and only if there is a actual danger of being cought up with. So next I made that.
When the robot catches up with the player he will play a punch animation and the player will be proppeled over an arch back to infront of their house.
And I ended day five by starting work on the crafting system which starts with me making a workbench.
I started day six by trying to make a proximity prompt on the workbench for which I would need it to draw an image on the 2d space of the screen instead of the 3d space in the game world.
After that I added so a key can be pressed to open the crafting menu which first moves your camera with a couruntine to the position looking at the workbench and then you can use arrow key s to select a recipe.
Now for some reason it took me a litteral half an hour to add a option to close the menu again.
So now that there is a way to get in the house and that there is a workbench in there with a purpose I thought it might make sense to actually make the inside of the house.
Now funnily the inside of the house likely because it is so big and spacious kind of looks like the backrooms.
Once again I am all over the place so I am without any transitioning now working on the outside surroundings. And hey, I fixed the trees dissapearing. Oh right I never mentioned that.
So because I have such little time I had just scrapped the idea of being in a city but instead I put the player in a forest. However that is not very inescapable, at least not without significantly more work and as I do not have time for said work, I need to do with the next best alternative. Introducing out of bounds.
See what allot of games do when they dont want people going somewhere is introduce this thing that makes that if they are to far away then their vision starts getting blurry, dark and they start hearing ilusional sounds before misteriously respawning where they are meant to be. So I made the exact budget copy of that.
But now the biggest problem of them all started dawning on me, a problem that could not be avoided even if I really wanted to, a problem so sever even my computer started complaining.
Lag.
Now I have a good computer I have a 12th gen intel processor and a 4060 graphics card yet I was getting between 20 and 30 frames per seconds usually.
Now with this unbearable performance I really couldnt continue work on the game.
Now using the Unity statistics button didnt only reveal this frame count but also that apparently it was usually rendering between four to seven million polygons per frame.
I really understood just how bad the situation was now.
My first idea on how to fix the situation was to starts some fixing on the amalgomation of random unexplained bugs such as that my trash burner was infact not burning trash (trust me I dont buy stuff from temu).
And now after fixing that I was actually getting a rather stable thirty five frames per second which after some consideration I deemed was absolute garbage.
Next up. As I mentioned at the start my models are all slightly beveled which does bring up the polygon count and whilst I am pretty sure that that doesnt explain 7 million of them I must take any sacrifice strictly necesarry.
But the with only marginal improvements I looked upon the game wondering if there was hope and realized: I have litterally a couple thousand trees each with a few thousand polygons and last time I checked math, a couple thousand by a couple thousands makes allot of millions.
Now unity does have an in built solution for trees, if setup correctly unity will make bilboards that will be rendered inplace of trees from a certain distance where it doesnt matter anyways however to implement this I must use some certain shader and make the tree models be one and a couple other things. To not bore you I am just going to say, after around one or two hours I am now using the tree bilboard system and according to the stats its only rendering between 1.5 and 3 million polygons now. Very nice.
However now the trees looked as if I had tooken a tree and tried recreating it in origami... and ran out of one type of green paper half way through.
And upon reading my notes I had made throughout the project I am seeing that I had wroten "WHY ARE THE TREES TINY" although just doing some stuff with reparenting the terrain objects for inexplicable reasons fixed it.
Now whilst the performance was already back to rather steady 60 frames per second I thought I could probably drastically improve the performance by replacing the C# script that would every frame loop through all 500 clouds with a computer shader which would do so significantly more efficiently, but upon atempting to do so for quite a while to no success I just called it a day after doing slightly more work on the interior of the house and making some more items to be delivered by the garbage truck.
Day 7
So I resumed work on the crafting system and in my notes I legitametly wrote this:
"In the middle of doing so i have to do everything differently so now i have like 7 errors at once and for some reason the copilot extension decides to go get a drink or something"
Now I did somehow manage to actually write C# Unity code after this (because I was kind of forced to), managed to make the crafting system close to working and found out that I had just run out of completions.
Now get this, I was here starting to get to the point where I was forcing myself to stay in my seat to continue work on this, listening to music on non stop to avoid a mental breakdown and as a quote feeling like if I wasnt listening to the music I would have probably been so mentally deranged that I would consider CMake a good thing.
Now to kind of pour salt in the wound I after way to long searching found out that most of my issues with the crafting system seemed to stem from me having in one case spelt a tag "CraftedObject" and in another line of code checking for the tag "CrafterObject". Now usually I am not the person who has issues with their code due to mispellings but only this one time in the actual project, so I really hadnt expected it. But after long last and a large chunk of my sanity lost I could finally say the crafting system was completly done with nothing else remaining necearry for completion.
I thought I would treat myself to now making the computer model to get starting on the computer system.
Making the actual model didnt go with any issues and I thought I could improve it by making the screen have tv static when not on a website.
Now from my other game development knowledge from amongst others Godot I knew I would have to use a shader for this and fortunatley for me, due to what else I had be doing I already knew how I could add this shader.
However the way shaders work on unity is widely different to how Godot shaders work, you see Godot uses a modified version of GLSL changed to fit the general Godot theme of being rather simple to understand yet powerfull in use. Unity uses a language called ShaderLab which according to google is a wrapper for HLSL and Cg. Not only is it not GLSL but it also include Cg whatever that is, so in Godot a simple albedo texture shader would be only a couple of lines wheras the Unity equivalent is composed of more lines of code than an entire random number guesser game. Seriously. I did however have the power of AI to assist me in trying to make this simple shader I had envisioned and with the help of it...
its grey
now its a darker grey
it remains as that
now its cyan
now its just normal blue
I had managed to make it generate some random noise with every color on the rgb spectrum and I also made (with significantly less struggles) that further down pixels would be colored a bit darker.
Introducing: "I attempt to make UI in Unity but instead make jokes in the made up urls and in my notes". Now because I want to later on make a video about this endevour on my Youtube Channel in my notes after stating that progress was going slow I have "but the lupus nocte "howling" started playing and when it stopped playing suddenly all of the websited where finished
For copyright reasons (in other words that i dont have a €131.88 ($155.62) anual epedemic sound license) i cant acually play that song right now"
And with that the day ended.
Day 8
Now by this point I had forced myself to be working on this project 8 hours a day for the last 7 days. In my notes I wrote:
"I am currently moddeling a car batterie whilst listening to a song made of grian noises (what has my life become)"
However I pressed through the mental pain and started work on adding some actual building recipes.
Now by this point in the game I did not have anything to judge whether you have won the game. My idea for how one could win the game was that the player was attempting to make a specific machine that would create a special EMP that only affect the robots. How does the player make this machine? By combining three different machines which can be made from parts on the junkyard. A Anti Robot Framework, A Source Code Analyzer and a Special EMP Launcher. The idea is that when these three parts are combined then the player sees a cutscene to indicate they have won.
The same day I did actually manage to make said cutscene in blender however I had no idea on how to put it into Unity.
Day 9
I started the second to last day by making so you can actually sell items.
My first idea for this had been that there would be a website where "orders" would come in asking for specific items and those orders could be completed for a stated amount of money. However by this point I knew that I neither had the required mental capacity nor the time to implement such a complex system so instead I just made this website be a single big sell button that sells all items in the sell area for respective prices.
__---/|\SOUND DESIGN/|\---__
Now up untill now the game was about as silent as outer space.
NOT A SINGLE SOUND.
So I thought I could fix that by first of all adding some music.
I wanted to make this music using my virtual Mini V3 which is a great virtual synthesizer. However the license to that is owned by Arturia and because they are ignorant there is no way to get either the ASC nor the individual products on linux (I dont think I had mentioned it yet but I made the entirety of the game on Ubuntu). In a search for a way to use it I searched the web on if anyone has already made it work, however I could not find a single answer. I already had a bit of knowledge as to how wine works so I started by just running the ASC installer with wine and low and behold it actually worked. However it only worked to the point of adding the files into directories I can not see. To actually launch the ASC I would have to get a bit creative. In a terminal I ran "winecfg" which opens the wine configuration menu. From there I clicked the "Add Application" button in the hopes of being able to create some sort of a shortcut or such but instead it revealed a file browser that was able to see these directories. From there utilizing some trial and error I navigated to the installed ASC .exe file and ran it withing this file browser. From there I was able to activate my product and following a similar procedure also start the Mini V3.
And all of that to say that I didnt actually end up using it to make the music.
Instead I made all of the music on onlinesequencer.net
And for the general outside music that plays I just downloaded a Youtube video of birds.
To start of sound effects I first made a list of what I could need. For the sake of not uncesearilly lengthening this text block I would leave the 15 bullet point list of what I thought I could need but instead will just say that I decided that a sound for a object falling on the floor and for when the player walks through the door would be to complicated.
Although before I decided that I wouldnt need a sound for something falling on the floor I had actually searched for one and wroten this in my notes:
"on the search for a sound when something falls on the floor i found the metal pipe sound and had to laugh so hard i got something like an astma attack"
I was actually wondering if the thought of that was legitimatley so funny or if it was just that I was so mentally drained and enjoyment deprived that I would have laughed at almost anything.
Now uppon testing the out of bounds sound effects I realized that I had actually made a rather terrifiyng out of bounds, which was kind of what I was attempting however I had not imagined it being that succefull.
Now for some reason after I had added the sound effects the fps had halfed. According to AI it could be that I would need to convert them to .wav instead of .mp3 because possibly decompressing the sound file could be causing lag however despite me doing so the fps did not improve.
I tried hunting down the issue using the Unity profiler but that that was only telling me that "Others" was halfing the framerate.
Although it did tell me that my clouds script was only talking 2ms per frame. Yeah I dont think a compute shader for that would have saved my framerate.
Despite me not having found the culprit I had to call it a day then because it was just getting to late.
Day 10 - THE FINAL DAY
Now the first thing I did on day 10 was to compile the project properly as that could possibly at least slightly improve the framerate however once I did I was baffled. Upon compiling the game it in the editor ran at around 60 to 70 fps. It remains a mystery why it improved the performance in the editor but I wont complain.
Next up I wanted to make there be a crafting hologram as I had already implemented the system and without it, it would be barely possibly to have a clue what you are currently trying to craft.
I also made the truck slightly louder as it was rather quiet.
Now for how the player was to know what they would need for the crafting recipes I just took the easiest way for me. I made a real website that the game would link to where you could view all of the recipes and their required parts.
This website does not use any java script or type script, not anything else like that or a fancy build system, no only 290 lines of html and 93 lines of css.
And besides uploading the game, making some thumbnails, exporting it to Windows which was litteral pain and submiting it to the game jam that was all I did on the last day...
Day 11?
Yes due to timezone stuff I still had 4 hours on what technically was the 11th day. I discovered this when I thought I would see what the others had submitted and found out that my own game didnt work. Specifically the crafting system would not accept parts. After some stressful searching to code in an attempt to find out what in the world was causing this, I managed to swap out that issue for that once a part is added the player gets deleted. Great. Now I could for the life of me not remember what was causing this and how I fixed it but all I know is that once I had fixed that, the next issue arrose. Being that when a part is added then the game teleports the player in front of the house and makes his camera continously teleport back there which his vision flashing black. I was entirely clueless as to what might cause, not to speak of fix, this. Now upon testing withing the scene view when this happened it turns out that when I would manually withing the scene view move the character it would give him free again kind of fixing the issue. So at the end of my mental capacity and just wanting to finally forget about the game I added a line in the crafting script that would move the character slightly upwards in hopes that that would fix the issue. And it did not only did the character not have the whole flashing screen and all of that but he would remain at the workbench.
And now finally 1 and a half hours before the final deadline I was able to submit my project and finally forget about it. Until now I am writing this on the 4th of July and I am fearing that I wont get sufficient ratings as I have not gotten a single rating in the last 3 days.
Thanks everyone for reading.
Files
Get Making with Trash
Making with Trash
Make stuff with trash
Status | Prototype |
Author | SCRIPTERBLOX |
Tags | 3D, assemble, carryable, Cartoon, Singleplayer |
Languages | English |
Leave a comment
Log in with itch.io to leave a comment.