Making a Voxel Engine from SCRATCH (w/ Destruction)

  Рет қаралды 33,376

MaxMakesGames

MaxMakesGames

Күн бұрын

Пікірлер: 93
@ndreOnSteroids
@ndreOnSteroids Жыл бұрын
That's some accomplishment... damn! I myself tried to make a voxel terrain demo in Vulkan/C++ a year ago. Let me say this: I did not have the mental stamina to withstand these constant setbacks for the most trivial seeming features. You pointed that out: It's actually quite hard to make anything work this close to the metal. So I definitely can appriciate what you've done there. Also the dry oak tree pun made me laugh, so I decided to comment. Nice work, man!
@MaxMakesGames
@MaxMakesGames Жыл бұрын
Thanks a lot for the comment ! I'm glad you enjoyed :) Yea it was hard but I did it as a side project over a month or so. That gave me time to breathe. Doing it all in one go would have made me go crazy I think haha I worked a bit on procedural generation after making this vid and it was ( and still is ) making me go crazy... Loading and unloading all that stuff without lagging or having any memory leak... oof Give it a shot again one day if you feel like it, it's a very nice project imo :)
@TerribleFire
@TerribleFire 4 ай бұрын
OpenGL expects you to depth sort so it doesnt have to waste time on it.
@logosking2848
@logosking2848 10 күн бұрын
Minecraft is a voxel game. Cube size isn't a requirement for a voxel game. Some renderers try to push voxelization to the extreme, but you could have even bigger cubes than minecraft and still have a voxel game.
@SadTown99
@SadTown99 3 ай бұрын
Geeeeez I had no idea this stuff was so complex… Now when I look at a game like “Shadows Of Doubt” it completely blows my mind 😵‍💫
@SuperLowe1
@SuperLowe1 Жыл бұрын
Dude how are you not more popular, the impressiveness of this aside this was really entertaining, keep it up homie.
@MaxMakesGames
@MaxMakesGames Жыл бұрын
Thanks a lot
@OfficialLordPlanks
@OfficialLordPlanks 7 ай бұрын
Bro this game is awesome keep working on It i love it@@MaxMakesGames
@PickIeJuice
@PickIeJuice Жыл бұрын
Does it have an ak
@MaxMakesGames
@MaxMakesGames Жыл бұрын
No it does not, BUT it could... 😏
@vvgr409
@vvgr409 4 ай бұрын
About your comment on depth (<a href="#" class="seekto" data-time="284">4:44</a>) - OpenGL is not drawing things "in random order" without depth testing. It is drawing in in exactly same order you draw it. And why would you want to draw things without depth testing? Because there are situations when you don't want to depend on depth buffer and sort your geometry manually. One example is transparent surfaces (in case of Minecraft like game blocks like water or glass). Sure in most situations you want to have depth buffering enabled but OpenGL is not game engine and it doesn't provide any default settings. It provides features you need to enable if you want to use them. That includes depth buffering.
@TriviaQuizocity
@TriviaQuizocity 5 ай бұрын
Im currently making a voxel engine in scratch😂... Im in hell
@darylg.4270
@darylg.4270 5 ай бұрын
That is really amazing! Thank you for the hard work and for the video, I hope you are proud!! I am blown away. Today i discovered what "voxel" is I guess. I am impressed!
@SCPokSecondaccound
@SCPokSecondaccound 4 ай бұрын
This may sound like a bad idea but trust me it's not. Try using raytracing for the render engine since it can get faster than rasterizasion if you want bigger renderdistance or smaller voxels, it would also make upgrading the graphics easier by just using more rays per pixel
@MaxMakesGames
@MaxMakesGames 4 ай бұрын
Yes you're right I actually did this recently. Checkout my lastest videos I have 2 about raytracing ;)
@jumbledfox2098
@jumbledfox2098 6 ай бұрын
That was epic! Loved the part when it looked like a drug trip hahaha
@samnelson7428
@samnelson7428 8 ай бұрын
The dirt/grass could just be, "if air above, then grass, if not, then dirt." This is just for generation, I don't know if Minecraft generates dirt in caves, I assume you could create special code for any specific instances you have where you generate dirt under air but with a block higher above it, if that even ever happens in your game
@tonypop1007
@tonypop1007 Жыл бұрын
this was extremely entertaining
@semydev
@semydev 3 ай бұрын
WTF was that backface culling explanation 😂😂😂
@solid_caliber6256
@solid_caliber6256 7 ай бұрын
your content is very impressive, enjoyed watching it ! :D
@AllExistence
@AllExistence Жыл бұрын
"Should i fix my very faulty memory problem before adding complexity to the project so it won't come to bite me in the ass as few things already did?" "Nah, it'll be fine!"
@MaxMakesGames
@MaxMakesGames Жыл бұрын
lmaooo yes that's exactly what I did and you will see in the next part that it DID end up screwing me over and I struggled to fix it... You predicted it haha
@AllExistence
@AllExistence Жыл бұрын
@@MaxMakesGames Haha, totally not relatable...
@naokizimmer4129
@naokizimmer4129 8 ай бұрын
C'est super stylé ce que tu fais continue comme ça
@aa898246
@aa898246 Жыл бұрын
cool video
@revanxanbabayev1621
@revanxanbabayev1621 Жыл бұрын
Thats dope, youre a really good developer especially when you realise that all great games loke minecraft started from sh*tty games but yours, your are far better, keep it up man never give up
@BreadCrumbsquad
@BreadCrumbsquad Жыл бұрын
does it have a baguette
@MaxMakesGames
@MaxMakesGames Жыл бұрын
Not yet, but that's definitely the first thing I'm adding once the engine base is done haha
@knuxuki1013
@knuxuki1013 10 ай бұрын
I'm no programmer (which makes this funnier to me) but I had this idea where things that can't be seen aren't rendered or acknowledged by the system, I come n watch this to discover back face culling and me and my smooth brain is actually surprised wasn't even being original at ALL lol
@MaxMakesGames
@MaxMakesGames 10 ай бұрын
Yeah there's back face culling which makes it so back faces are not rendered and also frustum culling which makes objects ( or in this case chunks ) that are outside of the camera's view not be rendered. Culling improves performance a lot :)
@knuxuki1013
@knuxuki1013 10 ай бұрын
@@MaxMakesGames well, I am glad this tactic exists at least, I had a feeling something like this did lol
@maxbrundev
@maxbrundev 10 ай бұрын
Hey I do not understand how some faces of your cube are not rendered with only glCullFace(GL_BACK); in order to not render some faces that are hide you have to re construct the mesh and disable some faces no ? @@MaxMakesGames
@MaxMakesGames
@MaxMakesGames 10 ай бұрын
@@maxbrundev Yes you have to construct the mesh with only the necessary faces ( squares ) but without culling those faces will be rendered on both sides so under the map too, but with culling they are only rendered on one side ( the clockwise triangles I think ) so you get 1 sided squares which is the better than 2 sided.
@maxbrundev
@maxbrundev 10 ай бұрын
Ohhh you are not using cube but 6 squares and you place your squares like a cube that's right? I am currently using a cube that's why I was having trouble, I cannot use different meshes with instancing and all my face are Counter clockwise already @@MaxMakesGames
@yal1621
@yal1621 5 ай бұрын
yayy
@williamjthebest
@williamjthebest 11 ай бұрын
Nice job ! Vive notre rayonnement culturel X)
@October-TE
@October-TE Ай бұрын
RIP backfaces
@Skeffles
@Skeffles Жыл бұрын
Fantastic start on your voxel engine. Do you know what you're going to add to the engine? A certain game perhaps?
@MaxMakesGames
@MaxMakesGames Жыл бұрын
Thanks ! Yes I'm hoping to make a game once the engine is good enough. Since I'm focusing quite a bit on the world and destruction right now, I'm thinking a simple game where you move around and destroy things at first ( the ground, trees, rocks, etc ) and also maybe use different powers to do so. I also always loved monster collection games like Pokemon so I thought maybe something like that with the monsters made of voxels too but I'd need to work on it for a while for that haha. Let me know if you have ideas :)
@Skeffles
@Skeffles Жыл бұрын
@@MaxMakesGames If the player can make their own monsters that could be pretty unique. I guess animation might be an issue though. 🤔
@MaxMakesGames
@MaxMakesGames Жыл бұрын
@@Skeffles Maybe you could collect voxels while playing and use them to "craft" monster presets with a few customization pieces so it's custom but not fully to allow animations, spells, etc to make sense... Anyway before my engine can handle that I have a long time to think about it haha
@Skeffles
@Skeffles Жыл бұрын
@@MaxMakesGames fantastic idea! Best of luck making the engine.
@bisisnowhere
@bisisnowhere Жыл бұрын
@@MaxMakesGames bro is making minecraft 2
@pedroarthur2246
@pedroarthur2246 Жыл бұрын
It's amazing! Brazil is watching you ❤
@timmygilbert4102
@timmygilbert4102 Ай бұрын
Did you backfaces? 😩
@datcanard4
@datcanard4 Жыл бұрын
Le mec est juste trop fort... Your accent is great though (and coding skills are epic)
@Vilebreken
@Vilebreken 10 ай бұрын
You're a baguette! Trop bien je m'abonne!
@i_like_pengwinz1065
@i_like_pengwinz1065 Жыл бұрын
Thank you for making my ass research fun
@vortexstudios_echo
@vortexstudios_echo 20 күн бұрын
whats that tutorial you used to get started? also have you ever tried vulkan? and i would love to see a PyOpenGL video
@MaxMakesGames
@MaxMakesGames 20 күн бұрын
@@vortexstudios_echo I started using a website called learnopengl it's good ! Also I did try Vulkan in my opinion it's really good but a bit harder to learn
@vortexstudios_echo
@vortexstudios_echo 20 күн бұрын
@@MaxMakesGames allright thanks! ive seen learnopengl i just thought it looked a bit different than learnopengl
@MaxMakesGames
@MaxMakesGames 20 күн бұрын
@@vortexstudios_echo I also used chat GPT to help me understand how some things worked and fix some issues I had. I 100% recommend using it :)
@alikyssss
@alikyssss Жыл бұрын
Make an apocalypsegame. In voxel engine
@MaxMakesGames
@MaxMakesGames Жыл бұрын
Thanks for the suggestion, I actually have something like that in mind. I mean, if I make an engine with a fully destroyable world, I sure am gonna make a game where you can destroy everything haha
@Amigo-oh2vv
@Amigo-oh2vv Жыл бұрын
The hard work u put in is insane Keep it up bro❤❤
@_Braised
@_Braised Жыл бұрын
I just want to know if it's possible to make a proper sequel to Ace of Spades. Y'know- that awesome WW1 voxel shooter- kzfaq.info/get/bejne/l5iGgN1k1565ZHk.html
@MaxMakesGames
@MaxMakesGames Жыл бұрын
That looks pretty fun haha Well yes it's definitely possible to make an FPS using an engine like this, but the multiplayer would be difficult to do. There's also a lot of things I'm missing to make games like a UI system. I still have a lot of work to do before my engine is capable of doing all that... In short: it's possible, but not right now :(
@korigamik
@korigamik 4 ай бұрын
Cool stuff man, can you share the source code for this project?
@MaxMakesGames
@MaxMakesGames 4 ай бұрын
Thanks ! Maybe one day but not yet because it's still very messy and bad. I would have to maintain everything clean and working and have versions and everything that's a lot of work :/
@BitBloxDevs
@BitBloxDevs 3 ай бұрын
Ouup
@solid_caliber6256
@solid_caliber6256 7 ай бұрын
i am trying to make something similar but i cannot find a solution on the voxel culling, i tried some stuff but it resulted in even bigger lagging, how did you achieve it?
@MaxMakesGames
@MaxMakesGames 7 ай бұрын
You mean culling things outside the camera ? I didn't do it at all for a while and at one point I didn't render whole chunks outside the camera view. Trying to cull too much based on the camera view often results in lag as you said so I think it might be better to avoid culling voxels. Instead, you should focus on only adding the necessary faces like I spoke about in this vid. If a voxel only has air above it, you only need to draw a square, not the whole cube. That's not dependant on the camera so it's a 1 time calculation and is much more worth it. And a square is 1/6 the amount of verts of a whole cube so huge improvement. Also like I did you should only render the surface. Voxels under the surface should not be rendered at all. You can do that in the world generation :)
@solid_caliber6256
@solid_caliber6256 7 ай бұрын
@@MaxMakesGames thank you for the reply but im not sure how do i check if there's air on that side, do i make an array of air positions?
@MaxMakesGames
@MaxMakesGames 7 ай бұрын
@@solid_caliber6256 I save air positions on world gen. I place air above the voxel and on the side if the terrain on the side is lower than that voxel. Then I use that air to add faces and destroy and when I destroy I update it
@solid_caliber6256
@solid_caliber6256 7 ай бұрын
@@MaxMakesGames so you save some air positions when making a cube and then every frame you go through all the air positions and check if they're above,next,etc... to the block?
@MaxMakesGames
@MaxMakesGames 7 ай бұрын
@@solid_caliber6256 No when I create my world, let's say I place the voxel at 50,20,50 (x,y,z). I know nothing is above it, so above is air. Then I check all 4 sides around. If the y is lower ( like 51,19,50 ) then I know that in that direction there is air. If it's equal or higher ( like 51,21,50 ), no air. At the moment of this video I didn't actually save air, I just had 6 bools for each cube that saved if each direction had air. Then when rendering I can loop all 6 bools and if they are true ( that direction has air ) I render that side. This way any side facing an other voxel or under the map will be false and not rendered and you only need to set the bools when you create it, not every frame.
@TheGreatProphecy
@TheGreatProphecy Жыл бұрын
I wish you would have showed how to make this instead of super vague shots.
@MaxMakesGames
@MaxMakesGames Жыл бұрын
I'm trying to make videos for everyone to enjoy so I don't want to get too technical but maybe one day I'll make an other video going more into details
@dumdum7099
@dumdum7099 4 ай бұрын
Isn't Minecraft also a voxel engine? Why did you say it wasn't?
@MaxMakesGames
@MaxMakesGames 4 ай бұрын
I didn't say it wasn't lol I said my project is different
@dumdum7099
@dumdum7099 4 ай бұрын
​@@MaxMakesGamesOohhhh I see, my bad then.
@albert_ac1045
@albert_ac1045 3 ай бұрын
i start to count from 0
@nadeekathusharidayananda4094
@nadeekathusharidayananda4094 Жыл бұрын
Wow that's really cool, but now I challenge you to make a fps game in opengl 👿👿👿
@ThefamousMrcroissant
@ThefamousMrcroissant Жыл бұрын
Easier than with Vulkan.
@rexoverwatch
@rexoverwatch Жыл бұрын
yes!111 black and white for the f/s
@patekfrfr
@patekfrfr 28 күн бұрын
erm actually this isnt from scratch 🤓👆
@moonshot3159
@moonshot3159 Жыл бұрын
ayo bro why is it not possible to do this in unreal engine like brooo whyyy
@MaxMakesGames
@MaxMakesGames Жыл бұрын
I think it is possible, but not optimal. Unreal engine was not made for voxel games so you would have to code all the optimizations and features yourself so it would still be as difficult and you would probably end up with a more laggy game because of the engine. There's no point taking an engine, not using its features and doing something completely different in it haha at that point just make your own engine :P
@moonshot3159
@moonshot3159 Жыл бұрын
@@MaxMakesGames but bro they have nanite and stuff wont that make things quicker? (I'm not a programmer)
@MaxMakesGames
@MaxMakesGames Жыл бұрын
@@moonshot3159 Nanite is used to reduce the rendered triangle count of meshes. So it takes a mesh with millions of triangles and reduces it based on distance and stuff. But cubes only have 12 triangles. There's nothing to reduce here. The problem is the amount of them. In unreal, you'd probably have to create an "Actor" for each cube and that would create lag because unreal will do some logic for each one of them ( such as checking the distance to them, if they have tick enabled, etc ) that my engine won't do. Basically, by making my own engine I can remove all the things that UE does that I don't want & that would slow things down and since it is pretty different from normal games, that means pretty much everything.
@michak7163
@michak7163 10 ай бұрын
There is literally a bunch of tutorials on how to make a voxel game in Unity and Unreal... Why do you say it is impossible??
@MaxMakesGames
@MaxMakesGames 10 ай бұрын
I never said that ? I made my own for fun and for the challenge. It is also more optimized to make your own from scratch. That's what I said.
@simongido565
@simongido565 Жыл бұрын
Every time I have to write it one kitten dies. THIS IS NOT A VOXEL ENGINE.
@CheeseIndex
@CheeseIndex 10 ай бұрын
yeah the moment i saw the triangles i stopped the video and went to the comments.... now to look for another video
@Erkle64
@Erkle64 8 ай бұрын
It is a voxel engine. It's not a raymarched voxel engine, but it is a voxel engine.
@simongido565
@simongido565 8 ай бұрын
@@Erkle64 This is a polygon engine... Does not matter that you shape polygons like cubes.
@Erkle64
@Erkle64 8 ай бұрын
So you're saying there's no such thing as a voxel engine? @@simongido565
@rtsrt165
@rtsrt165 Жыл бұрын
WTF, i thought i was watching ultra popular programmer, but after i seen that there’s only 270~ views…
What are Voxels and why are they so cool?
8:08
No Cap Gaming
Рет қаралды 848 М.
Unveiling my winning secret to defeating Maxim!😎| Free Fire Official
00:14
Garena Free Fire Global
Рет қаралды 9 МЛН
طردت النملة من المنزل😡 ماذا فعل؟🥲
00:25
Cool Tool SHORTS Arabic
Рет қаралды 21 МЛН
They made a game about philosophy...
23:19
Real Civil Engineer
Рет қаралды 470 М.
I remade my voxel game 3 times, this is why
12:11
Tantan
Рет қаралды 121 М.
I Added Procedural Generation to My Voxel Engine !
10:20
MaxMakesGames
Рет қаралды 6 М.
4 Months of Game Programming With My Own Engine
21:30
jdh
Рет қаралды 450 М.
Making a difficult game about fitting in - Acerola Jam 0
19:17
jess::codes
Рет қаралды 350 М.
I made my own Web
15:43
FaceDev
Рет қаралды 510 М.
Making Minecraft from scratch in 48 hours (NO GAME ENGINE)
16:38
I Remade my Voxel Engine from Scratch...
10:32
MaxMakesGames
Рет қаралды 10 М.
This is NOT Minecraft... ?!
12:14
AntVenom
Рет қаралды 1,9 МЛН
I Made A Difficult Game About Climbing
15:04
Pontypants
Рет қаралды 2,1 МЛН