Problem with LWM3

General discussion about Scenery Design. Questions about SBuilder for Flight Simulator FS2004.
Post Reply
User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Problem with LWM3

Post by Luis Sa » Tue Mar 08, 2005 10:54 am

Hi,

<font color="red">Edited Feb, 11, 19pm TMG - see bottom of this thread</font id="red">

Based on files that some users sent to me, I was able to find at least 3 problems/bugs with the version supporting the LWM Poly3() command:

- problem 1 - when appending an older LWM BGL file, appended polygons got an altitude of 0. This was a bug and present sbyyy.zip file is OK on this respect.

- problem 2 - when opening some old SBP files (or SBX files) an error 5 stops Sbuilder. Again this was a bug and the version in my PC is OK but I do not upload it because of the following problem,

- problem 3 - with the new Poly3() instruction, when you set the altitude to -9999, FS takes it literally, making a big a hole.

In a way I have doubts on what direction shall I go. As far as I can tell, you can only have "mesh climbing" (with altitude=-9999) if you use the FS2002 Poly2() instruction. On the other hand SCASM does not allow me to mix Poly2() with Poly3() instructions in the same file. I will write to Manfred Moldenhauer about this but I am not sure if it is possible, or desirable, to redefine the LWMFileHeader() SCASM command to allow the mixing.

In any case I will keep the new polygon format (polygon points all have its altitude). If no change in SCASM is possible, I can do the following:

- If all LWM polygons in a project are "constant altitude" polygons, SBuilder will use Poly2() commands and the file will have a sufix of _LWM2 (before was _LWM)

- If there are both "constant altitude" and "tilted polygons", SBuilder will generate 2 files with sufixes of _LWM2 and _LWM3.

<font color="red">This was implemented and errors corrected. Reading old format was fixed. -9999 altitude works as before (no holes). Poly3 polygons go to a separate file.</font id="red">

httt://www.ptsim.com/downloads/sbyyy.zip


Kind Regards, Luis

rhumbaflappy
Posts: 420
Joined: Sat Oct 16, 2004 10:11 pm

Post by rhumbaflappy » Tue Mar 08, 2005 5:18 pm

Hi Luis.

LWM3 doesn't allow any mesh-clinging. Not a bug, just a characteristic of that type.

My personal opinion is that I would use LWM3 only in very limited circumstances. LWM2 is much more flexible.

Dick

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Post by Luis Sa » Tue Mar 08, 2005 10:18 pm

Hello Dick,

Thanks for the feedback. I completely agree with you. My only small problem is that SCASM does not allow me to generate a single BGL with both Poly2() and Poly3(). With your macros and BGLComp I could, in the rare cases where I have "constant altitude" polygons and "tilted" polygons, to generate a unique BGL.

Regards, Luis

Horst
Posts: 137
Joined: Sun Sep 19, 2004 5:08 am
Location: Austria

Post by Horst » Wed Mar 09, 2005 6:24 am

Hello,
My thoughts:
I would agree, we should not lose LWM2 and the possibility to use it.
Of course for both (LWM2 and LWM3) we need the DEM and the polygons fit
together (being accurate), to get a nice result.
But "flying" "low and slow" and try to land on the rivers, I think we should
use also LWM3.
We can use LWM2 and flatten the unwanted "meshclimbing" water, but LWM3 will
do it in a "smoother" way (and easy) On the other side we will produce
sometimes "plateau" rivers, we have to take care about.
But we have everything we need in SB:
We can use the mesh map (for information).
We can join the polygons.
But I am looking forward (and test this, think about it - where it fails)
that LWM2 and 3 in SB generate 100% correct bgl code.

Kind regards
Horst

rhumbaflappy
Posts: 420
Joined: Sat Oct 16, 2004 10:11 pm

Post by rhumbaflappy » Wed Mar 09, 2005 5:31 pm

Hi Luis.

Yes. You should not have LWM3 and LWM2 in the same BGL... they have different version numbers in the header.

Dick

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Post by Luis Sa » Wed Mar 09, 2005 11:34 pm

Dick,

Do you mean it is impossible to have a BGL file with both type of polygons? If that is the case, it was stupid of me to suggest a change in SCASM. When I read the BGLs to import them into SBuilder I do the following:

- check the LWM header and set FS9Header = true or false
- then when reading the stream I read diferently Polys and Points. For example in Points I read 2 bytes if FS9Header = false or I read 3 bytes if FS9Header = true.

I still think that we could mix the 2 types of polygons in the same file, but I am convinced that it is better to generate Poly2() whenever possible and generate an isolated file when Poly3() are needed. I will try to implemnt this today.

Regards, Luis

Jan Nielsen
Posts: 22
Joined: Sun May 16, 2004 7:18 pm
Location: Norway

Post by Jan Nielsen » Thu Mar 10, 2005 6:42 am

Hi Luis,
I'm just popping in to say that it is not possible at all to combine polygon type 2 and 3 in the same file. As I recall, the version number in the file header is the only way to tell the flightsim which polygon type the lwm file contains. Hence you can not mix them, sorry. [8D]

Cheers Jan

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Post by Luis Sa » Thu Mar 10, 2005 7:55 am

Hi Jan,

I believe what you are saying. My confusion came from the fact that I did not see it stated in the MS SDK. I am coding right now, creating a _LWM2.BGL file (where all constant altitude polygons go) and a _LWM3.BGL file (where any tilted polygon goes).

Regards, Luis

Post Reply