How much faster is Godot 4? (Feat. My Minecraft Clone)

Ойындар

I made Minecraft in Godot. Over the past two months, I upgraded the project to Godot version 4 and ran side-by-side performance testing. Today, I'm sharing the results of that experiment.
Additional results are available here:
sdggames.itch.io/minemark
The source code for this game is available here:
gitlab.com/20-games-in-30-day...
All games in this series are available on Itch, and the source code is freely available.
sdggames.itch.io/20-in-30
gitlab.com/20-games-in-30-days
The game title was generated here:
textcraft.net/
Music used in this video:
freesound.org/people/Migfus20...
freesound.org/people/Drumarti...
I do have a Discord! / discord
------------------------------------------------------------
00:00 Intro
01:13 How this works
03:03 Editor, Debug, Release
04:10 Getting a Baseline
07:18 Instancing Thousands of Nodes
08:56 Mesh Results
10:34 Simple Results Recap
11:31 RenderingServer
13:19 Multimeshes
14:18 Gridmaps
16:00 Conclusion
------------------------------------------------------------
Check out some of the awesome tools I use for this series.
Godot: godotengine.org/
1BitDragon: 1bitdragon.com/
Gimp: www.gimp.org/
LibreSprite: libresprite.github.io/
Joplin: joplinapp.org/
Music and sound effects used in this series:
freesound.org/people/SDGGames...

