• 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.

Latest .agn file format discoveries

Messages
144
Country
us-arizona
Here's what we were given a year ago describing how a house record is saved inside the .agn file the Annotator program produces. It is wonderful insight into getting started but does not tell the full story.

House record:

4 bytes float: X position of first point
4 bytes float: Y position of first point
4 bytes float: X vector to the second point
4 bytes float: Y vector to the second point
4 bytes float: X position of third point
4 bytes float: Y position of third point

Values of position are -0.5 for left or upper side and 0.5 for bottom or right side. That means that upper left corener has value of <-0.5,-0.5>, center has value of <0,0> and upper right has value of <0.5,-0.5>.

Vectors have values from 0 to 1. Vector < 1,0 > means horizontal line, vector < 0,1 > vertical line, vector < 0.5,0.5 > means line with angle 45 deg from upper left to lower right.



The person was right on in describing the first 4 byte sets. The first 8 bytes truly contain the actual X and Y coordinates (from -.5 to .5) of the first point of the rectangle describing the house. The second 8 bytes truly do contain the X and Y vector info of the direction to the second point of that rectangle. The last 8 bytes however are not the actual positions of the 3rd point necessary to describe the full box but instead, the offset amounts from the first point to that third point. Depending on the values of the point 2 X and Y vectors, those offset values are either added to or subtracted from the point 1 coordinates to locate the third point. Now, having said that, this only works for boxes drawn horizontally and vertically.

Using that logic I was able to exactly reproduce the same boxes Annotator shows on their image on the image I intend to use as a backdrop for editing.

Once I put an angled house object in Annotator, all the rules stopped working. The first 8 bytes still accurately depict the point one coordinates. The second eight bytes contain the sin and cosine values of the angle from the first point to the second point. One can only however get the direction from those values, not the actual 2nd point of the box. The last two bytes also appear to be offset values but here's where my dilemna occurs. No matter how I combine those supposed offsets to the Point 1 positions or adjust them mathematically with the vector amounts, I can't get a point 3 to line up with where it should be any other corner of the box. I've tried multiplying the offsets by the sin or cosine values, dividing by them, adding and subtracting them. Next step will be looking at other trig functions based on those sin and cosine values and using those for adjustments. This is pretty daunting.

What scares me is that obviously others have been tempted into this minefield before and we have never seen an alternative produced. Have I found the point where everyone in the past has gotten blocked and just given up? Man, I could use some brainstorming help here. No suggestion is off the table at this point.

Art Martin
 
Latest work

Spent much of last night working on something a lot of people have been asking for - non-square tree areas. Very easy to program the code required to define the area. What I found the tough part to be was creating the squares within the selected area that best fill the possible shapes. Started out with logic that found the geographic center of the shape based on the farthest left, farthest right, top, and bottom screen positions and then slowing expanding a box until it hit an edge. Once I had the center rectangle I was going to try to fill in the other holes in a similar manner. Well, that seemed to work but it was dog slow and required huge amounts of code to do the work.

It became obvious to me that method was doomed so I went with another try. I created an 8 X 8 grid of small boxes across the defined area and within each box, looked for the existance of points that made up the area. If I found one, I excluded the box from consideration. Initially this worked pretty well but included boxes totally outside the shape. Next step was that any boxes on the outer 2 or so rows of the grid I defaulted to bad and then did a search outward for any points of the defined area. If I found any then I brought that box back into the good designation. After that, I was left with good defined boxes only inside the center of my defined area with the boxes that hit the perimeter shown as bad. Next step was to see if those outer boxes could be redefined by shrinking them down to make them stay within the boundaries. That's where I left off. That logic is very tricky since one has to treat a box on the right side of the area different from one near the top. I'll also want to write some code that combines boxes near the center to cut down the number of square vegetation areas I have to create.

None of the rules you set up work perfectly if your defined area has grossly exaggerated shapes to it. To save the number of points I have to save when defining the shape, I wrote code that only saves a new point if there's a change in both the x and y direction which can trip you up in the area evaluation later if you end up with a long span that might not have a point above, below, or to the side of a box you want to evaluation.

Now for the completion list. Code is done for defining new house boxes that are aligned horizontally and vertically using the standard method of a button push to mark one corner, dragging to the opposite corner, and letting go to set the rectangle. Another button is for creating angled houses, same first steps to create a rectangular box but when you release the button, mouse movements rotate the rectangle. Pressing the mouse button again sets the angle.

Another button is for creating multiple houses in a row. You set a narrow rectangle using the same method as a squared off house and then go back and click back into that rectangle to set a distance from your inital first point to set the width of the houses you want created. The computer automatically creates a row of spaced houses across your rectangle at the selected width. This works equally well for rectangles you define going across or up and down. Future versions might also allow for an angled rectangle to be defined but that would be much trickier creating the individual houses. This should speed up tremendously creating the hundreds of houses needed to really define an area such as a housing development.

