A long time ago, StarFox sent me an email about something he had done to the ART_CFG.h file by accident. He mis-keyed an entry in this line:
int ST3D_NUM_ZSORT_BUCKETS = 16384;
so it looked like this:
int ST3D_NUM_ZSORT_BUCKETS = 16384000;
What he told me was he noticed an improvement in the performance of his game and wanted to find out if it worked for anyone else as well. I put this change into my game and did notice an improvement. Nothing drastic or life changing, however.
This got me to looking at the ART_CFG.h file in general. It sets the parameters the game engine uses based upon how powerful the computer is which is being used. There are four sets of parameters and they vary widely from each other. The game engine was created about 1998, I am guessing. The devs had no way of knowing how powerful or what type of computer or graphics card was going to be used to play A2, so they had to use a shotgun approach and hope they got it right. But from looking at the coding and the way the file is set up, it seems the file tries to use all four sets of parameters at the same time, regardless of how powerful or wimpy the computer is which is being used. This didn't make any sense to me so I did this:
int GIVE_ALL_MISSIONS = 0; int SCROLL_INTERVAL = 6000; // How long should each line of chat text linger (milliseconds) int DEFAULT_CHAT_TEXT_HEIGHT = 25; // How much space between lines? int ST3D_CHUNK_MANAGER_MAX_CHUNKS = 4500; float ST3D_CHUNK_SIZE_FACTOR = 0.01; float ST3D_CHUNK_LIFETIME_AVG = 8.0; float ST3D_CHUNK_LIFETIME_DEVIATION = 4.0; float ST3D_CHUNK_MAX_ANGULAR_VELOCITY = 1.0; float ST3D_CHUNK_MAX_VELOCITY = 10.0; int ST3D_NUM_ZSORT_BUCKETS = 16384000; int ST3D_SHOW_LIGHT_SOURCE_INFO=0; int ST3D_PRELOAD_TEXTURES = 1; // When should we flush buffers (degrading performance) to work around driver bugs? // 0 = when we don't detect appropriate hardware // 1 = always // 2 = never int cfgST3D_ALWAYS_FLUSH_D3D_BUFFERS = 0; // Starfield parameters #define STARFIELD_GEOMETRY_NAME "mbgpur" #define STARFIELD_ODF_NAME "ststars.odf" // Clipping planes float NEAR_CLIPPING_PLANE = 20.0; // meters from eyepoint. Nominally 1.0 float FAR_CLIPPING_PLANE = 20000.0; // meters from eyepoint. float CINERACTIVE_FAR_CLIPPING_PLANE = 20000.0; // meters from eyepoint. // Object culling distance float cfgOBJECT_CULLING_DISTANCE = 2800.0; // meters from eyepoint. // Clipping planes for the cinematic camera float CINEMATIC_NEAR_CLIPPING_PLANE = 10.0; // meters from eyepoint. Nominally 1.0 float CINEMATIC_FAR_CLIPPING_PLANE = 300.0; // meters from eyepoint. // Special clipping planes for special effects float STAR_FAR_CLIP_PLANE = 80000.0; float GRID_FAR_CLIP_PLANE = 10000.0; float STARFIELD_GEOMETRY_SCALE = STAR_FAR_CLIP_PLANE*0.02; // The max index of each of these star types as taken from the // starfield.spr file plus 1. int cfgSTARFIELD_NUM_BSTAR = 20; int cfgSTARFIELD_NUM_MSTAR = 20; int cfgSTARFIELD_NUM_CSTAR = 20; // // Configuration 4 for a very fast machine // // Configure the main and cinematic views int DETAIL_4_cinematic_show_grid = 0; int DETAIL_4_cinematic_show_background = 1; int DETAIL_4_cinematic_show_stars = 0; int DETAIL_4_cinematic_show_ordnance = 1; int DETAIL_4_main_show_grid = 1; int DETAIL_4_main_show_background = 1; int DETAIL_4_main_show_stars = 1; int DETAIL_4_main_show_ordnance = 1; // Clipping planes float DETAIL_4_NEAR_CLIPPING_PLANE = 5.0; // meters from eyepoint. Nominally 1.0 float DETAIL_4_FAR_CLIPPING_PLANE = 1000.0; // meters from eyepoint. // Clipping planes for the cinematic camera float DETAIL_4_CINEMATIC_NEAR_CLIPPING_PLANE = 10.0; // meters from eyepoint. Nominally 1.0 float DETAIL_4_CINEMATIC_FAR_CLIPPING_PLANE = 300.0; // meters from eyepoint. // Special clipping planes for special effects float DETAIL_4_STAR_FAR_CLIP_PLANE = 80000.0; float DETAIL_4_GRID_FAR_CLIP_PLANE = 10000.0; // Levels of detail based on depth float DETAIL_4_LOD_0_DISTANCE = 700.0; float DETAIL_4_LOD_1_DISTANCE = 300.0; float DETAIL_4_LOD_2_DISTANCE = 150.0; float DETAIL_4_LOD_3_DISTANCE = 75.0; // Starfield object statistics int DETAIL_4_STARFIELD_MIN_STAR_COUNT = 700; int DETAIL_4_STARFIELD_MAX_STAR_COUNT = 1000; float DETAIL_4_STARFIELD_STAR_COUNT_SCALE = 1.0; int DETAIL_4_STARFIELD_BACKGROUND_STAR_COUNT = 750; float DETAIL_4_STARFIELD_BACKGROUND_STAR_MAX_DISTANCE = 20000.0; float DETAIL_4_STARFIELD_BACKGROUND_STAR_DISTANCE_VARIATION = 10000.0; float DETAIL_4_STARFIELD_BACKGROUND_STAR_MAX_SIZE = 75.0; float DETAIL_4_STARFIELD_BACKGROUND_STAR_SIZE_VARIATION = 35.0; int DETAIL_4_STARFIELD_MEDIUM_STAR_COUNT = 10; float DETAIL_4_STARFIELD_MEDIUM_STAR_MAX_DISTANCE = 20000.0; float DETAIL_4_STARFIELD_MEDIUM_STAR_DISTANCE_VARIATION = 6000.0; float DETAIL_4_STARFIELD_MEDIUM_STAR_MAX_SIZE = 400.0; float DETAIL_4_STARFIELD_MEDIUM_STAR_SIZE_VARIATION = 60.0; int DETAIL_4_STARFIELD_CLOSE_STAR_COUNT =3; float DETAIL_4_STARFIELD_CLOSE_STAR_MAX_DISTANCE = 20000.0; float DETAIL_4_STARFIELD_CLOSE_STAR_DISTANCE_VARIATION = 6000.0; float DETAIL_4_STARFIELD_CLOSE_STAR_MAX_SIZE = 1000.0; float DETAIL_4_STARFIELD_CLOSE_STAR_SIZE_VARIATION = 80.0;
I removed the first three sets of parameters from the file to make my laptop use only the last set. I also removed most of the lines which did nothing (comments). These changes have seemed to make a significant difference in the game's performance and appearance for me. I am sharing this with the Community to find out if it is actually true or if I am imagining things again. :p
30th September 2007
Is this the whole file, or only a part of it? If the first is right, then I'll try it right away. By the way, it would be extellent if we could optimize the game engine a bit to the modern computers. Just imagine: 6000 poly models without lag... Nice image from the future :)
AKA Captain Kirk76
16th November 2006
not much difference in normal play, but FPS when hovering above a nebula is slightly better.
Illiterate? I'm FahreS
24th March 2006
I did always think, that the engine is slower than my pc^^ thank you, ill try this later!
The settings may need some tweaking to be fully optimized, I think. Processors and video cards are much better now than in 2001. It may be possible to adjust some things, such as the LOD limits, to get a much better frame rate which is tuned to your specific computer and vid card.
6th February 2005
I'm not sure why, but using those crashes my maybe slightly modded copy. I'll have play and see if I can figure it out, its probably going to be something to do with Midnight as I recall that changes art_cfg.h
But yeah, we really ought to go back over pretty much all of the config files like this and see how and why they are setup, because we can safely assume people have hardware at least ten times more capable than the recommended requirements for the game.
HL2: Leak: Mod Fan/Geek
15th May 2008
Thanks, I may use this for the A2 Enhancement Mod.
a basin of water
12th April 2006
yeah, lets thank starfox for the mistype and thunderfooT for his persistence. but as I use midnight as well (honestly, who doesnt), I will put this one on hold and wait for freyr to have a look into it (or anyone else, maybe yacuzza himself).
I have MU 2.0 installed and have not had a crash as has been described. I have modified the planet, nebula and starfield files however to make midnight a little more friendly to my laptop's vidcard