Sign in to follow this  
Guest

New version of AutoAsm available

Recommended Posts

This is still a very early version, but there are some significant additions. It will handle more complex shapes than the first version and also allows multiple polygons. It generates the asm file about three times faster. After Dick's thoughts about TerraScene-generated water masks, the program can now import TerraScene water masks. However, this has opened a whole new can of worms, because these are much larger image sizes (larger than 8192*8192) with lots of lakes scattered around. AutoAsm can handle these images, but not completely reliably. There are potential problems, for example, when two different polygons enter the same LOD13 square. I need to do some more work before TerraScene import is completely reliable - thanks, Dick! Hopefully the next version will be able to handle anything you can throw at it completely reliably. But for now it should work well for most applications such as adding rivers and trimming coastlines. You can get it here: http://www.kline.demon.co.uk/AutoAsmV03.zip Best regards, Chris

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi all.The watermasks are Terrascene outputs of LOD8 size ( For resample's purposes the size needs to be slightly larger than the LOD8 bounds ).Most Terrescene watermask images are much less in size, and should work well for AutoASM as well. The output of Terrascene is a TARGA image that, I think, needs to be converted to 8-bit BITMAP for AutoASM.-------------------------Another possibility is creating "masks" for roads or shores or landuse polys... these could be translated then to VTP method1 polys in AutoASM's output quite easily. These "masks" are created by allowing only one Terrascene Option texture-type as black and the rest of the output as white.More possibilities, now.Dick

Share this post


Link to post
Share on other sites

Little bit off topic maybe, but I thought it would be nice to give a small update on the status of the tool we use in our team.As I told before we are building in the VTP and LWM polygons and at the moment the basic of both are added and working. So we have covered the Netherlands with a few thousand of these polygons with just a few mouse clicks :). At the moment we are removing the last bug (mainly with concave and complex polygons, we have make a triangulate algoritm for that, but that also still has some bugs left).Another things we are adding at the moment are the roads and shorelines. This is still in an early stage, but we already have some working tests for that.That is a bit where we are at the moment and I meant this post basically to let you all know that we are making some nice progress and to show that working with all the new features is very well possible :).Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Hello,Thanks to Chris and the work he did on AutoAsm !Here I have a litle problem with my scenery. I want to trim and reshape a default coasline but it seems that the water is overriding the compiled coast with AutoAsm.Here is a screenshot that shows the result. For some reason everything that falls outside the default shorelines is not visible. I pasted over the screenshot the RAW file outline to show what it would look like if it was all trimmed. Chris suggested that I extend the landclass(generic textures inside the water) so I filled a big part inside the sea with a City Class using FSLandClass but it still not working. I then noticed that the parts that are trimmed with the AutoAsm compiled coast are the ones that fall inside the default Shorelines (sand and wave) so I used DefArea tool to exclude the Shorelines but then again it is still not working.Anyone has an idea about this one please?Thanks!Michel

Share this post


Link to post
Share on other sites

What layer are you using for the new things you draw? From the SDK you can read that the first few layers are overwritten by the water, the higher ones should be placed on top of it.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Hi Arno,Thats a good question, Actually I am using Chris Wright AutoAsm wish is great but I do not think we can specify the layer thereUnless there is a way to specify it in the generated ASM file? Is there a section where we can modify the layer in the ASM?ThanksMichel

Share this post


Link to post
Share on other sites

