Have you seen those Misleading Ads? I made them REAL!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome i'm your code monkey now if you've been on youtube for a while then chances are you've seen those misleading mobile game ads you probably know the ones that i'm talking about actually let me know in the comments how many of you do know what i'm talking about i wonder how global these ads are if you just google misleading mobile ads you will find exactly what i mean usually they showcase some sort of pinned puzzle with lava or acid or a connect the gas puzzle however if you then click on those ads you end up on a game that has absolutely nothing to do with the game shown in those ads there was even a ruling in the uk that deemed those ads illegal due to being misleading but anyways the game ideas shown in the ads does seem interesting so i thought well why don't we try to turn those into a proper game also in this video i will talk about one of the most important hidden parts of game development so make sure you stick around for that so this is the main design that i was going for i wanted to be able to pull some pins and have some fluids like lava water and gas then combine those with a player character make some interaction between the particles and end up with a nice puzzle game so the first thing i began to do was making those fluids this is the first time that i attempted to do this so it actually required quite a bit of research i'm quite pleased with the end result i actually ended up making a complete tutorial on it on a previous video essentially it's tons of tiny spheres and some shader magic to make it look like a liquid go watch that video to see how it works i'm really happy with the final result so with that i had fluids working and i kept working on the game now i was actually going to cut out this next part from the video but i felt it showcased an important part of game development so i'll left it in but before i get to that let's thank the sponsor that helps these videos exist skillshare is an online learning community with thousands of classes on just about any topic explore new skills and improve your current ones at your own pace with unlimited access to thousands of inspiring classes for every skill level learn skills related to game development like the basics of computer science then learn modeling in blender by making your very first 3d character and then learn the basics of animation with all the important principles of squash and stretch timing and so on being a subscription means you don't have to buy each class individually so for less than 10 dollars a month with the annual subscription you have full access to all the classes you could possibly want with so many classes available you can learn skills related to game development but also improve on any hobbies you have for example learn how to play the guitar learning electronics with a arduino and a raspberry pi or learn how to be more productive in life join now with the link in the description and for a limited time the first 1000 people will get a free trial of skillshare premium membership thanks to skillshare for supporting the video and supporting the channel so as i was saying originally i was going to cut out this next part from the video but then i thought it would be so much better and more transparent if i just left it in now if you've seen many of my videos you might be misled into believing that i'm some sort of genius who makes all these complex systems perfectly without any errors but that's definitely not reality the reality is that as with anything making games and programming is all about learning and learning is all about making mistakes the final polished videos that you see are after i've done all of my mistakes and after i spent a considerable amount of time in research and preparation actually one comment that i sometimes get which is a bit frustrating is when people say that i go too fast in a certain video and they can't follow my response to that is to use the pause button and take your time learn at your own pace and just focus on learning but sometimes people get upset with that reply as if it's something they're not supposed to do like for some reason they think they should be able to learn absolutely everything about a particular system in exactly the length of the video so that's the distorted reality that a final published video creates when you see a 20 minute tutorial it absolutely did not take me 20 minutes to learn how to do that those final 20 minutes equate to hours or even days of research and preparation not to mention my 20 years of programming experience the learning progress takes time and mistakes are absolutely part of it i usually cut mistakes out of the videos because well i want to make sure that i'm teaching the correct way rather than leading you down a wrong path but those mistakes are no really mistakes just attempts that didn't exactly work out those do exist and are absolutely normal and part of the process now specifically what happened here was i was trying to solve one particular limitation of the liquid system that i showcased in the previous video in that system it uses a shader to apply a visual to the particles and then i have a different material for each liquid type however the shader is applied to all the particles on screen so i cannot have water particles and lava particles in the same scene at once for this design i absolutely needed multiple particle types active at once so i had to solve that after thinking for a bit i came up with an approach that could work so i thought i could tint the particles in a specific color and then in my shader use those colors essentially as masks so the shader would identify the red particles and make them look like lava then identify the blue particles and make them look like water it sounds like it should work and it probably does work however i'm not a shader expert it's one of the areas i don't have a lot of experience in so i had no clue how do i mask out a specific color out of an image i mean doing that through code is very simple i just go through every pixel check if it's close enough to the pixel color that i want to match and if so i keep the value if not i discard it i can easily think of that in logic but i couldn't really apply it to the shader so i tried doing it try doing a bunch of math to isolate a specific color i attempted subtracting the mask from the original colors and inverting the results i tried using a step node i thought maybe i could use multiplication or maybe the module node so i spent quite a while going through this trying all the possible scenarios and failing every single time not a single one of my attempted methods worked also it doesn't really help that i was trying to get this working at night after a 14 hour work day so that's a quick tip for you make sure you take your rest seriously a tired brain won't really just make tons of mistakes it's much better to rest and come back the next day so that's exactly what i did and in the end after destroying my brain for quite a while i opted to go with a simpler different approach i made a separate camera for each liquid type and used the same method as previously obviously this has a pretty steep performance cost having all these cameras and random textures at once but it did work so that's the part that normally i would cut from my videos and skip to this point but this time i felt it was important that i left it in trying different approaches and failing until you find the one that works is absolutely part of the process whenever you watch one of my videos i want you to know that i don't come up with all this magically it all takes tons of time and lots of trial and error and by the way if you find the video helpful consider subscribing and hitting the like button it really helps out the channel so with that i had my multiple liquids working next up i wanted to make some interactions between them for example i wanted to turn lava plus water into stone in terms of logic that task was surprisingly easy the first thing was i need to know the type of each particle and for that i made a scriptable object to hone the type these are super useful and i've used them in lots of games in this case i didn't even need any data just having the object for each tab was more than enough then i made a script that has a field to store the type and attach that script to every particle and with that now i know which particle is which so i made another simple script this one listens to collisions and when a collision happens it checks the type of the particles involved in collision if one of them is water and the other one is lava then i simply convert both those particles into stone as i mentioned previously the visual is handled by different cameras so changing the visual is literally just changing the layer in the particle and change the type stored in that script and that's it super simple interaction between the particles and now when lava touched water it would turn into stone the one issue is that it didn't really become as interesting as i would like essentially it would make a single layer of stone with lava beneath and water on top which i guess is realistic but it doesn't really look too good as a solution i thought well why don't i try to add some random jumping force to my left particles it would seem like the lava is bubbling which does make sense and having them bubble up would shift the particles around and clear some space so that more lava could turn into stone well i kind of messed up on the valves i used and accidentally created a lavish hour not exactly what i was going for but the idea worked so i tweaked the values a bit and the unliven particles randomly jumped up which slightly made them get into more contact with water and turned into more stone however that was still not great so i also added some simple logic to make the stone going to the bottom essentially if there is a collision it checks if one is stone and the other one is level then it checks if the lava is under the stone and if so they essentially swap positions then just for testing and also for fun i made a quick fountain script so it just spawns particles so i can keep spawning more water to make sure that everything works alright so with that it was time to move on from the particles next up was handling the pins i wanted to be able to click and push or pull a certain pin and it also needed to have some limits to how much it can move first for handling the click it's pretty simple just add a sprite for the pin head and implement i pointer down and i pointer up however it's actually not that simple i actually forgot that the pointer events were supposedly only meant to work with the ui usually for warmed objects you would use the mono behavior on mouse down however if you use a different raycaster in this case the physics raycaster they also work with game objects so that was interesting i went down a somewhat wrong path and learned something new and with that i could now click on the pins then it was time to move the pin alongside the axis this was another slightly tricky thing math is definitely not my strong point so this took some googling essentially i wanted to find out the closest point along the axis of the pin with that thankfully i found a great post on stack overflow applied to the pins and it worked perfectly with that i had the ability to click and drag pins along its axis then for the limits for the minimum it stores the starting position and collates the dot product between that and the desired new position if it's going past the starting position then simply don't move and for the maximum it's also simple calculate the distance between the start and new position if it's too far then snap it back and that's it another very simple mechanic implemented i can click and drag to move any pin and i can define how far i want it to move just with this if you put them together you already have some mechanics that work very well with one another so by this point the liquid portion of the game was working well so next up was handling the tubes for the gas i wanted a gas container with a tube that i could drag and if i connect it to another container then the gas should follow them first it was handling the custom shape of the pipe i wanted it to connect from the entry to the exit for that i made a simple custom mesh essentially just take these four points and generate the quad it's simple it works great i covered meshes in detail another video if you want to learn more then after that was actually the point when i started live streaming the development these live streams are not really planned ahead of time so if you want to be notified when they happen then make sure you hit the bell icon oh and by the way these characters you see at the bottom that was a fun overlay that i used during the live stream it shows the characters of the people in chat as well as some messages so make sure you join the next live stream to see yourself on screen i also previously made tutorials for the transparent tnt window as well as the chat bubble so the first task on the live stream was adding a health system to the player again i reused the health system which was actually made on the very first video on this channel over three years ago just made a health system and a health bar from my utilities then in order to apply damage i wanted to know when the lava touches the player since i already set up all the liquid types using scriptable objects this was very easy just make the player a trigger collider so it doesn't block liquids and listen to those collisions if it's lava deal damage very simple logic and work perfectly next up handling the coins also very simple these are exactly the same as the liquid particles except they don't have a special shader on top just a simple coin sprite the goals for the player to win when they touch these coins so then getting back into the pipes first handling the logic for clicking and dragging again using pointer vents and making it follow the mouse position then i made a separate connector and when the mouse is released it checks if there's a connector nearby if so it gets connect it snaps into the new position and rotation also added some external logic to make sure you can't drag the pipes too far with that they were connected then to make them flow was really just adding colliders there's the collateral on the entry and the exit and when a connection happens those two are disabled and two other colliders are created on the top and bottom and with this it allows the particles to flow it works for liquids and also works for gas for another mechanic i implemented player death and for the death type i used water essentially having the player drum so for that i placed a collateral at the height of the head then i made a simple script to listen to water collision if there's water touching the head then counts up a value and if it reaches above a certain value then the player simply drops again all very basic logic easy to implement and adds yet another mechanic into the game then i made pretty much exactly the same thing except instead of drowning it's lack of oxygen there's a timer constantly counting down and a bar showing the oxygen level every time the oxygen gas particle touches the character's face it raises that bar if it gets down to zero the player dies if it goes up the player survives so with this i could already make tons of unique designs based on gas pipes and liquids and that was the last test that i made during the live stream it was two hours which was surprisingly very productive again make sure you hit the bell icon if you want to be notified whenever i go live so after all that it was time to make some levels using all these mechanics i built a total of five levels all of them showcasing the various mechanics now i'm not much of a puzzle game designer myself but it was fun to design scenarios that showcase interesting interactions between the particles i designed those levels then just polish it all up and here's the final result alright so starting off over here on a very simple main menu just hit on play and yep here is the very first level so it's got water lava and some gold the objective is to get the gold so one of the interactions that i added was that if the coins such a lava they get destroyed so if i just point the coins right away and nope they don't actually reach the player they hit the lava and they get destroyed so that's not the solution so here the goal is essentially to drop the water on the lava so that creates some stone and then when there's enough stone essentially i can pass in the coins and they slide down they go through an invisible wall and they hit the player and you win alright very simple level then up here on level 2 on this one is to get stone into the pit so first i need to convert these into stone so pretty much just drag a bunch of water on there and if there's the interaction so as soon as water touches lava it turns into stone and then the stone gets filmed down into the bottom now here obviously tricky thing is that if i push it all away then a bunch of lava goes in and damages the player so i got to be careful with that i could essentially put it just little one by one and yep when enough stone gets on the pit then you win now up here on level three this scene showcases the gas pipes so if i connect the gas straight into the player then all this toxic gas goes towards the player as soon as it touches the player it starts damaging it and yep after a while there you go you'll lose so the goal here is to eliminate the zombie so instead of connecting to the player just connect into the zombie and yep you win and now on this one this one's really interesting so the goal save the knight in the water so right away the night is being drowned so he's under the water and constantly losing help so obviously i gotta connect the pipe in order to get the water to drain and there you go as soon as the water goes underneath the head area then the night is now no longer drowning however now i can't dump the water just like this since this is a gas so if i just connect these then nope doesn't quite work out so instead just open up that valve and now the gas is gonna flow away and with this and now the water flows down there and when enough water gets dumped if there you go we've got a little wind and on the final level also very interesting so the player is in there and he's in need of oxygen and right away there's oxygen down here in water in here if i just try to go nope doesn't quite go the water puts pressure on the oxygen and nothing actually happens so now the poor player is essentially gonna lose his oxygen so instead the solution this one is first dump the water so just connect the pipe and let the water flow then connect the oxygen now here is the tricky thing if i open the whole thing then the oxygen is going to leave through there so that's not quite going to work out only a bunch of them go in there so instead the solution is just to open up just a tiny bit just to be able to get exactly on there and not waste any oxygen and there you go when there is enough oxygen in there then the player is breathing it and your p saved alright so there it is those are five interesting levels that i made using these mechanics you can download the complete project files from the website or play the game for yourself through the steam app it's a simple design but it works quite well this was a great mini game to make i hope you enjoyed watching this making out video and thank you to everyone who joined me on the live stream if you want to be notified of new videos or whenever i go live then make sure you hit the bell icon don't forget to check out skillshare through the link in description and start learning a new skill today if you found this video helpful consider liking and subscribing this video is made possible thanks to these awesome supporters go to patreon.com unitycodemonkey to get some perks and help keep the videos free for everyone post any questions have any comments and i'll see you next time [Music]
Info
Channel: Code Monkey
Views: 688,776
Rating: undefined out of 5
Keywords: misleading mobile game ads, misleading ads, mobile ads vs reality, game ads vs reality, pin puzzle game, pin puzzle, unity mobile game, unity mobile, code monkey, game ads, unity puzzle game, unity liquid, fluid simulation, liquid simulation, puzzle game, unity push pull object, devlog, devlog unity, devlog indie game, game jam, unity 3d, unity, game design, game development, game dev, unreal, godot, unity 2d, programming, coding, c#, code, software development, gas
Id: ahvkFKSge2A
Channel Id: undefined
Length: 17min 41sec (1061 seconds)
Published: Sat Feb 20 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.