• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Creating coastlines for CFS2

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,948
Country
us-wisconsin
Hi Sander.

In some old sceneries I made using VTP1, I used some of the default textures... not line textures.... sand, lava, asphalt, concrete, grass, etc... because it didn't look too bad in the sim, and made the UV mapping a cinch!

I also made everything as "fans" because I made all roads and shorelines as polygons! ( cheated ).

Dick
 

SdC

Messages
35
Country
netherlands
Yeah although the fs2002 sdk makes a big deal about the difference between lines and poly's, the resulting ASM doesn't reflect this.
For the shorelines however it needs to be implemented neatly, because the exact texture mapping is essential. For roads it makes little difference. Streams (which have banks) also need to be mapped correctly.
 

SdC

Messages
35
Country
netherlands
I think vtp1 has a lot more flexibility than ground2k exposes.
For instance, it is possible to rotate textures in poly's (so we could for instance use the good 'ol CFS1 ground texture set again :) ) and we could place "photoreal" anyplace without having to edit the texture to fit the ground.
Also lines could have a randomized width variation, making streams and beaches look more fluent and natural.
 
Messages
15
Country
spain
May any of the Aces team be contacted? And, btw, who are them? (ugh! I have revealed myself as a "non-so-veteran" simmer...:)
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,948
Country
us-wisconsin
I think vtp1 has a lot more flexibility than ground2k exposes.
For instance, it is possible to rotate textures in poly's (so we could for instance use the good 'ol CFS1 ground texture set again :) ) and we could place "photoreal" anyplace without having to edit the texture to fit the ground.
Also lines could have a randomized width variation, making streams and beaches look more fluent and natural.

Hi Sander.

You're right there! VTP1 was a very flexible way of drawing.

One thing I have noted:

Occasionally, there are artifacts created by our VTP1 lines and polys. When viewed from top-down, north oriented, they appear as horizontal or vertical lines of misplaced texture. I think I have found the source of the problem. It seems in the macro:

Code:
VTPPointXYUV	Macro	X, Y, U, V

	BYTE	X	;	// The column offset in the area
	BYTE	Y	;	// The row offset in the area
	BYTE	U	;	// The column offset into the texture
	BYTE	V	;	// The row offset into the texture


EndM

The points X and Y cannot be '0'. The span should be 1-255, not 0-255. If I use 1-255, then the artifacts disappear. The texture U and V can remain 0-255. Ground2K uses a span of 0-255, and the annoying artifacts are often present... so some decompilation of the BGL, and some editing, is needed.

Dick
 

SdC

Messages
35
Country
netherlands
Hi Sander.

You're right there! VTP1 was a very flexible way of drawing.

One thing I have noted:

Occasionally, there are artifacts created by our VTP1 lines and polys. When viewed from top-down, north oriented, they appear as horizontal or vertical lines of misplaced texture. I think I have found the source of the problem. It seems in the macro:

Code:
VTPPointXYUV	Macro	X, Y, U, V

	BYTE	X	;	// The column offset in the area
	BYTE	Y	;	// The row offset in the area
	BYTE	U	;	// The column offset into the texture
	BYTE	V	;	// The row offset into the texture


EndM

The points X and Y cannot be '0'. The span should be 1-255, not 0-255. If I use 1-255, then the artifacts disappear. The texture U and V can remain 0-255. Ground2K uses a span of 0-255, and the annoying artifacts are often present... so some decompilation of the BGL, and some editing, is needed.

Dick


Gotcha! I'm coding the LOD13 poly clipping functions right now, and that is info I can incorportate immediately :D. Never thought I'd know what the Sutherland-Hodgman's polygon-clipping algorithm was..... :eek:
 

SdC

Messages
35
Country
netherlands
.....
... so some decompilation of the BGL, and some editing, is needed.

Dick

Some editing????? My projects typically contain THOUSANDS of lines :eek: :eek: :eek: Yeah we definately need a new compiler! (note: cfs2autocoast.exe will be able to read sbx files, so in the future you could use sbuilder to create little projects like Iwo Jima too! :cool: )
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,948
Country
us-wisconsin
Gotcha! I'm coding the LOD13 poly clipping functions right now, and that is info I can incorportate immediately :D. Never thought I'd know what the Sutherland-Hodgman's polygon-clipping algorithm was..... :eek:

Hi Sander.

Oddly, VTP2 is also restricted to spans of 255 per LOD13... 255 * 32 = 8160.

So all VTP lines and polys deal with the spans between the 256 points. This would also affect VTP1 photoreal.

It is possible the '0' point is somehow overlapped... what I am doing is to simply replace any '0' in the X,Y with '1'.

"MaskedRider" ( Chris Westervelt ) rejected using VTP1 for his blended airfields due to the artifacts. At that time, it never occured to me the X,Y points were the problem.

Dick
 
Messages
6
Country
us-california
Hiya Fellas,

