- 8
- 22 679
Deep Dive Dev
United States
เข้าร่วมเมื่อ 20 มี.ค. 2024
Hi, I'm a developer into making games, learning new things and making videos about them!
Boost Godot Project Performance With This Simple Trick
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!
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!
มุมมอง: 16 668
วีดีโอ
How I Made My First Multiplayer Game in 48 Hours | Jam Devlog 3
มุมมอง 1.3Kหลายเดือนก่อน
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
มุมมอง 688หลายเดือนก่อน
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.2K2 หลายเดือนก่อน
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
มุมมอง 1202 หลายเดือนก่อน
A montage of fractals renderered using Chaos Game! Don't ask me how long these took to render. Other video on how it works: th-cam.com/video/Y_o9Vo5nTT0/w-d-xo.html
Chaos Game - A Surprising Method To Generate Fractal Patterns
มุมมอง 3822 หลายเดือนก่อน
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
มุมมอง 2464 หลายเดือนก่อน
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
มุมมอง 1.3K4 หลายเดือนก่อน
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...
Hey that's super cool, I thought these are just type hints like in python. I guess I didn't bother reading the full manual and didn't realize these are proper static type declarations. Thanks!
There's one more important benefit, namely you will get autofill depending of type of variable/packed_scenes/texture/resource/nodes/etc. It really helps when you are using resources and classes and passing them from editor - i think its on by default but If you dont see them You access them through "Editor" -> "Text Editor" -> "Completion" -> "Add Type Hints".
Awesome. I didn't know this. Thanks. 🫡
I wondered what are the implications of using the ':'. Now I know. Thank You!
Nice video! But how are you calculating your speedup at 2:33? 1 - static_time / dynamic_time is not the speedup, idk know what that is lol. I guess the phrase A is x% faster than y is somewhat ambiguous. I guess a reasonable way to interpret that is to look at the amount of time it takes less than the base case (as a percentage of the base case). So then 40% faster than 100 would be 100 - 40%*100 = 60. Defined like that you would calculate it like this: (static_time - dynamic_time )/static_time = 1 - dynamic_time /static_time. So I guess your version is like how much more time does dynamic take than static as a percentage of static? I don't even know at this point lol, my head hurts. Also, generally speed tests in debug mode can behave pretty different than in release mode, so testing is release mode would be better. Idk how much that applies to godot, but its probably better to test for the case of a released game than a debug build. But as I said, nice video :)
Oh shoot! Thanks for letting me know I got the formula wrong. I must've rushed through that part of the code. The new formula I came up with for percent faster is: (dynamic_time / static_time - 1) * 100 I reran the performance tests and here are the new results, which have numbers that make more sense I think: dynamic add nums: 0.66875791549683 static add nums: 0.44424700737 static is 51% faster dynamic mult nums: 0.63372111320496 static mult nums: 0.44116997718811 static is 44% faster dynamic vector2 dist: 1.77509212493896 static vector2 dist: 1.18353796005249 static is 50% faster dynamic vector2 add: 0.85133600234985 static vector2 add: 0.35749793052673 static is 138% faster And yeah you're right about the debug vs release build performance. I just focused on the debug build for this vid, but I found some articles that cover the numbers for that if you are interested.
I always use static typing (Haskell refugee), but it never appeared to me how much of a performance increase it is for Godot.
I came from Java(my first language), it's the only one I know before trying and started to learn Godot and GDScript a week ago. Coming from a C based language, I'm too used in declaring the data types, so I started doing that right away after finding out I can do it 😅 I'm learning Python alongside GDScript right now… I hate Py.
Bonus: If you go to Editor>Editor Settings> TextEditor > Compilation and enable "Add type hints." Every inbuilt function when you select from the snippets will also have their return type.
I am a C++ dev who uses godot. Since I learned c++ before gdscript, I can't stop declaring datatypes😅
I'm still in college, but I can feel you being a Java programmer 😅
Another advantage of static typing is intellisense support.
Thank you so much !
How would that make things faster? (Not saying it doesn’t I just don't understand how that would effect it)
My guess is it's trying to figure out the data type first everytime they are used Which what makes it slow. So if the data type is already known, they don't need to figure it out anymore.
does giving static return types to functions also help?
worth the watch for the knowledge that I can set untyped declarations to throw errors alone, knowing it improves performance is the icing on the cake 😂 great video, thank you for the info.
Great Video!
1:20 the first thing I noticed was that the movement was done in _process and not _physics_process
Bro WHAT I thought programmers were just being fancy and organized by doing that, nobody told me it boosted performance by 60% lmao Thank you!
thanks for the tip. i knew of static typing i just didn't know why i should use it. i have a small game underway but luckily i'm not very deep yet so i can change the code to static typing :)
You can avoid explicit types at assignment, and still get static typing, by using the shortcut: var total := 100 Instead of var total : int = 100 A little tip that reduces boiler plate when the types are already easily readable in code. ( This pattern is also in other popular languages: Kotlin, C++ (auto), etc)
I've been hammering my head against this wall trying to learn programming as a hobby for 5-6 years now. I've run across this concept of static vs dynamic typing so often and it always confused me so I just thought "I'll worry about it tomorrow I guess." Somehow this video just really simplified it and something clicked for me. Thank you!
Interesting
bro inherits from characterbody2d and uses _process function instead _physics_process where all physics objects should be, but shows amazing tip LMAO
next time just state what you're doing up-front, then elaborate on it, and i might actually believe you're a genuine person
Holy shit! Thanks man this has drastically improved my performance
I watched a couple of GDQuest videos, and he does that, but I never heard explanation. Thank you!
Huh, I thought my code was running faster because coding skills were improving. Might just have been because I swapped fully to static typing as the other languages I use also use it (TypeScript, Swift).
3:09 If you press CTRL+R, you will enable "replace". You can simply replace all "=" with ":=", and anything after a paranthesis "()" with "() -> void" to fix all errors.
Omg my prediction was spot on. Static type EVERYTHING!
Coming from Unity I already did this as standard practice, good to know this actually helps performance lol!
I'm not against type hinting and i use it all the time, i'm gainst micro optimising stuff while the issue is the used functions themselves. looking at speed of type hinted or not should be the very last optimisaiton step before you give up and go to c# or c++ to do the slow algo. gdscript is fast enough to run 10k agents through a maze if you setup the data correctly. if you just use tilemap with nav layer and navigation agents you get only 500 tho before it falls below 60 fps. even worse if you need to be able to change the maze at runtime.
The music is the real jam here 😍 also the rising from grave animation was epic
personally I don't like the untyped declaration as an error since it doesn't work nicely with some things like Array.map/filter/reduce, or dictionaries. you can also just look at the line number, if it's green that means that line is completely typesafe, otherwise it's not
What do I do in something like my case... I've custom built Godot 3.1 with export templates for windows XP, there isnt untyped warning in the settings, plus they're not a radio button, but a boolean, so if I have to take the logic from the newer version yall are using, it'd take some time.. Is it really worth it? I just want to make the best out of my retro machine games...
I believe the performance increases are only available after godot 4.0. I can't speak too much about the prior settings before Godot 4, but still plenty of reasons to static type in 3.1! godotengine.org/article/gdscript-progress-report-typed-instructions/
@@DeepDiveDevelop okay, thank you, that's really appreciated! 🙏🙏🙏
Thank you for showing us the real performance gain in numbers. Other videos on the subject are missing that
The issue is when you use arrays. And i dont mean simple ones like an array of ints. I mean stuff like an array of array when each element is an array where the first element is an int, the second a node2d, the third a string.
Thanks for this, but you forgot something useful! Editor Settings -> Text Editor -> Completion -> Add Type Hints. With this setting, selecting functions via auto complete that can be overwritten (like _ready() etc.), they automatically get their type hint.
when you try to expand the, maybe try adding some pirate ships that can steal you fish and you have make upgrades to you ship so you can fand of pirates, you can even add a option to have a crew and they can help you with fish matter or processing the fish or fighting pirates, Or you can a boss level fish that is hard to catch, or you can also add a fisher gild when a fisher can register and take quest to find some rare fish or some under water gems or pearl or other important under water goods. or add water type monsters like kraken or mermaid.
Woa, thanks!
oh, well, I already prefered static typing everything so *this video was in fact clickbait technically for me* (this is just because I chose to follow a tutorial that showed me how to static type before and if I can static type, I will)
Could you share the link or title of the tutorial
EDIT: Looks like you struck gold with this topic. If you ever feel like talking about the debugger in more detail (for dummies like me who are 99% reliant on prints like a caveperson) I'll be there to watch it. 👍 Funnily enough, I already started using static types for my exported variables to get the proper inputs in the inspector, but hearing they also help with performance is good to know and I'll really have to get used to using return types again. Thanks! Oh and the := operator is great for primitive types. Yes, I am *that* lazy of a typer. :D
I'd say a good rule of thumb is to almost always use static types unless the function will work with generic types or you're writing an addon (types are erased (duplicated but not equal) when passed to those it seems).
I don’t like that it can’t auto-infer type of `var a = 5` it’s obviously capable when you use `:=`
Search this and Godot docs says "Also, typed GDScrypt improves performance by using optimized opcodes when operand/argument types are known at compile time.", which means that this should indeed work, given that documentation is accurate. Also it continues in the same paragraph "More GDScripts optimizations are planned in the future, such as JIT/AOT compilation.".
Also apparently there are "Type Hints". You access them through "Editor" -> "Text Editor" -> "Completion" -> "Add Type Hints".
Still don't understand the point of dynamic type. Just to save seconds of typing time and waste hours or days to hunt down bugs relating to mismatch type? That sounds like an unworthy tradeoff. The fact that most dynamic typing languages had to introduce static typing at some point already proved my point.
I wouldn't have thought of this - python has a very similar syntax called 'type annotation' but it doesn't seem to do much except for add additional checking. interesting!
Let's hope GDScript gets array typing soon.
You actually can type arrays in GDScript now. var my_array: Array[int] = [1,2,3,4] Although, it doesn't have the best support and can be a little finicky. Hopefully that will be addressed in the near future, along with nested array and Dictionary types like you see in TS
Coming from Python Godot's type hints felt very natural. The colon equals syntax is interesting, but I'm not convinced of its usefulness when assigning to a $ operation or a function call. For assignments to literal objects it's more worthwhile as it's as obvious there to the reader as the engine.
Wow can’t believe you made a game this polished in just 2 days
Wow that’s crazy ! Now I finally understand why some coders like to declare variable types, I’ll be doing it from now on !
C# will plunder your performances. I went there and thrust me, that cake is a lie.
Garbage in garbage out. The performance gains have already been tested. You need to refactor your code structure