Can Godot Handle 10,000 Bullets?!
Video Statistics and Information
Channel: GDQuest
Views: 16,943
Rating: undefined out of 5
Keywords:
Id: _z7Z7PrTD_M
Channel Id: undefined
Length: 3min 51sec (231 seconds)
Published: Fri Oct 22 2021
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Great advice about measuring performance.
I wouldnt recommend not deleting the bullet nodes, though. Each of those nodes costs a little bit of memory. If a user keeps playing the game, they will eventually run out of memory if nodes are never deleted
Can you expound upon why you think pooling did not improve performance in any meaningful way? That was a surprising result to hear.
This post appears to be a direct link to a video.
As a reminder, please note that posting footage of a game in a standalone thread to request feedback or show off your work is against the rules of /r/gamedev. That content would be more appropriate as a comment in the next Screenshot Saturday (or a more fitting weekly thread), where you'll have the opportunity to share 2-way feedback with others.
/r/gamedev puts an emphasis on knowledge sharing. If you want to make a standalone post about your game, make sure it's informative and geared specifically towards other developers.
Please check out the following resources for more information:
Weekly Threads 101: Making Good Use of /r/gamedev
Posting about your projects on /r/gamedev (Guide)
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
Performance is a very interesting subject.
It is nice to know about certain paths in the design mode of Godot that can give you better results.
So I tried this in C# in my own project (which admittedly muddies the waters) and noticed a few things.
At 1:55, the code sample creates two objects every frame: the query itself, and the result. At the 1000-1400 active bullets mark, I noticed sharp framerate drops (active meaning in tree, but not updating or visible). When I instead made the query object in the ready function, while the number of objects was still large (which should be obvious why), the framerate kept a stable 60fps at the same number of bullets, upwards to about 2k (where the framerate seems to drop again). I took this further by passing the same query object and changing the parameters during process instead, but this had no further influence (the object count did drop significantly, but since there was no removing and creating of objects it didn't seem problematic).
While I can accept that the things I'm doing could account for a 5x difference (I have yet to see 10k stable), I do wonder why my C# has problems with doing things in the process while the shown GDscript snippet seems to be doing fine. Obviously I'd need to actually write a GDscript version as well to compare the two on my own end, but it stuck out as something odd.
As an aside, I can attest deactivating nodes rather than removing them significantly improved the performance.