Hi Michel.Chris might answer this better.In AutoASM, what you're trying to generate is a land or water poly mask. From the jpeg, it's a little hard to tell which one you want to make.When I use LWMs, I've gotten in the habit of first changing the entire Area to land first, then add the water mask to carve out the water. Otherwise, you may be applying a watermask to an Area that already is masked, and who knows what the result will be, because the sim sees the old mask and your new mask as both valid.I've got a trick that forces land first, then custs the watermask.Here's an example:include TDFMacros.incinclude TDFHeaders.inc; LWM FlattenWater N31* 29.55' E26* 30.40'BGLHeader 34, 28, 32, 22, LWMHeader, TerrainHeaderStart LWMHeader label word LWMFileHeader 513, LWMIndexStart, LWMStart, LWMEndLWMStart label word datamark_0 label word LWMDataAreaDrawPolygons 1, 1, 1, 17, 13 LWMPoly2 4, 0, 0, -9999, 0 LWMPoint 10, 10 LWMPoint 200, 10 LWMPoint 200, 200 LWMPoint 10, 200 datamark_0 label word Cell_440_166 EQU LWMCellID 0, 0, 3, 440, 166 LWMIndexStart label word LWMIndexHeader 1, LWMIndexData LWMIndexData label word LWMIndexEntry Cell_440_166, LWMStart, datamark_0, datamark_1LWMEnd label wordIn that example, the green 1 in 'LWMDataAreaDrawPolygons 1, 1, 1, 17, 13' forces the LOD13 area to land... then the blue 0 in 'LWMPoly2 4, 0, 0, -9999, 0' cuts the watermask out of the land.Alternately, you could fill with water, then cut a land mask... I just like filling with land, because in the design stage, you could make all your landfills first, and then compile to see if the landclass is OK, before you cut out the water.As I said, this is something of a trick. Here's another way to get the same result:include TDFMacros.incinclude TDFHeaders.inc; LWM FlattenWater N31* 29.55' E26* 30.40'BGLHeader 34, 28, 32, 22, LWMHeader, TerrainHeaderStart LWMHeader label word LWMFileHeader 513, LWMIndexStart, LWMStart, LWMEndLWMStart label word datamark_0 label word LWMDataAreaDrawPolygons 2, 3, 1, 17, 13 LWMPoly2 4, 0, 1, -9999, 0 LWMPoint 0, 0 LWMPoint 255, 0 LWMPoint 255, 255 LWMPoint 0, 255 LWMPoly2 4, 0, 0, -9999, 0 LWMPoint 10, 10 LWMPoint 200, 10 LWMPoint 200, 200 LWMPoint 10, 200 datamark_1 label word Cell_440_166 EQU LWMCellID 0, 0, 3, 440, 166 LWMIndexStart label word LWMIndexHeader 1, LWMIndexData LWMIndexData label word LWMIndexEntry Cell_440_166, LWMStart, datamark_0, datamark_1LWMEnd label wordHere I just draw the whole Area as land with one poly, then draw my water poly.One last example:include TDFMacros.incinclude TDFHeaders.inc; LWM FlattenWater N31* 29.55' E26* 30.40'BGLHeader 34, 28, 32, 22, LWMHeader, TerrainHeaderStart LWMHeader label word LWMFileHeader 513, LWMIndexStart, LWMStart, LWMEndLWMStart label word datamark_0 label word LWMDataAreaFill1x1 0, 2, 1, 17, 13 LWMDataAreaHeight -9999, 0 LWMDataAreaDrawPolygons 1, 3, 1, 17, 13 LWMPoly2 4, 0, 0, -9999, 0 LWMPoint 10, 10 LWMPoint 200, 10 LWMPoint 200, 200 LWMPoint 10, 200 datamark_1 label word Cell_440_166 EQU LWMCellID 0, 0, 3, 440, 166 LWMIndexStart label word LWMIndexHeader 1, LWMIndexData LWMIndexData label word LWMIndexEntry Cell_440_166, LWMStart, datamark_0, datamark_1LWMEnd label wordAgain, the same effect... I used a 1x1 AreaFill for the land first, then cut out the watermask. With any of these methods, you get consistant results, by first forcing the LOD13 Area to land, then masking the water.As far as layers go, there are no layers with LWM masks, just land or water, and a choice to flatten.-----------------There are times when you'll want to preserve the existing watermask in an Area, but usually you'll want to make it all land and start from "scratch".Dick

Share this post


Link to post
Share on other sites

Thanks so much Dick!! I will try this method for sure!Cheers :)Michel

Share this post


Link to post
Share on other sites

Hi Dick,I tried the FillArea1x1 but now I have to guess based on my area what to fill. As I am new to the LWM commands I am not really sure how to edit the FillArea to match my area. Here I attach 2 new screnshots one from FS2002 and another one from AutoAsm. Also I copied and pasted from the Asm file generated by Autoasm the top section Now what I need to findis how to fill with Land (before doing the watermask) the whole area limited by the white box.my ASM sample:-------------- include TDFMacros.inc include TDFHeaders.inc BGLHeader 89,-89,179,-179,LWMHeader,TerrainHeaderStart LWMHeader label word LWMFileHeader 513,LWMIndexStart,LWMStart,LWMEnd LWMStart label word datamark_0 label word>> Here I must insert the FillArea to cover all the area with land I want to do the watermask for> << LWMDataAreaDrawPolygons 1,3,1,29,13 LWMPoly2 40,0,0,0,0 LWMPoint 206,34 LWMPoint 210,34 LWMPoint 225,34 LWMPoint 241,34 etc...ThanksMichel

Share this post


Link to post
Share on other sites

Hi Michel.You could try the first method I outlined.Wherever it has a line like "LWMDataAreaDrawPolygons 1,3,1,29,13"... just change the 2nd value to a '1'...."LWMDataAreaDrawPolygons 1,1,1,29,13". The Area fill method would also require you to find all the instances of "LWMDataAreaDrawPolygons", and use the last 2 values for the AreaLWMDataAreaFill1x1 0, 1, 1, 29, 13LWMDataAreaHeight -9999, 0LWMDataAreaDrawPolygons 1, 3, 1, 29, 13So you're looking in the right place in the code... but there will be many LOD13 Area to hunt for.Dick

