Godot Version
Godot 4.5
Question
I’m trying to design a bullet hell, but there are so many systems I cannot seem to wrap my head around, I’m not a total beginner (atleast in programming in general), so I feel a bit stupid for not understanding it.
-
Bullets and Bullet Spawners
This seems simple, you have a node that instantiates a packed scene (being a bullet), and that bullet flies in whatever direction you tell it to.
But what if the spawner shoots multiple streams of bullets? That sounds like a good excuse for a resource, so now I put all the data regarding the spawner into the resource, and now that works.
But now what if you want it to rotate? That’s not really a behaviour that relies on the bullets, so I feel like I need to make that a component, but now I have to do a bunch of extra stuff for pooling the spawners and it’s no longer “assign resource, move to position”
So hypothetically if I do move that rotation back into the resource, that fixes it, but now what if I want the spawner to orbit a target node? I’m now basically at where I was before, how many spawners are realistically going to do that? Is that worth putting into the resource? If not alot of spawners are doing it then is it okay to not pool them in that case?
_
This sort of conundrum applies to bullets as well, if not even more so, because you can’t give them unique logic and need to shove it all into a resource if you want to pool them well. Which kind of makes working with it a pain I’d imagine? -
Enemies
You would think this would also be simple, as enemies are glorified bullet spawner holders with health, but surprisingly it’s also not.
Typically enemies don’t just, appear on the screen, they descend, or fly in, from one of the out of bounds regions of the game, do things, and then fly out.
Given how these paths may be curvy, the option is surely to use Path2D, but since that Path2D is baked onto the enemy, it just ends up moving with it. So, I guess you could manually move the path out of the enemy, but even then, how do you work with the path? The enemy needs to stop at some point, what if the enemy moves in other ways? You can’t just travel it along the path the entire time or else it never has a chance to be a threat. But obviously not every enemy just has an “intro path”, stops, attacks, and then uses an “exit path”, some could have mid-stage behaviour like entering on the left side, then going to the right, then going back to the left, and then leaving.
Which sort of leads me to -
Sequencing
Everything above is mostly resolved if I figure out how to make a decent sequencer, which I have honestly no real plans for unlike the other things. My main idea is to just abuse the AnimationPlayer and it’s call method functionality. Which seems fine? But I have no clue how to apply it in the case of an enemy.
Which comes to kind of my main issue in tying everything together
Would the AnimationPlayer be a scene of itself? If I had 2 enemies, with identical stats and bullet spawners, but different paths, having them be different scenes seems kind of wasteful? So then the solution is to give them a AnimationPlayer path scene whenever I create them, which meeeeeeans
In the top level, the stage, there is an AnimationPlayer that controls the stage flow, you can spawn enemies by adding a “call method” key and passing in 4 Objects, the enemy you want to spawn, the path scene that you want the enemy to follow, the bullet the enemy shoots, and the resource for the spawner associated with it.
This is, quite cumbersome I think? Needing to manage arguments in the Key editor isn’t exactly fun.
Is there some obvious thing I’m missing?
I apologize for how long this is, but while I was searching for solutions the only things I could find were ancient unity tutorials, ancient open source projects that hard coded the direction bullets went in (which is fine for a free example!) and pretty much nothing else of note. Seemingly the only thing people have to say on this is to how to optimize bullets, which while fun is not exactly the part I think is particularly hard.
Hopefully by this being rather comprehensive someone in the future will have an easier time than me.
