Sign in to follow this  
rhumbaflappy

What is GMax View Distance Maximum

Recommended Posts

How can I get the GMax "View Distance" greater than 60000 meters?I have been successfully working with GMax for quite a while. During the export phase I have found that I have not been able to exceed a "view distance" of around 60000 meters--approximately 37 miles.I am presently working on a project that covers as much as a 20 mile radius and I need to be able to see it from well beyond that distance--preferably from 60 miles or more.The project is to graphically represent the inbound and outbound traffic patterns surrounding KATL--the flight paths which ATC uses to move aircraft safely in and out of the congested KATL area.I have been able to create these, but so far, I can't get it where you can fly outside of the immediate area and still be able to see the graphics. As soon as the aircraft goes beyond the 60000 meter perimeter, the graphics disappear. And that is just not quite far enough out to be able to view the entire graphic.Any ideas how to overcome that will be sincerely appreciated!Happy Flying!Bill MolonyAtlanta GA USAUnder the 27L Approach to KATL--the busiest airport in the world :)

Share this post


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

I thought Chicago O'Hare took back the Busiest airport in the world title this year? :) Anyway I think you have reached the maximum of view distance for Gmax. I read at the gmaxsupport.com forum about compiling the .bgl file then decompile it and change the view distance, and recompile.

Share this post


Link to post
Share on other sites

I think the best way is to split the project.I assume it consists of different objects and then it is best to export each object seperate. This has also the advantage that the visibility range is measured to the center of the object and you can use smaller ranges, which increases the performance. From performance point of view it is never a good thing to make big areas in one RefPoint, because that doesn't allow good optimalization for performance.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 Dave,Them's fightin' words!!! :) But I agree KATL and O'Hare do seem to rock back and forth between first place. Depends on which month of the year I guess. But KATL seems to be headed for the final win. After all KATL was in 3rd place just a few years ago behind both O'Hare and DFW and now they have left DFW in the dust. Time will tell.I appreciate the info on the possiblity of a decompile/recompile. Sounds like a promising solution. But I could not find anything further about it. If you have more info or some place where I can find more info, I would certainly appreciate it!Happy Flying!Bill MolonyAtlanta GA USAUnder the 27L Approach to KATL--the busiest airport in the world :)

Share this post


Link to post
Share on other sites

Arno,Thanks for the reply. But I am afraid separating them into several separate projects will just get too complex. I think my graphics objects are just too big and intricately involved with each other for that approach. Besides that, one of my objects is 20 nm in circumference! :)And performance has not seemed to be an issue at all. Surprisingly, with my graphics loaded, I cannot see any real degradation in performance at all.See the additional reply I added below with more info.Happy Flying!Bill MolonyAtlanta GA USAUnder the 27L Approach to KATL--the busiest airport in the world :)

Share this post


Link to post
Share on other sites

Interesting, know I understand your problem :).I haven't tried this with GMax, but in SCASM the maximum range of an Area can be 255 km, so that means that in theory you should be able to get a greater distance, but I never tested in GMax how this should or could be done.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

Yep, you are right. There is no good reason why this limit should be necessary. Obviously this is some type of arbitrary limit that was put on it by some programmer not really thinking deep enough.Probably felt that 10 miles away should be good enough for anything. Probably never considered something could actually need to be even twice as big as the limit he was putting on it.Or maybe even he was too lazy to take the time to allow for more units of measurement than simply meters and he had already set the value to integer and the variable could accept only up to 65536.Actually, I've known a lot of programmers like that personally ! :)Of course, it is even more likely that he was put on a strict and unrealistic time limit by management such that he did not have time to do more.Oh well! :)Happy Flying!Bill MolonyAtlanta GA USAUnder the 27L Approach to KATL--the busiest airport in the world :)

Share this post


Link to post
Share on other sites

A solution might be to make a library using FsRegen and then place the object with an API (or simple SCASM code). Maybe you can get the greater range then.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

Arno,What you are saying sounds like maybe the right track. Unfortunately I have no idea how to do what you are suggesting.Could you send me more detailed instructions. It might be best if we continue this through direct email.My email address is bmolony@bellsouth.netHappy Flying!Bill MolonyAtlanta GA USAUnder the 27L Approach to KATL--the busiest airport in the world :)

