Sign in to follow this  
Guest Marky Parky

FS2002 Autogen Annotation Tool

Recommended Posts

Hi all,I would like to know if something exists better than FS2002 Autogen Annotation Tool (annotator.exe) that is, in my opinion, excessively time-consuming because of its limited commands (zoom not powerful, impossibility of rotating buildings, and so on).Thanks all for an answerAlessandro Fantini

Share this post


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

Hi Alessandro.I don't believe anyone ever "cracked" the file structure of autogen, so no one was ever able to make a better tool.Dick

Share this post


Link to post
Share on other sites

>Hi Alessandro.>>I don't believe anyone ever "cracked" the file structure of>autogen, so no one was ever able to make a better tool.>>DickOkay Dick,thank you for your answer.I resign myselfAlessandro

Share this post


Link to post
Share on other sites

I cracked FS2002 agn structure and it is very simple ;)), but I have no time for development of such a tool. It is for .agn files that use default textures set only.The Structure is:HeaderHouse records placed one to otherVegetation records placed one to otherHeader:4 bytes int: 1-2 floor house density : value from 00h to 14h4 bytes int: 3-5 floor house density : value from 00h to 14h4 bytes int: 6-8 floor house density : value from 00h to 14h4 bytes int: 9-12 floor house density : value from 00h to 14h4 bytes int: number of houses4 bytes int: number of vegetation squares4 bytes int: don't know yet, but changes does not affact apearance in FS or in annotator tool. It is depending on number of vegetation squares and building somehow. 4 bytes int: 00h4 bytes int: vegetation 1 type : value from 00h to 06h, 00h means default vegetation4 bytes int: vegetation 2 type : value from 00h to 06h, 00h menas no vegetation type 24 bytes int: vegetation 1,2 relative density : value from 00h to 64h, 00h means only vegetation 2, 64h means only vegetation 14 bytes int: vegetation overal density : value from 00h to 64h, 00h means 0, 64h means 1004 bytes float: vegetation 1 min height4 bytes float: vegetation 1 max height4 bytes float: vegetation 2 min height4 bytes float: vegetation 2 max heightHouse record:4 bytes float: X position of first point4 bytes float: Y position of first point4 bytes float: X vector to the second point4 bytes float: Y vector to the second point4 bytes float: X position of third point4 bytes float: Y position of third pointValues 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.Vegetation record:4 bytes float: X position of first point4 bytes float: Y position of first point4 bytes float: X position of third point4 bytes float: Y position of third pointValues of position are the same as with houses, but it is not neccesary to use vectors here, because vegetation square is always oriented the same way.All this aplies to FS2002 .AGN files. I wonder if there is any diference in FS2004 .AGN files that is used to call library objects.If you know of some .AGN file that seems to contain souch a data, please let me know and I'll try to investigate it more

Share this post


Link to post
Share on other sites

Hi MarkyGood work, thanks! Good to see you here contributing to our little band of would-be scenery guru's and hackers.The FS2004 Autogen has two new types of footprint, in addition to the house and vegetation footprints from FS2002. They are (1) the new 'row houses' that use the second set of building texture sheets, and (2) the library objects. I suspect that the library object footprint data will indicate (a) the class GUID (see default.xml), but not the individual object GUID which is probably chosen by the Autogen system on a 'random' basis from all those listed for the class for the current region, (:( (probably) the footprint size - although that is available from default.xml as well, and © a vector for the orientation. If you like to write to me direct at gerrish@flightsims.co.uk I'll discuss this with you in more detail.Kind RegardsGerrish

Share this post


Link to post
Share on other sites

Thanks, this is interesting information :). I tried to investigate them myself some time ago, but I didn't come this far.

Share this post


Link to post
Share on other sites

I slowly continue with hacking and have following results:Header appears to be same for FS2002 and FS2004.Building and vegetation data are also the same.That is enough to have backward compatibility with FS2002 .agn files.After last vegetation record is added a new structure - small header with 8 unknown bytes simmilar to the unknown part of 2004 header, followed by two different collections of records. Each is introduced with number of records and then follow the records itself.First records are 4x4bytes long, second records are 8x4bytes long.First records might be new houses, but I don't see any on the place, so I am testing it now, second records are vector autogen objects, but there is no data like GUI, se they must be assigned some other way.I will continue hacking and report my progress.

Share this post


Link to post
Share on other sites

