Fundamental question about how games load assetts

futurefields

Diamond Member
Jun 2, 2012
6,470
32
91
When im playing a game like GTA4 on PC, how are assetts streaming in? I imagine that there is like a radius of X size around the player and basically all stuff within that radius gets pulled in, from the hard drive, and then to the RAM? At which point does Hard Drive speed begin to affect the performance of the game?
 

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76
I suspect its only marginally more complicated but I couldn't say for certain since the games code isn't available.

But its not uncommon to group visibility areas. So from within the area you are in certain other blocks may be visible and loaded, and as you move towards another block being visible invisible ones are unloaded and the soon to be visible ones are loaded. In essence the only real practical difference to having a radius is that the assets are more dependent on what is needed for drawing and what will soon be needed for drawing. A game like GTA4 or WatchDogs is quite wide in its visibility and what is soon to be visible can change quite rapidly as you move around quickly in a car. Maybe outside it is a radius, but I still suspect its by blocks rather than individual assets just to make it quicker to load.
 

JamesV

Platinum Member
Jul 9, 2011
2,002
2
76
What you are talking about, is the level of player-seen-detail.

Turn around quick and cars disappear in GTA that were in the distance last time you looked in that direction. I call this the 'active area'. Has nothing to do with your HDD, or system, but a limitation brought about by the lowest common denominator - consoles.

All game assets are loaded before you actually run around. Textures to interactions, this bubble of action is hardcoded, and there is nothing you can do to increase it, unless you can get your hands on the source code and increase it (pipe dream).

No graphics driver, quad-SLI, or prayers to the video Gods will make any difference. No RPM increase in your HDD, or SSD RAID setups will make any difference.



Game assets are loaded before you play. They are drawn from a pool of memory and pagefile, and are out of your control.
 

PrincessFrosty

Platinum Member
Feb 13, 2008
2,300
68
91
www.frostyhacks.blogspot.com
Most games have some LOD system where models, textures and effects are swapped out for lower quality variants at some given distance until eventually they're removed all together.

The models and textures sit resident in your GPUs video memory, when they're being drawn to the screen that takes GPU cycles to process, when they're removed from the screen they may or may not necessarily be removed from vRAM, usually the game engine has a way of managing what assets are no longer required and can release the memory for use in other things, different engines handle this in subtly different ways.

When assets are required in vRAM but don't exist there then they're usually streamed from the computers virtual memory which is a combination of your RAM and pagefile which is a portion of your disk that acts like RAM albeit very slow. If the assets are not in virtual memory they'll be on the disk and will need to be read.

Generally speaking you should set the games graphics to not exceed the amount of vRAM your video card has which means no loading other than the original map load needs to take place. Some game worlds do stream in objects dynamically to allow for a very large game spaces and how this is managed is really unique to the engine, performance when swapping RAM and vRAM is quite good normally you may get minor frame rate hits and some hitching, but if you need to wait for a hard drive read to fetch the assets then you're going to see full on pauses.