[A14] [CCL] DevSpeedEnabler

Started by lost_RD, July 21, 2016, 09:24:39 AM

Previous topic - Next topic

lost_RD

Requires CCL

Latest update: July 21 2016 | Download

If the hidden fourth speed mode "dev speed" is the only tool from dev mode that you use, this mod is for you. It enables dev speed outside of dev mode.

123nick

Quote from: lost_RD on July 21, 2016, 09:24:39 AM
Requires CCL

Latest update: July 21 2016 | Download

If the hidden fourth speed mode "dev speed" is the only tool from dev mode that you use, this mod is for you. It enables dev speed outside of dev mode.

any reason why it is hidden?

kinebudking

Quote from: 123nick on July 21, 2016, 10:34:46 AM
Quote from: lost_RD on July 21, 2016, 09:24:39 AM
Requires CCL

Latest update: July 21 2016 | Download

If the hidden fourth speed mode "dev speed" is the only tool from dev mode that you use, this mod is for you. It enables dev speed outside of dev mode.

any reason why it is hidden?
it eats fps with large maps and decent compounds.

Jakub k.

its only for debug,so normal gameplay would be less exciting with it

Mrshilka

Great mod, I always have Dev mode on so I can play at speed 4.
Now no need to scrambled text and crazy errors while I get my speed fix.

lost_RD

Quote from: kinebudking on July 21, 2016, 10:36:26 AM
Quote from: 123nick on July 21, 2016, 10:34:46 AM
Quote from: lost_RD on July 21, 2016, 09:24:39 AM
Requires CCL

Latest update: July 21 2016 | Download

If the hidden fourth speed mode "dev speed" is the only tool from dev mode that you use, this mod is for you. It enables dev speed outside of dev mode.

any reason why it is hidden?
it eats fps with large maps and decent compounds.

The following may not be 100% correct but it should explain why dev speed is not enabled by default. It assumes that the video rendering is capped at 60 frames per second.

At normal speed, the game tries to do 60 ticks per second. If a tick takes a millisecond (henceforth referred to as ms) and the game is aiming for 60 ticks per second then only 60ms of each 1000 are spent doing ticks. Rending a frame of video might take 3ms (because rendering images takes longer than doing game logic) so at 60 frames per second that's 180ms more for a total of 240 out of 1000ms doing things and 760ms resting. 240 is roughly a quarter of 1000 so the game does a game tick then renders a frame which takes a total of 4ms (1+3) then it rests for 12ms , repeating this cycle over and over.

The max speed without dev speed is called superfast and it tries to do 6 times as many ticks per second. If ticking takes a millisecond then 360 of every 1000ms will be spent ticking and at 60 frames per second there are an extra 180 ticks spent rendering. No problems here, we're only using 540 of our 1000ms. The loop is 6ms ticking, 3ms rendering then 8ms resting.

Dev speed is called ultrafast in the code and the speed multiplier is 15. At a millisecond per tick, the game is spending 900 of 1000ms ticking and once you add another 60 frames of video rendering we're actually above the 1000ms we get each second. The way the game handles this is by rendering less video frames. Since 900ms is used there are only 100ms remaining to render video and since each frame of video takes 3ms, only 33 frames can be rendered each second. A drop from 60fps to 33fps is very noticeable.

Now imagine you're using a low-end computer and a tick takes 2ms and a video frame takes 5ms. At normal speed the loop takes 420ms but at superfast the loop takes 720+300=1020ms which means already you've lost framerate, down to 54fps which is not the end of the world. This computer can't handle dev speed at all because the game ticks take 1800ms of every 1000ms - uh oh, this is impossible. A game can handle this situation using some rules about whether to prioritise keeping the game speed high or the framerate high and my experience is that RimWorld seems to prefer keeping the game speed high at expense of the framerate. Disclaimer though, I haven't played RimWorld on a proper low end machine, just a mid-end laptop that suffers a noticeable drop in fps with dev speed and sometimes even with superfast speed.

1000101

Regarding lost_rd's wall of text:

He's basically correct (ignore the actual numbers, they are just for illustration).  I do most of my RW dev on my laptop (1.66GHz Core2Duo w/Intel GM945 graphics) which is a very low spec machine simply to make sure that "if my code is reasonably performant on this potato then it will be excellent on my gaming desktop".  Even in 2x mode the game can get "choppy" on my laptop.

Long story short, the dev mode speed "ultra fast" is intended simply for making sure things work at the expense of graphics quality (FPS).  While it can be used to play at that speed, most people would not suffer the FPS loss.

No harm in using it but your mileage may vary.


Regarding the mod itself..

Good job unlocking this, for people using cheetahs with a rocket up it's butt, this will be grape!
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

lost_RD

I do have a rocket with a cheetah up its butt but it's in the shop at the moment (doesn't boot) and by in the shop I mean in pieces on my desk  :'(

But yeah, what E said.