Jump to content
Sign in to follow this  
arno

heli platform in BGLC

Recommended Posts

Guest christian

I finally found some misc elevation bgls in FS2002.After decompiling I can say that it still seems to work 100% as stated in the FS2000 SDK, so the examples in the SDK may be a good point to start with.The pure existence of that code may not necessarily mean that it works. I'll have to do some testing.Also, I only found SCALE, but not SCALE_AGL. SCALE_AGL may not be supported.I also found one slightly different example: There was one example that had an IFIN1 command after the AREA_SENSE. IFIN1 was using 'usrvar4' as an argument, and values like 20, 18, 16:AREA_SENSEIFIN1 usrvar4, 20, 20SET_ALTITUDEAREA_SENSEIFIN1 usrvar4, 18, 18SET_ALTITUDEetc(these commands are obvioulsy incomplete! they are just used as an illustration...)Dunno what usrvar4 does, nor what the whole thing is supposed to do. This command was used in San Diego. The only other elevated platforms I could find so far are in San Francisco.I couldn't find any dynamic opcodes yet, maybe that's not used in FS2002 at all?The search continues...Cheers, Christian

Share this post


Link to post
Share on other sites

Hi Christian,usrvar4 is (as the name says) a user variable. So normally it is not set. I expect, for this code to work fine, that somewhere else in the BGL this variable must be set to a certain value. Otherwise it makes no sense to me....No, I don't think Fs2002 still uses dynamic upcodes. They are still supported for backward compatibility I guess.Arno


Member Netherlands 2000 Scenery Team[link:home.wanadoo.nl/arno.gerretsen]Arno's FlightSim World for scenery design hints, tips and other tricks...

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Hi Christian.Arno might be right in that is a user variable of some kind.I think the bounding parameters are interesting... 20,20 and 18,18It got me wondering if the elevation is only set for the helipad if the aircraft is within 20 ( or 18 ) meters of the "RefPoint". There wouldn't be any need for the elevation to be set unless, the 'chopper' was over the pad.I'm assuming the helipad "hardening" was not in a Library Object (?).Do you have a lat-long point for the San Diego and San Francisco pads? I'd like to try them out. :)Dick

Share this post


Link to post
Share on other sites

>I think the bounding parameters are interesting... 20,20 and >18,18 Nothing strange about them, just a way to check if the variable is equal to that value. In SCASM there are two different command IfVarAnd and IfVarRange. IfVarAnd takes one value and looks if the variable is equal to it. IfVarRange takes two and looks if the variable is between them. If you give IfVarRange (or IFIN1 in BGLC) the same value twice it works just as IfVarAnd.>It got me wondering if the elevation is only set for the >helipad if the aircraft is within 20 ( or 18 ) meters of the >"RefPoint". There wouldn't be any need for the elevation to >be set unless, the 'chopper' was over the pad.Depends on what is stored in the usrvar4. As long as we don't know what is stored there, we don't know what is checked for. Can also be the amount of cows that are standing next to your pad or whatever :-lol. This must be set somewhere else, or else the value is zero I think and no hard surface is set at all.Arno


Member Netherlands 2000 Scenery Team[link:home.wanadoo.nl/arno.gerretsen]Arno's FlightSim World for scenery design hints, tips and other tricks...

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Hi Arno, Christian.I'm noting there are many helopads on buildings in the San Diego area... they are all on buildings with red strobing lights, marking the pad. I haven't found any on the really tall buildings.There is definitely no "fall through" on these buildings... and the surface area is landable until the COG of the helicopter goes beyond the egde of the building.There are also a number of ground level helopads, marked with the "circled-H" at a nearby airfield. I wonder if those have elevations set, as well.Dick

Share this post


Link to post
Share on other sites

