UnofficialCrusaderPatch / UnofficialCrusaderPatch3

Development for the dll Injection approach
GNU General Public License v3.0
11 stars 2 forks source link

[MODULES/3.1.0] Introduce a higher time resolution for certain game parts #32

Open TheRedDaemon opened 2 years ago

TheRedDaemon commented 2 years ago

SHC uses timeGetTime to receive its timing values. Despite SHC calling timeBeginPeriod and timeEndPeriod, the highest resolution it can achieve are milliseconds, due to this being the restriction of timeGetTime. While this is fine for a lot of places that deal with aesthetics like sound or videos, it may cause problems or create restrictions on certain functional game parts. At least the current scrolling may suffer partially from this, since due to its computation it can only really deal with framerate values of 1000/timeInMs, which leads to frame numbers like 250, 333, 500 and 1000 without numbers between at certain loop speeds Additionally, it might restrict us in certain places like the game loop speed.

The idea is to search for critical positions and try to implement the usage of a higher time resolution there.

At the moment, it seems like generally replacing timeGetTime with something that, for example, returns nanoseconds, will create avoidable problems. As a result, the focus should, at least at first, be on identifying and changing certain important functional parts.