Deep Dive Dev
Deep Dive Dev
  • 12
  • 65 956
Optimizing Your Godot Game's Rendering With MultiMeshInstance2D
This video was sponsored by Brilliant
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/DeepDiveDev/ You’ll also get 20% off an annual premium subscription.
Chapters:
0:00 Intro
2:23 Why Use It?
3:36 Quick Example
3:56 Draw Calls
4:40 Optimizing Draw Calls
6:09 Optimizing Node Count
7:45 Brilliant
9:08 Fixing Our Setup
11:31 Y-Sorting
11:58 Additional Features
12:28 Adding Transform Animations Back
12:55 Vertex Shader Animations
14:13 Vertex Shader Caveats
15:40 Adding Sprite Sheet Animations Back
16:43 Conclusion
Переглядів: 6 554

Відео

Object Pooling In Godot: Worth It?
Переглядів 11 тис.Місяць тому
This video was sponsored by Brilliant To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/DeepDiveDev/ You’ll also get 20% off an annual premium subscription. Today, we dive into object pooling. A fantastic optimization tool that can be used in the godot engine. Chapters: 0:00 Intro 0:15 What is it? 0:43 How is it faster? 1:53 When to use it 3:05 "But I heard i...
12 Tips to Boost Your Godot Game's Performance
Переглядів 13 тис.2 місяці тому
Here are some tricks that'll help boost your Godot game's performance. Enjoy! Chapters: 0:00 Intro 1:01 Jolt 1:55 Rapier 3:08 Physics Tick Rate 4:33 Less Colliders 5:18 move_and_slide() alternatives 6:48 faster programming languages 7:15 fewer solver iterations 7:46 run physics on separate thread 8:16 multithreading 8:37 compute shaders 9:28 Use GDScript Util Classes 10:11 Be smart about loadin...
Godot Finite State Machines Made Easy - A Simpler Method for Smarter Enemies
Переглядів 9953 місяці тому
We're diving into the world of Finite State Machines! Take a sip of lemonade every time I say the word "state". Play my games on itch: breckheck.itch.io/ Chapters: 00:00: Intro 00:30: What is State? 02:20: State Class 3:53: State Machine Class 4:25: Stealth Game Example 5:35: Flow Chart Setup 6:18: Enemy FSM Setup and Code 6:43: Add Shoot State 7:48: More Complex FSM Setups and Substate 8:35: W...
Boost Godot Project Performance With This Simple Trick
Переглядів 27 тис.6 місяців тому
Join the community discord! discord.gg/K4EZEWF9 Play my games on itch: breckheck.itch.io/ Here's a quick tip in the Godot universe I think the world should know about. GDScript static typing performance gains. Enjoy!
How I Made My First Multiplayer Game in 48 Hours | Jam Devlog 3
Переглядів 1,5 тис.6 місяців тому
I joined another game jam! This time its a multiplayer game for a console you probably haven't heard of. In this episode, we develop the game Pirate Panic in 2 days. Enjoy! Join the discord! discord.gg/K4EZEWF9 Play my games on itch: breckheck.itch.io/ Chapters: 00:00: Intro 00:20: GameNite 1:08: Brainstorming 2:26: Starting the Game! 3:45: TileMap 4:46: Pirate Art and Movement 5:29: Digging 6:...
I Made a Spooky Strategy Game in 5 Days | Jam Devlog 2
Переглядів 7827 місяців тому
I Joined another Game Jam! This one was a spooky strategy game built with the godot engine. Play Soul Weaver: breckheck.itch.io/soul-weaver Jame Gam 40 Submissions: itch.io/jam/jame-gam-40/entries Join the discord! discord.gg/K4EZEWF9 Play my games on itch: breckheck.itch.io/ Chapters: 0:00: Intro 0:20: Brainstorming 0:40: Game Idea 1:49: Project Start 2:50: Pathfinding 4:13: Art Change 5: 38: ...
I Made a Chill Fishing Game in 3 Days | Jam Devlog 1
Переглядів 2,4 тис.8 місяців тому
I Joined a Game Jam last weekend! Let's see how I did Play Waters of Fortune: breckheck.itch.io/waters-of-fortune Mini Jam 158 Submissions: itch.io/jam/mini-jam-158-shopping/entries Chapters: 0:00: Intro 0:40: Coming Up With Ideas 2:34: Starting the Project 2:44: Water 3:55: Boat and Player 4:35: Fishing Rod 5:36: Fish 7:21: Cards and Trading 7:39: Clouds 8:14: Upgrades 9:30: Music 9:54: OST 11...
I Made Over 250 Fractals With Chaos Game
Переглядів 1508 місяців тому
A montage of fractals renderered using Chaos Game! Don't ask me how long these took to render. Other video on how it works: ua-cam.com/video/Y_o9Vo5nTT0/v-deo.html
Chaos Game - A Surprising Method To Generate Fractal Patterns
Переглядів 5168 місяців тому
Today we dive into Chaos Game! Chapters: 0:00 Intro 0:23 What Is It? 0:52 How It Works 1:40 Switching to Lerp 2:29 Adding logic 6:58 Sequences 7:30 What's It Good For? 8:44 Conclusion links: en.wikipedia.org/wiki/Chaos_game www.sciencedirect.com/science/article/pii/S2001037021004736
Unlocking the Power of Binary Search Trees - The Basics of the Gateway Data Structure
Переглядів 3089 місяців тому
Today we kick off the dive into binary search trees! Chapters: 0:00 Intro 0:47 Insertion 2:19 Insertion Code 3:16 Searching 4:01 Searching Code 4:29 Deletion 5:59 Deletion Code 7:12 Balancing 9:10 Balancing Code 10:09 Duplicates? 10:36 Duplicates Code 10:51 Node Data Types 11:07 Binary Representation 11:42 Morse Code 11:58 Applications 12:50 LL vs Array vs BST 13:07 Conclusion animations made w...
Poisson Disk Sampling: Unshrouding the Secrets of Uniformly Distributed Points
Переглядів 2 тис.10 місяців тому
Today we dive into poisson disk sampling! Chapters: 0:00 Intro 0:16 Applications 0:39 Why Not Random Points? 1:07 Algorithm Visualization 5:18 Code 7:14 Performance 8:01 Conclusion animations made with MotionCanvas: motioncanvas.io/ big thanks to hhenrichsen for his MotionCanvas library: github.com/hhenrichsen/canvas-commons/tree/main more on poisson disk sampling: www.sciencedirect.com/science...

