Making my Voxel Engine faster

  Рет қаралды 45,669

Tantan

Tantan

Күн бұрын

I'm making a voxel engine with RUST! (the programming language...)
I originally was making my voxel game with Unity, but my love for the Rust programming language caused me to see if it's viable to swap over to that.
This episode is all about optimizing the code for the world generation.
Multithreading, benchmarking, profiling and data compression, are all things I've tackled with lately.
My discord group:
/ discord
Want to support me?
Patreon: / tantandev
XMR:
43Ktj1Bd4Nkaj4fdx6nPvBZkJewcPjxPB9nafnepM7SdGtcU6rhpxyLiV9w3k92rE1UqHTr4BNqe2ScsK1eEENvZDC3W1ur
timestamps:
0:00 hi
0:43 Tantans mixtape: gotta go fast
0:55 video layout
1:33 world generation
2:58 what we need to optimize
4:04 queue
4:37 multithreading
7:27 benchmarking & profiling
9:39 Generation settings for my pc
9:58 problems
10:26 Unity VS Rust
11:09 pain
11:22 the winner is
12:11 data compression
Resources:
The tech I'm using!
Graphics rendering api: wgpu.rs/
multithreading: github.com/rayon-rs/rayon
benchmarking: github.com/bheisler/criterion.rs
profiling: crates.io/crates/profiling, using Optick feature
The tutorial I followed to learn wgpu:
sotrh.github.io/learn-wgpu/
Relevant resources that may help when learning how to make a voxel engine:
sites.google.com/site/letsmak...
Voxel Game Mesh Optimizations by @Hopson
• Voxel Game Mesh Optimi...
I Made Minecraft in 24 Hours by @Sam Hogan
• I Made Minecraft in 24...
Making Minecraft from scratch in 48 hours (NO GAME ENGINE) by @jdh
• Making Minecraft from ...