Hi Christian.The BGL for the SanDiego helipads is in the F5244312.bgl, which contains the areas objects.I used BGLAnalyze to disassemble the code to SCASM... then extracted the object code of one of the generic buildings with a helipad. I then rebuilt it for the Delavan, Wisconsin, US area...; Delavan Helipad;Header( 1 N42:38:00.00 N42:38:00.00 W088:38:00.00 W088:38:00.00 )LatRange( N42:38:00.00 N42:38:00.00 ); ----------------------------------------Area( 5 N42:38:00.00 W088:38:00.00 12 ) IfVarRange( : 0346 3 32767 ) PerspectiveCall( :_Perspective ) ShadowCall( :_Placeit ) Jump( : ) :_Perspective Perspective:_Placeit RefPoint( rel :_FailReturn 1.00 N42:38:00.00 W088:38:00.00 V1= 6000 V2= 230 ) SeparationPlane( :_BuildObject m 0 32767 0 56.00 ) Call( :_Building ) Call( :_Light ) Return:_BuildObject Call( :_Light ) Call( :_Building ) Return:_Building AdvBldg( normal 50 50 LEVEL1 0 0 0 0 LEVEL2 58 55 320 352 320 LEVEL3 0 0 0 0 ROOF 10 256 256 ) Return:_Light IfVarAnd( :_FailReturn 030A 0018 ) LineColor( 0F F0 ) Dot( 0 56 0 ):_FailReturn ReturnEndA; ----------------------------------------It's apparently the SeparationPlane() command, that creates the helipad. I'm not exactly sure of the code for SeparationPlane, but it appears if you are within 56 meters width, centered on the z axis ( vertical axis ) it will build this separationplane... Otherwise it aborts, and jumps to the ':_BuildObject' label In slew mode, I can start a few hundred feet above the building's roof, and my FSUIPC based TDFCalc3 reads ground elevation. As I enter the airspace of the building, the ground elevation suddenly leaps to AGL + 55 meters ( the actual height of the building defined by the LEVEL2 of the building ). The jump in elevation seems precise.The light, is coincidentally at 56 meters... it could be much closer to the roof level... and just confuses the code. However, looking at the code, I note that outside of the 56 meter width on the z axis, the light is drawn first... but within the 56 meter width, the building is drawn first ( to get the object height needed for the SeparationPlane ? ).I'll play with this code some, and perhaps you could make a bgl... then decompile it to ASM.. to derive the BGLC code?The code doesn't work in CFS2... I didn't try FS2000 yet. In FS2002, the helipad is solid.. no fall-through, and much simpler than the other helipad schemes I've seen.Am I right in assuming the dimensions of the building actually create the landing surface? And that the SeparationPlane is, in effect, an object surface hardening qualifier?Dick

Share this post


Link to post
Share on other sites

>It's apparently the SeparationPlane() command, that creates >the helipad. I don't think so. This is just a command that checks where you are relative to that plane and that decides the drawing order. Here you see that in one case the light is drawn before the building and in the other case the other way around.The hard surface doesn't seem to be in this code. It's probably a Area16 and therefore not here.Arno


Member Netherlands 2000 Scenery Team[link:home.wanadoo.nl/arno.gerretsen]Arno's FlightSim World for scenery design hints, tips and other tricks...

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Hi Arno.You're right... I've been involved in a bunch of foolishness! *:-* I did find one thing though...; Delavan Helipad;Header( 1 N42:38:00.00 N42:38:00.00 W088:38:00.00 W088:38:00.00 )LatRange( N42:38:00.00 N42:38:00.00 ); ----------------------------------------Area( 5 N42:38:00.00 W088:38:00.00 12 ) IfVarRange( : 0346 3 32767 ) PerspectiveCall( :_Perspective ) ShadowCall( :_Placeit ) Jump( : ) :_Perspective Perspective:_Placeit RefPoint( abs :_FailReturn 1.00 N42:38:00.00 W088:38:00.00 E= 400 V1= 6000 V2= 65 ) Call( :_Building ) Call( :_Light ) Return:_Building AdvBldg( normal 50 50 LEVEL1 0 0 0 0 LEVEL2 58 0 320 352 320 LEVEL3 0 0 0 0 ROOF 10 256 256 ) Return:_Light IfVarAnd( :_FailReturn 030A 0018 ) LineColor( 0F F0 ) Dot( 0 0 0 ):_FailReturn ReturnEndA; ----------------------------------------It seems Advanced Buildings are landable... at least this one is.Oddly, it has no height! I left the light on! And, I placed it at an elevation of 400 meters.Nice shadow.... It is hard and landable, and invisible ( other than the shadow I placed ). :-xxrotflmao I think J.R. Morgan might be interested in how to make a helipad this way... he was dealing with some complicated code for an API, that involved an Area16n and 2(?) invisible runways. This seems a little simpler. You can fly over it, under it, even through it from below... but as soon as you are over it, the surface registers as elevation, and it's landable. I think it would be possible to stack layers of these pads, as well.Here's some simpler code:; Delavan Helipad;Header( 1 N42:38:00.00 N42:38:00.00 W088:38:00.00 W088:38:00.00 )LatRange( N42:38:00.00 N42:38:00.00 ); ----------------------------------------Area( 5 N42:38:00.00 W088:38:00.00 12 ) Call( :_Placeit ) Jump( : ):_Placeit RefPoint( abs :_FailReturn 1.00 N42:38:00.00 W088:38:00.00 E= 400 V1= 6000 V2= 65 ) Call( :_Building ) Call( :_Light ) Return:_Building AdvBldg( normal 50 50 ) Return:_Light IfVarAnd( :_FailReturn 030A 0018 ) LineColor( 0F F0 ) Dot( 0 0 0 ) Dot( -25 0 25 ) Dot( 25 0 25 ) Dot( 25 0 -25 ) Dot( -25 0 -25 ):_FailReturn ReturnEndA; ----------------------------------------[/code]I'm not sure what V2 needs to be set to here.Now, I'm wondering what Christian was looking at.Dick

