I'm using _physics_process() to check for player input every frame.
if shield <= 0:
One of the keypresses I check for is related to firing weapons.
if not cutscene_started:
I use a timer to flip a boolean that can be used to check if the player is able to fire weapons at the moment or not (the player's delay between shots is measured in milliseconds):
# fire button, isn't during heat sink failure, firerate timer
if Input.is_action_pressed("fire") and fire_conditions():
The problem shows up when I try to play the game at lower framerates (30 fps). I don't actually believe that anyone will be able to play this game at a lower framerate than 60 fps, considering it's rather small, but even then, with this method, the player's firerate cannot exceed maximum fps - you cannot check for player input more than once per frame, which means your firerate caps at 60 bullets per second for 60 fps, 30 bullets per second for 30 fps, etc.
There are a few things I considered in this situation:
- searching up if Godot supports substepping (or something of the sort, the first result redirects me to the Unreal Engine page), but I haven't got any results on that matter (and I don't even know how substepping works, so it could be overkill for this game anyway)
- somehow putting user input (or the bullet creation functions themselves) outside of _(physics)_process, but I'm not exactly sure how, and when I googled the _input function, I learned that _process input is used because it has less latency for stuff like action games
- if none of those are possible, increasing bullet damage to compensate for the fact that firerate is tied to framerate, but that still doesn't help the fact that this game's firing mechanics will run differently at 30 or 15 fps (though reaching such a low framerate would probably mean you shouldn't even be playing this game)
I'm kind of stuck on this one. I would appreciate some help on the matter.