Пікірлер: 171
@Tantandev
@Tantandev 3 жыл бұрын
I can't thank you guys enough for the support! my discord group: discord.gg/9P8QSYf
@Zetraxes
@Zetraxes 3 жыл бұрын
Maplestory brought the familiar system back time to go back on your Perma beginner account plzz :(
@stevenchristy6156
@stevenchristy6156 2 жыл бұрын
Practical optimization is two parts memory allocation strategy, one part algorithmic complexity with maybe a little knowledge of CPU caching thrown in. Ideally you minimize the number of memory allocations and adopt algorithmic approaches that bring you as close as possible to O(1). Got a loop that does 1 million allocations, first start by doing one allocation of a million instances and your program will gain performance increase in orders of magnitude. On the low end once you've addressed allocation strategy and algorithmic complexity you can eek a little bit out by removing or simplifying calculations, or finding opportunities to precalculate, etc. Throwing more threads at your code is not optimization. Keep in mind that a modern CPU-core executes billions of instructions per second, and the reason your code runs so slowly is because the CPU is effectively idle waiting for other tasks. Throw more threads at the problem without fixing the underlying cause is not optimization and will only compound the problem. Fix the underlying problem first, then once you have a sleek fast implementation, make it parallel and you'll unlock the true potential of the hardware.
@krtirtho
@krtirtho 3 жыл бұрын
I feel bad, your devlogs being so underrated
@Tantandev
@Tantandev 3 жыл бұрын
slow and steady wins the race :)
@TylerGreen
@TylerGreen 3 жыл бұрын
Your devlogs have to be one of the most underrated on this platform. Awesome job and love the song!
@Tantandev
@Tantandev 3 жыл бұрын
Dude thanks a lot!
@barj
@barj 3 жыл бұрын
Tantan really dipped for a month a wrote his own engine lmao
@Tantandev
@Tantandev 3 жыл бұрын
Now, let me get back to my cave... lmao
@JeremyChone
@JeremyChone 3 жыл бұрын
Your videos are as addicting as coding Rust. Thanks for those super high quality content and format.
@Tantandev
@Tantandev 3 жыл бұрын
Thank you dude!
@Affax
@Affax 3 жыл бұрын
Rust is love, rust is life
@openroomxyz
@openroomxyz 3 жыл бұрын
You use Rust?
@Ian-sm9uv
@Ian-sm9uv 3 жыл бұрын
I use Rust. Poorly, mind you, but I do use it.
@Affax
@Affax 3 жыл бұрын
@@openroomxyz I do
@Tantandev
@Tantandev 3 жыл бұрын
yes baby!
@DrIngo1980
@DrIngo1980 2 жыл бұрын
Using any kind of println!(...) or similar console output for debugging will always slow down your program. Also, did you test your Rust code in a --release build or a debug build (default when you run cargo build/run) against whatever Unity is doing by default 🙂? You didn't mention, so I thought to ask.
@SmoothieBuns
@SmoothieBuns 3 жыл бұрын
Our favorite rapping/didgeridoo playing Swedish coder is BACK.
@Tantandev
@Tantandev 3 жыл бұрын
haha that has to be the funniest description I've ever heard!
@isaacwolf2806
@isaacwolf2806 2 жыл бұрын
Just found your videos recently and I love how you show your code with the highlighting, different angles, and smooth transitions! Appreciate the work you put into making these high quality devlogs!
@Tantandev
@Tantandev 2 жыл бұрын
I appreciate it!
@risingfoxgames
@risingfoxgames 3 жыл бұрын
This stuff is so interesting, I love your video style. Didn't even realize the video was 16 minutes long.
@Tantandev
@Tantandev 3 жыл бұрын
Ah good to hear, thanks!
@Zac8668
@Zac8668 3 жыл бұрын
nice video! i rly liked that you talked about bitwise operations, it's such an interesting topic, this video is amazing as always, can't wait for the next one
@Tantandev
@Tantandev 3 жыл бұрын
Thanks! It was super interessting learning about bitwise operations, zeroes and ones everywhere :)
@grillad5
@grillad5 3 жыл бұрын
Great video! Really like the indepth dive into stuff and even I not a programmer understood :)
@AlexandruEne0x0
@AlexandruEne0x0 3 жыл бұрын
These are a joy to watch. I want that profile & optimize song on spotify :D
@MarcusIlgner
@MarcusIlgner 2 жыл бұрын
Impressive that you manage to not only do all that work on the game and engine but also create this high-quality video content! Keep up the good work! For a one-person-army these are some really impressive results!
@willlacey7621
@willlacey7621 2 жыл бұрын
Just stumbled on your channel! ABSOLUTELY LOVE YOUR CONTENT. Great work 😊
@Tantandev
@Tantandev 2 жыл бұрын
Thank you means a lot!
@oglothenerd
@oglothenerd 11 ай бұрын
Now that I am making a voxel engine of my own, these videos are so helpful! Thank you!
@zolaire
@zolaire 3 жыл бұрын
Watching your videos gives me energy, thank you.
@Tantandev
@Tantandev 3 жыл бұрын
these comments gives me energy, thank you!
@hylt0n
@hylt0n 3 жыл бұрын
dope, gl with improving the speed!
@Tantandev
@Tantandev 3 жыл бұрын
Thanks! Got lots to learn still
@rccservice
@rccservice 3 жыл бұрын
man, these videos motivate me so much. bless you, keep this up!
@Tantandev
@Tantandev 3 жыл бұрын
Thank you for the fuel! These comments motivate me
@simonthalen5674
@simonthalen5674 3 жыл бұрын
well produced, informative and funny!
@leftyhero147
@leftyhero147 2 жыл бұрын
keep up with the videos man, you're a inspiration to keep up with rust.
@serd_
@serd_ 3 жыл бұрын
I started learning rust thanks to you, mr tantan! I am loving it!
@Skeffles
@Skeffles 3 жыл бұрын
Looks like you jumped into the optimisations hole and have been having a good time! It's excellent to hear how you've been making this faster and in your own entertaining way. 😂
@XxDarnDragonxX
@XxDarnDragonxX 2 жыл бұрын
Woah, what an on spot recommendatjon youtube! I was always curious to see how would a custom engine work Don't think it was a waste of time!, you got alot of experience and since youtube recommended me this video it means this video is doing great, keep up
@XxDarnDragonxX
@XxDarnDragonxX 2 жыл бұрын
2x slower than the most famous engine on the market is awesome, you're a genius, looking forward to subscribing (sorry, i'm REALLY picky)
@kjpg7413
@kjpg7413 3 жыл бұрын
Great work! Really sells the difference between the two engine approaches. One pain point is that Perlin is a very visibly square-biased function for noise. There's a sort of vicious cycle in the PCG community where it's taught far more often than the alternatives which address its issues, and far too often not in the context of techniques which mitigate its issues. As resource creators we should strive to teach the best possible information, and this is an area that really needs it. Best of luck with your channel!
@MichaelPohoreski
@MichaelPohoreski 2 жыл бұрын
Indeed. Perlin noise should be banished forever. Hopefully more devs will start using Simplex noise.
@TheComfy
@TheComfy 3 жыл бұрын
Oh wow I just cant get enough of tantan!
@MarkWilds87
@MarkWilds87 3 жыл бұрын
this is pure tantantainment!!
@Tantandev
@Tantandev 3 жыл бұрын
As for now here are all of the libraries I'm using: image = "0.23" winit = "0.24" cgmath = "0.18" env_logger = "0.7" log = "0.4" futures = "0.3" bytemuck = {version = "1.4", features = ["derive"]} anyhow = "1.0" tobj = "3.0.0" rand = "0.8.3" lazy_static = "1.4.0" noise = "0.7.0" bracket-noise = "0.8.2" profiling = { version = "1.0", features = ["profile-with-optick"]} lagoon = { version = "0.1.2", features = ["recv", "scope"]} hashbrown = "0.11.2" # fast hashmap num_cpus = { version = "^1", optional = false } wgpu = "0.8.1" # pooling library lifeguard = "0.6.1" generational-arena = "0.2.8"
@scotthooper6460
@scotthooper6460 2 жыл бұрын
I wrote something similar in Java and later C++ years ago, but went farther, with ambient occlusion, textures, some variability on lighting, proper shadows. I then started to convert it to Vulkan and lost progress as life got in the way. Compression of those vertices is critical, but I recommend you skip the unnecessary bit fiddling and just use bytes for relative x,y,z, and another byte for your "face" (normal). Another key is to reduce geometry by making things like texture and brightness (from MC-style falling light, or ambient occlusion) dynamic so that you can ALWAYS mesh large flat areas into simpler shapes (with simpler geometry than it would be if you used one square per cube). I found moving brightness to textures and using a binning system was optimal. Good luck! I had a TON of fun working on my system! Oh, and be sure to use ambient occlusion, render front-to-back, and if you can, render down the primary, secondary and finally terteriary axis. That was my last improvement, and it made a huge difference in eliminating invisible geometry.
@mariobroselli3642
@mariobroselli3642 3 ай бұрын
He did Rust because it was too slow
@GrizzliusMaximus
@GrizzliusMaximus 3 жыл бұрын
the minecraft chunk size is going to get bigger soon. Really makes me wonder how they were able to handle such without lagging. I really wish GMS2 (the game engine I use) can handle multithreading without having to add external code. Maybe I should move to Rust? If ever I do, you know who to blame :) Great video as always!
@nivalius
@nivalius 6 ай бұрын
dude... that mixtape... do you have more of it? 🙏 i can't get enough
@uptightowl3801
@uptightowl3801 3 жыл бұрын
Having optimized code just feels so SATISFYING 😩
@dracula5752
@dracula5752 3 жыл бұрын
I would love too see maybe some rust tutorials
@Tantandev
@Tantandev 3 жыл бұрын
I personally wanna see more rust tutorials also! I don't think I could at the moment handle doing that and keeping up with making devlogs unfortunately.
@joysticktabby4520
@joysticktabby4520 3 жыл бұрын
Hell yeah he's back
@Tantandev
@Tantandev 3 жыл бұрын
I'm back baby!
@matteo.r4773
@matteo.r4773 3 жыл бұрын
Wow, nice!
@Tantandev
@Tantandev 3 жыл бұрын
veru nice!
@Khud0
@Khud0 3 жыл бұрын
Here I am, googling how Minecraft chunk generation and world saving (anvil file format) work in the morning, and in the evening Tantan releases the most comprehensible take on it ever. :D
@Tantandev
@Tantandev 3 жыл бұрын
haha perfect timing!
@mikah8998
@mikah8998 3 жыл бұрын
Yay ur back!
@Tantandev
@Tantandev 3 жыл бұрын
I am alive and well :P took an uncommon time to edit the video
@timmie2k3
@timmie2k3 3 жыл бұрын
You should run the multithreaded stuff as tasks so they can run across frames rather than running them in parallel in-place like that. Then your per-frame cost is just the cost of kicking off the tasks and just check for task completion to finish things up. A parallel-for for stuff like chunk loading or mesh creation isn't ideal. Maybe even have task dependencies for tasks so you could kick off a chunk load task and then a mesh creation task with a dependency on the chunk load task.
@Soulzjd2
@Soulzjd2 3 жыл бұрын
First off gratz on the knowledge gain and engine :D. Secondly I have been wondering and unable to find an answer to if the order of the triangles of a mesh matter in terms of speed? Like imagine a flat mesh terrain/grid, and removing a quad/two triangles and adding in say a tree that fits the hole left behind. Would adding the triangles to the end of the array effect speed in some way? Or imagine the order of all the triangles was random. I know the vertex order determines the face/normal but what about the triangle order? Back info on why I am wonder is simply put I am thinking about creating a map using tiles but combining or adding the meshes together and so the order of the times might not line up cleanly. Even if optimizing triangle order helps the gpu I don't want to spend time fixing my mesh if the gpu already optimizes incoming meshes since im sure its likly faster lol
@Cal97g
@Cal97g Жыл бұрын
Further compression could be achieved by storing colors as references so you don't need to replicate the rgb val for every item.
@josephvargas7806
@josephvargas7806 2 жыл бұрын
New to graphics dev to. Not familiar with wgpu-rs. Tinkered with gl and ash crate with rust. Maybe a solution could be adding more render data in a single draw call using batch data calls as much as possible? My understanding is that each cpu call to gpu has performance hit on the cpu side, so focusing cpu multitasking solely on gathering data for a single batch gpu call might do the trick. Still learning. Not sure how multitasking works on the gpu side yet. Also not sure if you have backface culling enabled. Significantly reduces the amount of drawing the gpu has to process. Interested in how well this works for ya!
@josephvargas7806
@josephvargas7806 2 жыл бұрын
Nevermind, just saw your following video.
@Ian-sm9uv
@Ian-sm9uv 3 жыл бұрын
To add some additional compression, you could find repeated blocks and have a repeat type block that indicates the previous block is repeated N times before the next block is placed. this would drastically reduce the size of your chunks depending on how random the block distribution is. for chunks with lots of contiguous blocks you could save a ton of space. even if the distribution is highly variable, it can only have smaller or equal storage size than storing every block.
@reasonnotfound
@reasonnotfound 3 жыл бұрын
For runtime he could probably omit the position. Currently he uses 6 bits for each axis, if he stored all the blocks in a chunk and retrieved position using indexing, he would have to store even empty space, but each block would have 18 bits less (good for cache). Chunks that are all empty could be ommited. Not sure why the normal thing, I would just check if there are neighbors directly. Maybe it's some smart trick I am not understanding, well... Color can be palettized into just few bits, who needs all the 16 million of it anyway. For storage on disk standard compression algorithms should do the trick.
@Tantandev
@Tantandev 3 жыл бұрын
wow that is a really good tip! Man everyone is giving me so many good tips, so much to do ;P
@RobLang
@RobLang 3 жыл бұрын
Great vid, Tantan! You probably know this but writing out to the console will eat your frame rate. Switch off any debugging output when you frame test. But you probably knew that. Take care, sir!
@Tantandev
@Tantandev 3 жыл бұрын
Good point, I needed a way to track how many chunks where loaded whilst comparing to the Unity version. I guess I could've printed out the moment it reached 2k chunks and compare to the Unity version now that I think about it haha. Not the most scientific way to compare :)
@RobLang
@RobLang 3 жыл бұрын
@@Tantandev yeah. In unity you can use .net's stopwatch. I'm sure there's something similar in Rust. Your videos make me want to pick up Rust so badly! It's a wonderful language. I just don't have the time!
@HackerMan1010
@HackerMan1010 3 жыл бұрын
Epic
@atalocke
@atalocke 2 жыл бұрын
As polyglot dev, I feel like there's more "it magically does this" in Rust than any other language I work with.
@sleepynuigurumiamalgamation
@sleepynuigurumiamalgamation 3 жыл бұрын
Neat.
@Tantandev
@Tantandev 3 жыл бұрын
@falxie_
@falxie_ 3 жыл бұрын
Rayon is such a sick library
@Tantandev
@Tantandev 3 жыл бұрын
it's so cool!
@JZSNooB
@JZSNooB 3 жыл бұрын
epic
@Xeros08
@Xeros08 3 жыл бұрын
Nice.
@driesceuppens7623
@driesceuppens7623 2 жыл бұрын
You might be able to compress the colour data by having presets much like the normal options. Then you just need to save an id for the preset and not the rgb value
@morvid1968
@morvid1968 3 жыл бұрын
Found my favourite youtuber. Can you give tutorial on rust and games?
@Tantandev
@Tantandev 3 жыл бұрын
Aye, thanks :) I have some Rust learning resources linked in my discord group, here are some relevant: [Articles/books] Everyone should probably read this: doc.rust-lang.org/book/ Many examples to learn from: doc.rust-lang.org/stable/rust-by-example/ Full ascii rougelike game tutorial: tomassedovic.github.io/roguelike-tutorial/ [KZfaq channels] YouCodeThings: Fun but also informative: kzfaq.infovideos Doug Milford, has some good short tutorials on getting started with Rust: kzfaq.info/get/bejne/aLGEepaAtra0emg.html
@morvid1968
@morvid1968 3 жыл бұрын
@@Tantandev alright man thanks 😀. Youre rlly underrated
@ConfusedAnt
@ConfusedAnt 3 жыл бұрын
yay! not dead
@Tantandev
@Tantandev 3 жыл бұрын
Hurrah!
@innovativename5268
@innovativename5268 3 жыл бұрын
for Unity, you could try unity dots or the jobs system with burst
@bjzaba
@bjzaba 3 жыл бұрын
Nice video! Is it possible to use mesh instancing on the GPU? Ie. upload the mesh for a single cube, then upload the (position, colour, ...) for in all the voxels you want in a buffer to the GPU, and let it do its thing in parallel? Not sure if that would be faster - it might decrease all the CPU work you need to do for generating the meshes though? I think this is what WebRender does for rendering web pages: you just have a single box that is instanced all around and modified using shaders.
@DerekBenson24
@DerekBenson24 3 жыл бұрын
This is the approach I took to rendering something similar in unity and it worked like a charm
@Tantandev
@Tantandev 3 жыл бұрын
I didn't even think of doing that, it sounds on theory that this method would be faster in some aspects. But I'm exploring a lot of things that are new to me, multithreading for example. So some things I'll naturally learn over time what works best. One thing I'm speculating on is, when I get physics into the engine, maybe I actually need mesh data, not sure but that is one reason I'll stick with this method for now, many unknowns.
@DerekBenson24
@DerekBenson24 3 жыл бұрын
@@Tantandev if you haven't already I'd check out Bevy. If you really want to write your own engine that's cool, but you're also in a unique position to do some interesting publicity/possible contributions to the community as well
@nonnymoose7005
@nonnymoose7005 Жыл бұрын
Not sure if you're already doing this or not, but you should only generate meshes for voxels that can be seen. You might even be able to precompute this data at generation / modification time.
@PlexusDuMenton
@PlexusDuMenton 3 жыл бұрын
You may want to use Simplex noise (Open Simplex noise since Simplex noise is patented until jan 2022) it have better performance for noise (especialy at higger dimension) and have less artifact than perlin noise
@VivekYadav-ds8oz
@VivekYadav-ds8oz 3 жыл бұрын
2x faster seems bad, but you have to realise that there are expert mathematicians and programmers dedicated for optimising such a popular game engine with perhaps even inline assembly at some places! I expected you to be around 5-6x slower, so this is impressive, especially considering that Rust compiler isn't very smart right now and leaves some optimisation opportunities at the table..
@modernkennnern
@modernkennnern 2 жыл бұрын
I expected the same. Only half the speed is very impressive. Granted, it seems like the Unity version also does more (Looks like smarter generation), but for a first time? Very impressive
@ishdx9374
@ishdx9374 3 жыл бұрын
awesome
@Tantandev
@Tantandev 3 жыл бұрын
u awesome
@ishdx9374
@ishdx9374 3 жыл бұрын
@@Tantandev
@rexoverwatch
@rexoverwatch 11 ай бұрын
cool
@user-cx9ti9hv4f
@user-cx9ti9hv4f Жыл бұрын
hi, man. Can you consider how to store the huge scene voxel datas? not use noise to generate height.
@oracuda
@oracuda 3 жыл бұрын
this might be a stupid quesiton but, have you tried just.. particle instancing all of the voxels on the gpu?
@AntonioNoack
@AntonioNoack 2 жыл бұрын
@15:24 you can make the code easier to read by writing (pos >> 18) & 63 instead of (pos & 16515072) >> 18 and also storing colors as floats? do you really have a 10 bit display where that would be of any use? use 8 bits per channel, at max
@ih8skylines713
@ih8skylines713 3 жыл бұрын
Every time he says voxel I hear Vauxhall.
@Tantandev
@Tantandev 3 жыл бұрын
now I can't stop hearing it man lol
@snk-js
@snk-js 2 жыл бұрын
you became my favorit person ever in earth
@notsoren665
@notsoren665 2 жыл бұрын
Can we get the full version of the song?? It's littt 🔥🔥🔥
@ZooHair
@ZooHair 3 жыл бұрын
Eyoo it's been a long time
@Tantandev
@Tantandev 3 жыл бұрын
Indeed!
@zyansheep
@zyansheep 3 жыл бұрын
Hello Tantan who is back
@Tantandev
@Tantandev 3 жыл бұрын
yaay!
@angeldude101
@angeldude101 2 жыл бұрын
This was probably an obvious step, but I just want to quickly ask if you compiled with "--release". Rust doesn't turn on optimizations by default and the layers of abstraction that it uses can slow down the code pretty significantly if not told to get inlined.
@Tantandev
@Tantandev 2 жыл бұрын
yes I did use --release :D
@angeldude101
@angeldude101 2 жыл бұрын
@@Tantandev 👍 I saw in the next episode that you were compiling in release mode. Just making sure since it can be an easy mistake to make when trying to speed things up.
@xicad1533
@xicad1533 2 жыл бұрын
You should use domain rotated noise, its weird and has a directional bias without
@blugatroff593
@blugatroff593 3 жыл бұрын
senpai noticed me :D
@Tantandev
@Tantandev 3 жыл бұрын
:D I don't think I would've looked into data compression if it wasn't for your comment!
@tristunalekzander5608
@tristunalekzander5608 3 жыл бұрын
I've gone done this road, multithreading, using a compute shader for the noise in Unity to get decent speed and the lowest level of graphics API available, literally setting the vertex attributes and whatnot. It was still about half the speed of Minecraft, which was disappointing. I explored using Vulkan and C++ (I'm good with C++) but I got bored and lost hope after getting stuck on how to do compute shaders with documentation that either assumes you are doing the most minimal project ever or assumes you are a rocket scientist. I'm just gonna wait until technology advances haha
@nyxkrage
@nyxkrage 3 жыл бұрын
You can represent numbers like 0b11_1111u32 instead of 63u32 in Rust which might make it a *bit* more readable
@Ian-sm9uv
@Ian-sm9uv 3 жыл бұрын
I think using an enum to represent the various sections of the float and the normal directions would help make things readable as well.
@Tantandev
@Tantandev 3 жыл бұрын
@@Ian-sm9uv oooh good idea!
@Tantandev
@Tantandev 3 жыл бұрын
Man, finding tricks like this in Rust is so neat, I'm learning a lot just by the nature of the language and also you commenting ;P
@renatocesar9972
@renatocesar9972 2 жыл бұрын
whitch program do you use to edit your videos? Davince?
@Tantandev
@Tantandev 2 жыл бұрын
it's called Sony Vegas pro 14, it costs money but I managed to pick it up from a cheap humble bundle some year ago
@theblckbird
@theblckbird 6 ай бұрын
Minecraft also has 16x16x16 chunks, they are just not inifinte on the Y-axis
@drinkwatrr9883
@drinkwatrr9883 2 жыл бұрын
What ide do you use for rust?
@Tantandev
@Tantandev 2 жыл бұрын
Visual studio code I also use vim plugin and rust analyzer
@millfreedom
@millfreedom Жыл бұрын
MPSC - lol 😂 There is nothing, except synchronization via mutex yet discovered for multithreaded processing. The only question is: how often locks are acquired. This might be optimized via “optimistic locking”, but in case of rendering it might be a waste of time, since concurrently will be almost in 100% of cases and you’ll be forced to acquire a lock after additional checks anyway.
@arsenbabaev1022
@arsenbabaev1022 3 жыл бұрын
Shank data )
@minitbnn
@minitbnn 3 жыл бұрын
7:36 There's no link to the Discord in the description :'(
@Tantandev
@Tantandev 3 жыл бұрын
Woops forgot to link it, here it is: discord.gg/9P8QSYf
@AnthonyBachour
@AnthonyBachour 2 жыл бұрын
are you generating every side even if they're not visible?
@Tantandev
@Tantandev 2 жыл бұрын
I do not, my meshing algorithm checks for each face we are about to generate if an adjacent voxel is solid. If it's solid, don't generate the face, otherwise do. Here's the code that does this: From line 72, process_voxel function. github.com/TanTanDev/first_voxel_engine/blob/main/src/voxel_tools/mesh_builder.rs
@paarkgrounds
@paarkgrounds 3 жыл бұрын
Hi tan, great video. Have you tried compiling your rust projects to wasm? i wonder how they perform on web, if it's as hype as everyone talks about
@2D_Sphere
@2D_Sphere 2 жыл бұрын
Still cool thoo
@AntonioNoack
@AntonioNoack 2 жыл бұрын
@4:18 my first though was: WTF, why is the block data stored in a hashmap? You loose all data locality advantages by using that.
@openroomxyz
@openroomxyz 3 жыл бұрын
Does it make to start learning Rust in 2021 ? I am thinking to give it a try. Can i use the code I write in Rust inside Unity game engine? Can you use Rust on web ( wasm? ).
@Tr3Calls
@Tr3Calls 3 жыл бұрын
You can use rust on the web but not on the unity game engine, you can use it in Godot tho
@Tantandev
@Tantandev 3 жыл бұрын
You technically can use Rust in Unity, but no one would probably recommend that, because you need to write so many bindings :P WASM support for rust is growing a lot, I really like the game framework Macroquad, runs surprisingly well on the web. Doesn't hurt to try it if you have some time, it just has a bumpy initial learning curve but after that it gets progressivly easier
@MichaelPohoreski
@MichaelPohoreski 2 жыл бұрын
@2:04 Please _don't_ use perlin noise. It is has many problems compared to the significantly faster and better simplex noise which is why Ken Perlin developed the replacement to his older perlin noise.
@HeinzAnimation
@HeinzAnimation 3 жыл бұрын
I can't even code 1 Single Game lol btw, do you know the guy "John Lin" which makes a incredible Voxel Game Engine, which is prob better than any Voxel Game Engine out there. The Better GPU's get, the better Voxels games can get, lets see how they will look like in 10 Years xD 9:54: Okay, i have a beffy Computer compared to yours (GTX 1080, AMD Ryzen 7 3700x 8-Core 3,60GHZ) My Computer isn't beffy compared to the 3000 Series Users tho lmao
@dorktales254
@dorktales254 3 жыл бұрын
I can't seem to find your discord
@Tantandev
@Tantandev 3 жыл бұрын
woops, forgot to link it, it's here: discord.gg/9P8QSYf
@NoiecityHacking
@NoiecityHacking 3 жыл бұрын
Here, wanting to see if switching from Unity to Rust just for performance, I really like C #, but come on, Rust is beautiful. For now I think I'll stick with Unity
@Tantandev
@Tantandev 3 жыл бұрын
Using Rust definetly requires a lot more work. I wanna use it though, because I'm learning so much!
@MarkWilds87
@MarkWilds87 3 жыл бұрын
Need new video every day :(
@benni5541
@benni5541 Жыл бұрын
I dont think there is ever a reason to sleep in any game/render loop. Try to remove sleeps and do anything else :D
@JoeEnderman
@JoeEnderman Жыл бұрын
What if the real treasure was the game engines we make along the way?
@chrisskyr623
@chrisskyr623 Жыл бұрын
Whattt my pc has an rtx 3050 and ryzen 5 5600x
@Tantandev
@Tantandev Жыл бұрын
stronk!
@3sc4p1sm
@3sc4p1sm 2 жыл бұрын
You should start thinking more about how many assembly instructions are executing per line of your code and figure out how to reduce that as small as possible, sometimes is storage size, sometimes it is how you store, sometimes its the logic implemented, sometimes ita how the logic is implemented, naive implementations are always the very exact specific mentally conceptual implementation and they are always slow
@eboatwright_
@eboatwright_ 3 жыл бұрын
how are you going to do networking now? XD
@Tantandev
@Tantandev 3 жыл бұрын
I'm not to worried about it, many libraries are available, and data serialization looks to be really awesome with Rust
@eboatwright_
@eboatwright_ 3 жыл бұрын
@@Tantandev Oh! :D I'm looking forward to that episode! :D
@vacantknight
@vacantknight 2 жыл бұрын
music videos please
@johnwilliams7999
@johnwilliams7999 3 жыл бұрын
The normal looks like the coronavirus
@Tantandev
@Tantandev 3 жыл бұрын
haha woops, I was going to use arrows, but the Unity version I made the representation with doesn't have a cone 3d model :P
@stcpimus
@stcpimus 2 жыл бұрын
Hola hablas español..?
@overloader7900
@overloader7900 2 жыл бұрын
You don't need to store normals: in fragment shader, use derivatives to calculate it from positions
@Jkauppa
@Jkauppa 2 жыл бұрын
compute shaders on gpu
@Jkauppa
@Jkauppa 2 жыл бұрын
one representation of the voxel, all point to the same model
@Jkauppa
@Jkauppa 2 жыл бұрын
you then have only on-off data for each voxel
@sectorrrrr
@sectorrrrr 3 жыл бұрын
everyone has been saying a lot of good things about rust, maybe i should try it?
@minegeymer
@minegeymer 3 жыл бұрын
Cool and, uh... you tried.
@Tantandev
@Tantandev 3 жыл бұрын
haha, gradually success shall be recieved!
@minegeymer
@minegeymer 3 жыл бұрын
@@Tantandev I don't doubt it!
I remade my voxel game 3 times, this is why
12:11
Tantan
Рет қаралды 120 М.
Voxel Game development - Creatures and Spells
12:01
Tantan
Рет қаралды 36 М.
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 56 МЛН
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 6 МЛН
THE POLICE TAKES ME! feat @PANDAGIRLOFFICIAL #shorts
00:31
PANDA BOI
Рет қаралды 25 МЛН
I asked an AI to create Minecraft from scratch.
8:02
Element X
Рет қаралды 925 М.
I made a Voxel Engine with Rust (NO GAME ENGINE)
9:49
Tantan
Рет қаралды 80 М.
ChatGPT makes Voxel Engine with Rust
12:20
Tantan
Рет қаралды 92 М.
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Рет қаралды 481 М.
Voxel Game Development Is Hard
12:24
Tantan
Рет қаралды 94 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 693 М.
Doubling the speed of my game's graphics [Voxel Devlog #18]
13:01
3 Months of Game Programming in 20 Minutes
20:32
jdh
Рет қаралды 594 М.
I Optimised My Game Engine Up To 12000 FPS
11:58
Vercidium
Рет қаралды 588 М.
育児6年目の韓国人父が娘と遊ぶ方法4 #shorts
0:11
ミョリムMyorimu
Рет қаралды 34 МЛН
ОТЛИЧНАЯ ПАЛАТКА
0:23
KINO KAIF
Рет қаралды 4,4 МЛН
Ты же девочка 2 👧🏻🤣😋 #comedy
0:26
Fast Family LIFE
Рет қаралды 480 М.
Эй Рамазан # DamirAgroDizel
0:16
DamirAgroDizel
Рет қаралды 7 МЛН
ПРАНКУЕМ ЧАПИ🙈🙈🙈
0:20
Chapitosiki
Рет қаралды 6 МЛН