Share this post


Link to post
Share on other sites

Hi bmolony.Have you checked the header bounds of the resultant BGL? A scenery is only active within the bounds set by the header.I'm thinking that might cause an object to limited as to it's viewing distance as well. The header could possibly be rewritten in the ASM code, or a hex editor used to hack the bounds, if they are at fault.Dick

Share this post


Link to post
Share on other sites

Hi Dick,Although I have a programming background, it has been a long time since I have done much coding. I am really not sure how to go about finding out what you are talking about.How do I read that header?What should I expect to find?How can I change it?Happy Flying!Bill MolonyAtlanta GA USAUnder the 27L Approach to KATL--the busiest airport in the world :)

Share this post


Link to post
Share on other sites

Hi Bill.You could use BGLanalyse to disassemble the BGL. That program will tell you the bounds in Latitude and Longitude that encloses your scenery.If that is the limitation, the bounds could be expanded NSEW to enclose a larger area. The FS2000 Scenery SDK explains the header section of the BGL.----------------------I looked in the SDK also for some type of limitation for viewing range. There is a BGL_SCALE command that does present a viewing range as an unsigned 16 bit integer... that would be a max of 65,535 meters. ( page 63 of the SDK ). I don't know if your code includes this command for the object, but that could also be the source of the limitation, and that would not allow a work-around. The 65Km limit would be about a 40 mile limit from the center of the object.If the project were split into fragments, the outer pieces of these fragments would have centers a bit more removed than the center of the original object... so an outer most piece would then be viewable by another 7-8 miles, perhaps.Take a look at the SDK, and see if anything rings a bell for you.Dick

Share this post


Link to post
Share on other sites

Hi Dick,RE: "unsigned 16 bit integer... that would be a max of 65,535 meters"---OUCH! That sounds like a terrible but very realistic probability with almost no work-around within the GMax Export routine. Sounds like my only hope is to do something outside of GMax to correct the problem. And I am not sure exactly what I can or should do.I had already considered--and quickly dismissed--the concept of dividing my graphic into several projects each with it's own center. But one of my primary goals for the project is to provide a method to view the entire graphic siumultaneously out to its full extent. That of course would mean being able to get out at least 50-60 nm from it in any direction. Parsing the graphic into separate entities would do nothing toward accomplishing that.Regardless, your first suggestion, "use BGLanalyse to disassemble the BGL", sounds like my only alternative at this time. The only problem with that is, although I have a programming background, it has been quite a while since I have done any real coding. And I was NEVER very good at "hacking". So I don't know whether I can do that or not. Guess I will have to just dig in and see what I can come up with.Some kind of "step by step" instructions would certainly be of some help. Or maybe even their is a good soul out there who would volunteer to take my project files and see if they can find a way to work around the problem.Any other suggestions you--or anyone else--can offer will certainly be appreciated.Happy Flying!Bill MolonyAtlanta GA USAUnder the 27L Approach to KATL--the busiest airport in the world :)

Share this post


Link to post
Share on other sites

Hi Bill.That possible 16-bit restriction on viewrange is not just for BGLC or Gmax... that's the sim's restriction ( hardcoded ) on all objects.Dick

Share this post


Link to post
Share on other sites