Share this post


Link to post
Share on other sites

Thanks Dick,Ummm, I thought at first that I can fill the whole thing with 1 command only. Now I start to understand the method. I think I will email Chris about it later to see if it will be possible to automate this process in AutoAsm for a future release. This way it will all be part of the same ASM file Thanks!Michel

Share this post


Link to post
Share on other sites

Hi Michel.There could be something you and I are missing concerning the program, so Chris would be the one to contact.You could also contact me via e-mail, if you can't get it working. If I have the code and a slewpoint from the sim, I can usually get all kinds of LWM and VTP code working. It's very difficult to communicate all this in the forum, but good for anyone studying the code to see how problems can be found. But stubborn problems are hard to solve without all the code, and a slew point so I can get easily orientated in the sim. Your code looks to cover 20-30 LOD13 Areas, so it's a little long for posting. :)Dick

Share this post


Link to post
Share on other sites

Hi Michel and Dick! Michel, you're doing great. But of course there's always one more problem! Dick, as you've probably realised, Michel has used AutoAsm to create a single flattened water polygon intended to trim the coast. In Michel's FS screenshot, look at the large bulge that sticks out to the left above the airport. At the top of the bulge you can see the coastline is more detailed than the default - and the coast road is in the water! That's where the water polygon has successfully trimmed the coast. But of course where the coast is too far inward then the polygon has nothing to bite on. As you suggested, the probable solution would be to add land fill areas along the coast. It would be quite easy for AutoAsm to add a fill area for each LOD13 that has data. I tried an experiment based on your example, as below. But it didn't work! I added one fill area on the bulge, and then three more extending out to the left to be sure. With one fill area nothing appeared. With four, there was nothing - except that the fill area on the extreme left appeared as a deep square hole! By the way, you can get the location from the AutoAsm screenshot, under lat and long - as INDEX is zero it'll be for the upper right corner. Best regards, Chris*************************************************include TDFMacros.incinclude TDFHeaders.incBGLHeader 89,-89,179,-179,LWMHeader,TerrainHeaderStartLWMHeader label word LWMFileHeader 513, LWMIndexStart, LWMStart, LWMEnd LWMStart label word datamark_0 label word ;LWMDataAreaFill1x1 0, 2, 1, 18, 18LWMDataAreaFill1x1 0, 2, 1, 19, 18;LWMDataAreaFill1x1 0, 2, 1, 20, 18;LWMDataAreaFill1x1 0, 2, 1, 21, 18LWMDataAreaHeight -9999, 0 LWMDataAreaDrawPolygons 1, 3, 1, 19,18LWMPoly2 4, 0, 0, -9999, 0 LWMPoint 10, 10LWMPoint 200, 10LWMPoint 200, 200LWMPoint 10, 200 datamark_1 label word Cell_459_159 EQU LWMCellID 0, 0, 3, 459,159LWMIndexStart label word LWMIndexHeader 1, LWMIndexData LWMIndexData label word LWMIndexEntry Cell_459_159, LWMStart, datamark_0, datamark_1 LWMEnd label word

Share this post


Link to post
Share on other sites

Hi Chris and Dick :)Thanks for your continous help! Dick here is the link where you can download the ASM code.http://www.littlelan.com/~mkaram/FS/bey_cst1b.asmAnd as Chris mentioned the coordinates are in the screnshots above. I also copy them here:N33.8624 E35.5237X=0.29 and Y=0.19Chris so you tried FillArea technique and it did not work? Thanks !!! :)Michel

Share this post


Link to post
Share on other sites

Hi Chris.I'm almost wondering if we have a bug with the areafills. I don't think you can consistantly get them to cooperate with polys drawn into the same area. As I suggested, there are 2 other ways to fill the area... with a 255x255 4 point poly ( covers the whole Area ), and with the "trick" I first suggested:LWMDataAreaDrawPolygons 1, 1, 1, 19,18LWMPoly2 4, 0, 0, -9999, 0 LWMPoint 10, 10LWMPoint 200, 10LWMPoint 200, 200LWMPoint 10, 200where the 'LWMDataAreaDrawPolygons' uses a value of 1 ( land ) for the second parameter, rather than the 3 that's normally used. That forces a landfill... then the actual polygon forces a water shape. If that works consistantly, it's a pretty 'elegant' solution to rewoking coastlines, as it uses less code, and doesn't force the area to be unneccesarily accessed by extra polygons. We could check that method out over the next few days, and it's converse as well ( fill with water, and then draw land shapes ). If it works, it might be something you could add to your code in the future.I'll look at Michel's code tomorrow. I'm sure we can get the results he wants.Dick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this