No video

I Remade my Voxel Engine from Scratch...

  Рет қаралды 10,335

MaxMakesGames

MaxMakesGames

Күн бұрын

Пікірлер: 58
@finalforeach
@finalforeach Жыл бұрын
The nice thing about the prototype stage is that you don't need to be scared of tech debt... Rewrites galore!
@ragdude7323
@ragdude7323 8 ай бұрын
Nice seeing you here.
@ragdude7323
@ragdude7323 8 ай бұрын
I got terrible memory, saw this video again, saw this comment again and was about to comment “Nice seeing you here.” Again
@half_invisible
@half_invisible 6 ай бұрын
@@ragdude7323 no way, i literally did the exact same thing for a finalforeach comment on another voxel game dev video :p
@talis1063
@talis1063 9 ай бұрын
OpenGL would've been fine if you understand the limitations. In OpenGL you can mapBuffer on main thread, fill it on a different thread and pass an event to main thread that unmaps it again. The highest performance approach is probably allocating a large buffer, and using something like glMultiDrawElementsIndirect to render stuff. Can basically implement a custom allocator that way, and render opaque chunks with a single draw call. The thing not clear about OpenGL is that you're writing commands to memory not executing them on the GPU directly. Important to know to avoid freezing.
@kpopalitfonzelitaclide2147
@kpopalitfonzelitaclide2147 9 ай бұрын
You could just use vulkan and c++
@Lemonzy
@Lemonzy Жыл бұрын
Very cool! I love Rust and Bevy, it's easy to get started but it can sometimes be difficult.
@orangomango
@orangomango 11 ай бұрын
Really nice videos, I'm making a voxel engine too (just that it's taking me like a few months lol) and I randomly discovered your videos. Great work!
@MaxMakesGames
@MaxMakesGames 11 ай бұрын
Cool, thanks!
@MaxIzrin
@MaxIzrin 8 ай бұрын
"Max is stupid" Extremely relatable. I also remake my whole [insert project here] from scratch on occasion.
@oglothenerd
@oglothenerd Жыл бұрын
Do you use Git for version control? It allows you to rollback if you make mistakes.
@MaxMakesGames
@MaxMakesGames Жыл бұрын
I don't use Git right now but I might. And yes I'm using Bevy !
@oglothenerd
@oglothenerd Жыл бұрын
@@MaxMakesGames OMG! You are shooting yourself in the foot without Git! You MUST use it! Not using Git is one of the painful mistakes early programmers make! Just learn the basics. You can get away with just knowing the add, commit, restore, and maybe some other Git commands.
@oglothenerd
@oglothenerd Жыл бұрын
@@MaxMakesGames Shameless plug: I may make a simple Git guide on my channel later.
@AndrewBrownK
@AndrewBrownK 9 ай бұрын
Thinking about TNT in minecraft, the performance on your engine is looking really promising so far
@ThePC007
@ThePC007 Ай бұрын
What GPU are you running this on? I’m currently trying to render voxels myself and it’d be kinda nice to put the performance you’re getting into perspective. :)
@MaxMakesGames
@MaxMakesGames Ай бұрын
I have an nvidia geforce RTX 3060 :)
@Skeffles
@Skeffles 11 ай бұрын
Brilliant! How do you like working with bevy and rust?
@MaxMakesGames
@MaxMakesGames 11 ай бұрын
I feel like bevy is easier than just raw graphics api, but also harder than common game engines like unity or unreal. You still have to do a lot of low-level work but it helps with spawning things and basic features like PBR, transparency, etc and also has an ECS so that helps for managing a lot of entities ( it will be a big help later if I want to make pieces fall to the ground and stuff I bet ). Rust is actually pretty similar to c++ but it has a lot more safety so I don't get memory leaks and crashes like I did in c++, but it's a bit harder to use imo.
@naterthan5569
@naterthan5569 Жыл бұрын
If you only turned on release mode at 8:00, does that mean that the performance tests in the middle of the video were also in debug mode?
@MaxMakesGames
@MaxMakesGames Жыл бұрын
Yes haha but I think using debug mode only caused lag when I had multiple entities ( aka chunks once I added the loading ). Before I added the loading, the whole thing was 1 entity so it probably didn't affect much.
@the0neskater
@the0neskater 6 ай бұрын
I can assure you opengl and c++ were not your issues haha...
@MaxMakesGames
@MaxMakesGames 6 ай бұрын
You are right actually it wasn't :P
@PotionScape
@PotionScape 8 ай бұрын
In the unity game im making, I somehow got it up to 1 billion voxels rendered, but that is like, totally out of the use cases that i would need
@MaxMakesGames
@MaxMakesGames 8 ай бұрын
How do you even store 1B voxels in memory ? Each one has to be at least 4 bytes so that's a minimum of 4Gb and going through that would take a while even with an octree
@IsaacCode95
@IsaacCode95 Жыл бұрын
So theres no way to achieve the same with c++ and vulkan instead of opengl ?
@MaxMakesGames
@MaxMakesGames Жыл бұрын
I think it's possible for sure, but rust offers a lot of tools for multithreading like rwlock, arc, etc. that makes it easier to manage multithreading without having errors, crashes, etc due to data race. With c++ you would have to use mutex and stuff like that which would end up locking the thread often ( at least that's what happened to me ) and it's just overall more difficult to manage. Rust will prevent you messing up so it's cool for that, but if you're really careful you could probably do the same thing in c++.
@ofrikirshen3071
@ofrikirshen3071 Жыл бұрын
ofc there is but what's even the point of dev if you don't rewrite shit in rust?
@FrankGennari
@FrankGennari Жыл бұрын
@@MaxMakesGames In C++ you can use OpenMP and put a parallel for loop around the iteration over blocks to update. This is how I do it. The large edits that cross multiple blocks are the ones that cause lag and also the ones that distribute well across threads.
@tadeohepperle7514
@tadeohepperle7514 11 ай бұрын
From your experience, would you say that creating inividual triangulated meshes from voxel data first, is much better than sending the voxels to the GPU as simple primitives (quads) using instancing?
@MaxMakesGames
@MaxMakesGames 11 ай бұрын
It's a bit more difficult to implement but not that much and it's a lot better in terms of performance!
@tadeohepperle7514
@tadeohepperle7514 11 ай бұрын
@@MaxMakesGames That is really great to hear! What size are the individual meshes you generate from the voxels? E.g. what kind of voxel volume / triangle count do they cover? One mesh for each loaded chunk?
@MaxMakesGames
@MaxMakesGames 11 ай бұрын
@@tadeohepperle7514 Right now I create 1 mesh per chunk and my chunks are 50x50 but I might reduce the chunk size because it becomes a bit laggy when doing queries for collisions and stuff. At this size the meshes are around 10k vertices I think but it depends on how flat the surface is. Flat means less side faces so less vertices and triangles. I also started generating structures on them so that increases the count a bit because I put them in the same mesh, but I might seperate them to facilitate physics later.
@tadeohepperle7514
@tadeohepperle7514 11 ай бұрын
@@MaxMakesGames Thanks! Btw how are you doing collisions and raycasting for picking a block with the cursor?
@MaxMakesGames
@MaxMakesGames 11 ай бұрын
I'm actually not 100% sure how my raycasting works lol I think I found it online and it's been a while so idk where, but here's the code in rust: pub fn raycast_hit_cube_pos_dist(cubepos: Vec3, raycastPos: Vec3, raycastDir: Vec3, dist: f32) -> Vec3{ let halfsize = 0.05; let dirInv = 1.0 / raycastDir; let tMinVec = (cubepos - halfsize - raycastPos) * dirInv; let tMaxVec = (cubepos + halfsize - raycastPos) * dirInv; let t1 = Vec3::min(tMinVec, tMaxVec); let t2 = Vec3::max(tMinVec, tMaxVec); let tNear = f32::max(f32::max(t1.x, t1.y), t1.z); let tFar = f32::min(f32::min(t2.x, t2.y), t2.z); if (tNear > dist || tNear > tFar || tFar < 0.001) { return Vec3::new(-10000.0,-10000.0,-10000.0); } return raycastPos + tNear * raycastDir; } halfsize is half the size of my cubes/voxels so mine are 0.1x0.1 so 0.05 halfsize. it checks from the raycastPos in the raycastDir if cubepos is hit within dist distance. If not it returns a -10000 vector and if so it returns the pos hit ( you could also just make it return false/true if you dont care about pos hit ). I just run that on every cube in the chunk and if there's no hits, move to the next chunk in the aim direction and check again. That's why I think I'll reduce my chunk size because looping 50x50 cubes for no hit is very bad lol. It can prob be optimized too but I hope that helps.
@agoatchannnel
@agoatchannnel 11 ай бұрын
Why did you say “my videos suck” on discord, there really good
@delphicdescant
@delphicdescant 7 ай бұрын
The Rust hype is greatly overplayed tbh. You could have done just as well, just as easily, with C++. Mostly it's just usually not worth switching languages or API's based on popularity contests, and sticking to something that you're familiar with has a greater advantage imo. But I'm not criticizing you - just hoping you don't get stuck in a loop of "stack switching" like sometimes happens to programmers' hobby projects.
@HAAAAAAAAHHHHHH
@HAAAAAAAAHHHHHH Жыл бұрын
Not really related to the video, but are you from Quebec ? xd
@MaxMakesGames
@MaxMakesGames Жыл бұрын
Yeah 😎
@HAAAAAAAAHHHHHH
@HAAAAAAAAHHHHHH Жыл бұрын
@@MaxMakesGames damn thats cool, i haven't seen any youtuber from there make coding/gamedev videos before
@AIAdev
@AIAdev Жыл бұрын
pigboss x max collab? sus.
@MaxMakesGames
@MaxMakesGames Жыл бұрын
Wait until I add a pig boss to my game before you :)
@sti3167
@sti3167 Жыл бұрын
What AI did you use? 2:53
@MaxMakesGames
@MaxMakesGames Жыл бұрын
The bing AI :) I just open Microsoft Edge and it's there, but idk if you can use it in an other browser. It's cool because it can search online. An other cool option is www.phind.com/ it's similar
@oglothenerd
@oglothenerd Жыл бұрын
Do you have a Discord server?
@MaxMakesGames
@MaxMakesGames Жыл бұрын
No sorry I don't because it takes a lot of time to manage and everything. I prefer to spend my time on my projects and videos
@oglothenerd
@oglothenerd Жыл бұрын
@@MaxMakesGames Could I be the moderator? Or could you at least point people to mine? I want there to be an environment where devs can talk to each other about this channel and stuff, I want to verify that you have the correct Bevy settings in Cargo.toml, etc... Also, Discord has a pretty good (annoyingly good) AutoMod.
@Vilebreken
@Vilebreken 10 ай бұрын
Do you speak french?
@MaxMakesGames
@MaxMakesGames 10 ай бұрын
oui bien sûr :)
@Vilebreken
@Vilebreken 10 ай бұрын
ça fait du bien de pas etre le seule baguette a regarder ce genre de vidéos mdr@@MaxMakesGames
@toao_rainys
@toao_rainys Жыл бұрын
not as impressive since you used an engine 😤anyways, the shadows finally look good though.
@AllExistence
@AllExistence Жыл бұрын
NOT from scratch.
@PeterKilian
@PeterKilian 4 ай бұрын
What the fuck are your expectations? Do you want a single person to somehow create a renderer, physics engine, input and windowing api, and everything like.. LITERALLY from scratch? On top of needing to need deadlines for his content creation? Seriously? He doesn’t need to be Id software to make something without a typical “game engine” and still have it be impressive and entertaining. Where is your game engine from scratch in assembly, that uses no external code? I think rust and vulkan is respectable by a single dev.
@AllExistence
@AllExistence 4 ай бұрын
@@PeterKilian Don't fucking lie then.
@PeterKilian
@PeterKilian 4 ай бұрын
@@AllExistence it isn’t a lie? there isn’t 1 way (your way) to interpret the phrase “from scratch”. When he says without a game engine, then that can still be interpreted as from scratch to an extent without him needing to create his own fucking OS for a youtube video.
@PeterKilian
@PeterKilian 4 ай бұрын
Maybe get him to build the computer from scratch too with a hammer and nails he built from scratch!
I Added RAYTRACING To My Voxel Engine ! ( From SCRATCH )
13:39
MaxMakesGames
Рет қаралды 9 М.
Making a Voxel Engine from SCRATCH (w/ Destruction)
14:31
MaxMakesGames
Рет қаралды 33 М.
SPONGEBOB POWER-UPS IN BRAWL STARS!!!
08:35
Brawl Stars
Рет қаралды 20 МЛН
Bony Just Wants To Take A Shower #animation
00:10
GREEN MAX
Рет қаралды 7 МЛН
Making my Voxel Engine faster
16:38
Tantan
Рет қаралды 45 М.
We Built the Internet in Minecraft
25:18
Branzy
Рет қаралды 2,8 МЛН
ChatGPT makes Voxel Engine with Rust
12:20
Tantan
Рет қаралды 94 М.
I Made Minecraft, but It's 4D
13:48
Mashpoe
Рет қаралды 5 МЛН
I could NEVER finish a game UNTIL THIS...
9:17
DevWhale
Рет қаралды 54 М.
This is NOT Minecraft... ?!
12:14
AntVenom
Рет қаралды 1,9 МЛН
I Added Procedural Generation to My Voxel Engine !
10:20
MaxMakesGames
Рет қаралды 6 М.
YOUR IDEAS Made My Voxel Engine EPIC
9:11
MaxMakesGames
Рет қаралды 3 М.
Making a difficult game about fitting in - Acerola Jam 0
19:17
jess::codes
Рет қаралды 351 М.