Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit) (+1)(-2)

Very nice tutorial. Really opened my eyes. But there is a small issue. When creating many bullets in the same frame, it may lag. As far as I could investigate, the issue is that Godot has a limited pool of RIDs created simultaneously which freezes when you try to allocate a lot of RIDs. A quick google search showed that it's better to implement some kind of "caching" for your objects and not to destroy/recreate new objects but reuse existing ones.

Also, I didn't get the thing about the SharedArea and what it does. EDIT: you should connect body_entered signal from this area. This gets called when bullets hit something

And also the note about collisions to everyone else:
If you implement the approach of calculating if objects collided (bullet hit) by hand (by calculating if the distance is small enough to the target object every frame), the algorithm's complexity is very big O(Nenemies * Nbullets), because for each bullet you are calculating the distance to each enemy. One way to optimize this is to divide your area into "cells" and check if the bullet is in the same cell as the enemy. AND the engine (Physics2DServer) is doing it on its own if you have a collision shape. The parameter for cell size is configured in physics/2d/cell_size. So implementing custom collision detection, in my point of view, is really rewriting the same functionality in Gdscript. However, I've seen a guy reporting that he rewrote the Gdscript algorithm into a C++ module (GDNative or something, I don't know) and got a massive performance boost.

So for now, looks like Godot doesn't have an "Ultimate Bullet Hell Approach". Looking forward to see some real addon for spawning and management bullet hell, optimized for the best performance

(+1)

Basically this GDNative plugin