Page 1 of 2

View distance

Posted: Mon May 03, 2010 7:56 pm
by Matchy
I want an object or effect to only show up when you get really close to it.
To stop any lag it creates when not in use.
any one know the view distance line ? lol i'm such a noob XD

Re: View distance

Posted: Mon May 03, 2010 8:32 pm
by motoko
Matchy wrote:I want an object or effect to only show up when you get really close to it.
To stop any lag it creates when not in use.
any one know the view distance line ? lol i'm such a noob XD

Code: Select all

Game.setViewDistance 550
in the init.con, maybe?

Re: View distance

Posted: Mon May 03, 2010 8:44 pm
by Poow
You can set this by changing the level of detail settings. In the Geometries.con of each model.

Crane1:
GeometryTemplate.create StandardMesh crane1_m1
GeometryTemplate.file crane1_m1
GeometryTemplate.setLodDistance 0 0 ->LOD 1
GeometryTemplate.setLodDistance 1 15 ->LOD 2 Distance 15
GeometryTemplate.setLodDistance 2 35 ->LOD 3
GeometryTemplate.setLodDistance 3 60 ->LOD 4
GeometryTemplate.setLodDistance 4 100 ->LOD 5
GeometryTemplate.setLodDistance 5 300 ->LOD 6 Distance 300
LOD means Level Of Detail

Just go into bf and look at a model and move back and come closer again. You will see how it change his shape.
Every "higher" LOD is a model with a lower resolution. Because a model doesn't need to look quite good if its 2 pixel big at the horizon. You don't even care about it. But your GPU does ;)

If you did everything correctly, your model should have these LODs.
Image

Re: View distance

Posted: Tue May 04, 2010 11:45 am
by Matchy
thank you mates :)

Re: View distance

Posted: Fri Apr 06, 2012 8:24 pm
by BF-Gamer
I tried this, but it didn't work for me.

I Increased the LODs in the Geometries.con of every Sea Vehicle (objects/vehicles/sea/XYZ/Geometries.con) and the Flags (objects/items/Flag/Geometries.con) around the double value and tested it on the maps "Midway" (American aircraft carrier, seen from the airfield) and "Eagles Nest" (German flag at the middle of the map, seen from the German headquarter).
Both times the same result, it doesn't matter if I use my modified Geometries.con's or the original ones: I can see the objects (Flag and aircraft carrier) only when I zoom the weapon or go a few steps closer to the object.

I have to say, that I modded all my maps to higher view distances and less fog (around 10 times higher than the original ones).
Foresight is great now, but objects are popping up now. Now I want to increase the view distance/LOD of every object.

What did I wrong?

Re: View distance

Posted: Tue Apr 17, 2012 3:43 am
by Swaffy
Blue: LOD number (0 is highest detail, 5 is lowest detail)
Red: Distance

If you want objects to be seen from far away:

GeometryTemplate.create StandardMesh crane1_m1
GeometryTemplate.file crane1_m1
GeometryTemplate.setLodDistance 0 0
GeometryTemplate.setLodDistance 1 50
GeometryTemplate.setLodDistance 2 100
GeometryTemplate.setLodDistance 3 200
GeometryTemplate.setLodDistance 4 300
GeometryTemplate.setLodDistance 5 500


If you want objects to be seen only from close distances:

GeometryTemplate.create StandardMesh crane1_m1
GeometryTemplate.file crane1_m1
GeometryTemplate.setLodDistance 0 0
GeometryTemplate.setLodDistance 1 5
GeometryTemplate.setLodDistance 2 10
GeometryTemplate.setLodDistance 3 15
GeometryTemplate.setLodDistance 4 20
GeometryTemplate.setLodDistance 5 25

Re: View distance

Posted: Tue Apr 17, 2012 10:06 am
by BF-Gamer
I doubled all the red numbers of every geometries.con in Vehicles\Sea\XYZ.

E.g.:

GeometryTemplate.create StandardMesh PTRaft_Hull_M1
GeometryTemplate.file PT_Raft_M1
GeometryTemplate.setLodDistance 0 0
GeometryTemplate.setLodDistance 1 50
GeometryTemplate.setLodDistance 2 100
GeometryTemplate.setLodDistance 3 200
GeometryTemplate.setLodDistance 4 400
GeometryTemplate.setLodDistance 5 800

to

GeometryTemplate.create StandardMesh PTRaft_Hull_M1
GeometryTemplate.file PT_Raft_M1
GeometryTemplate.setLodDistance 0 0
GeometryTemplate.setLodDistance 1 100
GeometryTemplate.setLodDistance 2 200
GeometryTemplate.setLodDistance 3 400
GeometryTemplate.setLodDistance 4 800
GeometryTemplate.setLodDistance 5 1600


But on Midway, all sea vehicles like rafts and carriers have exact the same view distance as before.
Same problem with the German flags in Eagles Nest.

Posted: Tue Apr 17, 2012 1:02 pm
by freddy

Code: Select all

ObjectTemplate.active Enterprise
objectTemplate.cullRadiusScale 5 
http://bfmods.com/mdt/scripting/ObjectT ... Scale.html

Re: View distance

Posted: Tue Apr 17, 2012 2:15 pm
by BF-Gamer
Thanks for that hint! But where can I find these two lines? Searched in the Midway.rfa-Files and in the Objects.rfa-Files.
Or do I have to add them manually? When yes, where?

I found it in the Kursk.rfa, but the values are already "5".

Posted: Tue Apr 17, 2012 7:09 pm
by freddy
some vehicles already have that line in the object.con file and some like the carrier doesn´t. you can add the code pretty much anywhere but if its just for one map it may be easiest to add it to ObjectSpawnTemplates.con