How to have flexible weapon firerate in multiplayer fps game when using client side prediction?
Right now I have a multiplayer fps game with tickrate of 40hz. My inputs are sampled @ 40hz on the client and at the same time physics are simulated (player movement). Client sends a sequence number to the server along with his inputs so any ‘weapon shoot’ commands are tick aligned. Server then processes these inputs so it has authority of player movement, toolbelt and hit detection.
40hz gives the following valid rpm values for weapons:
rpm: 2400
rpm: 1200
rpm: 800
rpm: 600
rpm: 480
rpm: 400
rpm: 343
rpm: 300
rpm: 267
If RPM value would be set to like 850 it would effectively make the rpm to 1200 due to tick alignment.
I have couple of options that come to mind:
1) Using subtick system where there is no fixed/discrete ticks. Client samples inputs at fps (frames per second) and bundles them and sends them via some tickrate. But this has an issue, what if the client is running at 300 FPS or even more? It would increase the number of inputs sent to the server and put more stress on the server so the sampling would need to be clamped to e.g. 120hz but it has the same issue (=weapon firerates are tick aligned)
2) Use variable tick where there is range of min/max sampling tickrates (e.g. [40hz, 120hz]) and discrete ticks. This allows for setting the firerate more accurately. These would be the valid firerate values:
rpm: 7200
rpm: 3600
rpm: 2400
rpm: 1800
rpm: 1440
rpm: 1200
rpm: 1029
rpm: 900
rpm: 800
rpm: 720
rpm: 655
rpm: 600
rpm: 554
(for example, you get values 1440 and 1800 between 1200 and 2400)
I have searched far and wide information about this with no success.