КОМЕНТАРІ

  • @comaybay
    @comaybay Годину тому

    This is so awesome, fantastic work! Im really struggling with optimization for a game im making right now and i was so excited when watching this video, i was like "this is exactly what i need!". But alas the cost of not being able to use animation player is too much for me. The game is animation heavy so I would hate spending hours and hours writing animation shader code instead of the ease of animation player. If you can convert animation player to vertex shader that would really be a godsend

  • @mission3479
    @mission3479 4 години тому

    thank you 🙏

  • @ninjabuddy1
    @ninjabuddy1 День тому

    Finally I can make a 2d top down dynasty warriors

  • @ahmede92
    @ahmede92 2 дні тому

    how did you make these animation??

  • @chaosmachines934
    @chaosmachines934 3 дні тому

    can you make custom ID in godot like every goblin has his own Unick functions. goblin with ID = 0 can be super-fast goblin with ID= 1 can do magic and so on i did learn this one from construct 2 so i do wander if godot can do it too.

  • @bennieholcomb4908
    @bennieholcomb4908 3 дні тому

    More of this please! Subbed!

  • @PontusWittenmark
    @PontusWittenmark 3 дні тому

    Great phasing and tone, you're a really good presenter 💯

  • @MattyDoesGameDev
    @MattyDoesGameDev 5 днів тому

    Man, you are getting a ton of totally unnecessary negativity in this comment section. You explained a lot of awesome content at a pace that was both engaging and digestible. I would bet that the people making negative comments are just projecting their insecurities. Don’t take them to heart, you’re making great content dude.

  • @breezingwing5574
    @breezingwing5574 6 днів тому

    i guess this is useful to know, but its strange you dont ever mention the canvasgroup node, since it seems to be an easier way to do a similar thing, if not on a smaller scale (havent used it myself so im not sure how well it would work for larger scales, though i have some ideas i'd like to test sometime.

    • @DeepDiveDevelop
      @DeepDiveDevelop 6 днів тому

      I tried the canvas group node in my setup, but it had poor performance compared to multimesh, so it seems like there's some overhead when using it

  • @stephenkamenar
    @stephenkamenar 6 днів тому

    why is godot so slow? only 100,000 sprites drops you to 60fps??? really?

  • @mikego2611
    @mikego2611 6 днів тому

    This might sound strange but, on 3D, in many specific circumstances, MeshInstance3D is more performant than MultiMeshInstance3D (as per 4.3). Using LODs, MeshInstance3Ds are able to reduce vertex count. MultiMeshInstance3D isn't able to use LODs properly a d hierarchical MultiMesh isn't a thing (dividing the MultiMesh in different LODs based on render distance). MeshInstance3D is able to use LODs per item, and the same mesh between many MeshInstance3D is still rendered in the same draw call (like MultiMeshInstance3D). I've done some experiments and, as on 4.3 there is no upside to using MultiMeshInstance3D if you are using LODs. Is more performant to use MeshInstance3D and LODs. But at the end of the day "try it yourselves, do your own experiments".

  • @ultimaxkom8728
    @ultimaxkom8728 6 днів тому

    Hmmm, crispy cat...

  • @dummyaccount1706
    @dummyaccount1706 6 днів тому

    0:05 Ok that "if true" in process function got me laughing real hard not gonna lie

  • @yuvrajkukreja9727
    @yuvrajkukreja9727 6 днів тому

    open source is the best

  • @FlorianAlushajGames
    @FlorianAlushajGames 7 днів тому

    So the y-sorting works for the instances itself when they move towards each other, but what with other objects from tilemaps or scene stuff? for example a sprite2d that is a tree, that is not managed by the multimesh. would the goblins go in front and behind the tree correctly depending on the trees pivot point with y-sorting on? also think about sharing source code when doing such videos.. it helps most people

    • @DeepDiveDevelop
      @DeepDiveDevelop 7 днів тому

      all mesh instances from a multimeshInstance2D node are the same z index. You can only change the draw order of mesh instances in relation to other instances by moving ids. So you'd need another multimeshinstance2d drawing at another z index to have some instances in front of a tree and behind a tree, because they'd have to be drawn in separate draw calls.

    • @FlorianAlushajGames
      @FlorianAlushajGames 7 днів тому

      @ thats exactly the point where i am. i decided to try that out and if its not good enough to switch completely to the renderingserver.

  • @fulongfromthegrave
    @fulongfromthegrave 7 днів тому

    Next make collision checks on all those goblins! 🎉

  • @agustinagustin3376
    @agustinagustin3376 7 днів тому

    Bro i am your new subscriber 😊

  • @TheBraine44
    @TheBraine44 7 днів тому

    So this doesn't work at all without explaining your custom multi-mesh-manager resource...whatever register_instance is, it does not work with the standard multi-mesh-instance-2d node

  • @gamedog9542
    @gamedog9542 7 днів тому

    Bro i thought this would have like 800,000 views. Nice video, i subscribed!

  • @aatwo
    @aatwo 7 днів тому

    Positive y points up in godot

    • @DeepDiveDevelop
      @DeepDiveDevelop 7 днів тому

      It actually points down surprisingly! It can seem a bit counter-intuitive tbh. for 3D it's probably another story though

    • @aatwo
      @aatwo 3 дні тому

      @DeepDiveDevelop oh sorry, apparently it depends what you mean. Screen space and 2d games = y-down. 3D world space is y-up which is what I was thinking about.

  • @adventuretuna
    @adventuretuna 7 днів тому

    This video was a pain to watch in 1x speed.

    • @conkcreet5546
      @conkcreet5546 7 днів тому

      yeah ive watched too many 1.6x speed podcast tiktoks

    • @DeepDiveDevelop
      @DeepDiveDevelop 7 днів тому

      can you elaborate on this? Do I talk too slow? too many pauses between sentences? not concise?

    • @ultimaxkom8728
      @ultimaxkom8728 6 днів тому

      @DeepDiveDevelop Honestly? I don't see any significant issue with your pacing, *personally,* and I watch at x1 speed. It's low filler & *very* clear.

    • @soggycereal9563
      @soggycereal9563 День тому

      @@DeepDiveDevelopyour pace is just fine for me

  • @cecgaming9916
    @cecgaming9916 7 днів тому

    bro has an i9-14900k with the gtx 970. No need to flex like that

  • @Galomortalbr
    @Galomortalbr 7 днів тому

    pro tip, you are better off using viewport texture instead of a vertex shader, or many of them even

  • @gabochip4703
    @gabochip4703 7 днів тому

    Cool video The animations while you explain the topi are very smooth

  • @bvnanadev
    @bvnanadev 7 днів тому

    this is great! I never noticed this node while checking the docs before. And the limitations actually seem more than manageable for simpler environmental objects like grass!

  • @kaisa89475
    @kaisa89475 7 днів тому

    it's cool but we can't interact with them though...

    • @Mr.Sunshine2023
      @Mr.Sunshine2023 7 днів тому

      we can, just needed adjustment

    • @kaisa89475
      @kaisa89475 7 днів тому

      @ how

    • @timmygilbert4102
      @timmygilbert4102 7 днів тому

      That's just a renderer

    • @fabians7807
      @fabians7807 7 днів тому

      Collision detection does not work for Multimesh instances.

    • @timmygilbert4102
      @timmygilbert4102 7 днів тому

      @fabians7807 neither they do for mesh anyway, that's a different component, this is only render optimisation. You can have interaction then pass the data to the mesh instance custom rendering to reflect that

  • @DeepDiveDevelop
    @DeepDiveDevelop 8 днів тому

    To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/DeepDiveDev/ You’ll also get 20% off an annual premium subscription.

  • @JeffEnriqueJohnson
    @JeffEnriqueJohnson 8 днів тому

    Thank you!

  • @anothercastle17
    @anothercastle17 14 днів тому

    I was static typing variables already just because it felt like it made things more readable, but I was unaware of the performance boost, I'll keep this in mind.

  • @duke605
    @duke605 22 дні тому

    Idk how godot does it's arrays but it might be better to also store a cap and and length variable and when pulling, just reduce the length and when adding, add to array using the length index unless the array is at its cap. The just use push and increase cap by 1. This will prevent a bunch of array copies and allocations

  • @Nora_Short
    @Nora_Short 22 дні тому

    thank you for this video, i'm new to Godot so this video was very useful!

  • @heraldoffire5104
    @heraldoffire5104 22 дні тому

    I've always used static typing, and GDScript was no exception when I started learning it. The difference honestly doesn't surprise me. Any time variants are used, you're adding extra processing time as the engine figures out what type of variable it's meant to be before engaging with it. C# variants get around this problem because they're not *actually* variants, they're strongly typed variables that inherit their type from their declaration (eg. var myVar = Object ). It's why you can only use them as locals.

  • @powertomato
    @powertomato 26 днів тому

    As of 4.4 Jolt will be part of the engine, so no more downloading. You just need to switch it in the project settings

  • @spyhacksgadgets4016
    @spyhacksgadgets4016 28 днів тому

    Thanks man, interesting. Coming from embedded C++, not declaring the variable types is confusing to me. I did not know it actually boost performance!

  • @juanhernandez-up4pg
    @juanhernandez-up4pg Місяць тому

    Great video, thanks 👍

  • @SpotAllen
    @SpotAllen Місяць тому

    I like your style man. Subbed.

  • @mohsenzare2511
    @mohsenzare2511 Місяць тому

    good video! I also think pool can increase performance! But I think the GDScript is not a best option to create this! in Array you keep a pointer to the object, so object are not next to each other in memory which will not get the best performance! another think adding and removing object to array is performance costly sometimes for this you need to allocate memory which is the same thing as allocating memory for object! even if you want to remove from array it is better to remove the last element! by the way it is best this should be implemented in core or GDExtension

  • @Biokompott
    @Biokompott Місяць тому

    Thanks. Useful!

  • @pixiri21
    @pixiri21 Місяць тому

    Best advice I can give for Godot devs, never listen to the people who make Godot. :)

  • @xornedge8204
    @xornedge8204 Місяць тому

    This is the best explanation I've ever seen. It just makes sense!

  • @noobkiller100
    @noobkiller100 Місяць тому

    very interesting subscribed

  • @dealloc
    @dealloc Місяць тому

    Keep in mind that measuring performance is not enough. Understand _why_ it is slow before making optimizations, like pooling. Vast majority of cases are because instantiation of objects take too long (like slow calculations during initialization, or too much allocation upfront when you don't need it). Limit what your objects needs to do when they are instantiated. Chances are you can get away with very minor changes that doesn't need to involve data structures like ring buffers, linked lists or some other arbitrary structure. See where you could pre-compute values, possibly store them as static values, and where your initializations could be deferred or lazily evaluated. It's often slower to tame memory by adding more abstractions, than for example just recalculating things If you know you're being limited by other factors, like garbage collector, before just picking the first tool that some comment tells you, try different ways (easiest first), and measure.

  • @RoddieH
    @RoddieH Місяць тому

    Keep grinding that content out - you deserve more followers and you will get them. Can't wait to watch your take on FSMs next!

  • @Codethe_Road
    @Codethe_Road Місяць тому

    I was running into performance issues in my godot project, and I implemented some of my own "scratch" fixes--- but this technique did help quite a bit when I did get around to trying it.

  • @Cammymoop
    @Cammymoop Місяць тому

    Nice video, though as others pointed out you most likely want to take objects out of the end of the pool rather than the start. I do want to "devil's advocate a little though, what Juan said was a little misleading I've seen people quote that tweet a bunch in the same context, so that's fair. But the example you showed really isn't what he was trying to address, I think he's responding to people wanting every single game object to be pooled in one or more pools regardless of how often they are added or removed from the game environment. The way he said it in that tweet can be interpreted any number of ways though, but imo it's not even presented as advice on optimization, just a random thought from Juan 6 years ago. For a more constructive critique, "Simple area2ds with sprites" are not that simple and not the best or simplest way to implement a large amount of bullets like that. That's 2 whole nodes in the tree and lots of functionality you will never need for those bullets. They are the easiest way to do it, yes, so if a simple pool of area/sprite bullets is good enough performance then go for it! The Godot docs specifically point out how the scene tree isn't always the best approach and show how to use the Server classes like the PhysicsServer and RenderingServer to manage actual lightweight instances (that live outside of GDScript comletely, other than a reference RID). There's also 2 different types of particle systems, which aren't as easy to use in collisions (you'll have to set up collision detecting manually) but are definitely an option and they handle the pooling for you plus have lots of nice options out of the box that could be useful for different kinds of firing patterns or bullet behaviors. Creating and destroying 3000+ objects a second is still always going to have a performance impact and if you need to go even further beyond that it will only get worse and worse, so pooling is the obvious approach for things like bullets in a shmup/bullet hell.

    • @DeepDiveDevelop
      @DeepDiveDevelop Місяць тому

      Thanks for the feedback. To be clear, the video might've made it seem this way, but I wasn't trying to bring down Juan or stir the pot in any way with that tweet, he knows the engine 100x better than me. And your definitely right there are further optimizations that could be done to probably get even more bullets per second and fps with the quick example I show. I do plan on touching on using the server classes in the future. Might even do a follow up video on pooling if there's interest. Thanks for watching!

    • @Cammymoop
      @Cammymoop Місяць тому

      @@DeepDiveDevelop Don't worry, it didn't come across like you were pot stirring haha. I just figured the dude has enough on his plate already, with godot becoming such a big thing in the last few years, and the whole, uh PR incident thing. So I wanted to provide a mediating voice for anyone who might be the conclusion jumping type

  • @1000_Gibibit
    @1000_Gibibit Місяць тому

    Why instantiate lot object when pool few object do trick? Glad you covered this, pooling can be very helpful. One thing you didn't explicitly mention, I think, is that pooling can move some initialization costs from hitting during runtime to a loading screen. So even if you only expect 1,000 instances of something in a level, spawning them all up front can give a performance boost. This can be helpful on mobile platforms where you don't get a lot of CPU time but you will probably have some leftover RAM. Not just in theory, this helped me and my team in a production environment once.

  • @Jplaysterraria
    @Jplaysterraria Місяць тому

    Looking at 6:44 I see a potential perf problem in your implementation: If the object pool is an Array, then remove_at(0) is probably a performance pitfall; remove_at(0) will have to copy all elements that come after it so it's an O(N) operation, using the Array as a stack instead (removing the last element instead of the first) should always be more performant O(1). This is the case even if you have a Queue instead, Queues can pop the first and the last element in O(1) time, but this is more expensive than popping the last element of an Array.

    • @Grif_on96
      @Grif_on96 Місяць тому

      Yes . This is an example of how optimization techniques can lead to decreasing of the performance instead . So , profiler in the debugger is your best friend when optimizing ! And of course genneral Computer Scince allows to quickly find such fuck-ups even without profiler :)

  • @kerduslegend2644
    @kerduslegend2644 Місяць тому

    Remember, instantiating more object is a lot faster than getting an already instantiated object

  • @ajpink5880
    @ajpink5880 Місяць тому

    I wonder how we could best re-educate Juan... But people in the Godot community do this a lot, where they throw out theoreticals but don't actually try it before they start talking. If you don't know if something will gain/lose performance, just try it and see. Theoreticals can only get you so far.

  • @MaceTLOF
    @MaceTLOF Місяць тому

    I did this automatically because when i originally tried the spawn and remove the player's attacks it would lag my game out each time the abilities were used, pooling worked a lot better for me