Oki, I have another part solved.I am now able to place vegetation, houses and vector autogen objects.Here is the file structure:Header ( same as in FS2002 ):4 bytes int: 1-2 floor house density : value from 00h to 14h4 bytes int: 3-5 floor house density : value from 00h to 14h4 bytes int: 6-8 floor house density : value from 00h to 14h4 bytes int: 9-12 floor house density : value from 00h to 14h4 bytes int: number of houses4 bytes int: number of vegetation squares4 bytes int: don't know yet, but changes does not affact apearance in FS or in annotator tool. It is depending on number of vegetation squares and building somehow. 4 bytes int: 00h4 bytes int: vegetation 1 type : value from 00h to 06h, 00h means default vegetation4 bytes int: vegetation 2 type : value from 00h to 06h, 00h menas no vegetation type 24 bytes int: vegetation 1,2 relative density : value from 00h to 64h, 00h means only vegetation 2, 64h means only vegetation 14 bytes int: vegetation overal density : value from 00h to 64h, 00h means 0, 64h means 1004 bytes float: vegetation 1 min height4 bytes float: vegetation 1 max height4 bytes float: vegetation 2 min height4 bytes float: vegetation 2 max heightHouse records follow - number of records is in header.House record ( the same as in FS2002 ):4 bytes float: X position of first point4 bytes float: Y position of first point4 bytes float: X vector to the second point4 bytes float: Y vector to the second point4 bytes float: X position of third point4 bytes float: Y position of third pointVegetation record follow - number of records is in header.Vegetation record:4 bytes float: X position of first point4 bytes float: Y position of first point4 bytes float: X position of third point4 bytes float: Y position of third pointThe new part of file:4 bytes int: don't know yet, simmilar to FS2002 header no effect4 bytes int: 00h4 bytes int: number of new housesNew houses records follow - I didn't hack them yet, I have to find some file with those houses and play a bit with them4 bytes int: number of GUI's : I have found just 00h or 01h but maybe other values are possibleGUI's record follows:4x4 bytes int: GUI of class of object : important is, that these are 4 times 32bit integers and not one 128bit integer4 bytes number of vector autogen objectsVector autogen object records follow:4 bytes float: X position4 bytes float: Y position4 bytes float: X vector of rotation4 bytes float: Y vector of rotation4 bytes float: X size in km4 bytes float: Y size in kmPositions are from -0.5 to 0.5, vectors from -1 to 1 as i described in previous post.File is ending with 24 bytes of value 00h that may be reserved for future or may contain some more data that are not discovered yet.

Share this post


Link to post
Share on other sites

Oki, I have resolved complete FS2004 agn format. Here it is:Header of FS2002 objects:{4 bytes int: 1-2 floor house density : value from 00h to 14h4 bytes int: 3-5 floor house density : value from 00h to 14h4 bytes int: 6-8 floor house density : value from 00h to 14h4 bytes int: 9-12 floor house density : value from 00h to 14h4 bytes int: number of houses, lets call it H4 bytes int: number of vegetation squares, lets call it V4 bytes int: don't know yet, but changes does not affact apearance in FS or in annotator tool. It is depending on number of vegetation squares and building somehow. 4 bytes int: length of texture sheet name, 00h means default texture, lets call it LL bytes char: name of custom texture sheet without extension4 bytes int: vegetation 1 type : value from 00h to 06h, 00h means default vegetation4 bytes int: vegetation 2 type : value from 00h to 06h, 00h menas no vegetation type 24 bytes int: vegetation 1,2 relative density : value from 00h to 64h, 00h means only vegetation 2, 64h means only vegetation 14 bytes int: vegetation overal density : value from 00h to 64h, 00h means 0, 64h means 1004 bytes float: vegetation 1 min height4 bytes float: vegetation 1 max height4 bytes float: vegetation 2 min height4 bytes float: vegetation 2 max height}H-times follows house record:{4 bytes float: X position of first point4 bytes float: Y position of first point4 bytes float: X vector to the second point4 bytes float: Y vector to the second point4 bytes float: X position of third point4 bytes float: Y position of third point}V-times follows vegetation record:{4 bytes float: X position of first point4 bytes float: Y position of first point4 bytes float: X position of third point4 bytes float: Y position of third point}Header of FS2004 objects:{4 bytes int: don't know yet, but changes does not affact apearance in FS or in annotator tool. It is depending on number of vegetation squares and building somehow. 4 bytes int: length of texture sheet name, 00h means default texture, lets call it L2L2 bytes char: name of custom texture sheet withoud extension}4 bytes int: number of row houses, lets call it RR-times follow row-house record:{4 bytes float: X position of first point4 bytes float: Y position of first point4 bytes float: X vector to the second point4 bytes float: Y vector to the second point4 bytes float: X position of third point4 bytes float: Y position of third point}4 bytes int: number of used GUI classes, lets call it GG-times follow GUI-record:{4x4 bytes int GUI: It is neccessary to read as 4 time 32-bit int, not as 128bit int, because of byte order4 bytes int: number of objects placed with this class, lets call it OO-times follow object record:{4 bytes float: X position4 bytes float: Y position4 bytes float: X vector of rotation4 bytes float: Y vector of rotation4 bytes float: X size in km4 bytes float: Y size in km, negative or positive in this selects in which side of vector the building apears}}24bytes int: 00hHope this helps for building some simple autogen placing utility till the SDK will be released.

