Huge map, looks bad far away when engine removes parts of map and skybox takes over

Well title explains the problem.
Also here is an image
http://s30.postimg.org/xmzu09spc/2014_11_21_00001.jpg

Any idea how to fix this?

Fog

It looks like a HL2 coast map, it’s not easy to change the fog of an already compiled map.

Try doing this in the console:

sv_cheats 1
r_farz 32768

Im tweaking one of the coast maps, so it has been decompiled. But there is already the original fog in it.
Maybe valve used some other technique.

r_farz 32768, did not do anything I could tell.

[editline]22nd November 2014[/editline]

After tweaking the fog controller, it is fixed.
Thanks :slight_smile:

In your 3D skybox, extend the water over the open space where the real map goes. Make sure the textures of 3D and real world line up. When the FarZ kicks in, it will render the water from the 3D sky and make it appear seamless.

GiGaBiTe gave you a value that does not account for the diagonal distance across the map. 32768 is the largest side distance a map can have. Use r_farz 50000. It also is not a cheat command, you can use it without setting sv_cheats to 1.

alternatively, to not have to do this every time your map loads, make a lua file under your lua/autorun/client directory and inside it, put this:


if SERVER and game.GetMap( ) == "YOURMAPNAME" then
  AddCSLuaFile( )
else
  local function Initialize(  )
    RunConsoleCommand( "r_farz", 50000 )
  end

  hook.Add( "Initialize", "SpecialMap.FixFarZ", Initialize )
end

[editline]25th November 2014[/editline]

or, if this is a non garry’smod map, you can use a logic_auto to fire a point_clientcommand with the command “r_farz 50000”

Except it is a cheat. sv_cheats must be set to 1 to use it.

You’re right, it does say that. It would seem Valve either never made that true, or changed it to a non cheat command, however. Here is a demonstration in garry’smod, though it is true for half-life 2 and episode 2 as well. I have not tested it in any source game other than these three. Skip to about 0:26, the first bit is just me finding a corner of the map.

Of course it works in single player, multiplayer is the problem.

Hm, I wasn’t aware there was a difference since I’ve never tested it on multiplayer, but having tested it now, it does not work on a multiplayer server.

I was told that if it was a cheat command you could adjust farz using calcview, with something like this:


if SERVER and game.GetMap( ) == "YOURMAPNAME" then
  AddCSLuaFile( )
else
  local function CalcView( pl, pos, ang, fov, near, far )
    return { farZ = 50000 }
  end

  hook.Add( "CalcView", "SpecialMap.FixFarZ", CalcView )
end

but I haven’t tested it so I don’t know if it works

It was already solved in post #4. The fog controller can increase the distance before clipping(?) happens.
Valve managed to put dense fog right around where the clipping happens, probably a more slick way in terms of framrerate. No idea how they did that though.
Thanks anyway, might be usefull for someone else.