Very ineresting discussion.

Finding the cause and solution to the artifact problem with VTP1's is a great find- from my limited perspective, anyway. :)

It will allow me to start using my normal custom ground poly textures as custom textures in VTP1s as I had always wanted to do.

I am ready to start decompiling and editing right now!

I was wondering first off whether G2Kv4 generates source files that are or can be saved? If so, where are they?

Chris
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,948
Country
us-wisconsin
Hi Chris.

For decompiling all LWM and VTP use Jim Keir's LWMViewer 1.3:

http://www.jimkeir.co.uk/FlightSim/LWMViewer.html

I wouldn't use version 1.4b, as it's a beta with some problems, and version 2.0 is also a beta.

For an ASM editor, you can use notepad, but large files need something beefier... I use the editor with Visual Studio C++ Express Edition ( incredibly fast for huge files ).

Dick
 
Messages
6
Country
us-california
Hi Guys thanks for all the info.

WRT LWMViewer- yep, I've been usin it for some time- mainly just to check my coastline polys for spikes and such. Version 1.4B, too. At least that what I've been using on the new computer- I may have 1.3 on the old one.

In any event I now have both on the new one. Did some decompiling with it. Works fine.

WRT a more powerful text editor- I downloaded the 45 day free trial version of UltraEdit. Pretty cool program, for sure. Most likely I'll end up forkin over the dough!

Until later,
Chris
 

SdC

Messages
35
Country
netherlands
Hi Dick,
I received your vtp1fix tool, but my replies to you bounced after a few days:
<.....@....>: delivery temporarily suspended: connect to
mail.charter.net[209.225.8.224]: Connection timed out
What I tried to say is that it is a LOT of code :D for a simple problem!!! But it works great!
Here's my interpretation of the solution; save as .vbs file, then you can drag-and-drop the ASM file (or files) on it and it will create a _fixed.asm file. The only limitation is there should not be period "." in folder name (like "c:\myscenery\test.1\blabla.asm").
Code:
Option Explicit
Const ForReading = 1
Const ForWriting = 2
Dim objFSO,  objShell, objSourceFile, objDestinationFile, objArgs
Dim strText, strFile, strArg
dim strX, strY, strCoords
set objArgs = WScript.Arguments
Set objFSO = CreateObject("Scripting.FileSystemObject")
for each strFile in objArgs
    Set objSourceFile = objFSO.OpenTextFile (strFile, ForReading, True) 
    Set objDestinationfile = objFSO.CreateTextFile(replace(strFile,".","_Fixed."), True)
    do while not objsourcefile.AtEndOfStream
      strText = objSourceFile.ReadLine
      if instr(strtext,"VTPPointXYUV") then
      	'Get all coordinates
      	strCoords=right(strtext,len(strtext)-instr(strtext,"VTPPointXYUV")-11)
      	'Strip away the coordinates from original string
      	strText=left(strtext,instr(strtext,"VTPPointXYUV")+12)
      	'strip away the X
      	strX=left(strcoords,instr(strcoords,","))
      	strcoords=right(strcoords,len(strcoords)-instr(strcoords,","))
      	'Strip away the Y
      	strY=left(strcoords,instr(strcoords,","))
        'Leave the UV
      	strcoords=right(strcoords,len(strcoords)-instr(strcoords,","))
      	strtext = strtext & replace(strX," 0,"," 1," ) & replace (strY," 0,"," 1,") & strcoords
      end if
      objDestinationFile.writeline strText
    loop
    objSourceFile.Close 
    objDestinationFile.close
next
WScript.Quit
 
Last edited:

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,948
Country
us-wisconsin
Hi Sander.

My code was a bit long. :D

I don't know why the mail was bouncing... I've been getting emails from all over.

For everyone else:

The code Sander is refering to is a program to correct VTP1 code from Ground2K or from LWMViewer. I discovered a bug in CFS2 that doesn't read the zero values for X or Y positioning in VTP1 polys and lines. I made a program to change those values from 0 to 1 in the ASM ( or BGS ) files, so they may be recompiled and artifacts are then removed from the sim.

I'm attaching the Net 2.0 executable... the code is too bulky to include!

Dick
 
Last edited:

SdC

Messages
35
Country
netherlands
Hi Dick,
Do you mind if I re-post your file on the SOH Design forum? I'll post both versions (mine has evolved a bit since the above post) so people will have a choice :), with a small tutorial.
Cheers,
-Sander
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,948
Country
us-wisconsin
Hi Sander.

Yes, repost it if you like.

I suspect there are only about 3 of us that actually use this. :(

Dick
 
Messages
20
Country
us-texas
Ahhh it's good to be back.... reporting for active duty!:D


Came over to look at FSX XML for my designing PHP for FSX (hmm new name PHPX!! LOL)


This is a great thread fellas.... always good to see great minds at work. :stirthepo
 
Top