Share this post


Link to post
Share on other sites

Hi all!I programmed a delphi software that reads an AGN file. When the program reads the vectors to the second point of a house, it gets the value of 0.70710676908 for a 45

Share this post


Link to post
Share on other sites

I couldn't find the piece of text where the 0.5 is mentioned, but 0.707 does not seem strange to me, the sine or the cosine of 45 degrees is 0.707.

Share this post


Link to post
Share on other sites

Thank you for your answer :-)The text that mentions 0.5 value is on the first description of the AGN file format. I report the text: "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."SIN (45

Share this post


Link to post
Share on other sites

The text only says that a vector defined as <0.5,0.5> defines an angle of 45 degrees. And that is logical as in that case both the x and y component of the vector are the same (with results in 45 degree angle). So I guess you should be reading two values, before you can reconstruct the vector.

Share this post


Link to post
Share on other sites

This has been a wonderful reference since I'm working feverishly on a new replacement to the annotator program to save myself from a life of carpal tunnel syndrome pain. In looking over the above format I notice one possible ommission though. In Annotator, one has the ability to, when say placing a house, selecting the house type such as Urban Small, Urban Medium, Rural Large, etc. Nowhere in that format above is that info saved. It certainly seems like choosing the different house types does result in different autogen houses appearing in FS9 so it must be being saved somewhere.Perhaps it's in those 4 byte sections you couldn't resolve. It would seem more logical that, since you can change the house type for each individual house, that the type would be saved in each house record. Seems there's redundant info in the house records anyway. If one knows the first two point locations exactly and the vector from the 1st to the third, why the need for both the X and Y for the third point? You'd simply need to know the distance along the vector. Could that be the case and the last four byte single or integer is the type?I'm going to experiment with this a bit. Hopefully the original authors of this post are still watching.Art Martin

Share this post


Link to post
Share on other sites

Hi Art,I agree this is a great reference. One of the guys on the Visual Flight forums is hoping to do an MSc dissertation on generating autogen from photographic scenery textures.George

Share this post


Link to post
Share on other sites

Glad I hadn't started coding that part yet. I sure read it wrong. Understand the first point X and Y. Next two 4 byte pairs are the X and Y vectors to the 2nd point? Why not just the actual positions or the angle and distance? Sheesh. What is an X and Y vector anyway? Isn't a vector an angle? Why would you need two of them? For that matter, if you're simply drawing a box and have data storage room (6 4 byte sections) for three full points, it would seem that would define the box completely if you simply stored the X and Y positions directly. Since we know the house definition is in the form of a rectangle that can be angled from the horizontal, the best utilization of the file space would be:1st 4 byte space - x position of 1st point2nd 4 byte space - y position of 1st point3rd 4 byte space - vector (angle) to 2nd point4th 4 byte space - distance to 2nd point5th 4 byte space - length of line from 1st to 3rd point.The 3rd and 4th spaces could also simply be the actual X and Y positions of the 2nd point. The angle is easily derived from the offsets of the 1st and 2nd.This all leaves one space open for other info. No need to define the angle to the third. It's going to be 90 degrees off from the vector to the 2nd.I still would love to know what tool the Microsoft programmers use to create their autogen files. Have this feeling it's not Annotator.Art

Share this post


Link to post
Share on other sites

Hello Art,I have been reading your posts with great interest. I remember this thread as, in the past, I thought of adding to Sbuilder something similar to what you are doing. One think that would be nice was the ability to anotate the raw (whole) bitmap that we use to produce the photo scenery instead of working on individual slices. The programme could generate the agns where annotations have been done (where annotations exist).Regards, Luis

Share this post


Link to post
Share on other sites

Art,A vector is a line at an angle and has a length. The X/Y values are the components in the directions of the x and y axes.Why are you suggesting a different format for the file? The file format exists so you will need to use it.George

Share this post


Link to post
Share on other sites

This most definately is a great resource, thanks George for pointing me over here! Hope I can be successful working on it!Will

Share this post


Link to post
Share on other sites

George, I wasn't suggesting that at all. I was just really confused by what seemed to be a very strange format that Microsoft chose. Obviously I have to work with what they've established. I'm simply wondering, given that there's no place in the above decoded format for the code that identifies the style of building, if maybe that decoding might not be in error and that the info does exist within each house record. Never hurts to take a second look at something. I guess you could say too I was poking a bit of fun at the complexity of nerdiness. Just thought it was strange that Microsoft would go through so much trouble to compress this info into binary format when very few of the values would ever get above integer levels and the picture you're setting up autogen for is only 256 X 256 pixels in the first place. It's always amusing to me in programming what true nerds go through to save a byte here and there when the file could've been a simple tab delimited or fixed length field file of actual numbers that very clearly showed someone opening it what it contained. Take the first four byte groups for example. They describe 4 numbers with ranges of 0 - 20 and yet in their zeal to put everything in hex, they've managed to take up 16 bytes of the file. Even saving the text "20" followed by a tab character 4 times, only requires 12 bytes and were someone to go into the file, it'd be immediately readable. We know the picture is going to be 256 X 256 pixels across so why do we need this obscure way of representing X and Y locations with a -0.5 to 0.5 scale? Why not simply save the actual pixel positions as a number between 0 and 256 in text format?If fully understand data compression when it's truly needed but in my own daily programming I also live by my own rule of thumb - Don't make anything too complex that should it break it takes you a day to remember how you did it.I'm not worried. I'm sure I'll solve this all on my own with some true experimentation that involves creating a brand new .agn file with annotator, drawing one house at a time, saving the file, and using a hex editor, watch the exact changes to the file. I hope the Microsoft programmer that designed this stuff has trouble helping his son with his math homework just as I hope the inventor of the necktie died a slow strangulation death.

Share this post


Link to post
Share on other sites

Annotating the entire bitmap would be cool although, in the scenery I was creating, my original files were often 40mb in size and when zoomed out to fit on a single computer screen no details could be seen. Facing the task of setting up 10,000 houses at a time would've been a bit daunting. Maybe Microsoft had it right there by breaking up the chore into the individual tiles. They just didn't make the program user friendly. My first programming task has been a much simpler user interface for deciding what file you want to work on, allowing you to see each tile and know which ones already had autogen assigned to them. Next step is to put patches of color on those selection images so you can get a general idea of the level of editing you've completed already. Next programming step will be the editing page. First of all, I don't know about the rest of you, but the first steps I always did on Annotator were to expand the window size, zoom in, and pan the zoomed image back to the center of the window. Man, make the image as big as you possibly can right from the start. Who wants to draw tiny little boxes on a tiny little thumbnail print? Then, give the user some preset house buttons. I find that the majority of my houses are square to the image. Why in the world do I have to draw the first line and expand it out if I don't want the house angled? The classic (mouse down to set the first corner, drag to the opposite corner, and release) seems a bit easier on the hands. If I click back inside the box I just drew, I select the object for deleting, moving, or resizing. Most angled houses I've found are at a 45 degree angle. Why not a button for that drawing style using the same logic? A freehand tool then makes up any other angled styles.Another button lets you define a rectangle as a row of individual houses as you'd find in a housing development. This is where either AI logic comes in for the computer to decide the spacing based on patterns it finds in the underlying picture or you simply let the user decide the house size and the amount of space between them. Annotator gives you the option after the fact of seeing if you've overlapped any of your defined houses. Duh! Don't let the user overdraw another house in the first place. I've heard many complaints about the vegetation tool. Annotator only allows you to define rectangular areas. Mine will allow freehand drawing of an area and, once defined, will fill in the appropriate boxes required by the output file. All the defaults (building heights, vegetation choices, etc) will be saveable and will be the default for each new agn file you create unless the user intentionally changes it. I can't tell you how many times I've gone into Annotator and forgotten to change those defaults and ended up with 10 story buildings in a residential neighborhood. When I'm done with this program, the EULA is going to state: "This software is free for use for any private scenery design user. Should any employee of Microsoft wish to make use of it, open your wallets suckas....."

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