Page 1 of 1

FPS question

Posted: Sat Feb 07, 2009 3:03 pm
by Aprop
Are there any difference in fps in map compiled with "vis - fast" and "vis - final" or "light - fast" and "ligfht - final"?

Posted: Tue Feb 10, 2009 2:37 pm
by Rookie One.pl
Light - no. It only affects the visual quality of the map, but not the FPS.

Vis - yes. The vis compile generates a binary tree that the game uses to determine which parts of the map are currently visible to the player (e.g. if you stand inside a room, there's no need to draw the outside of the buildingS). Fast vis practically disables the generation of that tree, resulting in the game drawing the entire map at all times, even if some parts are not visible and shouldn't be drawn. And the fewer things the game has to draw, the better the FPS is.

Final vis compile, on the other hand, enables extra precision in the process of generation of the visibility tree, which, although takes more compile time, may result in improved game performance in the map.

Note that there is also a medium precision level for the vis compile which is enabled by default if you specify neither -fast nor -final in the command line.

In general, -fast compiles are recommended for in-production map builds, while -final ones are supposed to be used for, well, the final map version that is to be released to the public.

Posted: Tue Feb 10, 2009 9:49 pm
by Aprop
Thank you... another question, do hided entities affect FPS?
Hided mean:
$entity hide

I ask because Im planning to put a lot of grass on map, with script that draw grass when player is near it... (if player is too far from grass, $grass hide)

Posted: Tue Feb 10, 2009 10:42 pm
by Rookie One.pl
Hidden entity -> entity isn't drawn -> better FPS.

However, such a script is only going to be useful in single player. The hide command hides an entity from everyone in the server.

Posted: Wed Feb 11, 2009 8:27 am
by Aprop

Code: Select all

while (1)
{
for (local.g=1;localg<=$grass.size;local.g++)
{
local.grass = $grass[local.g]

for (local.p=1;local.p<=$player.size;local.p++)
{
local.player = $player[local.p]
//need to find only one nearest
if (local.grass.foundplayer != 1)
{
if (vector_within local.grass.origin local.player.origin level.drawdistance)
{
local.grass show
local.grass.foundplayer = 1
}
}
}
//if there is no players...
if (local.grass.foundplayer != 1)
{
local.grass hide
}
//reset the foundplayer state so grass keep looking for near player every.. frame?
local.grass.foundplayer = 0 //not 1
}
wait 1 
//or frame? fast loops can slow down fps?
}
Should it work?

It show grass only near players, grass far from all players iss hided.....

Posted: Wed Feb 11, 2009 2:46 pm
by Rookie One.pl
Well, that should work. :) It's not a very ellegant solution, but then there's nothing better available.

You can safely use a waitframe there, this loop is not very complex and will have almost no impact on performance.