Visual Plane Issues
- by Devil
- There is a (presently) hard-coded limitation of how far the player can see geometry in Reflex called the visual plane. Having a player see geometry being culled in real-time, e.g. when looking at a far off vista, breaks world consistency, and so should be avoided.
Avoiding the Visual Plane
Imagine a sphere with a radius of approximately 4048 to 4080 unit radius surrounding the player. Any geometry outside of this sphere is culled, i.e. not rendered. This cut-off in geometry is called the visual plane.
So when mapping, you should take into account the diagonal distances of your geometry in order to avoid seeing the plane in your map. It is good to know where that plane is for large open air arenas so that you can see from one end to the other without any anomalies. The actual visual plane distance when looking directly at an object in the distance is, as mentioned, approximately 4048u to 4080u. There is no way to currently adjust the visual plane distance in Reflex (as of v0.28.4). So, for the time being we all have the same fixed visual plane distance.
Speculations on the view distance
Having thought about it my guess on the exact distance is either 4064 (254x16) or 4080 (255x16). 254 & 255 is a common maximum integer for databases. Sometimes 254 is used if the first number counted is 0 instead of 1. In order to get to a 16Ku map needed for CTF mode, the developers will have to find a way to push that 255 integer value up to 1024. The problem with doing that is it could be disastrous for GPUs in this game's unoptimized state. So developers are taking it slow one step at a time instead of opening everything up at once and trying to find massive bugs where there currently are not any. The development path they are taking here by starting small is one that I completely agree with but it will have to be opened up in the near future to allow for larger map development.
How big should I make my room?
One of the most frequently asked questions a new mapper asks is what is the biggest size I can build my room? My answer is a maximum of 2800u in any direction. Wait, 2800? Did I not just say 4000u was the visual plane distance earlier? This is actually a pitfall for a lot of first time mappers including myself. I assumed that if I made a room 3500u x 3500u since it is below 4000u it would be just fine. That is not the case when it comes to visual planes diagonally. Diagonally a 3500u x 3500u room will contain a vis plane. Actually, it is much smaller than 3500u too, it is about 2800u and I will show you how I figured that out.
Note: Pythagoras to the rescue: 3500²+3500²=c², the diagonal in that room, the longest view distance is actually c = 4950u, so way above the maximum visual plane distance of 4048u. Using c = 4048u, the maximum side length of an exactly square floor ends up to be 2862u x 2862u. (AEon)
Here we start with the basic empty.map file that is included with every version of Reflex. The spawn location is centred perfectly at 0,0,0 coordinates. Purple lines measure out the room distance which is 3900x3900 centred at the spawn point. That gives us an excellent base to identify maximum diagonal distance and measure it. The orange markers are directly in line with the spawn entity as a point of reference. The distance between the orange markers represents the maximum distance before a diagonal vis plane appears.
The orange marker at each corner represents the distance before getting into a diagonal vis plane. My measurements put it at about 2829u x 2896u. By using Pythagorean Theorem we can calculate the diagonal visual plane distance at 4048u. If your room is bigger than 2900 diagonally, then the 4000u visual plane will show up.
So what is the maximum vis plane height vertically? The same, 4048. Therefore you are basically inside of a 4000u visual sphere, a bubble. If you want to be extra cautious and not have any remote possibility whatsoever of visual plane issues then do not make your total map area larger than 2800 in any direction represented above by orange lines. This will mostly apply to those with completely open air arenas. Add in a few well placed walls and the visual plane issue is removed and you can then increase your maximum room size up to 8000x8000x8000 without running into lightmap issues in build 0.28.4.