How I Made a 3D Platformer in 2D Game Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
fourth game is Crystal Seeker 3D platformer Crystal Seeker 3D platformer yeah that's right you heard me right 3D games in scratch most impressive 3D games I've ever seen on scratch oh wow this stuff is wild and this is one of the coolest game on scratch because it's a full third person controller and most everything done here has to be done with some very Advanced Techniques attention to detail here is just Immaculate usually with these 3D scratch games everything is Cube but here we actually have a character it's actually good level design too like this platforming is pretty interesting like this whole 3D environment built entirely in [Music] scratch I don't see why people are confused on white this crazy div us made SC CR they basically just made their own vers of unity except people think this is way more impressive to be built on scratch in a proper coding language like C++ yes it is impressive for someone to make a 3D engine but if you're going to call him a God for call Unity death too maybe SK guy was right perhaps there is nothing special about this game is nothing more impressive than creating 3D engine in C++ or creating a 3D game in unity just look at it everything about this game is unexpired player is literally seven pyramids enemies are not even 3D this game just shoots this is most generic 3D platformer you will ever play or is it you see this game is made in scratch while in other game engines you could just drag 3D stuff in and it works in scratch you have to create everything well from scratch okay but what it makes more impressive than creating a custom 3D engine in C++ for example an answer is simply scratch is not meant for 3D only two available rendering options are either drawing Tod Sprites or lines let's summarize you can't render 3D shapes and even if you could it will be so slow that it will be impossible to make anything working in it and the top of that you must code everything yourself from 3D rendering object management and 3D collisions to creating levels and designing game this is going to be a lot of fun this is a story how I made a 3D platformer in 2D game engine things were far from going smooth I already know in order to have 3D working you will need to convert 3D Point into a screen position in other words you need to project 3D Point into a screen and if you search how to do it on internet you will find this if you wonder what even this monstrosity is it is projection Matrix if you feel intimidated by it don't worry it turned it out don't even need that for 3D thanks to math math Math's full 3d tutorial I finally find out how to make 3D work in scratch and that bring us to the first laow of 3D when an object goes far it becomes th small and in practice this means this the projected XY coordinates are calculated by dividing X and Y by Z value of point and then multiplying it by a focal length which which is opposite thing of field of view the bigger is it the more zoomed it is therefore you see less things this is sufficient if your view is locked the same way you're looking on phone all day but what if we want to actually see world around us that is what introduced us to the second law of 3D cameras aren't real no wait Birds AR TR birds are actually cameras made by government to spy on us and no they actually drone where was I oh yeah in 3D camera is a virtual object this means even they have their 3D position and 3D rotation they don't exist basically your camera is always fixed but if you want to move view to the left you move col world to the right so every time you want to move the view you just move everything in opposite direction this applies same for rotation rotation how you even rotate stuff rotation matrixes luckily for us our body mat matth mat simplified them for us the only thing left is only this as you can see when drawing line the first subtract camera position as explained before then rotate Point using 3D rotation formulas and then before drawing we need to check if that line is actually in front of camera by checking is that distance from camera larger than some minimum distance which is called near plane in 3D then after doing other line stuff repr project the points and draw the line but honestly who will play game made out only offlines okay apparently many people want to play games made out only offlines but why stopped here what about triangles every 3D game now knows all 3D stuff is made out of triangles but you can drive triangles in scratch only spres and lines remember but what if you use lines to draw triangles ah if you find the in circle of triangle and then draw a circle and then bunch of lines around it and you get a triangle and you even can dve 8,000 of this per second depending on device for reference Super Mario N64 level have th000 triangles does this mean you will have 8 FPS no because rendering takes only 50% of all performance meaning it will be run at four FPS are all hops lost then of course not first there's no reason to draw all triangles in scene at once and second you could pretend it's 9983 and make the most low po game ER H looks kind of Epic though but before that I skipped one crucial thing how you get from a bunch of manually verting cubes to the actual 3D model in game engines you just put the things inside and they works but here you need to code everything 3D models can be represented in in various ways but the easiest one is the obj file obj is basically a text which tells you first the positions of 3D vertices then the indexes of vertices requir to form a face you remember connect the dots game it's basically the same thing just it connects triangle vertices now you can't simply put the file in scratch you must copy and paste the whole file inside the block making the length of the block larger than V of China after that you put all those data in bunch bunch of lists and then you spend 3 months desperately trying to make it work and it still not works somebody please help me and finally models in scratch now let's start making the 3D platformer If You observe carefully you will notice that 3D Platformers are 2D Platformers which are 3D this means only thing we need to check is player colliding with the ground and if so make it doesn't touch the ground for Simplicity our player is treated as a sphar now I'll give you 5 Seconds to tell me how you can check that sphere located on position XY Z with a radius R is colliding with a triangle defined with three vertices time starts now you have no idea right so why you think I V I'm a Game Dev not a mathematician so you think that made me give up yes that made me give up thanks for watching and see you in I found a book and that book has spere Triangle Collision written in C++ and I took the code and converted it to scratch in only one day after spending whole month trying to create it by myself therefore we can induce third love of 3D don't through to reinvent the wheel if you could find the exact thing in some random book from internet now when we have Collision I finally can create [Music] the it took me 13 months to create the final game you are for sure starting to get feeling way Performance Scratch is slow scratch is slow scratch is slow first first and wel come our pyramid guy three the enemies to the enemies levels are practically not hiding that they're made of a bunch triangles lines and Sprites I even had to create a 3D editor just to try to get as much performance as possible and that lead us to the next part game design you can always put a bunch of triangles and lines and call it a game but the real thing what what game needs is a soul a thing which feel separate it from other games there are a lot of 3D Platformers made in scratch I wasn't the first but there are only few with a soul like a Ninja 3D or Dot World so what is so unique and impressive about this game well basically this game is superior to all the scratch 3D Platformers in each aspect player is not a cube levels aren a bunch of cubes and have actual teams grassland ice and jungle levels are much bigger and have a lot of unique features like seesaws ice physics and swing ropes but yes compared to famous 3D Platformers like crash Marion spiral this is indeed's most generic 3D platformer you will ever play but the real value of it is the actual fact it is made in scratch a 2d game engine on the first glance there is nothing astonishing but when you look behind the scenes there are a lot of things going on for example one of the main problem is rendering you see all real 3D rendering systems use method called Zed buffering this means that each pixel on screen have its unique Zed value then each triangle which needs to be rendered have exact pixels on which it is projected for each of those pixels it checks two values the current Z value and the triangle Z value Z value is basically a CA distance so in other words the triangle is closer to the camera than a previous distance of pixel then that Z value gets overwritten Additionally the pixel color also changes value this method would also work on scratch if there was no one simple problem yeah it's literally unplayable you see all those calculations are normally executed on GPU while on scratch you're forced to use CPU for 3D and rendering in order for you to understand this imagine CPU as CEO of the company while GPU is executive team CEO of one company have many skills and serves as a central decision maker and coordinator of task within the system a few moments later the GPU specializes in graphic related tasks and parall processing a little longer than a few minutes later there is a reason exec team exists and there is a reason they put gpus in computers boring excuse me what boring wait why you are here your explanation is lame why it is ah look me I'm smart I use complex terms executive team parallel processing specialized capabilities what do you mean I'm just trying to help you viers understand it and you're terrible in doing that okay then I will let you explain it to them sure so CPU is like the brain guy and GPU is like the people who do the labor for him when GPU is gone it's like the brain guy has to do all his job alone so he struggles you can't use GPU in it's full power on scratch so that's why it's it is slow doing 30 stuff you know what leave my video it f much better right now okay chill I'm leaving so how I solve this problem I optimize rendering for CPU how do add that painters algorithm like the Z buffer whose basic unit is a pixel in painters algorithm basic unit is a triangle or any other 3D object each object is treated as a single 3D point and then using sorting algorithm you get in which order object should be drawn just like the painter knows the order of drawing objects and from manually rendering 100,000 pixels only need to draw few hundred objects so if it so faster why no other game engines uses it because of happy little accidents we don't we don't make mistakes we have happy accidents you see there are many problems with this meth first if two objects are overlapping there is no way to draw the intersection one will be always above the second but at least you can simply solve that problem with just making levels that way two objects never overlap but the main problem is simply that this method never could work fully look at this image there is no way to draw it using Pinter algorithm there is just no correct order all orders are incorrect the same thing happens in the game name there could be never a correct order so what I did I made rendering prioritize this player if it isn't that way often player could be rendered below ground in specific situations and I made bottom part of the flying islands where along to minimize the graphical artifacts I also had to manually place and check what combinations of position W work the best and sometimes even remove triangles which make problems now let's take a look on the game play itself first the player movement unlike other popular Platformers player have zero special abilities you can only move and jump and that's all no effects no well jumps no jum boo no anything just all plain pyramid guy jumping around on top of that walking is very slow the main reason reason of this is that if you make player goes too fast due to lack of performance it is possible to go through solid platform which is well kind of bad so considering all this you will think that this game have nothing interesting to offer but there is one thing and that thing is what gives it the soul speed running speed running didn't I said just before the Moet is literally walking and juming what is so interesting in trying to beat level as fast as possible when your options are so limited but in reality whole game is secretly designed for Speed running don't believe me just watch [Music] this you will think this is a bug but in reality it's indeed a feature each enemy type have possibility to help you pass the level faster but that isn't the only thing boosting circles ropes and even axes all of those could be used for increasing your speed and on top of that I added time TR mode where collecting coins freezes time for the value of the coin this adds additional Dimension to the speed running levels as now you must decide which coins are worth and which are not pitting level within given time gives you a time Crystal which is one of the requirements of unlocking B bosses bosses yes there are three of them first the boss of grassland section D all bosses are very simple especially this one only thing you have to do is to go far from it and Doge the charge each time it hits fence becomes weaker until it disappears completely then finally when the bull charges into empty space it falls into abys and you win overall nothing special but at least still better than this Abomination next is Tech MEC which have a bit more complex move set punching you with a shield or shooting snowballs from each Cannon once a while it sucks all snow from the environment forming a giant snowball and throwing it in air your goal is to lure the robot into the spot where the giant snowball is going to land three hits and you won the last one and most unique one is SLO frog your goal the frog is jumping from one Island to another and trying to hit you with its tongue once a while it will break one Island making the challenge even harder and at the time it doesn't have any places to go it just Falls and you win essentially they're nothing mindblowing and Innovative it's just nice to have them in to give the game some [Music] variety so far I was only speaking about good things from this game but what about bad things it's impossible for a game to be perfect first I said I will make the move set more complex and faster also one of the biggest complaints I got for my 500,000 viewers was the requirements for bosses are just stupid which I agree for example third boss have 300 coins and four time crystals unlocking requirement this means first you will have to play Same levels you previously have played two more times and even having to be much better than previous attempts due to time TRS additionally coin limit is not correctly introduced meaning you could just casually enjoy game because you missed few coins you have to play Same levels again in order to get enough coins resulting you have to play literally each level at least twice in order to beat final level which is for sure stupid why don't I remove limit now I just don't like modifying my older games so I can forever remember my mistakes also one of the common complaint is that enemies are too deep which I can see why just having 3D enemies will make it much better looking reason I even made them 2D is because I was desperate to gain as much performance as possible even at the cost of visuals this was one of the most revolutional projects on scratch ever made it has shown to many the true potential of scratch it is not for nothing one of the most liked scratch game ever in future I plan making SLE to it so be sure you're sub subscribe so you don't miss my future projects next as promised I will cover surprisingly even better game than this let toid TD 3D so stay tuned and thanks for watching also shout out to my brother who made models and animation for the game and Seven original soundtracks
Info
Channel: ggenije
Views: 425,629
Rating: undefined out of 5
Keywords: scratch, 3d, 3d graphics, game engine, game dev, game developement, ggenjie, ggenji, genje, ggenje, genji, crystal seeker, 3d platformer, scratch 3d game
Id: dYbF71Ah0u8
Channel Id: undefined
Length: 21min 23sec (1283 seconds)
Published: Sat Nov 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.