I'll get a screenshot of my progress completed in the next day or so and let you see it. Man, this has been a great refresher course on graphics programming and trigonometry. In my own job as a programmer in the transportation industry, we as programmers have been reduced from creative analysts to simple code and data mechanics as the moronic government we work for pushes for more and more off-the-shelf software packages and shuts down in-house development. It's a breath of fresh air to play like this and feel once again that artistic side I always loved about programming. Too bad the fun stuff doesn't pay the bills.

Art Martin
 
latest

Well, the program is coming along great. Got over some very challenging hurdles on all my desired features and have added a few more. Here's the list of things that are now working in it:

(sorry I don't have screen shots but I'm posting this from work and don't have the program in front of me.)

1. Simple treeview-style user interface for identifying and opening (or creating) the appropriate .agn file for a selected .bmp tile. When browsing through your scenery areas, the DXT files are displayed as viewable images to make your selection easier. Ones that already have an associated .agn file created are clearly identified.

2. Once selected, the image is displayed as a 10240 x 10240 zoomed picture for editing.

3. To the right of the image are sliders and entry boxes for the various defaults such as building height amounts, vegetation types and sizes, densities, etc. When opening a new image that doesn't have an associated .agn file defined, these sliders and amounts will remain set to the same amounts as the previous image you just edited. When closing the program, those defaults will be saved to a user .ini file as preferences and will be the default when starting up with a new file.

4. These are the editing buttons at the top of the screen and their functionality:

- Simple horizontally/vertically aligned house button. Box is created using standard button press, move cursor to opposite side of rectangle, and release.

- Angled house button. Box is created exactly as in the current version of Annotator.

- Simple horizontally/vertically aligned multiple house creation button. User creates a rectangle as in horz/vert house process. Next button press defines the distance from the first set point to indicate the width of each house. Program automatically creates multiple houses within the defined box along the longest width of that box with spacing between them determined by a slider to the right of the image.

- Angled multiple house creation button. User creates an angled rectangle. Next button push sets point as above to determine house width. Program creates multiple houses aligned with the defined angled box.

- Simple horizontally/vertically aligned row house creation button. Same as hor/vert house but creates row houses instead.

- Angled row house creation button. Same as angled house creation but defines angled row house instead.

- Freeform vegetation area button. User traces out a freeform area they wish vegetation to be placed. When button is released, program calculates the rectangles that best fit the area.

- Rectangular vegetation area button. Same as old Annotator program for simple or very small areas.

- Undo button. Removes the results of your last action.

- Select button. Next on programming list. User can draw box around an area on the screen and do various actions on the objects defined in that area such as delete and move.

This morning I successfully saved an agn file I had loaded in and all of the defined areas that had been identified as being important in the earlier hacks of the file format, saved exactly as the Annotator program did. There are however, a few byte sets that the hacks listed as unimportant that I'm really wondering about. Nowhere in the format is there any place to save the selections shown in the current Annotator program that define the house styles such as Urban Small, Rural Medium, etc. It's my suspicion that those unidentified bytes may just have that info in them. If anyone reading this can help in this identification or can help rule out that theory I'd be eternally grateful. I'm going to do some serious experimentation but not knowing what to look for could be daunting.

Screenshots coming soon.

Art Martin
 
Screenshot - ready for Beta very soon.

Ok, here's the promised screenshot from the new Autogen program I've been working on. I've used it extensively to add to the photoreal scenery I'm working on, especially the multiple house generation tools.

Art Martin
 

Attachments

  • Autogen1.jpg
    Autogen1.jpg
    89.3 KB · Views: 704
Cool stuff ...

Hi Martin,

eeek - looks great !
If you look for beta-testers i am here :teacher:

Keep on running


Greetz - Enzo :wave:
 
eeek - looks great !
If you look for beta-testers i am here :teacher:

Here I am too (another beta-tester, I mean ;) )

Looks like a fresh new input for scenery designers. I was working with custom object libraries in autogen (just a little bit of tweaking in the autogen XML file... that's all that I can do) and photoreal sceneries look much better.
Will custom object libraries be usable too in your nice prog.?

Thanks. Mauro
 
See the new thread I just created asking for beta testers. GUI object classes can be inserted in my new program. It should allow any custom classes you create in the DEFAULT.XML file.

Art
 
artmartin said:
See the new thread I just created asking for beta testers. GUI object classes can be inserted in my new program. It should allow any custom classes you create in the DEFAULT.XML file.

Art

Thanks, art. I'll check it :D

Mauro
 
Back
Top