Jump to content

Sign in to follow this  
ShezA

Question...no.2

Recommended Posts

How can I populate scenery with autogen? Any download out there which will allow AFW to pick up the api and place lots of objects (eg. houses)? or for that matter any other program.Shez

Share this post


Link to post
Share on other sites

I have never heard of a tool that allows you to place APIs like autogen. So that would require a lot of clicking :). Maybe it is better to use the normal mesh techniques that allow autogen?

Share this post


Link to post
Share on other sites

Yes, maybe, but I think you will never get the random looking effect of the real autogen. In such a line it is always the same object.

Share this post


Link to post
Share on other sites

One way to do the random effect is to maybe use the technique GG uses for his trees. He assigns trees from his library whereby four different trees can be placed in one macro. Maybe worth exploring?Shez

Share this post


Link to post
Share on other sites
Guest JR Morgan

Hi Shez..Here's a macro I made for AFW and was improved for compactness and execution effeciency by Dick Ludowise. It places 52 MSFS AdvBldgs to augment lack of autogen houses. User can add more or delete bldgs as desired, by adding or deleting TransformCalls. The individual bldgs positioning can be manipulated by each individual line of the TransformCalls if necessary to 'dodge' existing objects (existing trees, etc).;============================;Api Macro to add 52 Advanced Buildings To Augment Lack Of Autogen;AdvBldg( Type 40 is Brown Ranch/Bungalow House;AdvBldg( Type 30 is White Semi-Colonial Facaded House;User can select other AdvBldg objects if macro is revised accordingly at "BldgType" section below ;%1=Latitude;%2=Longitude;%4=Scale;%5=Heading;Copyright SCASM - Macro by J.R. Morgan Jr. Improved by Richard Ludowise for compactness and effeciency of execution.;Tested in FS8 and FS9;============================ Area( 5 %1 %2 10 ) RefPoint( 7 :Fail %4 %1 %2 V2= 22 ); Object Calls RotatedCall( :Fail 0 0 0 ); DummyCall TransformCall( :House1 000 000 000 0 0 0 0 0 0 ) TransformCall( :House2 100 000 000 0 0 0 0 0 0 ) TransformCall( :House1 200 000 000 0 0 0 0 0 0 ) TransformCall( :House2 300 000 000 0 0 0 0 0 0 ) TransformCall( :House1 300 000 -100 0 0 0 0 0 0 ) TransformCall( :House1 400 000 -100 0 0 0 0 0 0 ) TransformCall( :House1 200 000 -100 0 0 0 0 0 0 ) TransformCall( :House1 100 000 -100 0 0 0 0 0 0 ) TransformCall( :House1 000 000 -100 0 0 0 0 90 0 ) TransformCall( :House1 000 000 -200 0 0 0 0 90 0 ) TransformCall( :House2 100 000 -200 0 0 0 0 0 0 ) TransformCall( :House1 200 000 -200 0 0 0 0 0 0 ) TransformCall( :House2 300 000 -200 0 0 0 0 0 0 ) TransformCall( :House1 400 000 -200 0 0 0 0 90 0 ) TransformCall( :House2 200 000 -300 0 0 0 0 0 0 ) TransformCall( :House1 100 000 -300 0 0 0 0 0 0 ) TransformCall( :House2 000 000 -300 0 0 0 0 90 0 ) TransformCall( :House1 000 000 -400 0 0 0 0 90 0 ) TransformCall( :House2 100 000 -400 0 0 0 0 0 0 ) TransformCall( :House1 190 000 -400 0 0 0 0 90 0 ) TransformCall( :House1 000 000 -500 0 0 0 0 90 0 ) TransformCall( :House2 100 000 -500 0 0 0 0 90 0 ) TransformCall( :House1 200 000 -500 0 0 0 0 0 0 ) TransformCall( :House2 300 000 -500 0 0 0 0 0 0 ) TransformCall( :House1 450 000 -500 0 0 0 0 0 0 ) TransformCall( :House2 000 000 -650 0 0 0 0 90 0 ) TransformCall( :House1 100 000 -650 0 0 0 0 0 0 ) TransformCall( :House2 200 000 -650 0 0 0 0 0 0 ) TransformCall( :House1 300 000 -650 0 0 0 0 0 0 ) TransformCall( :House2 400 000 -650 0 0 0 0 0 0 ) TransformCall( :House2 000 000 -750 0 0 0 0 90 0 ) TransformCall( :House1 100 000 -750 0 0 0 0 0 0 ) TransformCall( :House2 200 000 -750 0 0 0 0 0 0 ) TransformCall( :House1 300 000 -750 0 0 0 0 0 0 ) TransformCall( :House2 400 000 -750 0 0 0 0 90 0 ) TransformCall( :House1 000 000 -850 0 0 0 0 90 0 ) TransformCall( :House2 100 000 -850 0 0 0 0 0 0 ) TransformCall( :House1 200 000 -850 0 0 0 0 0 0 ) TransformCall( :House2 300 000 -850 0 0 0 0 0 0 ) TransformCall( :House1 400 000 -850 0 0 0 0 90 0 ) TransformCall( :House2 000 000 -950 0 0 0 0 90 0 ) TransformCall( :House1 100 000 -950 0 0 0 0 0 0 ) TransformCall( :House2 180 000 -950 0 0 0 0 90 0 ) TransformCall( :House1 320 000 -975 0 0 0 0 0 0 ) TransformCall( :House2 400 000 -950 0 0 0 0 90 0 ) TransformCall( :House1 005 000 -1050 0 0 0 0 90 0 ) TransformCall( :House2 100 000 -1050 0 0 0 0 0 0 ) TransformCall( :House1 200 000 -1050 0 0 0 0 0 0 ) TransformCall( :House2 300 000 -1100 0 0 0 0 0 0 ) TransformCall( :House1 400 000 -1100 0 0 0 0 0 0 ) TransformCall( :House2 007 000 -1120 0 0 0 0 90 0 ) TransformCall( :House1 100 000 -1120 0 0 0 0 90 0 ) RotatedCall( :Fail 0 0 0 ) ; DummyCall Jump( : ); BldgType:House1 AdvBldg( PEAKED 40 20 LEVEL1 27 5 128 128 LEVEL2 0 0 256 256 256 LEVEL3 0 0 256 256 ROOF 9 256 256 7 256 ) Return:House2 AdvBldg( PEAKED 30 15 LEVEL1 81 4 256 256 LEVEL2 0 0 256 256 256 LEVEL3 81 4 256 256 ROOF 28 256 256 2 256 ) Return:Fail ReturnEndAHere's a picture of the app tested in FS9: http://forums.avsim.net/user_files/78493.jpg 78493.jpg J.R

