• Shoutbox
    Active Users: 0
  • Notice: N/A
  • Active Users
  • There are currently no users chatting.
Results 1 to 5 of 5
  1. #1

    proper precache problems

    G'day folks,
    Yesterday I wrote a precache script for mohdm4 (a.k.a. "Crossroads", "The Bridge").
    I was mainly concerned with the sandbags on the bridge, within two or three paces the sandbag textures change 3 times.

    This happens a lot with certain models in the game, even on the default maps. But apparently not on all PC systems or at least not noticed by all players.

    I thought to use the compile log file to list all of the map models for me. However both the compile log file and the Radiant menu are full of you know what.

    Radiant menu:
    suggesting the tik file path is located at "static/obstacle/" or at least the model's respective skc and skd files, however no such path exists in the pak0.pk3

    Compile log: "static//sandbag_link_main.tik"
    which omits the file name from the precache due to the double "//" used as notation marks.
    So I tried removing one "/" however that still caused all of the models in the map to be invisible.
    The sandbags were still a physical obstruction, preventing the player from walking where they are positioned but without any visual indication that they existed at all.

    The actual tik file is in "models/static/" and the respective skc & skd files are in "models/static/sandbags/".

    The opposite happens with the light bulbs & light shades.

    Radiant menu: "static/lamp/"

    Compile log: "static/lights/"
    but no such path exists in the models folder of the pak0.pk3
    All of the light models tik files are simply in "models/static/" and their respective skc & skd files are located in "models/static/lamp/".

    So what's the best way to write a precache file for your map?
    Is there a correct list of model precache references or a precache tutorial available for download?

    If you leave it up to the "qconsole.log" it wants reference made to crap that your map doesn't even have and it doesn't ask you to reference what your map does have.

    "Add the following line to the *_precache.scr map script:

    cache models/fx/barrel_oil_leak_big.tik"
    "Add the following line to the *_precache.scr map script:
    cache models/fx/barrel_oil_leak_medium.tik"
    "Add the following line to the *_precache.scr map script:
    cache models/fx/barrel_oil_leak_small.tik"
    "Add the following line to the *_precache.scr map script:
    cache models/fx/barrel_oil_leak_splat.tik"

    There aren't any oil barrels in the freakin' map. In fact there are no barrels in mohdm4 at all but it asks the same for all barrel types.
    So yeah, I trust the qconsole.log. NOT

    I'm sure most user-made precache files have no impact on the game whatsoever due to the misleading BS and tik path inconsistencies.
    But they are supposed to preload the required model and it's correct texture before / while the map loads.

    I was actually hoping to write a small program that would read your map file, list all models used and create the precache script for you. Sounds simple enough to do, but I can't find any consistency with them.
    Last edited by AccadaccA; 04-28-2019 at 11:09 PM.

  2. #2
    I've just used the console log in the past.

    I think some assets are asked to be precached no matter what. Whether it's to do with how the tiki is constructed, or what is in them (e.g. anim definitions), or the engine is hard-coded to cache certain files, I don't know.

    I just cache them as it asks. The usual suspects inside fx folder are:

    cache models/fx/bh_paper_lite.tik
    cache models/fx/bh_paper_hard.tik
    cache models/fx/bh_wood_lite.tik
    cache models/fx/bh_wood_hard.tik
    cache models/fx/bh_metal_lite.tik
    cache models/fx/bh_metal_hard.tik
    cache models/fx/bh_stone_lite.tik
    cache models/fx/bh_stone_hard.tik
    cache models/fx/bh_dirt_lite.tik
    cache models/fx/bh_dirt_hard.tik
    cache models/fx/bh_grass_lite.tik
    cache models/fx/bh_grass_hard.tik
    cache models/fx/bh_mud_lite.tik
    cache models/fx/bh_mud_hard.tik
    cache models/fx/bh_water_lite.tik
    cache models/fx/bh_water_hard.tik
    cache models/fx/bh_glass_lite.tik
    cache models/fx/bh_glass_hard.tik
    cache models/fx/bh_sand_lite.tik
    cache models/fx/bh_sand_hard.tik
    cache models/fx/bh_foliage_lite.tik
    cache models/fx/bh_foliage_hard.tik
    cache models/fx/bh_snow_lite.tik
    cache models/fx/bh_snow_hard.tik
    cache models/fx/bh_carpet_lite.tik
    cache models/fx/bh_carpet_hard.tik
    cache models/fx/bh_human_uniform_lite.tik
    cache models/fx/bh_human_uniform_hard.tik
    cache models/fx/water_trail_bubble.tik
    cache models/fx/grenexp_base.tik
    cache models/fx/bazookaexp_base.tik
    cache models/fx/grenexp_paper.tik
    cache models/fx/grenexp_wood.tik
    cache models/fx/grenexp_metal.tik
    cache models/fx/grenexp_stone.tik
    cache models/fx/grenexp_dirt.tik
    cache models/fx/grenexp_grass.tik
    cache models/fx/grenexp_mud.tik
    cache models/fx/grenexp_water.tik
    cache models/fx/grenexp_gravel.tik
    cache models/fx/grenexp_sand.tik
    cache models/fx/grenexp_foliage.tik
    cache models/fx/grenexp_snow.tik
    cache models/fx/grenexp_carpet.tik
    cache models/fx/water_ripple_still.tik
    cache models/fx/water_ripple_moving.tik
    cache models/fx/barrel_oil_leak_big.tik
    cache models/fx/barrel_oil_leak_medium.tik
    cache models/fx/barrel_oil_leak_small.tik
    cache models/fx/barrel_oil_leak_splat.tik
    cache models/fx/barrel_water_leak_big.tik
    cache models/fx/barrel_water_leak_medium.tik
    cache models/fx/barrel_water_leak_small.tik
    cache models/fx/barrel_water_leak_splat.tik
    cache models/fx/barrel_gas_destroyed.tik
    cache models/fx/fs_light_dust.tik
    cache models/fx/fs_heavy_dust.tik
    cache models/fx/fs_dirt.tik
    cache models/fx/fs_grass.tik
    cache models/fx/fs_mud.tik
    cache models/fx/fs_puddle.tik
    cache models/fx/fs_sand.tik
    cache models/fx/fs_snow.tik
    As with static models like sandbags, they are never asked to precache AFAIK, even the original devs never bothered. I think it may be due to the fact they are part of the $world entity (done at compile), do not have animations, and are 'baked' into the map (thus not being 'true' entities in the Quake sense). I think the precache system is only used to cache tiki animations. I'm not certain of this, but looking at the source code and the type of files it asks to precache, this is what it leads me to think.

    If you are interested, here is the source code:
    dtikianim_t *TIKI_RegisterTikiAnimFlags( const char *path, qboolean use )
    	dtikianim_t *tiki;
    	char filename[ 1024 ];
    	strcpy( filename, path );
    	FS_CanonicalFilename( filename );
    	if( tikianimcache )
    		dtikianim_t **t;
    		t = tikianimcache->find( filename );
    		if( t ) {
    			return *t;
    		tikianimcache = new con_map < pchar, dtikianim_t * > ;
    	tiki = TIKI_LoadTikiAnim( filename );
    	if( tiki )
    		if( use )
    			Com_Printf( "^~^~^ Add the following line to the *_precache.scr map script:\n" );
    			Com_Printf( "cache %s\n", filename );
    		( *tikianimcache )[ tiki->name ] = tiki;
    	return tiki;
    The flicker and change in appearance of static models is likely due to the LOD system. You can change your LOD settings in-game which is why it may be different from person to person. For example, r_uselod 0 in console will stop LOD altogether. Most models come with a .lod file that is used by the rendering engine to determine the number of polys to show at a certain distance. The game even comes with a tool menu to generate these files. I've use it to fix LOD issues with the oil lamp, for instance, because the model never came with a .lod file and as such is culled after a few feet by the rendering engine.
    Last edited by 1337Smithy; 09-17-2019 at 09:18 AM.

  3. #3
    Thanks mate.

    Sorry for not returning sooner, I got dragged into playing Ark with the mob I played Sea of Thieves with. lol
    That meant changing to Win 10 because the game was the cross-play version.

  4. #4
    Hey, nice to see you back!

  5. #5
    Cheers mate.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts