PreCache.con
PreCache.con
What is "PreCache.con? What is and how it can be used?
- Apache Thunder
- Posts: 1210
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: PreCache.con
For me the quickest way to make one of these is to run your map with the debugger, then use the console command "game.writePrecache" to write a Precache.con file at the game's root folder. You can then copy this file to your map.
The command is exactly as follows:
There are no settings for this command, thus do not place a "1" or anything else at the end of it. Doing so will result in the console rejecting the command.
The command is exactly as follows:
Code: Select all
game.writePrecache
I have cameras in your head!
Re: PreCache.con
But what is the real objetive or reason to have Precache.con on some maps?
At what time will be necessary to create a file "Precache.con?
At what time will be necessary to create a file "Precache.con?
- Apache Thunder
- Posts: 1210
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: PreCache.con
Generally I don't really notice a difference between not having one and having one. I guess it would have some effect on slower machines. But my machine is a beast and so it is impossible for me to tell the difference.
I assume Precache was meant to cut down on lag associated with loading object meshes and such midgame (judging from the debugger logs the game always loads ALL the game coding at map load, so it doesn't cache object coding as far as I can tell). So things like meshes and textures are cached faster via the Precache so it doesn't have to load them ingame when the object spawns. But machines these days are easily able to do this on demand and the Precache doesn't do much now.
I assume Precache was meant to cut down on lag associated with loading object meshes and such midgame (judging from the debugger logs the game always loads ALL the game coding at map load, so it doesn't cache object coding as far as I can tell). So things like meshes and textures are cached faster via the Precache so it doesn't have to load them ingame when the object spawns. But machines these days are easily able to do this on demand and the Precache doesn't do much now.
I have cameras in your head!
Re: PreCache.con
You got it right.
The files defined in the PreCache.con are loaded to RAM during map load. This means that they are already "available" for the engine once they have to be rendered when they enter the players visual range. If they weren't precached, they would be loaded only once they appear in your field of view. Back in the old days when BF42 was brand new on the shelf this could cause tiny lag issues on some machines (Those computers that were pure crap even then, and are considered medieval today). Even the worst of worst currently existing hardware sets don't benefit from the Precache.con anymore, so it's completely safe to just ignore it in about EVERY case.
When I created the vehicle test maps for BG42 I tested the Precache.con, because those maps had an extreme number of unique and complex vehicles on it (test map, eh...). Without Precache, I got a slight (like a splitsecond) lag the first time I put the full ground vehicle park in view. Which are several hundred unique meshes and textures in BG42.
When I did the same WITH a Precache.con, this teeny tiny lag was gone. So unless you intend to swarm a kingsize-map with gargantuan loads of vehicles, you are safe without Precache.
The files defined in the PreCache.con are loaded to RAM during map load. This means that they are already "available" for the engine once they have to be rendered when they enter the players visual range. If they weren't precached, they would be loaded only once they appear in your field of view. Back in the old days when BF42 was brand new on the shelf this could cause tiny lag issues on some machines (Those computers that were pure crap even then, and are considered medieval today). Even the worst of worst currently existing hardware sets don't benefit from the Precache.con anymore, so it's completely safe to just ignore it in about EVERY case.
When I created the vehicle test maps for BG42 I tested the Precache.con, because those maps had an extreme number of unique and complex vehicles on it (test map, eh...). Without Precache, I got a slight (like a splitsecond) lag the first time I put the full ground vehicle park in view. Which are several hundred unique meshes and textures in BG42.
When I did the same WITH a Precache.con, this teeny tiny lag was gone. So unless you intend to swarm a kingsize-map with gargantuan loads of vehicles, you are safe without Precache.
it was a bit annoying when your screen froze and started to lag when you met a enemy vehicle that wasnt in the memory yes.Senshi wrote: Back in the old days when BF42 was brand new on the shelf this could cause tiny lag issues on some machines
especially Desert Combat took (on that time) a lot more resources of your computer
Re: PreCache.con
I still have this on certain BG42 maps when they forgot to put some vehicles in the Precache.con. You'd take a flag and suddenly your screen stands still for a second or two, because several vehicle types spawn for the first time and need to be loaded from HDD first.