How to make Cortex Command lag less. [V1.2.2]
This one should be especially helpful to those of you with shitty computers.
Please read the tutorial in its entirety before posting or attempting anything. NOTE FOR VISTA USERSNone of this will work most of the time if your CC is located in "C:\Program Files\" due to Vista's system folder virtualisation. Just move it to your desktop or documents or whatever.
A QUICK GROUNDING IN CC PATHSPlease pick the path relevant to your Operating System:
WINDOWS: C:\Program Files\Data Realms\Cortex Command\
MAC: <Application>/Resources/
This directory will be referred to as the "CC directory" herein, and all paths listed are relative to this path.
For example, "Base.rte" on Windows refers to "C:\Program Files\Data Realms\Cortex Command\Base.rte\"
Please note: forward slashes are used in all paths for cross platform compatibility.
TURNING ON PERFORMANCE DISPLAYA little-known command that is a lot of help in getting CC working: Ctrl+P
This should bring up a performance display dialogue, which will allow you to check out how your game is running, and if you need to fiddle with anything. Basically, we need to get TimeScale reading 1.00x at all times to have a smoothly running game. Make sure the bottom of the dialogue reads "ONE SIM UPDATE PER FRAME!"; it's important for this tutorial.
If it isn't there, hit Ctrl+O.
GLOSSARYCC - Cortex Command.
TimeScaling - Having ONE SIM UPDATE PER FRAME mode on.
Full Speed - having a timescale of 1.00x while playing with TimeScaling.
Sim Frames Per Second - 1/DeltaTime
Welcome.For this tutorial, we are going to be manipulating the humble Base.rte/Settings.ini - before we go any further,
please back up this file.Open Base.rte/Settings.ini now.
DELTATIME FIDDLINGDeltaTime is the amount of time taken to render each
simulation frame (not graphical frame), in seconds. A DeltaTime of 0.5 means there will be 2 frames per second.
DeltaTime is the most important variable in relation to lag. By default it should be set to 0.0166667. In other words, Cortex Command is set to run at ~60 FPS by default.
If you experience constant lag, your computer is quite likely not powerful enough to play CC at such a high framerate (it could also be that CC inexplicably doesn't like your computer, which seems to be a common issue).
"But", I hear you asking, "if my computer's hardware is the problem, how can I make it run any faster?". We make the game run faster by making it simulate less frames per second. Each simulated frame means a
lot of calculations, so cutting down the number of frames cuts down the amount of work your processor has to do.
If CC is running slowly, try the following values until you can run Zombie Cave or Prom Grounds (or any other small map) at full speed (or until you're happy enough with performance):
Code:
DeltaTime = 0.0181818 // 55 FPS - No real change
DeltaTime = 0.02 // 50 FPS
DeltaTime = 0.0222222 // 45 FPS - Mildly Choppy
DeltaTime = 0.025 // 40 FPS
DeltaTime = 0.0285714 // 35 FPS - Getting bad
DeltaTime = 0.0333333 // 30 FPS - Minimum tolerable
DeltaTime = 0.05 // 20 FPS - My PIII can run CC too, guise!
Pros Of DeltaTime Fiddling:- It takes a lot of strain off your CPU, and reduces lag effectively.
- Its not hard to make custom values (open calculator, 1/<number of frames per second>)
- Can be used to put CC into "Beautiful Mode" on beastly computers (0.006667 - ~150 fps)
- It allows you to use TimeScaling at the same time.
Cons Of DeltaTime Fiddling:- Everything starts to gib more easily the faster everything gets. At lower deltatimes, this means everything explodes without reason.
- AirResistance and similar things are softened the higher the deltatime goes, as they are calculated per physics frame (which is a stupid thing to do, and Dan should be told off for it).
- Terrain-Rape gets bad after a while, because everything moves further per frame.
As a bonus, if you make the game do
more frames per second, the game looks amazing.
Code:
DeltaTime = 0.005 // 200 SFPS - "Pretty" mode (try this on high-end computers only!)
SHRINKING YOUR RESOLUTION WHILE RETAINING PLAYABILITYThis one can help quite a bit on low end machines. See these two variables?
Code:
ResolutionX = 640
ResolutionY = 480
Fairly self-explanatory, yes? we're going to reduce these. pick any two numbers that will still fit in your resolution when multiplied by two. for example, if your native resolution is 600x800, 300 and 400 are your maximums. Once you have inputted your numbers, test to see if CC will still run (MAKE SURE IT IS RUNNING IN WINDOWED MODE!), if not, pick some new numbers.
Code:
Sure to work presets, in X : Y format,
320 : 240
400 : 300
If it does work, quit out of the program (you dont need to wait for it to load), and set the following line:
This will make your window twice as large without doing extra work, which will allow you to play in a non-tiny window with less laggy CC.
Pros Of Resolution Fiddling:- No Physics Alteration.
- Shows CC from a whole new perspective.
- Considerable performance boost on older computers.
Cons Of Resolution Fiddling:- Unsuitable for Multiplayer.
- Makes the menu misbehave.
TIMESCALING OFFThis method of reducing lag is for those who dont mind an inconsistent frame rate.
Basically, when you're playing, if you notice the game slowing down and the noises sounding weird, hit Ctrl+O. You should notice the game jumping about a bit in action-packed scenes, but CC should run quite a bit visually faster. Consider turning up your DeltaTime aswell to improve consistency.
Pros Of Turning TimeScaling off:- Really fast and easy to do, and easily reversible.
- No .ini fiddling!
- No Physics alteration - things should still respond as normal.
Cons Of Turning TimeScaling off:- Makes the game inconsistent.
- Doesn't do much to how much maths your CC is doing.
Personally I hate this solution, but it makes some people happy, so at least give it a go.
UPDATING YOUR DRIVERSupdating your drivers can significantly increase performance, especially for those of you with multi-core processors (due to timing issues with CC and older drivers). however, doing it wrong can seriously ♥♥♥♥ up your computer.
If you're still keen and know what you're doing with a computer, go to either:
here (Intel) or
here (AMD)NO RESPONSIBILITY WILL BE TAKEN FOR YOU ♥♥♥♥ UP YOUR COMPUTER!MINOR TWEAKSThe Following Tweaks will give less noticeable performance boosts, but feel free to try them out.Turn glows off. This is done with the following lines of code (found in Base.rte/Settings.ini again)
Set MaxUnheldDevices to a lower number, or 0 to prevent devices from sticking around after you drop them.
This will prevent heaps of devices (25) from laying about on the map, and should speed things up a little bit on larger maps, and death mode. It's a very minor tweak but can net you an extra half frame per second on a bad day.
FOOD FOR THOUGHT
All of the Non-Boolean variables described above can also be tweaked in the opposite direction.
This means that you can turn the Simulation Quality up by lowering the DeltaTime variable, make it so devices can always be picked by setting MaxUnheldDevices to 5000, and (extending our reach to some other variables) tweak the console size (ConsoleScreenRatio), skip straight into the game (PlayIntro), or even prevent MOs from settling (EnableParticleSettling). Hopefully, most of these will be put into a settings dialogue in future builds, to allow people to tweak these things without poking around in settings files.That's it for now!
Hopefully, this will help some people enjoy Cortex Command in a more responsive environment.
EndNotes:
I'll expand this more later, i mainly just wanted to stop having to write out the DeltaTime thing over and over again. Feel free to comment, and if you have any other personal ways of reducing lag, PM them to me in a format similar to the one present in this post and i'll edit them into the OP, and include credit and whatnot. I'm especially interested in known Minor Tweaks currently.
3/12/10: Spelling and a few structure changes V1.2.2
29/08/09: Deltatime effect clarification. V1.2.1 (minor edit)
Also, added something for vista users
02/07/09: Driver Details. V1.2
13/05/09: Added resolutions and two minor tweaks, and food for thought. V1.1
Dates are in DD/MM/YY