Skip to content

[Core] Assumed Ticks Per Second / Frames Per Second is not unified across all parts of the codebase #997

@FilmBoy84

Description

@FilmBoy84

At present, several areas of the code deviate from the original game in assuming various ticks per second values; often these are tied to erroneous frames per second values

Since the Alpha 0.2 series of OpenApoc versions, the frame rate has been fixed at 60fps as opposed to the original game's assumed 18/36.

However, ticks per second is still all over the place with some parts of the code, for example, weapons ballistics assuming 144TPS on a 144Hz Monitor - this causes very real problems with the ballistics calcs making matching the original game impossible as many values are based on integers which do not permit decimal values

Some time ago tentative discussion was made on discord about fixing this

One idea would be to have the game assume 180 ticks/sec for everything - this is because 18/36/60 based calculations from the original game can be easily adapted into whole number multiplications/divisions when calculating certain game mechanics and we can keep using int instead of float - it's a lot less work to update the codebase and fix any calculations if 180 is the unified value

Though this would present an issue in meeting the 5ms optimisation target on none-desktop hardware

Whilst I'm inclined, given that any mobile forks of OpenApoc would need massive changes to the UI as well as other optimisations, to go "leave it to the mobile devs to sort out" and shift to the ideal of 180TPS. We should probably try not to break compatibility if a "better" solution can be found

The IDEAL solution is for all calculations to be separated from TPS / FPS but this will require quite some work to resolve

Please see discussion on discord for further details:
https://discord.com/channels/142798944970211328/143424162998910976/642830538117349385
https://discord.com/channels/142798944970211328/143424162998910976/702306923894145025

Metadata

Metadata

Assignees

No one assigned

    Labels

    !BUG! MEDIUM PRIORITYA serious issue! Stops game progression or loses data, but no crash. Needs a fix finding ASAP!Code QuerySomething doesn't seem right in the code. It may not be a bug, but it probably needs fixing!Help WantedHelp is required in making this fix/feature complete. If you can code or test, please take a look!Verified / ReplicatedThis issue has been verified or replicated by a developer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions