Пікірлер
@viniciusschadeck4992
@viniciusschadeck4992 21 сағат бұрын
Oohhhhhhhhh, if i use a seedValue to generate the points, i can reach the same pattern all the time. Also, if i put each point with differenct R i can set different strats to use like filling trees and rocks, or first rocks then trees, but rocks has radius of 15 and trees of 5, soo trees are more close than rocks in a florest like, but in a mountain i can just switch both and had more rocks together and few trees as well... Dude, i need to code this, not mind, but i will try my own version, my quadTree is not perfect, but works to me, also, my A* pathfinder almost worked, the issue was trying to use it at the same time to a really large of entitys, in the maze test that are really much more complex than any real case for now, and i not implemented path reusability or even lowering grid levels to just get arround the correct coords before getting even closer, soo, my code is kinda raw, but already works very well for a single entity going into a maze I guess i can make this as well to improve my procedural generation even further LOL
@decorummortis5175
@decorummortis5175 6 күн бұрын
C# and C++ have a massive community so there is there, that means you just need to know what you are looking for they are not originally designed for game programming but had business and scientific backings
@anyeos
@anyeos 12 күн бұрын
​@DeepDiveDevelop I never tested it but I always use typed because it helps me a lot staying between desired results. I never thought that not doing it will have a performance cost. Good to know it, thank you.
@Kry0000
@Kry0000 12 күн бұрын
Thank you for making this video, I've heard the same answer from others when it comes to the performance gain of static typing, this help's reinforce their statements. I forgot that you could set the editor to error at non-static types, so thank you for that reminder.
@loganb2198
@loganb2198 13 күн бұрын
I always static type everything simply for auto complete purposes.
@nrwl23
@nrwl23 19 күн бұрын
tl;dr Use staticly typed variables bc gdscript can decide what it doesn't need to do, making everything faster. Excellent Untyped Declaration tip too. Great video, thanks. Subbed.
@PlayBASIC-Developer
@PlayBASIC-Developer 22 күн бұрын
Static types make compile time optimization a reality also..
@yucelcelik372
@yucelcelik372 24 күн бұрын
Hey thanks this was actually helpful even if not with performance it was with cleaner code and the video was right to the point.
@feivmoon
@feivmoon 26 күн бұрын
nah bro. cause i really thought that it was going to be something that i didnt know, fak u 😢😢😢😢😢😢
@F00dstamp96
@F00dstamp96 26 күн бұрын
I hate dynamic typing. Static typing just solves so many issues and, in my opinion, reads better. I think in types and values, not just values.
@shrippie-4214
@shrippie-4214 28 күн бұрын
Good thing I mostly learned Godot not knowing how to make variables any other way than Static types
@aeolianthecomposer
@aeolianthecomposer Ай бұрын
I'm slightly disappointed cause I was already using these Good video tho
@cosmilitebar6772
@cosmilitebar6772 Ай бұрын
Good to know, i thought is was like in python where it does not give you more performance. Also it can prevent you from generating bugs. So its probably worth all the time - even in non-performance-critical parts of the projects.
@Godot-Bro
@Godot-Bro Ай бұрын
Great game and devlog! I am pretty new to Godot myself, but I am doing something similar to you--making devlogs on game jams/small projects. Good luck to you in your pursuits!
@Rai2M
@Rai2M Ай бұрын
I do miss the days when you had no "variable" types and had to follow strict typing.
@asdfasdfasdfasdf-f3p
@asdfasdfasdfasdf-f3p Ай бұрын
This simple example should be in the godot documentation with an explanation - you can use the Variant type, but with a 30% performance loss.
@NatiiixLP
@NatiiixLP Ай бұрын
Personally, I use and recommend all the editor warnings, except for INFERRED_DECLARATION. As a Rust/Golang enjoyer, I simply can't understand why would inferred types ever be considered a negative thing, and the verbosity in GDScript (especially with enums) without type inference is unbearable. What really bothers me with GDScript is that static typing doesn't give you static analysis. Even if your variables are typed statically, the values assigned to them, member access, method calls, etc. are _sometimes_ evaluated only at runtime. So I need to run the game to learn that something doesn't exist because I renamed it, even though Godot knows the specific type, and should statically know that it doesn't have that member.
@_.-.
@_.-. Ай бұрын
Wait, you Neanderthals seriously program without declaring variable types?
@Aeduo
@Aeduo Ай бұрын
It's like remembering to put % after everything in QBASIC that should be an int.
@jRsqILVOY
@jRsqILVOY Ай бұрын
How do you do the terrain creation in Asesprite at 6:38 ?
@KucheKlizma
@KucheKlizma Ай бұрын
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!
@dmsys6516
@dmsys6516 Ай бұрын
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".
@JFran.
@JFran. Ай бұрын
Awesome. I didn't know this. Thanks. 🫡
@Seraph120
@Seraph120 Ай бұрын
I wondered what are the implications of using the ':'. Now I know. Thank You!
@Julianiolo
@Julianiolo 2 ай бұрын
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 :)
@DeepDiveDevelop
@DeepDiveDevelop Ай бұрын
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.
@out1007
@out1007 2 ай бұрын
I always use static typing (Haskell refugee), but it never appeared to me how much of a performance increase it is for Godot.
@Reymax164
@Reymax164 2 ай бұрын
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.
@content8420
@content8420 2 ай бұрын
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.
@content8420
@content8420 2 ай бұрын
I am a C++ dev who uses godot. Since I learned c++ before gdscript, I can't stop declaring datatypes😅
@Reymax164
@Reymax164 2 ай бұрын
I'm still in college, but I can feel you being a Java programmer 😅
@OnyxIdol
@OnyxIdol 2 ай бұрын
Another advantage of static typing is intellisense support.
@Jinrty
@Jinrty 2 ай бұрын
Thank you so much !
@billy91011
@billy91011 2 ай бұрын
How would that make things faster? (Not saying it doesn’t I just don't understand how that would effect it)
@Reymax164
@Reymax164 2 ай бұрын
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.
@indigouanJ
@indigouanJ 2 ай бұрын
does giving static return types to functions also help?
@igorthelight
@igorthelight Ай бұрын
Yep!
@mr1880
@mr1880 2 ай бұрын
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.
@VladimirZuev-Elbacha
@VladimirZuev-Elbacha 2 ай бұрын
Great Video!
@Lexiosity
@Lexiosity 2 ай бұрын
1:20 the first thing I noticed was that the movement was done in _process and not _physics_process
@RetroCroww
@RetroCroww 2 ай бұрын
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!
@igorthelight
@igorthelight Ай бұрын
It's a new thing in Godot 4. In Godot 3 it only helps autocomplete ;-)
@ShadeKirby500
@ShadeKirby500 26 күн бұрын
Tbh its both. I like it and I've not considered the performance gains. Because I love the intellisense improvement, I love that I can't accidentally set my number to a string like a dumbass
@hylucien2980
@hylucien2980 2 ай бұрын
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 :)
@KyleLuce
@KyleLuce 2 ай бұрын
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)
@igorthelight
@igorthelight Ай бұрын
True! But that was shown in the video tho ;-)
@guardllama8922
@guardllama8922 2 ай бұрын
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!
@ddxyzz
@ddxyzz 2 ай бұрын
Interesting
@Thund3rboltGaming
@Thund3rboltGaming 2 ай бұрын
bro inherits from characterbody2d and uses _process function instead _physics_process where all physics objects should be, but shows amazing tip LMAO
@Mithaldu
@Mithaldu 2 ай бұрын
next time just state what you're doing up-front, then elaborate on it, and i might actually believe you're a genuine person
@HamishMonkey
@HamishMonkey 2 ай бұрын
Holy shit! Thanks man this has drastically improved my performance
@zhengistasbolatov8480
@zhengistasbolatov8480 2 ай бұрын
I watched a couple of GDQuest videos, and he does that, but I never heard explanation. Thank you!
@decepi
@decepi 2 ай бұрын
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).
@AlyphRat
@AlyphRat 2 ай бұрын
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.
@igorthelight
@igorthelight Ай бұрын
Not a great idea - some "=" are just to assign a new value ;-)
@aqua-bery
@aqua-bery 2 ай бұрын
Omg my prediction was spot on. Static type EVERYTHING!
@setaindustries
@setaindustries 2 ай бұрын
Coming from Unity I already did this as standard practice, good to know this actually helps performance lol!
@dovos8572
@dovos8572 2 ай бұрын
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.