Comments
Northern Territory, Australialucasc19010 years ago

Since my last post, I looked more into making the FPS limiting more accurate but everything I've tried so far has either used a lot of CPU (I think this issue may be common in frame limiters) or caused the FPS to drop when the game was rendering more things (not enough things to lag the game below what I was limiting to, had I not been limiting it) (I think this issue may also be common in frame limiters). I intend on looking into this more and it may or may not be fixed in the next version. You can work around this by picking a frame rate that 1000 is divisible by (like 50 or 100).

My frame limiter doesn't get rid of any frames. It basically makes it so when the game processes stuff, it waits until a certain amount of time has passed since the last time it processed stuff. It may help with the stuttering to do the waiting in between the game rendering and presenting to the screen instead and I intend the next version to do this. It's difficult for me to test because either I'm not good at noticing it or it doesn't happen as much on my computer for some reason (I usually limit the frame rate to 60 (mainly so my computer doesn't need to work as hard and so its fan doesn't need to come on but also for the physics and other issues) and my screen refresh rate is 59 Hz (I could change it to 60 Hz but it defaulted to 59 Hz and I've had no reason to change it).

I did some tests and didn't notice any major issues when changing the FPS I limit the game to on the fly.

I believe the slow loads (when limiting the frame rate while the game is loading things) are caused by the game's background loading code waiting for the main thread in places it shouldn't (or possibly my hack doing the limiting in a place it shouldn't). There's not much that can be done about this with V-sync since it is usually done by Direct3D (or maybe the graphics card itself) and many games create Direct3D resources on their background loading thread (I believe Grand Theft Auto San Andreas disables V-sync on the loading screen for this reason) but I see no reason why this should happen with other frame limiting. Not limiting the frame rate while the game is on the loading screen (and the license screen as it loads stuff at that point too) works around most of the issue, although the game does load world and other stuff while in game as well (I'm not sure if this is affected by the issue too as if it is, it's a lot less noticeable). Fixing this may be very complicated but I'll probably look into it at some point. Doing the limiting right before the game presents to the screen (like I intend the next version to do) instead of when it processes doesn't seem to help this.

I made a lot of small changes to a lot of things since the previous version; I don't know/remember if any of them could have improved stuttering for some people or not (and I may not have noticed if it did for me).

Yours sincerely, Lucas Cardellini

Northern Territory, Australialucasc19010 years ago

The inaccurate frame rate is due to the fact that the most efficient way I could find to wait until an amount of time has passed on Windows requires an integer number of milliseconds and the amount of milliseconds required to wait between frames to accomplish 60 FPS is somewhere between 16 and 17. I may be able to improve the accuracy of this in the future but I don't want to do so at the cost of efficiency.

I'm not sure about the stuttering, it may have something to do with where in the game's main loop I'm doing the waiting. I would like to fix this but I'm not currently sure how.

The Simpsons Hit & Run on PC (I don't know about the console versions) has no native frame rate (other than the movies/cutscenes as they're pre-rendered Bink videos (possibly created by a third-party company) (renamed to .rmv) created at 30 FPS), it just runs as fast as the user's computer can run it. This wasn't a problem when the game was released as most computers back then couldn't run it with many hundreds to thousands of frames per second as many modern computers can. When the game runs faster, it has to compensate for this by moving things by a proportionately lower amount each frame. When the FPS is high enough, this results in floating point inaccuracy which can cause physics and other issues. Grand Theft Auto III and Vice City can have similar issues if you turn their 30 FPS frame limiter off in the settings (I'm not sure about San Andreas although I believe it's different, possibly for the same reason mine is).

I'm not currently sure if I want to add keys to change the FPS limit while in game. It depends on how many people want the functionality, how well the game handles its FPS changing suddenly by a large amount which I am yet to test and possibly other factors.

My Mod Launcher and all accompanying hacks are closed source and I currently have no intention of making them open source.

Yours sincerely, Lucas Cardellini

About lucasc190
Joined
10 years ago
Online
5 years ago
Runs
0