Share this post


Link to post
Share on other sites
Guest JR Morgan

Hey you guys... I think you may have discovered the "right way" to do it :-); anyway, 'Hope so. As time permits I'm eager to try these ideas you've discovered. I've always been 'Pestered' by the crutchy way I've been doing it but I needed some elevated helipads :-).Also, I think the small V2 values might be a good idea. Dick, did you happen to notice any effect on nearby AGN?'Film at eleven.....'J.R.PS: BTW Dick, I really appreciate your always "SCASM'izing" these BGLC's to SCASM code for us.

Share this post


Link to post
Share on other sites
Guest christian

I guess I made this mistake of not posting the darn code :-lolHere it is. The misc code is in its own BGL file (asandieg.bgl).; Microsoft Flight Simulator BGL Source File; decompiled with BGL2ASM © Christian Stockdata_base label word; DATABASE HEADER dw 1 ; world set number dd 0003A7353h ; North Bound dd 000366E2Ah ; South Bound dd 0AE000001h ; East Bound dd 0AC000001h ; West Bound dd 0 ; VOR data dw 0 ; lowest VOR freq dw 0 ; highest VOR freq dd 0 ; seeds level 8 data dd 0 ; seeds level 9 data dd 0 ; seeds level 10 data dd 0 ; seeds level 11 data dd 0 ; seeds level 12 data dd 0 ; traffic data dd 0 ; minimum safe altitude data dd 0 ; terrain mesh data dd 0 ; object data dd 0 ; library data dd 0 ; facilities data dd 0 ; anchor point data dd 0 ; ATIS data dd 0 ; ADF data dd 0 ; dynamic object paths data dd 000000000h,000000000h ; minimum library id dd 000000000h,000000000h ; maximum library id dd misc_data - data_base ; miscellaneous data dd 0 ; title and description data dd 0 ; magnetic variation data dd 0 ; exception and exclusion data dd 0h ; magic number dd 0 ; compression switch dw 0 ; spare; MISC DATABASEmisc_data label word LATBAND_START LATBAND_REL 01B36h, 01D3Ah, object_list_0000 LATBAND_ENDobject_list_0000 label word PLATFORM_HEADER address_332, 00000h, 01Dh, 00000h, 019h, 00000h, 0AEh, 00000h, 0AAh SCALE address_332, 0, 0, 000020000h, 000372DBCh, 00000h, 0AC9ACA00h, 00000h, 000000000h, 00000h INSTANCE_CALL address_198, 00000h, 00000h, 05555h JUMP address_332address_198 label word AREA_SENSE4 address_330, 27, -78, 27, -37, 73, -37, 73, -78 IFIN1 address_236, usrvr4, 24, 24 ALTITUDE_SET 7 BGL_RETURNaddress_236 label word IFIN1 address_252, usrvr4, 22, 22 ALTITUDE_SET 8 BGL_RETURNaddress_252 label word IFIN1 address_268, usrvr4, 20, 20 ALTITUDE_SET 9 BGL_RETURNaddress_268 label word IFIN1 address_284, usrvr4, 18, 18 ALTITUDE_SET 10 BGL_RETURNaddress_284 label word IFIN1 address_300, usrvr4, 16, 16 ALTITUDE_SET 11 BGL_RETURNaddress_300 label word IFIN1 address_316, usrvr4, 14, 14 ALTITUDE_SET 12 BGL_RETURNaddress_316 label word IFIN1 address_330, usrvr4, 12, 12 ALTITUDE_SET 13address_330 label word BGL_RETURNaddress_332 label wordaddress_332 label word PLATFORM_HEADER address_540, 00000h, 01Dh, 00000h, 019h, 00000h, 0AEh, 00000h, 0AAh SCALE address_540, 0, 0, 000020000h, 000372DBCh, 00000h, 0AC9ACA00h, 00000h, 000000000h, 00000h INSTANCE_CALL address_392, 00000h, 00000h, 05555h JUMP address_540address_392 label word AREA_SENSE4 address_422, -317, -38, -317, 26, 105, 26, 105, -38 ALTITUDE_SET 7 JUMP address_538address_422 label word AREA_SENSE4 address_538, 27, -78, 27, -37, 73, -37, 73, -78 IFIN1 address_460, usrvr4, 10, 10 ALTITUDE_SET 14 BGL_RETURNaddress_460 label word IFIN1 address_476, usrvr4, 8, 8 ALTITUDE_SET 15 BGL_RETURNaddress_476 label word IFIN1 address_492, usrvr4, 6, 6 ALTITUDE_SET 16 BGL_RETURNaddress_492 label word IFIN1 address_508, usrvr4, 4, 4 ALTITUDE_SET 17 BGL_RETURNaddress_508 label word IFIN1 address_524, usrvr4, 2, 2 ALTITUDE_SET 18 BGL_RETURNaddress_524 label word IFIN1 address_538, usrvr4, 0, 0 ALTITUDE_SET 19address_538 label word BGL_RETURNaddress_540 label wordaddress_540 label word PLATFORM_HEADER address_770, 00000h, 01Dh, 00000h, 019h, 00000h, 0AEh, 00000h, 0AAh SCALE address_770, 0, 0, 000020000h, 000372DBCh, 00000h, 0AC9ACA00h, 00000h, 000000000h, 00000h INSTANCE_CALL address_600, 00000h, 00000h, 05555h JUMP address_770address_600 label word AREA_SENSE4 address_626, 27, -78, 27, -37, 73, -37, 73, -78 JUMP address_768address_626 label word AREA_SENSE4 address_652, 177, -46, 177, 32, 334, 27, 334, -37 JUMP address_764address_652 label word AREA_SENSE6 address_686, 128, -78, 27, 73, 73, 82, 124, 82, 179, 32, 179, -46 JUMP address_764address_686 label word AREA_SENSE5 address_716, -220, -78, -247, 41, -234, 73, 27, 73, 128, -78 JUMP address_764address_716 label word AREA_SENSE4 address_742, -298, -41, -247, 41, -220, -78, -284, -55 JUMP address_764address_742 label word AREA_SENSE4 address_768, -321, -44, -330, 32, -247, 41, -298, -41address_764 label word ALTITUDE_SET 19address_768 label word BGL_RETURNaddress_770 label wordaddress_770 label word EOLobject_end_0000 label wordThere you go :)I knew usrvar4 would be a user variable, but what strikes me is that it isn't set anywhere. I just wonder if usrvar4 has been reassigned to something else in the meantime? Also, as Arno remarked, the use of IFIN1 and 2 identical values is a bit odd...In regards to the dynamic scenery, the new aircraft AI doesn't make it obsolete! We would still need it for land and water vehicles, eg sailboats and fuel / catering trucks on airports... I really hope I can find some examples, but so far it seems as if FS2002 doesn't use any dynamic objects.side note: the double labeling is obviously a bug. It's because the platforms mix misc and object opcodes...Cheers, Christian