Пікірлер: 104

  • @SDGGames
    @SDGGames Жыл бұрын

    Hey everyone, thanks for the feedback! I knew that I would be showcasing my ignorance to a certain extent with this one, so I'll leave any major updates/corrections here. As a reminder, we are generating millions or hundreds of millions of objects, so I don't want anyone to take away the conclusion that Godot sucks :) This is a stress test, after all. 1. It got cut from the script, but I will be creating minimal reproduction projects and submitting bugs to Godot for this video and the last. 2. 11:34 My RenderingServer code could have been better, there is a way to batch submissions similar to how the MultiMesh code worked. I don't expect that the framerate would have changed much, but the resource contention would have cleared up for Godot 3. 3. 13:45 I tried suppressing the error printing for MultiMeshes and GridMaps, and the framerate did improve for multimeshes. It averaged 100 fps during the test (up from 80) and 90 while the test was ending (up from 45). The obvious solution is to figure out the vulcan rendering error and fix it, but that may take time and is likely an engine issue. 4. No one noticed the obvious error in one of my graphs, so that's good... I'll update this comment with anything else that comes up.

  • @Waffles_Syrup

    @Waffles_Syrup

    Жыл бұрын

    I think you forgot to pin this message :P

  • @MasterofBlubb

    @MasterofBlubb

    Жыл бұрын

    Did some digging through the github repo of godot, passing by your issue for the Gridmaps, i found that the underlying issue for those seem to be that Gridmap is NOT threadsafe. Someone also made a Pull Request and its marked for 4.1 milestone, so maybe we will need a small revisit when that gets fixed ;)

  • @RenderingUser
    @RenderingUser Жыл бұрын

    1:03 >says excel >uses libre calc nice

  • @SDGGames

    @SDGGames

    Жыл бұрын

    Wait, there's a difference? I always thought Excel was a genericized trademark, like kleenex or bandaid.

  • @RenderingUser

    @RenderingUser

    Жыл бұрын

    @@SDGGames XD well thats cause most people just use windows. so excel all they ever call a software like that

  • @Smaxx
    @Smaxx Жыл бұрын

    Performance drops with errors happening: Don't know what's printed or how much is printed, but if you're using the classic Windows terminal windows (i.e. not the new "Windows Terminal"), terminal output can slow down programs significantly. You could totally try rerouting output to the nul device and see if that changes anything (or possibly combine that with the new terminal, which you can install standalone on Windows 10, too).

  • @dmaz123

    @dmaz123

    Жыл бұрын

    even rerouteing to null imparts significate overhead and should invalidate any test results. he needs to fix the issue for valid timing.

  • @SDGGames

    @SDGGames

    Жыл бұрын

    Thanks for that one, I tried re-running without the console, and it does look better for the multimesh. It averaged 100 fps during the test (up from 80) and 90 while the test was ending (up from 45). I was using .bat files run through PowerShell for the tests in the video.

  • @Smaxx

    @Smaxx

    Жыл бұрын

    @@dmaz123 Yes, just hiding issues isn't ideal either. However, some of these might be debug messages, too. Plus I completely forgot about the option to just tell Godot not to use a console window, which should solve this *without* relying on any piping.

  • @monad_tcp

    @monad_tcp

    Жыл бұрын

    Modern windows terminal with vt100 can push easily 12MB/s of text. I tested with tracing in CMake. it only used 25% of one core.

  • @Smaxx

    @Smaxx

    Жыл бұрын

    @@monad_tcp Correct. Emphasis on "modern Windows Terminal".🙂

  • @RADkate
    @RADkate Жыл бұрын

    so apparently gd 4 also has almost no optimization yet and its still better than 3, thats kinda amazing. im also surprised by gd3 compiled games being not any faster

  • @scarm_rune

    @scarm_rune

    Жыл бұрын

    because gd3 is pure garbage and no one should use it

  • @imaginaryash1807

    @imaginaryash1807

    Жыл бұрын

    @@scarm_rune GD3 still perfect for 2D games

  • @SDGGames

    @SDGGames

    Жыл бұрын

    To be fair, re-architecting the entire engine is one of the best forms of optimization. Though it will be fun to see how granular optimizations change things.

  • @ChrisD__

    @ChrisD__

    Жыл бұрын

    @@imaginaryash1807 And still surprisingly good for 3D games, but no one ever pushes it.

  • @imaginaryash1807

    @imaginaryash1807

    Жыл бұрын

    @@ChrisD__ yes if you know what you doing with art style of your game and dont wanna make a generic "hyper realistic" game 😁. But GD4 is taking the cake for 3D, vulkan is neck to neck with DirectX 12 takes advantage of modern gpus like rtx having global illumination and auto lod. Cant wait for stable release (still learning on GD3 im noob)

  • @yuetia4193
    @yuetia4193 Жыл бұрын

    You've put an insane amount of work into this! Thank you for sharing the data this is great information and even though it is very data heavy you made the video captivating. Great job!

  • @johansjolin6495
    @johansjolin6495 Жыл бұрын

    Super interesting and a very cool analysis!

  • @Visleaf
    @Visleaf Жыл бұрын

    Very cool results!

  • @FinaISpartan
    @FinaISpartan Жыл бұрын

    Amazing video! Your testing methodology is on point!

  • @HeraldOD
    @HeraldOD Жыл бұрын

    I hope you submitted issues for all the godot4 bugs you encountered! some of this stuff could be really useful for cleaning up the beta before release

  • @SDGGames

    @SDGGames

    Жыл бұрын

    Yup, working on the minimal reproduction projects now. (That will also ensure that I'm not reporting a bug in my own code)

  • @rhapsodyaria
    @rhapsodyaria Жыл бұрын

    There are a lot of complicated technical reasons to explain why the various things happened the way they did. The basic reason for why meshes are fastest is: It just has to process the outside faces. That's way fewer vertices and triangles than dealing with everything inside a block. There's also memory bandwidth to consider. The GPU can only hold so much data, and it takes time for the data to be transferred between the main CPU and RAM to the GPU RAM. MultiMesh and RenderingServer have to hold and process so much data, so many transforms, and that's gonna be really inefficient. There are also weird issues when it comes to MultiMeshes where it doesn't batch uploading new instance transforms. Mesh is the best option for traditional voxel rendering. Unless you wanna use a voxel traversal algorithm to make a voxel raytracer, but that's a whole other story.

  • @snarf45
    @snarf45 Жыл бұрын

    such a great detailed video. Thank you!

  • @troybonneau4717
    @troybonneau4717 Жыл бұрын

    SDG, really good quality content. I was impressed to see Godot 4 beta handle over 200GB of RAM given how easy it is to crash it on a good day. Cheers and looking forward to more.

  • @Bananenbauer123
    @Bananenbauer123 Жыл бұрын

    The only benchmarking I ever did was comparing some string methods with string builder. Can't even imagine how difficult it is to benchmark game engines. Very impressive

  • @jamesmunroe6558
    @jamesmunroe6558 Жыл бұрын

    This is a THOUSAND different kinds of awesome! I'm so ecstatic and grateful for your mountains of hard work in bringing us fellow devs these fabulous resources and making the source for them freely available to us! THANK YOU from the bottom of my heart!

  • @sanyi9667
    @sanyi9667 Жыл бұрын

    you've done an amazing work! I really hope they will fix all the warnings and bugs because I also feel like the engine is still fairly unstable

  • @SDGGames

    @SDGGames

    Жыл бұрын

    It's getting better, though. I didn't have any results for Beta 1 because it crashed outright as soon as I started the game. The official release could be up to a year away still, but things will only improve between now and then.

  • @TimthePhilosiraptorExhale
    @TimthePhilosiraptorExhale Жыл бұрын

    Thank you very much for sharing, I have forked your project in hopes to create my own vision of a voxel game, and since you put it under the MIT, I am supposedly allowed to do this, but I just wanted to thank you and inform you that this is what I am planning on doing. I am very impressed with your work, but most of all I am grateful that your engine was made with godot since that is something anyone can use to change the code and do whatever they want with. Thank you very much for your contribution to the open source world, you have created a canvass on which I, an artist and musician, can hopefully make something that people all over the world can enjoy for free and love as an alternative to the 'king' of voxel games today which has been tainted by microjang and their busybody nanny mindsets.

  • @SDGGames

    @SDGGames

    Жыл бұрын

    100% feel free! I'd love to see what you do with it.

  • @janismancevics6638
    @janismancevics6638 Жыл бұрын

    Amazing video!!! Thank you!

  • @leonstansfield
    @leonstansfield Жыл бұрын

    Really interesting! Great video :)

  • @nowherebrain
    @nowherebrain Жыл бұрын

    this is a great, very interesting video..I know it seems in depth, but I know it was only cut down to get it to work for youtube...I would love to see an absurdly long video on this...but, I know this was already, a ton of work...thanks.

  • @SDGGames

    @SDGGames

    Жыл бұрын

    Thanks! I feel like a lot of the stuff I cut was even less scientific than the stuff I kept, though I will definitely consider expanding on some of these concepts in the future. I am finishing a write-up for Reddit to go with/promote the video, I'll probably put that in the Itch project as well when its done.

  • @dmaz123
    @dmaz123 Жыл бұрын

    Fantastic series!!! stdout and stderr should never be accessed when doing a timing test. you really need to find and eliminate those errors for any of the timing to be consistent.

  • @b4ph0m3tdk9
    @b4ph0m3tdk9 Жыл бұрын

    Thx for this, very interesting.

  • @ChippedMonk
    @ChippedMonk Жыл бұрын

    Godot benchmark tool, where users can submit their results / see how they stack up. or block up on their different computers / rig configurations. Could use that data to uncover bigger patterns to help the devs fix issues and optimize Godot. Someone take my vague ideas and spin it into gold.

  • @SDGGames

    @SDGGames

    Жыл бұрын

    You could export the results to a shared database instead of a local file, then use a tool like Grafana to generate averages and comparisons. The big question would be: what kinds of data are worth gathering? One of the hardest parts of this video was figuring out what was actually worth sharing, there were a few hundred files that didn't make the cut because they didn't tell any meaningful story about Godot.

  • @evgenkonyshock4913
    @evgenkonyshock4913 Жыл бұрын

    Don't worry if you feel like you are doing something wrong and are spending too much time when doing performance tests. I work in a relatively big gamedev company and this is more or less the same way how I approach performance testing. And I feel the same frustration every time I do those tests, lol. I also use excel. And setting up a good performance test always takes lots of time. You're good, no worries.

  • @moonshinetheleocat1235
    @moonshinetheleocat1235 Жыл бұрын

    The server sounds odd. I think that might be for a very different case than just merely a performance cap. As trying to use physics server runs into the same hardlimit that the nodes does. I think this has to do with the RIDs, which typically requires a synchronization via spinlock. Performance optimizations using servers is not the same as just using a function call. Generally using the provided functions is no faster than the nodes, if submitting data through Godot's usual update pipeline (nodes and linked list). To properly make use of the servers for performance boost, you need to treat the nodes a bit differently. I think you may want to try bulk submissions instead of just pinging the servers each time? I had to do something similar, by adding code that allowed me to completely bypass the locks, and send data in bulk. But looking at what you're doing. It also doesn't surprise me that meshing is faster than your server implementation. The meshing algorithm generates data on the spot. And submits to the renderer in one go, and not individually. This avoids regularly smashing into the RID several thousand times a frame from multiple threads. Bulk submitting data to the visual server would prove to be faster, but I do not reasonably believe that it will be faster than the implementation for meshing. But... if you want to see why Multimesh does not usually have this problem. Take a look at multimesh.h in scene/Resources/

  • @lkasikakalus123
    @lkasikakalus123 Жыл бұрын

    nice work

  • @WiseNoodleOfficial
    @WiseNoodleOfficial Жыл бұрын

    Hell yes, Godot is AWESOME!

  • @SDGGames

    @SDGGames

    Жыл бұрын

    I agree :)

  • @LuaanTi
    @LuaanTi Жыл бұрын

    Don't be ashamed for using a spreadsheet for something like this. This is exactly one of the things spreadsheets are great for. Spreadsheets are awesome.

  • @SDGGames

    @SDGGames

    Жыл бұрын

    The barrier to entry is so much lower. I took a class on data mining in college, but spreadsheets are often far easier for a non-professional. I put a note in because I felt like someone would mention it if I didn't, but using another program wasn't ever really a consideration for this particular project.

  • @Pandize
    @Pandize Жыл бұрын

    I have no idea what Godot is but I was recommended this. So I guess I'll listen to you crunch some numbers. :D

  • @SDGGames

    @SDGGames

    Жыл бұрын

    Haha, gotta love the algorithm. Godot is a game engine, a little less known than Unity or Unreal. Anyways, they came out with a version 4, turns out it's a bit faster...

  • @nowherebrain
    @nowherebrainАй бұрын

    would love to see code cmpr between gdscrit, gdnative, c# etc... I would also(I never looked into it) if there is a way to limit the messaging pool to the debugger...because that is super annoying and seems a little res heavy. :)

  • @RedSW
    @RedSW Жыл бұрын

    Love this video! So useful

  • @slipperynickels
    @slipperynickels Жыл бұрын

    i'd love to see a gdscript version benchmarked against a c# version.

  • @KittenKatja
    @KittenKatja Жыл бұрын

    There's a difference between loading chunks and generating chunks. You're generating chunks, while loading chunks means to go towards chunks that were previously generated.

  • @SDGGames

    @SDGGames

    Жыл бұрын

    True, I probably could have been clearer in my language. I never loaded a previously generated chunk in this video, thought the game does have the capability. The code does a "load or generate" for each chunk that enters the player's radius, so the language bleeds over a bit in the source code. Somehow, naming things well is still the hardest part...

  • @electric_lizzzard
    @electric_lizzzard Жыл бұрын

    so GD4 is just four times faster thanks to Vulkan API. thank you for your work. i doubted if i can make 3D arena fighter game with decent graphics. thanks tou you now i know i can

  • @brylie
    @brylie Жыл бұрын

    Very cool! Could you share the project code as open-source? I’m really hopeful to see an open-source voxel game emerge for the Godot engine.

  • @SDGGames

    @SDGGames

    Жыл бұрын

    It's already available (MIT). I did update the description to feature the link to the source code more prominently. This isn't the best/only voxel game or tool out there, but I hope it can be helpful to anyone who needs it!

  • @cvabds
    @cvabds Жыл бұрын

    How it's not 1million viewers already?

  • @Sean-gx1sf
    @Sean-gx1sf Жыл бұрын

    If you haven't done an atb style battle system yet, you should consider giving it a shot. I've learned a lot from what I've done so far, it is kind of bizarre compared to more traditional turn-based systems.

  • @SDGGames

    @SDGGames

    Жыл бұрын

    That's a good idea. I just realized that I didn't have a traditional turn-based battle system on the list, either.

  • @aleksitjvladica.
    @aleksitjvladica. Жыл бұрын

    I am very interested in this MineCraft project. Post scriptum: It is about a year later and I do know to make it myself, yet, I am making something different. I will probably post a few videos about it.

  • @goreldeeno
    @goreldeeno Жыл бұрын

    It is insane but...Can you make an Opengl 3 version?..

  • @cvabds
    @cvabds Жыл бұрын

    I doubt you can make a Minecraft clone in TempleOS with HolyC and assembly

  • @matt92hun
    @matt92hun Жыл бұрын

    Probably a dumb question, but would it be quicker if instead of using 2 triangles for every face of a cube you'd use a single triangle, but it's only textured on a square surface and the rest is transparent? So that the actual "cube" would be a mess of triangles, but you couldn't see the messy part of it.

  • @SDGGames

    @SDGGames

    Жыл бұрын

    That's not a bad idea in theory. I think that it might cause more problems than it solves, though. Graphics cards are so highly optimized for triangles that other forms of rendering are a lot slower. Alpha, specifically (making parts invisible) was one of the larger hassles I had to deal with (due to Z-depth sorting), and the GPU would be "drawing" the entire triangle even if the pixel doesn't end up on screen when its done. Since a triangle would need to be twice as big as the square, it would be twice as many pixels. It would save the cost of three vertices, but I don't think the net gain would be positive. Level of detail (combining a few cubes into one large cube when you are far away) is a common approach that would also decrease render distance. There's a Minecraft mod called Far Plane Two that can result in thousands of kilometers of render distance by compressing entire chunks into a single pixel. The same thing happens in Kerbal Space Program to render an entire planet at a good framerate. I could probably do that here, drawing fewer but larger cubes for chunks that aren't near to the player.

  • @matt92hun

    @matt92hun

    Жыл бұрын

    @@SDGGames Ah, I guessed that there was a reason people don't do it. I've seen the MC mod, it looked cool.

  • @alex15095

    @alex15095

    Жыл бұрын

    I believe rendering in this manner would hurt performance by disabling early z rejection, and also stress the GPU fillrate because now there's twice(?) as many fragment shader invocations

  • @MattWyndham
    @MattWyndham Жыл бұрын

    Don’t feel guilty about using excel instead of a database, sometimes excel is the better solution for visualizing data

  • @not_herobrine3752

    @not_herobrine3752

    Жыл бұрын

    if it works it works

  • @Ceisriel
    @Ceisriel10 ай бұрын

    would it be possible to make mninecraft but with sloped terrain? like the stairs in minecraft... but sloped... and made of dirt/rock

  • @SDGGames

    @SDGGames

    9 ай бұрын

    It should be. Sam Hogan did a video that converted Minecraft to smooth terrain. If you just want to add a differently shaped object, you would have to re-write the mesh generation to build a slope instead of a cube. For the Tileset, you might be able to import unique geometry and use it in the existing tile set, but I haven't tried it myself.

  • @user-mq2ij9ke3j
    @user-mq2ij9ke3j Жыл бұрын

    why are you saying go doe?

  • @SDGGames

    @SDGGames

    Жыл бұрын

    It's the most popular pronunciation, and the one I like best. (Google actually claims that this is the proper pronunciation). I know that playwright specialists call the play GOD-oh, but I'm not interested in the play, and the Godot devs haven't ever made one pronunciation official. Sorry if it's grating for you, I know that people will be chafed either way.

  • @corpsecueen
    @corpsecueen Жыл бұрын

    what is godot?

  • @SDGGames

    @SDGGames

    Жыл бұрын

    A game engine. Also an actress and a broadway play, but mainly a game engine.

  • @corpsecueen

    @corpsecueen

    Жыл бұрын

    @@SDGGames is it easier then unreal and unity?

  • @esben181
    @esben181 Жыл бұрын

    Right so you have 220 GB of RAM

  • @swizzler

    @swizzler

    Жыл бұрын

    It was a page file, basically when you run out of ram, your PC will use the SSD for emergency ram, it's slower, but prevents a full system crash.

  • @esben181

    @esben181

    Жыл бұрын

    @@swizzler Thanks

  • @SDGGames

    @SDGGames

    Жыл бұрын

    I bought 128 so I can build a nas/server alongside my workstation. I just threw it all into the one computer during the test. Realistically, extra ram doesn't make a computer better, I just thought it would be fun to cram as much in as possible.

  • @AltMe-kq5lr
    @AltMe-kq5lr Жыл бұрын

    Just code it in C bruh

  • @D-K-C
    @D-K-C Жыл бұрын

    Ъ

  • @crispiumva
    @crispiumva Жыл бұрын

    just play minetest

  • @SDGGames

    @SDGGames

    Жыл бұрын

    Why play it when you can make it?

  • @ChrisD__

    @ChrisD__

    Жыл бұрын

    Honestly though, a network compatible Minetest client in Godot 4.0 would be kinda amazing.

  • @SDGGames

    @SDGGames

    Жыл бұрын

    @@ChrisD__ I feel like I might have actually seen someone making that on Reddit the other day. There are a surprising number of Minecraft clones right now.

  • @swiftpawtheyeet6648
    @swiftpawtheyeet6648 Жыл бұрын

    "i wasnt about to learn databases for a one-off video about Minecraft", why learn to code at all if you arent going to learn, the video wouldve been the excuse, youd never use databases for just this video after you learn though :l

  • @swiftpawtheyeet6648

    @swiftpawtheyeet6648

    Жыл бұрын

    like youre supposed to use the excuses to learn new things to learn new things, amateur video ion need to see anything past the 1:10 mark

  • @pleonexia4772
    @pleonexia4772 Жыл бұрын

    Weird that they optimised exports in the next version?

Келесі