Planetary Surface vanishes
-
I have a planetary surface that is built up of 8 extra large CMP files. The terrain is constructed of 127 convex shapes, hence the eight files (the exporter has a limit of 18 mesh parts). It uses a SUR file that is identical to the CMP - and I get perfect hit and coll detection everywhere.
There is one problem, though. At certain angles, some of these CMPs disappear. As I move further from the center of the surface (the objects are all placed at/near 0, 0, 0), all the CMPs vanish (much before reaching the “edge of the world”).
The solararch entry is based on dyson_scape, so that shouldn’t be causing any problems.I understand one possible solution might be adjusting the sur radius. The SUR file was generated by LS’s SUR Builder utility. It works like a charm - but does not allow me to set the radius of the SUR. I don’t really want to use FLModelTool because it tends to modify other parts of the SUR as well - but I’d be glad to use a hex editor if someone can help me locate the part where the radius is stored.
I’d much appreciate any other alternative, as well.See the attached file for CMPs, SURs, solararch and system entries.
-
Actually the dyson shape has the same problem. You will need to increase the far rendering distance and the LOD range on the models. I have a land surface in mine and its 1 million units across, I can also fly past the edge of it without it disappearing.
-
SurDump (command line utility) has an option to show the hex offset. For example:
--> bw_fighter.sur <-- 00008 Root (0x12688F2D) 00010 !fxd - not fixed 00014 exts - Extents 00018 minimum: -6.827560, -1.792366, -11.571496 00024 maximum: 6.827561, 2.362134, 6.495000 00030 surf - Surface 00038 center: 0.014422, 0.012039, -1.458160 00044 inertia: 1.328390, 9.213571, 9.200788 00050 radius: 10.900290 00054 scale: 0.916 00055 size: 0x31B4 (12724) 00058 bits ofs: 0x2E50 ```The radius is a float at file offset 0x50 (but scale is a byte that is divided by 255).
-
My solararch LOD ranges are:
LODranges = 0, 1000000My far plane of view frustum (0x210534, Frelancer.exe) is set to 1000000 (float).
I will have a go at increasing the sur radius using surdump, and see if that helps. Thanks.
Edit: Well, increasing the Sur files’ radius settings to 1 million each have solved the problem - to the extent that the parts do not disappear, and I can fly to a distance about 20k (some 19.8k) from the center. Past that point, all parts vanish at the same time, if I come back within range, they reappear.
I guess that might have to do with the scale offset. Do you know what its exact function is? In my sur files, its value is 250 (and so surdump outputs 1.0). I can’t really push that higher, as it’s only a single byte. -
I think the radius is used for a quick initial test, then the scale is applied for more accuracy. At least, that’s what I surmise for the bits stuff (an initial sphere, then refined as an ellipsoid), but that doesn’t really seem necessary in the surf description. Hm, maybe the radius includes the shield bubble, with the scale just being the ship?