ScruffyDuck Scenery

February 16, 2007

Ramblings on Scenery Compilers (and Decompilers)

Filed under: Programming, Scenery Design — scruffyduck @ 9:13 am

I wrote some of this in a post  at fsdeveloper.com and thought to put it here for others to comment on.  This line of thought has come about as I develop SDE and watch the efforts of those people trying to update AFCAD2 files to work in FSX.

I am sure there are many ‘de-compilers’ out there for Scenery Files.  Just about every scenery design program and flight planner will have some code to extract data from Bgl files.  In most cases I would guess they are incomplete.  I know of three generalized de-compliers that are available.  BglXml, BglAnalyze (in several forms) and now SDE.   None of them are perfect and that is more or less impossible because, one we are working with a file format for which there is no published schema, and two the process is not circular.  i.e the compilation of XML results in a Bgl file which does not contain everything we put in so we have sometimes to guess at how to reconstruct the original.  Of course there is no reason why we should be able to get back the input source from the output file.

AFCAD2 is probably one of the most widely used design tools and, although it was primarily developed to support AI Traffic is is used just about any time someone wants to modify an airport. This program clearly has a good ‘de-compiler’ built in.  It also does it’s own compiling and that is where the interesting part comes.

The official compiler for FS XML based scenery is BglComp.  There are two versions one which works with FS9 and one with FSX.  Each of these represent the model way of doing things.  Together with the associated xsd schema file they impose standards and rules on designers.  In some cases this seems involve missing access to some parameters and limitations to counts and so on.  To understand what happens when things go wrong it is necessary to realize that there are two places that generate errors, compliance with the schema and the internal compiler rules.  Unfortunately there are places where these conflict. 

AFCAD2 has it’s own compiler which (as far as I can tell) bypasses both the schema and BglComp standards and limitations.  Of course it has to create Bgl files which are acceptable to the FS Scenery Engine otherwise it would crash.   This provides both strengths and weaknesses – in the first place AFCAD can create things and set parameters that you can’t access via BglComp, in the second place de-compiling AFCAD2 files can generate problems especially if the intention is to update them for FSX.  SDE is helping me find quite a few – generally when it dies ungracefully onto the Desktop.

Getting AFCAD2 files for FS9 into FSX appears simple of the face of it and for small airports the process of using a general decompiler and then putting the resulting XML through BGLComp yields good results for some.  For more complex airports a number of problems turn up and there is a running thread on some of these on the XML forum at fsdeveloper.com.  In many case there is manual (or assisted via SDE) modification of the XML code needed.

I have pretty much decided that SDE should use BGLComp to ensure compliant scenery is generated.  However I have thought about direct compilation of Bgls and I am leaning towards the idea of a limited ‘tweaker’ for Scenery Bgl which would allow designers to access some of the parameters which do not seems available through the XML source.  This would work a bit like Arno’s excellent Mdl Tweaker allowing users to access and modify certain parameters, those being things that cannot otherwise be worked with.

October 11, 2006

LOM and FSX

Filed under: Programming, Scenery Design — scruffyduck @ 5:49 am

Well I have been digging around in the new FSX MDL format for the last few days and while I still don’t understand the rendering information I have enough so that LOM should be able to import FSX libraries.  There will be a  new release of LOM/SM in a month or so.  

August 30, 2006

XNA Game Studio Express Beta Available Today

Filed under: Programming — scruffyduck @ 7:33 am

Well – it should be available from Microsoft this day as a download .  For any curious enough the main XNA page is here  http://msdn.microsoft.com/directx/xna/

August 26, 2006

XNA Game Studio Express

Filed under: Programming — scruffyduck @ 5:39 am

The XNA Framework is the latest stuff from Microsoft for Games Designers.  It is intended to make writing games better and easier.  Also Games should work on both Windows and XBox.  The Express Edition is an IDE based on C# to write Games.  It will be a free download.  Read about the XNA Framework here: http://blogs.msdn.com/xna/default.aspx

XNA uses DirectX and  would have made writing LOV a whole lot easier.  I plan to port LOV onto the XNA Framework just to see how it goes.

August 8, 2006

New Utility in Development

Filed under: Programming — scruffyduck @ 4:01 pm

As a result of a request I am developing a new FS utility which will be called Way-point Manager.  It’s main job is very simple – to collect and manage any way-point which may be of interest to you.  They are captured by placing your plane at the way-point.  You can then add extra information about it – give it a name and so on.  Once it is created then you can move your plane back to it at any time using the program.

The initial requirement came from a scenery designer looking to collect co-ordinates for use in design but it occurred that it might be useful more generally since I can see the use of being able to record way-points – whether they be locations we would like to return to or maybe sightseeing points etc which are not that easy to save at the moment unless you create and save a flight.

Should be a first beta in a week or two.

June 17, 2006

Smaller Progress

Filed under: Programming, Scenery Design — scruffyduck @ 3:04 pm

This may take a while!   I do most of my development in VB.NET and really only use my 'knowledge' of C# to convert stuff that I need from that language to VB.  Both operate on dotNET so the resulting code that you run on your computer is pretty much the same.  However I am finding that I need to use C# for the DirectX work.  I have been thinking for some time about moving, but given that LOM has over 26,000 lines of code I  am not that excited about the prospect.  Well of course anything written in C# and compiled in to a library can be used by LOM so from now on I plan to create library functions such as the Object Renderer in C#.  So that is me back to the drawing board twice so to speak, once to learn about DirectX and once to bring my theoretical knowledge of C# up to a level where I can write complex applications in it……..  I may be some time.

Blog at WordPress.com.