Share this post


Link to post
Share on other sites

Now that is very promising! Thanks will check this out. I am not a sophisticated mesh designer so I tend to lose autogen near the airports. This will be of great help.ThanksShez

Share this post


Link to post
Share on other sites

Dumb question, I am not able to rotate this set of buildings. Is that designed to be like that?Shez

Share this post


Link to post
Share on other sites
Guest JR Morgan

Hi Shez..I don't think the entire array can be rotated with this code, however, each individual object can be displaced on an 'X, Z, Y' axis basis and also each individual object can be rotated.'Requires some thought as to what might be done. You might need to use smaller (<52 objects) groupings and fit them in with offsets from the RefPoint where desired? That method might give an "apparent" rotation to the group but it's really not rotating the group; rather, it would simply be offsetting objects in the group and rotating them so as to appear that the group is rotated.To reduce the size of the array from say 52 to 20 objects, you can simply comment-out (place an apostrophe character at the start of each of 32 of the 52 "TransformCall" lines of code.) Or you could also revise the macro by copy/paste to reduce (or increase) the quantity of objects called in the array if that's what is needed?J.RPS: An afterthought -- are you trying to simulate autogen on photo real or on native MSFS textured ground?

Share this post


Link to post
Share on other sites

Hi JR,The first thing I did installing this was as you pointed out, reduced the number of buildings, allowing more flexibility for airport surrounds. If the code is not able to rotate it will still leave the alternate as you described of moving the individual buildings (which is something I am doing).I need this for scenery with a photoreal background.BTW is there a listing of the types of buildings which can be used with this code?Thanks again.Shez

Share this post


Link to post
Share on other sites
Guest JR Morgan

Hi Shez..Re: >"BTW is there a listing of the types of buildings which can be used with this code?"

Share this post


Link to post
Share on other sites

J.R.This looks good. The problem with photoreal ground is that it wipes out the agen. I am not an expert in VTP polygons etc. so this is an equally good solution.BTW, I was tinkering with the api yesterday and I found an issue with its interaction. I found that an existing api became invisible from certain angles (???) and it only reappeared when this agen api was deleted and recompiled. I tinkered around with V2 settings etc. of the affected api but no joy. Any clues why this would be happening?Shez

Share this post


Link to post
Share on other sites
Guest JR Morgan

Hi Shez..Well, in situations like that I've been known to do things that bring out the ire in the programming ethics guys.Here's what I'd try:1. In the Area( call, change area 5 to area b.2. In the RefPoint line, erase the V2= 22, leaving no V2= value specified.3. Try to position the RefPoints you offset-from for this macro so that it 'offset radial' (the X & Y values) is not real close (overlapping into) to the object that's got the visibility problem. This tests OK here but I've no doubt got an entirely different situation than you have.BTW, are you placing your PR textured ground polygons using the normal SCASM routine for ground polygons?J.R

Share this post


Link to post
Share on other sites

Let me try and experiment with the above. I hand-code the ground using scasm normal routine. Probably an old technique but one I find is tried and tested.Shez

Share this post


Link to post
Share on other sites
Guest JR Morgan

Hi Shez..Although it works, use of that TransformCall macro to add scads of buildings to augment lack of autogen might be a "band-aid" type of scenario here. Since FS9 is already 'overflowing' with autogen, if you could just find a way to preserve the default autogen, it might be a much better approach for your project. And as you've already experienced, you're into lots of time-consuming, 'brain-piercing' edits in using the TransformCalls effectively.If it were me and knowing the niceties of the scenery you produce, I would at least try to maintain (all) the default autogen."Dummy" Rotated Calls within textured ground polygon macros, located so as to 'supposedly' force the sim's Scenery Engine to refresh, re-index, hiccup, or whatever (?), at a sequential point in the macro (ie the Ref Point's label) seem to preserve autogen within the bounds (and nearby) of textured ground polygons. There does not seem to be any obvious frame rate penalty using this process.ie: if a ground polygon macro's RefPoint label is named ":Label_1", then the below sequence of code would be inserted into in the macro that draws your textured ground polygon(s) immediately after the label as below:;========================:Label_1 (leave the existing label name intact)RotatedCall(:RC 0 0 0 );(insert these 4 lines of code)Return:RCReturn;========================I don't know if the PhotoReal guys have tried this or not but it might be worth trying. I know it works with other custom-made texture bitmaps applied to ground polys. I would try the below process:1) Save all your existing scenery files -- in a program like AFW, all you'd need do is to do a to a new project name. You would still have your last-named project saved intact and would be able to go back to it.2) In the newly named "saved-as" project, edit the SCASM code for your ground polygons that are textured with the the PR bitmaps by inserting (pasting-in) the above 4 lines of code (starting with "RotatedCall" and ending with the 2nd "Return".If this works and if the resulting preservation of autogen is satisfactory for your project, you will have eliminated the need for all the added buildings produced by the "TransformCall" macro. You could then delete the "TransformCall" based macro(s), further simplifying your project.If you are hesitant to edit your working macros and wish to do so, you may email me one of the macros used to draw your PR ground polys and I will test to see if such technique will work with your bitmap. Unfortunately, I would also need at least one of your PR texture bitmaps used for ground polys.J.R.

Share this post


Link to post
Share on other sites
Guest JR Morgan

Hi Shez..Hey man, you're livin' right. It just dawned on me that I had one of your PR bitmaps (dca8a.bmp) in my download tank from placing one of your DCA jetway objects in SGX.The picture below shows that PR texture bmp on an airport area with all the autogen living happily on the ground polygon textured with your dca8a.bmp (A DXT3 bmp).Obviously, my test is merely a conglomerate of your total bmp --- but it works great making the polygon using AFW/188. I set the LayerCall in AFW at layer 8.So forget about what I said about emailing me any files -- since I already had one of your PR textures to work with I could go ahead and do it.J.Rhttp://forums.avsim.net/user_files/78847.jpg

Share this post


Link to post
Share on other sites

Hi J.R,Actually my coding is done within the SCA file because of an anomaly in AFW polygon generator which does not display the bitmap properly on the polygon. If you notice your pic the PR bitmap is "jumbled up" i.e. the bitmap has been cut into four pieces and juggled like a maze. That is why my code is different. When I place your lines in my code the bitmap disappears. I think I am placing the code incorrectly.Here is a code of a ground polygon made in AFW166. It is different from my usual method but it is easier to work with.; polygon 1Area( b 33:40.83131 -117:51.71231 30 ) LayerCall( :Taglayer 8 ) Jump( : ):Taglayer RefPoint( 7 :TagPoly 5 33:40.83131 -117:51.71231 V1= 40000 V2= 1416 ) Bitmap( Image1.bmp 0 0 0 0 ) Smoothing( 1 ) Points( 1 -00100 0 00100 ; 001 00100 0 00100 ; 002 00100 0 -00100 ; 003 -00100 0 -00100 ; 004 ) StartSurface MoveToPt( 1 ) DrawToPt( 2 3 4 ) EndSurface Smoothing( 0 ):TagPoly ReturnEndAWhere would your code go in this?Shez

Share this post


Link to post
Share on other sites
Guest JR Morgan

Hi Shez..Re: >"Actually my coding is done within the SCA file because of ananomaly in AFW polygon generator which does not display thebitmap properly on the polygon."<*I guess I don't understand the anamoly you mention. The portion of a bitmapdisplayed on a ground polygon in SCASM (AFW) is STRICTLY controlled by the "Points"definitions and the relative size (or resolution in AFW's polygon creator routine)of the polygon in the code. are you seeing the bitmaps being flipped vertically byAFW? If so, you could vertically flip the bitmap and re-save it for testing?*Re: >"If you notice your pic the PR bitmap is "jumbled up" i.e. the bitmap has beencut into four pieces and juggled like a maze. That is why my code is different. WhenI place your lines in my code the bitmap disappears. I think I am placing the codeincorrectly."<*Yes, I mentioned that the example I made was a "conglomerate" of your bitmap. I think thereason for that is that the polygon's resolution was set to 1 instead of 5 as in your macro below. I didn't know what your "Points Definitions" and the "relataivesize" of your polygon is. That exercise was merely to test whether or not autogen could be retained using a PR textured bitmap -- and obviously, it can.*Re: >"Here is a code of a ground polygon made in AFW166. It is different from my usualmethod but it is easier to work with."<* As regards placement of 'autogen friendly' ground polygons, I'm not sure whether or not'AFW166' does all the things regarding this that the latest (AFW 3.0/build 188) does. Iused the latest build in this test. Regardless of that, it's the coding that controlswhat's happening, whether compiled manually or within a GUI like AFW..As requested, I've inserted the code in your macro, as shown below and also, below that,the macro made by AFW/188 used for testing and as resulted in the previous picture showingall the autogen present. Notice that the only real difference is the "Scale or Resolution"setting in the RefPoint line of code. Yours is "5" and the test poly was "1", meaningthat in bitmap resolution, all distances (points-wise) would be in meters: ; polygon 1Area( b 33:40.83131 -117:51.71231 30 ) LayerCall( :Taglayer 8 ) Jump( : ):Taglayer RefPoint( 7 :TagPoly 5 33:40.83131 -117:51.71231 V1=40000 V2= 1416 ) Bitmap( Image1.bmp 0 0 0 0 ) Smoothing( 1 ) Points( 1 -00100 0 00100 ; 001 00100 0 00100 ; 002 00100 0 -00100 ; 003 -00100 0 -00100 ; 004 ) StartSurface MoveToPt( 1 ) DrawToPt( 2 3 4 ) EndSurface Smoothing( 0 ):TagPoly;===========================; Inserted Dummy Call and Surface Type Here RotatedCall( :B2 0 0 0 ) Return:B2 SurfaceType( 1 41 41 0 ); (For dirt or grass) ReturnEndA;============================;======== The AFW/188 tested macro =============================================Area( b 38:59.56291 -089:9.9118 30 ) LayerCall( :Taglayer 8 ) Jump( : ):Taglayer RefPoint( 7 :TagPoly 1 38:59.56291 -089:9.9118 V1= 40000 V2= 463 ) Bitmap( dca8a.bmp 0 0 0 0 ) Smoothing( 1 ) Points( 1 -00089 0 00213 ; 001 00084 0 00213 ; 002 00089 0 -00214 ; 003 -00083 0 -00213 ; 004 ) StartSurface MoveToPt( 1 ) DrawToPt( 2 3 4 ) EndSurface Smoothing( 0 ):TagPoly RotatedCall( :B2 0 0 0 ) Return:B2 SurfaceType( 1 41 41 0 ) ReturnEndAAgain, I don't know why your bitmap would not display because it works normally when tested here using your dca8a.bmp. Is the "Image1.bmp" used in your example an equivalent to dca8a.bmp PR bitmap? I think you're close to getting what you want here and I also think AFW could be used to easily place and scale those ground polys while retaining all the autogen. Also, I think you can use floating point values in scaling them.J.R.

Share this post


Link to post
Share on other sites

J.R.Success! It works if I just leave the PR tiles in. Now the question is why when I place the scenery in does it not work. I remember there was a discussion post on how ground polygons made by AFW and especially roads tended to wipe out agen in a wide area. Maybe this is the issue?Anyway this is certainly a big help!ThanksShez

Share this post


Link to post
Share on other sites
Guest JR Morgan

Shez..Re: >"Success! It works if I just leave the PR tiles in. Now the question is why when I place the scenery in does it not work.<"Oops, now I'm really confused -- when you say "it works" I'm 'guessing' you mean that after pasting-in the dummy RotatedCall and SurfaceType code into your macro, and compiling the macro, that then, the autogen appears on your PR textured 'tiles' (actually ground polygons)? Then you're saying that when you place the 'scenery in' it does not work? What method did you use to "place the scenery in"? -- Or, how did you determine that 'it works' if you had not yet placed the scenery into an active FS9 scenery folder and viewed it in the sim? If you could give more of a step by step description of the methods you used, then we could probably easily get things working the way you want.Re: >"I remember there was a discussion post on how ground polygons made by AFW and especially roads tended to wipe out agen in a wide area. Maybe this is the issue?"<Unless you're using and older version of AFW, this is not the issue. Recent versions of AFW allows the user to choose whether or not he wishes to implement the dummy calls into Polygons by providing an "Autogen Code" checkbox in it's 'Create Polygon' routine.For AFW roads, the user would need to manually edit the code for roads, applying the dummy call to the road system, else: yes, the AFW roads would be an autogen killer.J.R

Share this post


Link to post
Share on other sites

>Shez..>>Re: >"Success! It works if I just leave the PR tiles in.>Now the question is why when I place the scenery in does it>not work.<">>Oops, now I'm really confused -- when you say "it works" I'm>'guessing' you mean that after pasting-in the dummy>RotatedCall and SurfaceType code into your macro, and>compiling the macro, that then, the autogen appears on>your PR textured 'tiles' (actually ground polygons)? Then>you're saying that when you place the 'scenery in' it does not>work? What method did you use to "place the scenery in"? -->Or, how did you determine that 'it works' if you had not yet>placed the scenery into an active FS9 scenery folder and>viewed it in the sim? If you could give more of a step by>step description of the methods you used, then we could>probably easily get things working the way you want.My ground tiles are in a separate bgl.>Re: >"I remember there was a discussion post on how ground>polygons made by AFW and especially roads tended to wipe out>agen in a wide area. Maybe this is the issue?"<>>Unless you're using and older version of AFW, this is not the>issue. Recent versions of AFW allows the user to choose>whether or not he wishes to implement the dummy calls into>Polygons by providing an "Autogen Code" checkbox in it's>'Create Polygon' routine.>I am using 166 but can try out 188. Let me check this.>For AFW roads, the user would need to manually edit the code>for roads, applying the dummy call to the road system, else:>yes, the AFW roads would be an autogen killer.Roger on this. I guess I have not been following AFW development closely and missed this checkbox.>J.RShez

Share this post


Link to post
Share on other sites
Guest JR Morgan

Shez..Re: >"My ground tiles are in a separate bgl."<I think that should not be a problem as long as you have and can edit the SCASM source code that made the seperate bgl for your PR polygons, because that's the code that needs editing to apply the dummy call and SurfaceType. If you should do it that way, then you probably would not want to use the AFW created polygons although I think they could be made to work for you.With both bgls in the active scenery folder there may be a layering problem because AFW hard codes ground polygons at layer 8 and the 'seperate bgl' (without the added Dummy Call) may be set to a layer call that overrides layer 8.J.R

Share this post


Link to post
Share on other sites

Actually the success was for the PR tiles bgl so no worries there. I need to work out the polygons placed in my main scenery bgl which brings in AFW generated ramp polygons on top of the PR tiles. These will need the checkbox treatment from AFW188.;-) Shez

Share this post


Link to post
Share on other sites
Guest JR Morgan

Hi Shez..Hey, that's good news. Now I understand the situation. I'm glad you can now retain all the default agn objects on your PR textured ground polys; and could add other bldgs of your choice by TransformCalling them.I think you'd do well in upgrading AFW to the latest build and using the ltest SCASM release. 'Lots of new capabilities in it, some of which are:- Opening multiple projects at the same time for the purpose of copying/pasting objects between projects.- Improved background map usage (now handled same as any other object and able to quickly toggle it on or off with 1 click).- Buffered for FP calculations. And of course, the "Autogen Checkbox" (presently limited to polygons only) which inserts the dummy calls into your code, if checked.J.R

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...