Share this post


Link to post
Share on other sites

Hi Christian.They are made for hardening a surface:N32* 32.45'W117* 16.45'The decks of the USS Abraham Lincoln, off the coast of SanDiego.Above decks is 19m. Below decks is 7m.SanFrancisco has a water-ridge near the mouth of the bay at 70m, a 40m "mistake" near Alcatraz, and another aircraft carrier, at 20m.Dick

Share this post


Link to post
Share on other sites

>I knew usrvar4 would be a user variable, but what strikes me >is that it isn't set anywhere. I just wonder if usrvar4 has >been reassigned to something else in the meantime? Also, as >Arno remarked, the use of IFIN1 and 2 identical values is a >bit odd... That's really strange if it is not set somewhere. I think I have used this variable too in my frequency controlled animation scenery tests and then I didn't notice anything strange (like something else setting it to a different value or so). I really wonder why they are checking for the user variable here.And about the IFIN1 with twice the same value, I tried to explain that it is not odd :). I think BGLC doesn't have a IfVarAnd and also in SCASM I have sometimes seen that a IfVarRange with twice the same value works better then a IfVarAnd. So I would say it is just the normal way to check if the variable is equal to that value.>In regards to the dynamic scenery, the new aircraft AI >doesn't make it obsolete! We would still need it for land >and water vehicles, eg sailboats and fuel / catering trucks >on airports... I really hope I can find some examples, but >so far it seems as if FS2002 doesn't use any dynamic >objects.No, as I said before I think they are not used anymore. Also I am not sure that for ground vehicles the dynamic scenery is the best option (I am not sure how long MS will keep supporting it). For example the new tool BusyObjects that was announced some time ago seems a good alternative. It uses the animation code that is present in the BGL.Arno


Member Netherlands 2000 Scenery Team[link:home.wanadoo.nl/arno.gerretsen]Arno's FlightSim World for scenery design hints, tips and other tricks...

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...