FPS question

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

FPS question

Post by Aprop »

Are there any difference in fps in map compiled with "vis - fast" and "vis - final" or "light - fast" and "ligfht - final"?
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

Post 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)
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

Post 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.....
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply