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
Help AVSIM continue to serve you!
Please donate today!

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

I guess one could use the "Line of 3d objects" function.;) Shez

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

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

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

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

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

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

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