Lower CPU Patch
Moderator: thunderchero
- Flocke
- BORG Trouble Maker
- Posts: 3246
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
Re: Lower CPU Patch
If there's such a demand for this, at least set it down to <=10ms. (though inaccuracy of the sleep call might limit it to around 15ms minimum)
I've spent quite some time on 3D game programming and I know of juddering/stuttering caused by low fps in games. Commonly 30 fps is sufficient, BUT only if the framerate keeps to be constant each frame and there's no fast movement.
AND a sleep of 20h or 32ms doesn't mean it renders at 1000/32=31.25 fps BUT below of it, cause within sleep duration no computation can be done.
That's also why this actually never has been a BUG. Way back when there's been no alternative to the sleep calls, the only way to garanty good fps but still not block other applications was to use the special sleep(0) call.
That said, I agree with QD that botf is old and you won't get to see stuttering often. Eventually on camera movement or huge fleets with high poly ships in some mods.
And sry I'm not that enthusiastic on this disclosure.
If people find it useful that's great!
Now let me heat my cpu again, it's getting cold.
I've spent quite some time on 3D game programming and I know of juddering/stuttering caused by low fps in games. Commonly 30 fps is sufficient, BUT only if the framerate keeps to be constant each frame and there's no fast movement.
AND a sleep of 20h or 32ms doesn't mean it renders at 1000/32=31.25 fps BUT below of it, cause within sleep duration no computation can be done.
That's also why this actually never has been a BUG. Way back when there's been no alternative to the sleep calls, the only way to garanty good fps but still not block other applications was to use the special sleep(0) call.
That said, I agree with QD that botf is old and you won't get to see stuttering often. Eventually on camera movement or huge fleets with high poly ships in some mods.
And sry I'm not that enthusiastic on this disclosure.
If people find it useful that's great!
Now let me heat my cpu again, it's getting cold.
- QuasarDonkey
- Code Analyst
- Posts: 433
- Joined: Tue Jul 26, 2011 8:29 pm
- Location: Ireland
Re: Lower CPU Patch
Well, you got me Flocke, I may have oversimplified things a little. You're right, you don't get 32 FPS. I hadn't really worked through any calculations, but I just picked values that worked okay for me.
So, if it takes 20 ms to render one frame with sleep(0), that's 1000/20 = 50 FPS. Now if we sleep(30), that means we get 1000/(20+30) = 20 FPS. That's quite a hit.
I just decided to test it, I forgot you could do that in combat. I only get 18-20 FPS with sleep(30). Without patch on the same battle, I get 50 FPS. Of course, if your system is faster than mine, it will be less pronounced. Actually I never really noticed it being choppy Maybe my brain runs faster than a normal huh-mon. Although I see now it is a bit smoother at 50 FPS.
By my calculations it takes 20 ms to do one frame on my system. Since I have a 733 MHz CPU, then logically, since all 3D rendering is done in software, if you have a 2 GHz processor, you should have a framerate of about 150 FPS. In that case, sleep(30 ms) will slow the framerate down to about 30 FPS. That is too much. 16 ms delay or less is acceptable (about 50 FPS on 2 GHz).
I'll edit the main post to recommend 16 ms (10h) maximum, and only for people who really want it. 32 ms sleep is pushing it too far for most users.
I guess we should heed Flocke's advice, and not treat it as a bug, but a feature (i.e. don't put this fix in mods by default). I guess one day, we can solve this to everyone's satisfaction by using a variable time delay based on framerate (or waitable timers ).
I'll see if I can set sleep(0) only for tactical combat, and sleep longer for the GUI screens. I reckon that would solve this.
So, if it takes 20 ms to render one frame with sleep(0), that's 1000/20 = 50 FPS. Now if we sleep(30), that means we get 1000/(20+30) = 20 FPS. That's quite a hit.
I just decided to test it, I forgot you could do that in combat. I only get 18-20 FPS with sleep(30). Without patch on the same battle, I get 50 FPS. Of course, if your system is faster than mine, it will be less pronounced. Actually I never really noticed it being choppy Maybe my brain runs faster than a normal huh-mon. Although I see now it is a bit smoother at 50 FPS.
By my calculations it takes 20 ms to do one frame on my system. Since I have a 733 MHz CPU, then logically, since all 3D rendering is done in software, if you have a 2 GHz processor, you should have a framerate of about 150 FPS. In that case, sleep(30 ms) will slow the framerate down to about 30 FPS. That is too much. 16 ms delay or less is acceptable (about 50 FPS on 2 GHz).
I'll edit the main post to recommend 16 ms (10h) maximum, and only for people who really want it. 32 ms sleep is pushing it too far for most users.
I guess we should heed Flocke's advice, and not treat it as a bug, but a feature (i.e. don't put this fix in mods by default). I guess one day, we can solve this to everyone's satisfaction by using a variable time delay based on framerate (or waitable timers ).
I'll see if I can set sleep(0) only for tactical combat, and sleep longer for the GUI screens. I reckon that would solve this.
- ruthlessferengi
- Multiple Tournament Champion
- Posts: 880
- Joined: Sat Apr 26, 2008 2:00 am
- Location: GMT- 5
Re: Lower CPU Patch
ok, for those hexediting challenged folk, is there an executable dummy proof file there?
Relevance is a post hoc phenomenon
На безптичье и жопа воробей...
Ancient Klingon Battlecry
На безптичье и жопа воробей...
Ancient Klingon Battlecry
- QuasarDonkey
- Code Analyst
- Posts: 433
- Joined: Tue Jul 26, 2011 8:29 pm
- Location: Ireland
Re: Lower CPU Patch
no, unfortunately there's no patching program for this.
- ruthlessferengi
- Multiple Tournament Champion
- Posts: 880
- Joined: Sat Apr 26, 2008 2:00 am
- Location: GMT- 5
Re: Lower CPU Patch
will be?
Relevance is a post hoc phenomenon
На безптичье и жопа воробей...
Ancient Klingon Battlecry
На безптичье и жопа воробей...
Ancient Klingon Battlecry
- QuasarDonkey
- Code Analyst
- Posts: 433
- Joined: Tue Jul 26, 2011 8:29 pm
- Location: Ireland
Re: Lower CPU Patch
If you want, I'll throw something really simple together. You can remind me tomorrow if I forget.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7936
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Lower CPU Patch
You are going to spoil us.....QuasarDonkey wrote:If you want, I'll throw something really simple together. You can remind me tomorrow if I forget.
thunderchero
- Spocks-cuddly-tribble
- Code Master
- Posts: 1928
- Joined: Sun Apr 27, 2008 2:00 am
Re: Lower CPU Patch
Here is a patched multi-installer 1.0.2 exe (default path was C:\games\botf, in case that matters)ruthlessferengi wrote:ok, for those hexediting challenged folk, is there an executable dummy proof file there?
http://www.file-upload.net/download-389 ... k.exe.html
=> 0x115526 10 -> 10 //
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Tethys
- Past Administrator
- Posts: 2404
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: Lower CPU Patch
When QD originally posted those locations it was 0x115526 10 -> 20, since then he has edited it. I believe rather than removing it, he left it since its part of the total code?
-
- BORG Trouble Maker
- Posts: 2323
- Joined: Sat Jan 03, 2009 3:00 am
- Location: the 36th Chamber
Re: Lower CPU Patch
Good guess, now as his old chimney is goneSpocks-cuddly-tribble wrote: Just a shot in the dark, but may be the secret fear behind Flocke's comments is the patch could bring on colds for those BotF players, who're utilising the synergy effect of the CPU bug for home heating in winter^^?
- ruthlessferengi
- Multiple Tournament Champion
- Posts: 880
- Joined: Sat Apr 26, 2008 2:00 am
- Location: GMT- 5
Re: Lower CPU Patch
nice and thanks!
Relevance is a post hoc phenomenon
На безптичье и жопа воробей...
Ancient Klingon Battlecry
На безптичье и жопа воробей...
Ancient Klingon Battlecry