Hi Bill.There may be a work-around for your problem.How are you displaying the object? From the BGLC code derived from Gmax?Backup the BGLC code first!Somewhere near the top of your BGLC code, you may have a line that is like: NEAR_FAR_SMALL_OBJECT_HEADER 000550F18h, 00143C150h, object_end_0000, 100It actually should be like: NEAR_FAR_HUGE_OBJECT_HEADER 000550F18h, 00143C150h, object_end_0000, 100and that alone might work. The parameters are the Lat,Long,objectend label, and the "power" ( 100% ).-----------------------If you make that change ( please backup the BGLC code first! ), and the viewing range is not extended, then there may be one other solution:There is an old FS5.1 command that is called LARGE_RANGE ( might not even be a bglc macro for it ). This code may work for a macro:; ------------------LARGE_RANGE_HEADER macro latitude,longitude,object_end,low_range,high_range LOCAL opcodeopcode db 13 dd latitude,longitude db low_range,high_range dw object_end-opcode endm; ------------------ LARGE_RANGE_HEADER 000550F18h, 00143C150h, object_end_0000, 0, 255or possibly: LARGE_RANGE_HEADER 000550F18h, 00143C150h, object_end_0000, 1, 255or possibly: LARGE_RANGE_HEADER 000550F18h, 00143C150h, object_end_0000, 255, 255The sim might crash, it might show no difference, or it may be just what you need. I'm not sure of the values for low_range and high_range. It may even be a percentage like "power", but I think not. They are bytes, and so are limited to 0-255 ( 0h-0ffh ). ---------------------------Here's another possiblility... first the macro:;----------------------ALWAYS_LOAD_OBJECT_HEADER macro latitude,longitude,object_end LOCAL opcodeopcode db 14 dd latitude,longitude db 255 ;image power dd object_end-opcode endm;----------------------Note the opcode here is 14 (E). SCASM refers to this as Area(E). I found it in the FS98 SDK. So you would have to paste that Macro code in. Then the code should read: ALWAYS_LOAD_OBJECT_HEADER 000550F18h, 00143C150h, object_end_0000And that may work. Oddly, this code indicates that "power" is not limited from 1-100, but extends from 1-255, and may actually show a general misunderstanding of the power parameter. It was thought of as a percentage... but here indicates it's a fractional range from 1-255, as does the other macro range.Dick

Share this post


Link to post
Share on other sites

Dick,THANKS for answering further on this problem. I had given up on finding a solution that I could do and this message thread had gotten very old so I did not expect further responses either.Those all sound like great possible solutions! Unfortunately, I don't know how to do what you are discussing. :(At present, all I am doing is building the structures in GMax and then using the built-in GMax Export function that builds a BGL file that is automatically put in the ...Scenery folder.And that BGL file is strictly machine code--no text, BGLC code, or anything readable. There are no intermediate steps or files that I can find that I can read.Could you explain to me how to get that intermediate BGLC code to read?How about sending me an email at bmolony@bellsouth.net so we can discuss it further.Happy Flying!Bill MolonyAtlanta GA USAUnder the 27L Approach to KATL--the busiest airport in the world :)

Share this post


Link to post
Share on other sites

Hi Bill.We've got an impasse... I don't know GMAX very well.I'm thinking MakeMDL gives an option to save the BGLC code. There should be 2 ASM files created. One file places the object, and the other file ( much larger ) actually is the object.The code to play with should be in the smaller file.To compile that ASM code, you need both ASM files and BGLC.exe in the same folder. Then drag'n'drop the smaller ASM onto the BGLC icon. That should produce the BGL in that folder.If you get that far, could you attach both the ASM codes to your return post, as a TXT file? Then I can play with them as well.Dick

Share this post


Link to post
Share on other sites

There are no such files being created that I know of.But I will be happy to send you anything you need.Please email me about this:bmolony@bellsouth.netHappy Flying!Bill MolonyAtlanta GA USAUnder the 27L Approach to KATL--the busiest airport in the world :)

Share this post


Link to post
Share on other sites

Hi Bill.I've e-mailed you, and we'll continue that way.I'll post results of the experiment ( but not your private code ), at a later time.Dick

Share this post


Link to post
Share on other sites

Hi Bill.Bad news. There is no way to bump up the visual range limit of an object... I think it's actually 65535 meters radius from the center of the object ( about 40 miles ). With your scenery, I can see the "outer ring" from within the scenery's limit, but when I move out of the radius, ( just beyond the inner ring ) it all disappears! So perhaps to view the 65535 meters, you must be within 32767 meters of the center. :(Radius maximum size should be 65535 meters... allowing a diameter of 131070 meters... But again, that seems too high.. so maybe the SDK writers confused radius with diameter. Who knows.Anyways, your object is too big, and seems to be only viewable from the "inside".I know you don't want to break up the object, but that is the only way I can think of to extend the view limits.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