<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.flightgear.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chriscalef</id>
	<title>FlightGear wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.flightgear.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chriscalef"/>
	<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/Special:Contributions/Chriscalef"/>
	<updated>2026-04-17T10:57:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=User:Chriscalef&amp;diff=123547</id>
		<title>User:Chriscalef</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=User:Chriscalef&amp;diff=123547"/>
		<updated>2020-04-14T20:34:59Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== FlightGear as a Data Source for External Applications and Games ==&lt;br /&gt;
&lt;br /&gt;
For quite some time I have been engaged in an effort to utilize FlightGear to provide both aircraft position as well as terrain and scenery data to external applications.&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=User:Chriscalef&amp;diff=123546</id>
		<title>User:Chriscalef</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=User:Chriscalef&amp;diff=123546"/>
		<updated>2020-04-14T20:31:55Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: Created page with &amp;quot;'''FlightGear as a Data Source for External Applications and Games''' == Heading text ==  For quite some time I have&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''FlightGear as a Data Source for External Applications and Games'''&lt;br /&gt;
== Heading text ==&lt;br /&gt;
&lt;br /&gt;
For quite some time I have&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81899</id>
		<title>FlightGear WorldTerrain SkyBox Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81899"/>
		<updated>2015-03-05T03:35:05Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Non-stable}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|image =worldserver.png&lt;br /&gt;
|name = FlightGear SkyBox Server&lt;br /&gt;
|started= 03/2013 &lt;br /&gt;
|description = FlightGear-based SkyBox server &lt;br /&gt;
|status = Under active development as of 03/2015&lt;br /&gt;
|website = [http://www.garagegames.com/community/blogs/view/22269 garagegames.com]&lt;br /&gt;
|developers =  * chriscalef (since 03/2013) &lt;br /&gt;
&lt;br /&gt;
|topic-fg= {{Git link|gitorious|fg/chriscalef2-flightgear|worldDataSource}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebar&lt;br /&gt;
| name	= Related&lt;br /&gt;
| title = Related&lt;br /&gt;
| contentstyle= text-align: left;&lt;br /&gt;
&lt;br /&gt;
| content1 = IPC &amp;amp; RPC&lt;br /&gt;
* [[Improved_J661_support#Patch_prototype|Extending the built-in telnet protocol]]&lt;br /&gt;
* [[Howto:Add new fgcommands to FlightGear]]&lt;br /&gt;
| content2 = Scene to Texture&lt;br /&gt;
* [[Howto:Use_a_Camera_View_in_an_Instrument|Rendering a camera to a texture]]&lt;br /&gt;
* [[Howto:Start_core_development#JPEGFactory|FlightGear Screen Shot Factory]]&lt;br /&gt;
* [[Canvas_Development#Supporting_Cameras|Canvas Cameras]]&lt;br /&gt;
* [[Canvas_Development#Adding_a_new_Element|Creating a new Canvas Camera Element]]&lt;br /&gt;
* [[Canvas_Troubleshooting#Serializing_a_Canvas_to_disk_.28as_raster_image.29|Serializing a Canvas]]&lt;br /&gt;
| content3 = FlightGear Server&lt;br /&gt;
* [[FlightGear Headless]]&lt;br /&gt;
| content4 = IG&lt;br /&gt;
* [[Canvas_Development#Placement.2FElement_for_Streaming:_Computer_Vision|Streaming Live Imagery]]&lt;br /&gt;
* [[CompositeViewer Support]]&lt;br /&gt;
* [[FlightGear high-level architecture support]]&lt;br /&gt;
* [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
'''Notes from the author (Chris Calef) March 04, 2015:'''&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to make FlightGear's extensive library of world data, weather &amp;amp; environment logic, and map editing tools, available for the realtime use of other applications over a socket connection, either locally or over a network.&lt;br /&gt;
&lt;br /&gt;
The initial driving application for this ability is a first person game engine. When this project was initiated in 2013, the Unity engine was chosen for the flagship demo, but we have since switched back to T3D in order to maintain complete source access and a totally open license (and in recognition of the impressive work being done by the Torque3D steering committee and community).&lt;br /&gt;
&lt;br /&gt;
At present, only two types of data are transferred from FlightGear to the client game engine: skybox images and terrain data. A custom camera group has been created (skybox-cameras.xml) which creates a set of five images capable of being mapped to a skybox in the client (there is no bottom image at this time). Meanwhile, as the player moves around the world, the terrainPager class in T3D sends requests for terrain data, which are answered in FlightGear by the creation of binary float array files for heights and integer array files for texture reference. These are named with the protocol &amp;quot;hght.(coordinates).bin&amp;quot; and &amp;quot;text.(coordinates).bin&amp;quot; respectively.&lt;br /&gt;
 &lt;br /&gt;
The application is still under heavy development, but the current version uses a custom networking class called &amp;quot;dataSource&amp;quot;, which is responsible for opening and maintaining the socket connection, and sending a basic packet of information, and &amp;quot;worldDataSource&amp;quot; which inherits dataSource and handles all the real work. &lt;br /&gt;
&lt;br /&gt;
This structure is up for debate and it is very likely that it will be discarded in the future in favor of a more general networking base class, probably from SimGear.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Apologies, but the rest of this page is a group of somewhat random quotes on this subject, mostly from myself, helpfully assembled by Hooray who also created this page. I will attempt to make this a more organized presentation of the project at some point in the future. In the meantime, check out the blog at [http://www.garagegames.com/community/blogs/view/22953].) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |My ultimate goal here is a real-world-terrain-based MMO game using Unity for the FPS engine and FlightGear as a backend {{wikipedia|Skybox (video games)}} server.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would also like to make this skybox/terrain mechanism available to others, however, for many different types of projects.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Part of my plan here is to go off on a fork of terragear et al, at whatever level is necessary to change the interpretation of the GIS data, eg to substitute something more blasted and smoking where the urban areas are in the current flightgear world.  Once I get that handled I plan to use GIS shapefiles as a format for creative game-related mapping work, so we're not limited to just the existing real world data, but can paint towns and roads wherever we want.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180759#p180759&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Long story short, it's useful because I want to create a first person MMO game based in real life terrain, and I want to leverage flightgear's very long view distances, awesome weather and day/night simulation, GIS-based terrain texturing, tree shaders, etc. to give the player the sense of truly being immersed in a planetary scale game environment.  And, ultimately, to let them play the game right in their own home town, when I get all the parts put together.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm really aiming larger than just making a single game here, though.  Ultimately I would like to make this into an open source simulation tool / online metaverse explorer that could be used for many different purposes.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180766#p180766&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's also in no way locked to Unity, that's just the environment I'm focusing on right now, due to its ease of cross platform export, among other things.  I have already written a terrain pager in Torque, and could just as easily pipe these skybox images there, which would result in a 100% open source solution... but only for windows or possibly Mac at the moment, no linux.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180767#p180767&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |my skybox is working pretty well now, and I have the FG textures also imported into my Unity terrain, so if I can find a quick way to determine which texture goes where in flightgear when I load a new terrain, I will be a big step forward in the process of replicating my FG experience on the Unity terrain.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181292#p181292&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Easy way to find texcoords or texture for given lat/long?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sat Apr 13&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm in the process of retrofitting the above described prototype so as to allow it to save out an array of finished Unity terrains and skyboxes, using the data provided once by flightgear during development, and then page through this precompiled data at runtime.  This way the end user never has to have flightgear or terragear installed, they just run the Unity game, and only the developer has to deal with the flightgear side of things.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=187648#p187648&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Reporting back on some LiDAR research...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Jul 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm still working on my [http://www.flightgear.org/forums/viewtopic.php?f{{=}}19&amp;amp;amp;t{{=}}19626 &amp;quot;FlightGear World Server&amp;quot;], and the current mission is to replace my (achingly slow) skybox generator.  My previous method was to rotate the camera via PropertyTree changes, and save screenshots at each cardinal direction.  I finally got through the literature on CameraGroups and Cameras, however, and managed to hook up a set of five cameras which simultaneously record all five desired directions, with the correct field of view.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=183792#p183792&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Anybody got any handy OSG image manipulation tips?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Mon May 20&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed&amp;gt;&lt;br /&gt;
SkinnerButteSouth2.jpg&lt;br /&gt;
SkinnerButteEast2.jpg&lt;br /&gt;
WestEugeneWest.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
The skyboxes are currently handled on the FlightGear side by the use of a custom camera group, located in a file called skybox-cameras.xml. I haven't worked out the rest of my data pruning issues and hence have not uploaded anything to the fgdata side of my FlightGear repository for this project, but the skybox file is necessary to run the project.  Here is the skybox-cameras.xml file:&lt;br /&gt;
&lt;br /&gt;
[[http://indiemotionsoftware.com/files/skybox-cameras.xml]]&lt;br /&gt;
&lt;br /&gt;
Also, here is my preferences file, where the skybox-cameras file is included:&lt;br /&gt;
&lt;br /&gt;
[[http://indiemotionsoftware.com/files/preferences.xml]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |what I'm primarily doing is using flightgear to draw skyboxes for the Unity (or other FPS style) engine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All I get out of flightgear is five textures, which draw to the front, back, sides and top of the skybox.  The local terrain in Unity I'm actually handling on my own, at much higher resolution than flightgear's terrain (10m instead of 90m(?) for flightgear), although I would like to figure out how to also export the terrain height data from flightgear for the rest of the world beyond my current 50km area of high res data.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I would also like to be able to lift the terrain texture for a given area out of flightgear and inform Unity of it, but I'm taking it one step at a time...&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  | the way I have it designed at the moment is all over a TCP/IP socket, so we should be pretty much free and clear - the flightgear end stays GPL, and the other end doesn't have to really care, it just sends a world position and gets textures back through the socket. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180771#p180771&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There may be some overlap when it comes to objects - I may end up converting some of the .ac files in flightgear into FBX or collada, so I can load them into Unity, but more often I think I'll be going the other way and adding my FBX game models into flightgear, ala [http://www.flightgear.org/forums/viewtopic.php?f{{=}}18&amp;amp;amp;t{{=}}19250 this thread.]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As it is now, though, I can run and run across 2500 square km of area, and wherever I go I can refresh the skybox to see flightgear's view of my position.  Only a very limited region of terrain has to be actually instantiated in Unity at any given time.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |This is all done using Unity C# scripts, opening up sockets to communicate with  A) a tiny little terrain server I wrote in C++, which accepts a starting latitude/longitude and a width/height of the area, and returns height data from a giant ten-meter-resolution height data file I made from DEM maps.  In Unity I have a 3x3 set of tiny terrains (640m each) which page across the landscape, loading new data and moving as necessary to stay in front of the player.  And then, B) a modified flightgear instance, which takes a socket connection from which it reads latitude, longitude, and elevation, and returns five screenshots taken at 90 degree angles to each other, with a 90 degree field of view.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The result was actually better than I expected, although the lighting comes out pretty sharply different between the different camera angles.  There is no hiding the fact that I'm painting to a skybox - but for a first pass, it's actually pretty entertaining anyway.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
=== Networking ===&lt;br /&gt;
There's cross-platform/multi-platform socket handling code in simgear for all the socket stuff you are doing there e.g. see [http://api-docs.freeflightsim.org/simgear/classSGSocket.html SGSocket] Internally, I/O protocols and network stuff usually live in $FG_SRC/Network&lt;br /&gt;
Which is also where you can see, that there's the concept of an &amp;quot;FGIOChannel&amp;quot; for encapsulating all the logic you added to fg_init.cxx&lt;br /&gt;
fg_init.cxx will only set up the IO channel, which just inherits from the corresponding interface class: http://api-docs.freeflightsim.org/simgear/classSGIOChannel.html&lt;br /&gt;
&lt;br /&gt;
For examples, look at the httpd or telnet/props stuff&lt;br /&gt;
&lt;br /&gt;
You will find that using these SimGear 2-3 APIs will greatly simplify and reduce your code, while making it much more straightforward to move it into a separate module, that also compiles across all platforms.&lt;br /&gt;
&lt;br /&gt;
Equally, there's a ton of SGGeo* helpers available for doing all lat/lon computations that can dream of&lt;br /&gt;
&lt;br /&gt;
== Demo using Python ==&lt;br /&gt;
Using the Python code available at [http://new.math.uiuc.edu/im2010/schirle/skybox.pdf], the following snippet of code can be used to display a FlightGear-based SkyBox using Python:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |it's still using the chunky 90m terrain, and my height sampling gets glitchy here and there (hence the needle problem down by the corner of the skybox).  It's also slower than cold molasses when it comes to making the skyboxes and doing the terrain sampling, but I have a long list of planned optimizations and improvements going forward from here.  Even as is, however, it should still be adequate for a player moving at normal human speed.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181686#p181686&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 19&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There are several flightgear related tasks remaining to figure out.  (Warning, gross understatement.)  It would work much better if I could somehow turn off rendering for everything within a certain radius of the camera, so I would not accidentally fill half my sky with one tree. :-P  The best solution would be to somehow cut out the exact square that I'm rendering locally in Unity, but I'm quite willing to accept cheap hacks and half measures at this point.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I also need to figure out a quick &amp;amp;amp; easy way to raycast for a terrain height at any given place in the flightgear world.  And figure out enough of terragear to know how the terrain textures are placed.  And on and on and on... but I thought some folks here might get a laugh out of this little project, at least.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Rendering is done for a near camera and a far camera anyway, so I think all you need to do is not to render the near camera, and that's it... (I think this was specified somewhere in camera_group.cxx ). &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180788#p180788&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 05&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81898</id>
		<title>FlightGear WorldTerrain SkyBox Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81898"/>
		<updated>2015-03-05T03:34:01Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Non-stable}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|image =worldserver.png&lt;br /&gt;
|name = FlightGear SkyBox Server&lt;br /&gt;
|started= 03/2013 &lt;br /&gt;
|description = FlightGear-based SkyBox server &lt;br /&gt;
|status = Under active development as of 03/2015&lt;br /&gt;
|website = [http://www.garagegames.com/community/blogs/view/22269 garagegames.com]&lt;br /&gt;
|developers =  * chriscalef (since 03/2013) &lt;br /&gt;
&lt;br /&gt;
|topic-fg= {{Git link|gitorious|fg/chriscalef2-flightgear|worldDataSource}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebar&lt;br /&gt;
| name	= Related&lt;br /&gt;
| title = Related&lt;br /&gt;
| contentstyle= text-align: left;&lt;br /&gt;
&lt;br /&gt;
| content1 = IPC &amp;amp; RPC&lt;br /&gt;
* [[Improved_J661_support#Patch_prototype|Extending the built-in telnet protocol]]&lt;br /&gt;
* [[Howto:Add new fgcommands to FlightGear]]&lt;br /&gt;
| content2 = Scene to Texture&lt;br /&gt;
* [[Howto:Use_a_Camera_View_in_an_Instrument|Rendering a camera to a texture]]&lt;br /&gt;
* [[Howto:Start_core_development#JPEGFactory|FlightGear Screen Shot Factory]]&lt;br /&gt;
* [[Canvas_Development#Supporting_Cameras|Canvas Cameras]]&lt;br /&gt;
* [[Canvas_Development#Adding_a_new_Element|Creating a new Canvas Camera Element]]&lt;br /&gt;
* [[Canvas_Troubleshooting#Serializing_a_Canvas_to_disk_.28as_raster_image.29|Serializing a Canvas]]&lt;br /&gt;
| content3 = FlightGear Server&lt;br /&gt;
* [[FlightGear Headless]]&lt;br /&gt;
| content4 = IG&lt;br /&gt;
* [[Canvas_Development#Placement.2FElement_for_Streaming:_Computer_Vision|Streaming Live Imagery]]&lt;br /&gt;
* [[CompositeViewer Support]]&lt;br /&gt;
* [[FlightGear high-level architecture support]]&lt;br /&gt;
* [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
'''Notes from the author (Chris Calef) March 04, 2015:'''&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to make FlightGear's extensive library of world data, weather &amp;amp; environment logic, and map editing tools, available for the realtime use of other applications over a socket connection, either locally or over a network.&lt;br /&gt;
&lt;br /&gt;
The initial driving application for this ability is a first person game engine. When this project was initiated in 2013, the Unity engine was chosen for the flagship demo, but we have since switched back to T3D in order to maintain complete source access and a totally open license (and in recognition of the impressive work being done by the Torque3D steering committee and community).&lt;br /&gt;
&lt;br /&gt;
At present, only two types of data are transferred from FlightGear to the client game engine: skybox images and terrain data. A custom camera group has been created (skybox-cameras.xml) which creates a set of five images capable of being mapped to a skybox in the client (there is no bottom image at this time). Meanwhile, as the player moves around the world, the terrainPager class in T3D sends requests for terrain data, which are answered in FlightGear by the creation of binary float array files for heights and integer array files for texture reference. These are named with the protocol &amp;quot;hght.(coordinates).bin&amp;quot; and &amp;quot;text.(coordinates).bin&amp;quot; respectively.&lt;br /&gt;
 &lt;br /&gt;
The application is still under heavy development, but the current version uses a custom networking class called &amp;quot;dataSource&amp;quot;, which is responsible for opening and maintaining the socket connection, and sending a basic packet of information, and &amp;quot;worldDataSource&amp;quot; which inherits dataSource and handles all the real work. &lt;br /&gt;
&lt;br /&gt;
This structure is up for debate and it is very likely that it will be discarded in the future in favor of a more general networking base class, probably from SimGear.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Apologies, but the rest of this page is a group of somewhat random quotes on this subject, mostly from myself, helpfully assembled by Hooray who also created this page. I will attempt to make this a more organized presentation of the project at some point in the future. In the meantime, check out the blog at [http://www.garagegames.com/community/blogs/view/22953].) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |My ultimate goal here is a real-world-terrain-based MMO game using Unity for the FPS engine and FlightGear as a backend {{wikipedia|Skybox (video games)}} server.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would also like to make this skybox/terrain mechanism available to others, however, for many different types of projects.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Part of my plan here is to go off on a fork of terragear et al, at whatever level is necessary to change the interpretation of the GIS data, eg to substitute something more blasted and smoking where the urban areas are in the current flightgear world.  Once I get that handled I plan to use GIS shapefiles as a format for creative game-related mapping work, so we're not limited to just the existing real world data, but can paint towns and roads wherever we want.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180759#p180759&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Long story short, it's useful because I want to create a first person MMO game based in real life terrain, and I want to leverage flightgear's very long view distances, awesome weather and day/night simulation, GIS-based terrain texturing, tree shaders, etc. to give the player the sense of truly being immersed in a planetary scale game environment.  And, ultimately, to let them play the game right in their own home town, when I get all the parts put together.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm really aiming larger than just making a single game here, though.  Ultimately I would like to make this into an open source simulation tool / online metaverse explorer that could be used for many different purposes.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180766#p180766&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's also in no way locked to Unity, that's just the environment I'm focusing on right now, due to its ease of cross platform export, among other things.  I have already written a terrain pager in Torque, and could just as easily pipe these skybox images there, which would result in a 100% open source solution... but only for windows or possibly Mac at the moment, no linux.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180767#p180767&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |my skybox is working pretty well now, and I have the FG textures also imported into my Unity terrain, so if I can find a quick way to determine which texture goes where in flightgear when I load a new terrain, I will be a big step forward in the process of replicating my FG experience on the Unity terrain.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181292#p181292&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Easy way to find texcoords or texture for given lat/long?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sat Apr 13&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm in the process of retrofitting the above described prototype so as to allow it to save out an array of finished Unity terrains and skyboxes, using the data provided once by flightgear during development, and then page through this precompiled data at runtime.  This way the end user never has to have flightgear or terragear installed, they just run the Unity game, and only the developer has to deal with the flightgear side of things.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=187648#p187648&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Reporting back on some LiDAR research...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Jul 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm still working on my [http://www.flightgear.org/forums/viewtopic.php?f{{=}}19&amp;amp;amp;t{{=}}19626 &amp;quot;FlightGear World Server&amp;quot;], and the current mission is to replace my (achingly slow) skybox generator.  My previous method was to rotate the camera via PropertyTree changes, and save screenshots at each cardinal direction.  I finally got through the literature on CameraGroups and Cameras, however, and managed to hook up a set of five cameras which simultaneously record all five desired directions, with the correct field of view.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=183792#p183792&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Anybody got any handy OSG image manipulation tips?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Mon May 20&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed&amp;gt;&lt;br /&gt;
SkinnerButteSouth2.jpg&lt;br /&gt;
SkinnerButteEast2.jpg&lt;br /&gt;
WestEugeneWest.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
The skyboxes are currently handled on the FlightGear side by the use of a custom camera group, located in a file called skybox-cameras.xml. I haven't worked out the rest of my data pruning issues and hence have not uploaded anything to the fgdata side of my FlightGear repository for this project, but the skybox file is necessary to run the project.  Here is the skybox-cameras.xml file:&lt;br /&gt;
&lt;br /&gt;
[[indiemotionsoftware.com/files/skybox-cameras.xml]]&lt;br /&gt;
&lt;br /&gt;
Also, here is my preferences file, where the skybox-cameras file is included:&lt;br /&gt;
&lt;br /&gt;
[[indiemotionsoftware.com/files/preferences.xml]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |what I'm primarily doing is using flightgear to draw skyboxes for the Unity (or other FPS style) engine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All I get out of flightgear is five textures, which draw to the front, back, sides and top of the skybox.  The local terrain in Unity I'm actually handling on my own, at much higher resolution than flightgear's terrain (10m instead of 90m(?) for flightgear), although I would like to figure out how to also export the terrain height data from flightgear for the rest of the world beyond my current 50km area of high res data.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I would also like to be able to lift the terrain texture for a given area out of flightgear and inform Unity of it, but I'm taking it one step at a time...&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  | the way I have it designed at the moment is all over a TCP/IP socket, so we should be pretty much free and clear - the flightgear end stays GPL, and the other end doesn't have to really care, it just sends a world position and gets textures back through the socket. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180771#p180771&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There may be some overlap when it comes to objects - I may end up converting some of the .ac files in flightgear into FBX or collada, so I can load them into Unity, but more often I think I'll be going the other way and adding my FBX game models into flightgear, ala [http://www.flightgear.org/forums/viewtopic.php?f{{=}}18&amp;amp;amp;t{{=}}19250 this thread.]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As it is now, though, I can run and run across 2500 square km of area, and wherever I go I can refresh the skybox to see flightgear's view of my position.  Only a very limited region of terrain has to be actually instantiated in Unity at any given time.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |This is all done using Unity C# scripts, opening up sockets to communicate with  A) a tiny little terrain server I wrote in C++, which accepts a starting latitude/longitude and a width/height of the area, and returns height data from a giant ten-meter-resolution height data file I made from DEM maps.  In Unity I have a 3x3 set of tiny terrains (640m each) which page across the landscape, loading new data and moving as necessary to stay in front of the player.  And then, B) a modified flightgear instance, which takes a socket connection from which it reads latitude, longitude, and elevation, and returns five screenshots taken at 90 degree angles to each other, with a 90 degree field of view.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The result was actually better than I expected, although the lighting comes out pretty sharply different between the different camera angles.  There is no hiding the fact that I'm painting to a skybox - but for a first pass, it's actually pretty entertaining anyway.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
=== Networking ===&lt;br /&gt;
There's cross-platform/multi-platform socket handling code in simgear for all the socket stuff you are doing there e.g. see [http://api-docs.freeflightsim.org/simgear/classSGSocket.html SGSocket] Internally, I/O protocols and network stuff usually live in $FG_SRC/Network&lt;br /&gt;
Which is also where you can see, that there's the concept of an &amp;quot;FGIOChannel&amp;quot; for encapsulating all the logic you added to fg_init.cxx&lt;br /&gt;
fg_init.cxx will only set up the IO channel, which just inherits from the corresponding interface class: http://api-docs.freeflightsim.org/simgear/classSGIOChannel.html&lt;br /&gt;
&lt;br /&gt;
For examples, look at the httpd or telnet/props stuff&lt;br /&gt;
&lt;br /&gt;
You will find that using these SimGear 2-3 APIs will greatly simplify and reduce your code, while making it much more straightforward to move it into a separate module, that also compiles across all platforms.&lt;br /&gt;
&lt;br /&gt;
Equally, there's a ton of SGGeo* helpers available for doing all lat/lon computations that can dream of&lt;br /&gt;
&lt;br /&gt;
== Demo using Python ==&lt;br /&gt;
Using the Python code available at [http://new.math.uiuc.edu/im2010/schirle/skybox.pdf], the following snippet of code can be used to display a FlightGear-based SkyBox using Python:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |it's still using the chunky 90m terrain, and my height sampling gets glitchy here and there (hence the needle problem down by the corner of the skybox).  It's also slower than cold molasses when it comes to making the skyboxes and doing the terrain sampling, but I have a long list of planned optimizations and improvements going forward from here.  Even as is, however, it should still be adequate for a player moving at normal human speed.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181686#p181686&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 19&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There are several flightgear related tasks remaining to figure out.  (Warning, gross understatement.)  It would work much better if I could somehow turn off rendering for everything within a certain radius of the camera, so I would not accidentally fill half my sky with one tree. :-P  The best solution would be to somehow cut out the exact square that I'm rendering locally in Unity, but I'm quite willing to accept cheap hacks and half measures at this point.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I also need to figure out a quick &amp;amp;amp; easy way to raycast for a terrain height at any given place in the flightgear world.  And figure out enough of terragear to know how the terrain textures are placed.  And on and on and on... but I thought some folks here might get a laugh out of this little project, at least.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Rendering is done for a near camera and a far camera anyway, so I think all you need to do is not to render the near camera, and that's it... (I think this was specified somewhere in camera_group.cxx ). &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180788#p180788&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 05&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81897</id>
		<title>FlightGear WorldTerrain SkyBox Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81897"/>
		<updated>2015-03-05T03:33:09Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Non-stable}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|image =worldserver.png&lt;br /&gt;
|name = FlightGear SkyBox Server&lt;br /&gt;
|started= 03/2013 &lt;br /&gt;
|description = FlightGear-based SkyBox server &lt;br /&gt;
|status = Under active development as of 03/2015&lt;br /&gt;
|website = [http://www.garagegames.com/community/blogs/view/22269 garagegames.com]&lt;br /&gt;
|developers =  * chriscalef (since 03/2013) &lt;br /&gt;
&lt;br /&gt;
|topic-fg= {{Git link|gitorious|fg/chriscalef2-flightgear|worldDataSource}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebar&lt;br /&gt;
| name	= Related&lt;br /&gt;
| title = Related&lt;br /&gt;
| contentstyle= text-align: left;&lt;br /&gt;
&lt;br /&gt;
| content1 = IPC &amp;amp; RPC&lt;br /&gt;
* [[Improved_J661_support#Patch_prototype|Extending the built-in telnet protocol]]&lt;br /&gt;
* [[Howto:Add new fgcommands to FlightGear]]&lt;br /&gt;
| content2 = Scene to Texture&lt;br /&gt;
* [[Howto:Use_a_Camera_View_in_an_Instrument|Rendering a camera to a texture]]&lt;br /&gt;
* [[Howto:Start_core_development#JPEGFactory|FlightGear Screen Shot Factory]]&lt;br /&gt;
* [[Canvas_Development#Supporting_Cameras|Canvas Cameras]]&lt;br /&gt;
* [[Canvas_Development#Adding_a_new_Element|Creating a new Canvas Camera Element]]&lt;br /&gt;
* [[Canvas_Troubleshooting#Serializing_a_Canvas_to_disk_.28as_raster_image.29|Serializing a Canvas]]&lt;br /&gt;
| content3 = FlightGear Server&lt;br /&gt;
* [[FlightGear Headless]]&lt;br /&gt;
| content4 = IG&lt;br /&gt;
* [[Canvas_Development#Placement.2FElement_for_Streaming:_Computer_Vision|Streaming Live Imagery]]&lt;br /&gt;
* [[CompositeViewer Support]]&lt;br /&gt;
* [[FlightGear high-level architecture support]]&lt;br /&gt;
* [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
'''Notes from the author (Chris Calef) March 04, 2015:'''&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to make FlightGear's extensive library of world data, weather &amp;amp; environment logic, and map editing tools, available for the realtime use of other applications over a socket connection, either locally or over a network.&lt;br /&gt;
&lt;br /&gt;
The initial driving application for this ability is a first person game engine. When this project was initiated in 2013, the Unity engine was chosen for the flagship demo, but we have since switched back to T3D in order to maintain complete source access and a totally open license (and in recognition of the impressive work being done by the Torque3D steering committee and community).&lt;br /&gt;
&lt;br /&gt;
At present, only two types of data are transferred from FlightGear to the client game engine: skybox images and terrain data. A custom camera group has been created (skybox-cameras.xml) which creates a set of five images capable of being mapped to a skybox in the client (there is no bottom image at this time). Meanwhile, as the player moves around the world, the terrainPager class in T3D sends requests for terrain data, which are answered in FlightGear by the creation of binary float array files for heights and integer array files for texture reference. These are named with the protocol &amp;quot;hght.(coordinates).bin&amp;quot; and &amp;quot;text.(coordinates).bin&amp;quot; respectively.&lt;br /&gt;
 &lt;br /&gt;
The application is still under heavy development, but the current version uses a custom networking class called &amp;quot;dataSource&amp;quot;, which is responsible for opening and maintaining the socket connection, and sending a basic packet of information, and &amp;quot;worldDataSource&amp;quot; which inherits dataSource and handles all the real work. &lt;br /&gt;
&lt;br /&gt;
This structure is up for debate and it is very likely that it will be discarded in the future in favor of a more general networking base class, probably from SimGear.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Apologies, but the rest of this page is a group of somewhat random quotes on this subject, mostly from myself, helpfully assembled by Hooray who also created this page. I will attempt to make this a more organized presentation of the project at some point in the future. In the meantime, check out the blog at [http://www.garagegames.com/community/blogs/view/22953].) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |My ultimate goal here is a real-world-terrain-based MMO game using Unity for the FPS engine and FlightGear as a backend {{wikipedia|Skybox (video games)}} server.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would also like to make this skybox/terrain mechanism available to others, however, for many different types of projects.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Part of my plan here is to go off on a fork of terragear et al, at whatever level is necessary to change the interpretation of the GIS data, eg to substitute something more blasted and smoking where the urban areas are in the current flightgear world.  Once I get that handled I plan to use GIS shapefiles as a format for creative game-related mapping work, so we're not limited to just the existing real world data, but can paint towns and roads wherever we want.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180759#p180759&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Long story short, it's useful because I want to create a first person MMO game based in real life terrain, and I want to leverage flightgear's very long view distances, awesome weather and day/night simulation, GIS-based terrain texturing, tree shaders, etc. to give the player the sense of truly being immersed in a planetary scale game environment.  And, ultimately, to let them play the game right in their own home town, when I get all the parts put together.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm really aiming larger than just making a single game here, though.  Ultimately I would like to make this into an open source simulation tool / online metaverse explorer that could be used for many different purposes.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180766#p180766&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's also in no way locked to Unity, that's just the environment I'm focusing on right now, due to its ease of cross platform export, among other things.  I have already written a terrain pager in Torque, and could just as easily pipe these skybox images there, which would result in a 100% open source solution... but only for windows or possibly Mac at the moment, no linux.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180767#p180767&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |my skybox is working pretty well now, and I have the FG textures also imported into my Unity terrain, so if I can find a quick way to determine which texture goes where in flightgear when I load a new terrain, I will be a big step forward in the process of replicating my FG experience on the Unity terrain.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181292#p181292&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Easy way to find texcoords or texture for given lat/long?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sat Apr 13&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm in the process of retrofitting the above described prototype so as to allow it to save out an array of finished Unity terrains and skyboxes, using the data provided once by flightgear during development, and then page through this precompiled data at runtime.  This way the end user never has to have flightgear or terragear installed, they just run the Unity game, and only the developer has to deal with the flightgear side of things.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=187648#p187648&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Reporting back on some LiDAR research...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Jul 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm still working on my [http://www.flightgear.org/forums/viewtopic.php?f{{=}}19&amp;amp;amp;t{{=}}19626 &amp;quot;FlightGear World Server&amp;quot;], and the current mission is to replace my (achingly slow) skybox generator.  My previous method was to rotate the camera via PropertyTree changes, and save screenshots at each cardinal direction.  I finally got through the literature on CameraGroups and Cameras, however, and managed to hook up a set of five cameras which simultaneously record all five desired directions, with the correct field of view.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=183792#p183792&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Anybody got any handy OSG image manipulation tips?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Mon May 20&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed&amp;gt;&lt;br /&gt;
SkinnerButteSouth2.jpg&lt;br /&gt;
SkinnerButteEast2.jpg&lt;br /&gt;
WestEugeneWest.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
The skyboxes are currently handled on the FlightGear side by the use of a custom camera group, located in a file called skybox-cameras.xml. I haven't worked out the rest of my data pruning issues and hence have not uploaded anything to the fgdata side of my FlightGear repository for this project, but the skybox file is necessary to run the project.  Here is the skybox-cameras.xml file:&lt;br /&gt;
&lt;br /&gt;
[[http://indiemotionsoftware.com/indiemotionsoftware.com/files/skybox-cameras.xml]]&lt;br /&gt;
&lt;br /&gt;
Also, here is my preferences file, where the skybox-cameras file is included:&lt;br /&gt;
&lt;br /&gt;
[[http://indiemotionsoftware.com/indiemotionsoftware.com/files/preferences.xml]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |what I'm primarily doing is using flightgear to draw skyboxes for the Unity (or other FPS style) engine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All I get out of flightgear is five textures, which draw to the front, back, sides and top of the skybox.  The local terrain in Unity I'm actually handling on my own, at much higher resolution than flightgear's terrain (10m instead of 90m(?) for flightgear), although I would like to figure out how to also export the terrain height data from flightgear for the rest of the world beyond my current 50km area of high res data.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I would also like to be able to lift the terrain texture for a given area out of flightgear and inform Unity of it, but I'm taking it one step at a time...&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  | the way I have it designed at the moment is all over a TCP/IP socket, so we should be pretty much free and clear - the flightgear end stays GPL, and the other end doesn't have to really care, it just sends a world position and gets textures back through the socket. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180771#p180771&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There may be some overlap when it comes to objects - I may end up converting some of the .ac files in flightgear into FBX or collada, so I can load them into Unity, but more often I think I'll be going the other way and adding my FBX game models into flightgear, ala [http://www.flightgear.org/forums/viewtopic.php?f{{=}}18&amp;amp;amp;t{{=}}19250 this thread.]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As it is now, though, I can run and run across 2500 square km of area, and wherever I go I can refresh the skybox to see flightgear's view of my position.  Only a very limited region of terrain has to be actually instantiated in Unity at any given time.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |This is all done using Unity C# scripts, opening up sockets to communicate with  A) a tiny little terrain server I wrote in C++, which accepts a starting latitude/longitude and a width/height of the area, and returns height data from a giant ten-meter-resolution height data file I made from DEM maps.  In Unity I have a 3x3 set of tiny terrains (640m each) which page across the landscape, loading new data and moving as necessary to stay in front of the player.  And then, B) a modified flightgear instance, which takes a socket connection from which it reads latitude, longitude, and elevation, and returns five screenshots taken at 90 degree angles to each other, with a 90 degree field of view.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The result was actually better than I expected, although the lighting comes out pretty sharply different between the different camera angles.  There is no hiding the fact that I'm painting to a skybox - but for a first pass, it's actually pretty entertaining anyway.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
=== Networking ===&lt;br /&gt;
There's cross-platform/multi-platform socket handling code in simgear for all the socket stuff you are doing there e.g. see [http://api-docs.freeflightsim.org/simgear/classSGSocket.html SGSocket] Internally, I/O protocols and network stuff usually live in $FG_SRC/Network&lt;br /&gt;
Which is also where you can see, that there's the concept of an &amp;quot;FGIOChannel&amp;quot; for encapsulating all the logic you added to fg_init.cxx&lt;br /&gt;
fg_init.cxx will only set up the IO channel, which just inherits from the corresponding interface class: http://api-docs.freeflightsim.org/simgear/classSGIOChannel.html&lt;br /&gt;
&lt;br /&gt;
For examples, look at the httpd or telnet/props stuff&lt;br /&gt;
&lt;br /&gt;
You will find that using these SimGear 2-3 APIs will greatly simplify and reduce your code, while making it much more straightforward to move it into a separate module, that also compiles across all platforms.&lt;br /&gt;
&lt;br /&gt;
Equally, there's a ton of SGGeo* helpers available for doing all lat/lon computations that can dream of&lt;br /&gt;
&lt;br /&gt;
== Demo using Python ==&lt;br /&gt;
Using the Python code available at [http://new.math.uiuc.edu/im2010/schirle/skybox.pdf], the following snippet of code can be used to display a FlightGear-based SkyBox using Python:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |it's still using the chunky 90m terrain, and my height sampling gets glitchy here and there (hence the needle problem down by the corner of the skybox).  It's also slower than cold molasses when it comes to making the skyboxes and doing the terrain sampling, but I have a long list of planned optimizations and improvements going forward from here.  Even as is, however, it should still be adequate for a player moving at normal human speed.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181686#p181686&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 19&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There are several flightgear related tasks remaining to figure out.  (Warning, gross understatement.)  It would work much better if I could somehow turn off rendering for everything within a certain radius of the camera, so I would not accidentally fill half my sky with one tree. :-P  The best solution would be to somehow cut out the exact square that I'm rendering locally in Unity, but I'm quite willing to accept cheap hacks and half measures at this point.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I also need to figure out a quick &amp;amp;amp; easy way to raycast for a terrain height at any given place in the flightgear world.  And figure out enough of terragear to know how the terrain textures are placed.  And on and on and on... but I thought some folks here might get a laugh out of this little project, at least.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Rendering is done for a near camera and a far camera anyway, so I think all you need to do is not to render the near camera, and that's it... (I think this was specified somewhere in camera_group.cxx ). &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180788#p180788&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 05&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81896</id>
		<title>FlightGear WorldTerrain SkyBox Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81896"/>
		<updated>2015-03-05T03:31:47Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Non-stable}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|image =worldserver.png&lt;br /&gt;
|name = FlightGear SkyBox Server&lt;br /&gt;
|started= 03/2013 &lt;br /&gt;
|description = FlightGear-based SkyBox server &lt;br /&gt;
|status = Under active development as of 03/2015&lt;br /&gt;
|website = [http://www.garagegames.com/community/blogs/view/22269 garagegames.com]&lt;br /&gt;
|developers =  * chriscalef (since 03/2013) &lt;br /&gt;
&lt;br /&gt;
|topic-fg= {{Git link|gitorious|fg/chriscalef2-flightgear|worldDataSource}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebar&lt;br /&gt;
| name	= Related&lt;br /&gt;
| title = Related&lt;br /&gt;
| contentstyle= text-align: left;&lt;br /&gt;
&lt;br /&gt;
| content1 = IPC &amp;amp; RPC&lt;br /&gt;
* [[Improved_J661_support#Patch_prototype|Extending the built-in telnet protocol]]&lt;br /&gt;
* [[Howto:Add new fgcommands to FlightGear]]&lt;br /&gt;
| content2 = Scene to Texture&lt;br /&gt;
* [[Howto:Use_a_Camera_View_in_an_Instrument|Rendering a camera to a texture]]&lt;br /&gt;
* [[Howto:Start_core_development#JPEGFactory|FlightGear Screen Shot Factory]]&lt;br /&gt;
* [[Canvas_Development#Supporting_Cameras|Canvas Cameras]]&lt;br /&gt;
* [[Canvas_Development#Adding_a_new_Element|Creating a new Canvas Camera Element]]&lt;br /&gt;
* [[Canvas_Troubleshooting#Serializing_a_Canvas_to_disk_.28as_raster_image.29|Serializing a Canvas]]&lt;br /&gt;
| content3 = FlightGear Server&lt;br /&gt;
* [[FlightGear Headless]]&lt;br /&gt;
| content4 = IG&lt;br /&gt;
* [[Canvas_Development#Placement.2FElement_for_Streaming:_Computer_Vision|Streaming Live Imagery]]&lt;br /&gt;
* [[CompositeViewer Support]]&lt;br /&gt;
* [[FlightGear high-level architecture support]]&lt;br /&gt;
* [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
'''Notes from the author (Chris Calef) March 04, 2015:'''&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to make FlightGear's extensive library of world data, weather &amp;amp; environment logic, and map editing tools, available for the realtime use of other applications over a socket connection, either locally or over a network.&lt;br /&gt;
&lt;br /&gt;
The initial driving application for this ability is a first person game engine. When this project was initiated in 2013, the Unity engine was chosen for the flagship demo, but we have since switched back to T3D in order to maintain complete source access and a totally open license (and in recognition of the impressive work being done by the Torque3D steering committee and community).&lt;br /&gt;
&lt;br /&gt;
At present, only two types of data are transferred from FlightGear to the client game engine: skybox images and terrain data. A custom camera group has been created (skybox-cameras.xml) which creates a set of five images capable of being mapped to a skybox in the client (there is no bottom image at this time). Meanwhile, as the player moves around the world, the terrainPager class in T3D sends requests for terrain data, which are answered in FlightGear by the creation of binary float array files for heights and integer array files for texture reference. These are named with the protocol &amp;quot;hght.(coordinates).bin&amp;quot; and &amp;quot;text.(coordinates).bin&amp;quot; respectively.&lt;br /&gt;
 &lt;br /&gt;
The application is still under heavy development, but the current version uses a custom networking class called &amp;quot;dataSource&amp;quot;, which is responsible for opening and maintaining the socket connection, and sending a basic packet of information, and &amp;quot;worldDataSource&amp;quot; which inherits dataSource and handles all the real work. &lt;br /&gt;
&lt;br /&gt;
This structure is up for debate and it is very likely that it will be discarded in the future in favor of a more general networking base class, probably from SimGear.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Apologies, but the rest of this page is a group of somewhat random quotes on this subject, mostly from myself, helpfully assembled by Hooray who also created this page. I will attempt to make this a more organized presentation of the project at some point in the future. In the meantime, check out the blog at [http://www.garagegames.com/community/blogs/view/22953].) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |My ultimate goal here is a real-world-terrain-based MMO game using Unity for the FPS engine and FlightGear as a backend {{wikipedia|Skybox (video games)}} server.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would also like to make this skybox/terrain mechanism available to others, however, for many different types of projects.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Part of my plan here is to go off on a fork of terragear et al, at whatever level is necessary to change the interpretation of the GIS data, eg to substitute something more blasted and smoking where the urban areas are in the current flightgear world.  Once I get that handled I plan to use GIS shapefiles as a format for creative game-related mapping work, so we're not limited to just the existing real world data, but can paint towns and roads wherever we want.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180759#p180759&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Long story short, it's useful because I want to create a first person MMO game based in real life terrain, and I want to leverage flightgear's very long view distances, awesome weather and day/night simulation, GIS-based terrain texturing, tree shaders, etc. to give the player the sense of truly being immersed in a planetary scale game environment.  And, ultimately, to let them play the game right in their own home town, when I get all the parts put together.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm really aiming larger than just making a single game here, though.  Ultimately I would like to make this into an open source simulation tool / online metaverse explorer that could be used for many different purposes.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180766#p180766&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's also in no way locked to Unity, that's just the environment I'm focusing on right now, due to its ease of cross platform export, among other things.  I have already written a terrain pager in Torque, and could just as easily pipe these skybox images there, which would result in a 100% open source solution... but only for windows or possibly Mac at the moment, no linux.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180767#p180767&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |my skybox is working pretty well now, and I have the FG textures also imported into my Unity terrain, so if I can find a quick way to determine which texture goes where in flightgear when I load a new terrain, I will be a big step forward in the process of replicating my FG experience on the Unity terrain.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181292#p181292&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Easy way to find texcoords or texture for given lat/long?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sat Apr 13&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm in the process of retrofitting the above described prototype so as to allow it to save out an array of finished Unity terrains and skyboxes, using the data provided once by flightgear during development, and then page through this precompiled data at runtime.  This way the end user never has to have flightgear or terragear installed, they just run the Unity game, and only the developer has to deal with the flightgear side of things.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=187648#p187648&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Reporting back on some LiDAR research...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Jul 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm still working on my [http://www.flightgear.org/forums/viewtopic.php?f{{=}}19&amp;amp;amp;t{{=}}19626 &amp;quot;FlightGear World Server&amp;quot;], and the current mission is to replace my (achingly slow) skybox generator.  My previous method was to rotate the camera via PropertyTree changes, and save screenshots at each cardinal direction.  I finally got through the literature on CameraGroups and Cameras, however, and managed to hook up a set of five cameras which simultaneously record all five desired directions, with the correct field of view.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=183792#p183792&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Anybody got any handy OSG image manipulation tips?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Mon May 20&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed&amp;gt;&lt;br /&gt;
SkinnerButteSouth2.jpg&lt;br /&gt;
SkinnerButteEast2.jpg&lt;br /&gt;
WestEugeneWest.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
The skyboxes are currently handled on the FlightGear side by the use of a custom camera group, located in a file called skybox-cameras.xml. I haven't worked out the rest of my data pruning issues and hence have not uploaded anything to the fgdata side of my FlightGear repository for this project, but the skybox file is necessary to run the project.  Here is the skybox-cameras.xml file:&lt;br /&gt;
&lt;br /&gt;
[[indiemotionsoftware.com/indiemotionsoftware.com/files/skybox-cameras.xml]]&lt;br /&gt;
&lt;br /&gt;
Also, here is my preferences file, where the skybox-cameras file is included:&lt;br /&gt;
&lt;br /&gt;
[[indiemotionsoftware.com/indiemotionsoftware.com/files/preferences.xml]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |what I'm primarily doing is using flightgear to draw skyboxes for the Unity (or other FPS style) engine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All I get out of flightgear is five textures, which draw to the front, back, sides and top of the skybox.  The local terrain in Unity I'm actually handling on my own, at much higher resolution than flightgear's terrain (10m instead of 90m(?) for flightgear), although I would like to figure out how to also export the terrain height data from flightgear for the rest of the world beyond my current 50km area of high res data.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I would also like to be able to lift the terrain texture for a given area out of flightgear and inform Unity of it, but I'm taking it one step at a time...&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  | the way I have it designed at the moment is all over a TCP/IP socket, so we should be pretty much free and clear - the flightgear end stays GPL, and the other end doesn't have to really care, it just sends a world position and gets textures back through the socket. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180771#p180771&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There may be some overlap when it comes to objects - I may end up converting some of the .ac files in flightgear into FBX or collada, so I can load them into Unity, but more often I think I'll be going the other way and adding my FBX game models into flightgear, ala [http://www.flightgear.org/forums/viewtopic.php?f{{=}}18&amp;amp;amp;t{{=}}19250 this thread.]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As it is now, though, I can run and run across 2500 square km of area, and wherever I go I can refresh the skybox to see flightgear's view of my position.  Only a very limited region of terrain has to be actually instantiated in Unity at any given time.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |This is all done using Unity C# scripts, opening up sockets to communicate with  A) a tiny little terrain server I wrote in C++, which accepts a starting latitude/longitude and a width/height of the area, and returns height data from a giant ten-meter-resolution height data file I made from DEM maps.  In Unity I have a 3x3 set of tiny terrains (640m each) which page across the landscape, loading new data and moving as necessary to stay in front of the player.  And then, B) a modified flightgear instance, which takes a socket connection from which it reads latitude, longitude, and elevation, and returns five screenshots taken at 90 degree angles to each other, with a 90 degree field of view.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The result was actually better than I expected, although the lighting comes out pretty sharply different between the different camera angles.  There is no hiding the fact that I'm painting to a skybox - but for a first pass, it's actually pretty entertaining anyway.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
=== Networking ===&lt;br /&gt;
There's cross-platform/multi-platform socket handling code in simgear for all the socket stuff you are doing there e.g. see [http://api-docs.freeflightsim.org/simgear/classSGSocket.html SGSocket] Internally, I/O protocols and network stuff usually live in $FG_SRC/Network&lt;br /&gt;
Which is also where you can see, that there's the concept of an &amp;quot;FGIOChannel&amp;quot; for encapsulating all the logic you added to fg_init.cxx&lt;br /&gt;
fg_init.cxx will only set up the IO channel, which just inherits from the corresponding interface class: http://api-docs.freeflightsim.org/simgear/classSGIOChannel.html&lt;br /&gt;
&lt;br /&gt;
For examples, look at the httpd or telnet/props stuff&lt;br /&gt;
&lt;br /&gt;
You will find that using these SimGear 2-3 APIs will greatly simplify and reduce your code, while making it much more straightforward to move it into a separate module, that also compiles across all platforms.&lt;br /&gt;
&lt;br /&gt;
Equally, there's a ton of SGGeo* helpers available for doing all lat/lon computations that can dream of&lt;br /&gt;
&lt;br /&gt;
== Demo using Python ==&lt;br /&gt;
Using the Python code available at [http://new.math.uiuc.edu/im2010/schirle/skybox.pdf], the following snippet of code can be used to display a FlightGear-based SkyBox using Python:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |it's still using the chunky 90m terrain, and my height sampling gets glitchy here and there (hence the needle problem down by the corner of the skybox).  It's also slower than cold molasses when it comes to making the skyboxes and doing the terrain sampling, but I have a long list of planned optimizations and improvements going forward from here.  Even as is, however, it should still be adequate for a player moving at normal human speed.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181686#p181686&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 19&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There are several flightgear related tasks remaining to figure out.  (Warning, gross understatement.)  It would work much better if I could somehow turn off rendering for everything within a certain radius of the camera, so I would not accidentally fill half my sky with one tree. :-P  The best solution would be to somehow cut out the exact square that I'm rendering locally in Unity, but I'm quite willing to accept cheap hacks and half measures at this point.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I also need to figure out a quick &amp;amp;amp; easy way to raycast for a terrain height at any given place in the flightgear world.  And figure out enough of terragear to know how the terrain textures are placed.  And on and on and on... but I thought some folks here might get a laugh out of this little project, at least.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Rendering is done for a near camera and a far camera anyway, so I think all you need to do is not to render the near camera, and that's it... (I think this was specified somewhere in camera_group.cxx ). &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180788#p180788&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 05&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81895</id>
		<title>FlightGear WorldTerrain SkyBox Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81895"/>
		<updated>2015-03-05T03:16:03Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Non-stable}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|image =worldserver.png&lt;br /&gt;
|name = FlightGear SkyBox Server&lt;br /&gt;
|started= 03/2013 &lt;br /&gt;
|description = FlightGear-based SkyBox server &lt;br /&gt;
|status = Under active development as of 03/2015&lt;br /&gt;
|website = [http://www.garagegames.com/community/blogs/view/22269 garagegames.com]&lt;br /&gt;
|developers =  * chriscalef (since 03/2013) &lt;br /&gt;
&lt;br /&gt;
|topic-fg= {{Git link|gitorious|fg/chriscalef2-flightgear|worldDataSource}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebar&lt;br /&gt;
| name	= Related&lt;br /&gt;
| title = Related&lt;br /&gt;
| contentstyle= text-align: left;&lt;br /&gt;
&lt;br /&gt;
| content1 = IPC &amp;amp; RPC&lt;br /&gt;
* [[Improved_J661_support#Patch_prototype|Extending the built-in telnet protocol]]&lt;br /&gt;
* [[Howto:Add new fgcommands to FlightGear]]&lt;br /&gt;
| content2 = Scene to Texture&lt;br /&gt;
* [[Howto:Use_a_Camera_View_in_an_Instrument|Rendering a camera to a texture]]&lt;br /&gt;
* [[Howto:Start_core_development#JPEGFactory|FlightGear Screen Shot Factory]]&lt;br /&gt;
* [[Canvas_Development#Supporting_Cameras|Canvas Cameras]]&lt;br /&gt;
* [[Canvas_Development#Adding_a_new_Element|Creating a new Canvas Camera Element]]&lt;br /&gt;
* [[Canvas_Troubleshooting#Serializing_a_Canvas_to_disk_.28as_raster_image.29|Serializing a Canvas]]&lt;br /&gt;
| content3 = FlightGear Server&lt;br /&gt;
* [[FlightGear Headless]]&lt;br /&gt;
| content4 = IG&lt;br /&gt;
* [[Canvas_Development#Placement.2FElement_for_Streaming:_Computer_Vision|Streaming Live Imagery]]&lt;br /&gt;
* [[CompositeViewer Support]]&lt;br /&gt;
* [[FlightGear high-level architecture support]]&lt;br /&gt;
* [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
'''Notes from the author (Chris Calef) March 04, 2015:'''&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to make FlightGear's extensive library of world data, weather &amp;amp; environment logic, and map editing tools, available for the realtime use of other applications over a socket connection, either locally or over a network.&lt;br /&gt;
&lt;br /&gt;
The initial driving application for this ability is a first person game engine. When this project was initiated in 2013, the Unity engine was chosen for the flagship demo, but we have since switched back to T3D in order to maintain complete source access and a totally open license (and in recognition of the impressive work being done by the Torque3D steering committee and community).&lt;br /&gt;
&lt;br /&gt;
At present, only two types of data are transferred from FlightGear to the client game engine: skybox images and terrain data. A custom camera group has been created (skybox-cameras.xml) which creates a set of five images capable of being mapped to a skybox in the client (there is no bottom image at this time). Meanwhile, as the player moves around the world, the terrainPager class in T3D sends requests for terrain data, which are answered in FlightGear by the creation of binary float array files for heights and integer array files for texture reference. These are named with the protocol &amp;quot;hght.(coordinates).bin&amp;quot; and &amp;quot;text.(coordinates).bin&amp;quot; respectively.&lt;br /&gt;
 &lt;br /&gt;
The application is still under heavy development, but the current version uses a custom networking class called &amp;quot;dataSource&amp;quot;, which is responsible for opening and maintaining the socket connection, and sending a basic packet of information, and &amp;quot;worldDataSource&amp;quot; which inherits dataSource and handles all the real work. &lt;br /&gt;
&lt;br /&gt;
This structure is up for debate and it is very likely that it will be discarded in the future in favor of a more general networking base class, probably from SimGear.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Apologies, but the rest of this page is a group of somewhat random quotes on this subject, mostly from myself, helpfully assembled by Hooray who also created this page. I will attempt to make this a more organized presentation of the project at some point in the future. In the meantime, check out the blog at [http://www.garagegames.com/community/blogs/view/22953].) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |My ultimate goal here is a real-world-terrain-based MMO game using Unity for the FPS engine and FlightGear as a backend {{wikipedia|Skybox (video games)}} server.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would also like to make this skybox/terrain mechanism available to others, however, for many different types of projects.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Part of my plan here is to go off on a fork of terragear et al, at whatever level is necessary to change the interpretation of the GIS data, eg to substitute something more blasted and smoking where the urban areas are in the current flightgear world.  Once I get that handled I plan to use GIS shapefiles as a format for creative game-related mapping work, so we're not limited to just the existing real world data, but can paint towns and roads wherever we want.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180759#p180759&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Long story short, it's useful because I want to create a first person MMO game based in real life terrain, and I want to leverage flightgear's very long view distances, awesome weather and day/night simulation, GIS-based terrain texturing, tree shaders, etc. to give the player the sense of truly being immersed in a planetary scale game environment.  And, ultimately, to let them play the game right in their own home town, when I get all the parts put together.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm really aiming larger than just making a single game here, though.  Ultimately I would like to make this into an open source simulation tool / online metaverse explorer that could be used for many different purposes.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180766#p180766&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's also in no way locked to Unity, that's just the environment I'm focusing on right now, due to its ease of cross platform export, among other things.  I have already written a terrain pager in Torque, and could just as easily pipe these skybox images there, which would result in a 100% open source solution... but only for windows or possibly Mac at the moment, no linux.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180767#p180767&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |my skybox is working pretty well now, and I have the FG textures also imported into my Unity terrain, so if I can find a quick way to determine which texture goes where in flightgear when I load a new terrain, I will be a big step forward in the process of replicating my FG experience on the Unity terrain.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181292#p181292&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Easy way to find texcoords or texture for given lat/long?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sat Apr 13&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm in the process of retrofitting the above described prototype so as to allow it to save out an array of finished Unity terrains and skyboxes, using the data provided once by flightgear during development, and then page through this precompiled data at runtime.  This way the end user never has to have flightgear or terragear installed, they just run the Unity game, and only the developer has to deal with the flightgear side of things.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=187648#p187648&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Reporting back on some LiDAR research...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Jul 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm still working on my [http://www.flightgear.org/forums/viewtopic.php?f{{=}}19&amp;amp;amp;t{{=}}19626 &amp;quot;FlightGear World Server&amp;quot;], and the current mission is to replace my (achingly slow) skybox generator.  My previous method was to rotate the camera via PropertyTree changes, and save screenshots at each cardinal direction.  I finally got through the literature on CameraGroups and Cameras, however, and managed to hook up a set of five cameras which simultaneously record all five desired directions, with the correct field of view.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=183792#p183792&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Anybody got any handy OSG image manipulation tips?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Mon May 20&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed&amp;gt;&lt;br /&gt;
SkinnerButteSouth2.jpg&lt;br /&gt;
SkinnerButteEast2.jpg&lt;br /&gt;
WestEugeneWest.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
&lt;br /&gt;
[[File:Skybox-cameras.xml|thumbnail|A camera group that presents five images at ninety degree angles, to fill a skybox.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |what I'm primarily doing is using flightgear to draw skyboxes for the Unity (or other FPS style) engine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All I get out of flightgear is five textures, which draw to the front, back, sides and top of the skybox.  The local terrain in Unity I'm actually handling on my own, at much higher resolution than flightgear's terrain (10m instead of 90m(?) for flightgear), although I would like to figure out how to also export the terrain height data from flightgear for the rest of the world beyond my current 50km area of high res data.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I would also like to be able to lift the terrain texture for a given area out of flightgear and inform Unity of it, but I'm taking it one step at a time...&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  | the way I have it designed at the moment is all over a TCP/IP socket, so we should be pretty much free and clear - the flightgear end stays GPL, and the other end doesn't have to really care, it just sends a world position and gets textures back through the socket. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180771#p180771&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There may be some overlap when it comes to objects - I may end up converting some of the .ac files in flightgear into FBX or collada, so I can load them into Unity, but more often I think I'll be going the other way and adding my FBX game models into flightgear, ala [http://www.flightgear.org/forums/viewtopic.php?f{{=}}18&amp;amp;amp;t{{=}}19250 this thread.]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As it is now, though, I can run and run across 2500 square km of area, and wherever I go I can refresh the skybox to see flightgear's view of my position.  Only a very limited region of terrain has to be actually instantiated in Unity at any given time.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |This is all done using Unity C# scripts, opening up sockets to communicate with  A) a tiny little terrain server I wrote in C++, which accepts a starting latitude/longitude and a width/height of the area, and returns height data from a giant ten-meter-resolution height data file I made from DEM maps.  In Unity I have a 3x3 set of tiny terrains (640m each) which page across the landscape, loading new data and moving as necessary to stay in front of the player.  And then, B) a modified flightgear instance, which takes a socket connection from which it reads latitude, longitude, and elevation, and returns five screenshots taken at 90 degree angles to each other, with a 90 degree field of view.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The result was actually better than I expected, although the lighting comes out pretty sharply different between the different camera angles.  There is no hiding the fact that I'm painting to a skybox - but for a first pass, it's actually pretty entertaining anyway.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
=== Networking ===&lt;br /&gt;
There's cross-platform/multi-platform socket handling code in simgear for all the socket stuff you are doing there e.g. see [http://api-docs.freeflightsim.org/simgear/classSGSocket.html SGSocket] Internally, I/O protocols and network stuff usually live in $FG_SRC/Network&lt;br /&gt;
Which is also where you can see, that there's the concept of an &amp;quot;FGIOChannel&amp;quot; for encapsulating all the logic you added to fg_init.cxx&lt;br /&gt;
fg_init.cxx will only set up the IO channel, which just inherits from the corresponding interface class: http://api-docs.freeflightsim.org/simgear/classSGIOChannel.html&lt;br /&gt;
&lt;br /&gt;
For examples, look at the httpd or telnet/props stuff&lt;br /&gt;
&lt;br /&gt;
You will find that using these SimGear 2-3 APIs will greatly simplify and reduce your code, while making it much more straightforward to move it into a separate module, that also compiles across all platforms.&lt;br /&gt;
&lt;br /&gt;
Equally, there's a ton of SGGeo* helpers available for doing all lat/lon computations that can dream of&lt;br /&gt;
&lt;br /&gt;
== Demo using Python ==&lt;br /&gt;
Using the Python code available at [http://new.math.uiuc.edu/im2010/schirle/skybox.pdf], the following snippet of code can be used to display a FlightGear-based SkyBox using Python:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |it's still using the chunky 90m terrain, and my height sampling gets glitchy here and there (hence the needle problem down by the corner of the skybox).  It's also slower than cold molasses when it comes to making the skyboxes and doing the terrain sampling, but I have a long list of planned optimizations and improvements going forward from here.  Even as is, however, it should still be adequate for a player moving at normal human speed.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181686#p181686&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 19&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There are several flightgear related tasks remaining to figure out.  (Warning, gross understatement.)  It would work much better if I could somehow turn off rendering for everything within a certain radius of the camera, so I would not accidentally fill half my sky with one tree. :-P  The best solution would be to somehow cut out the exact square that I'm rendering locally in Unity, but I'm quite willing to accept cheap hacks and half measures at this point.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I also need to figure out a quick &amp;amp;amp; easy way to raycast for a terrain height at any given place in the flightgear world.  And figure out enough of terragear to know how the terrain textures are placed.  And on and on and on... but I thought some folks here might get a laugh out of this little project, at least.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Rendering is done for a near camera and a far camera anyway, so I think all you need to do is not to render the near camera, and that's it... (I think this was specified somewhere in camera_group.cxx ). &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180788#p180788&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 05&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81886</id>
		<title>FlightGear WorldTerrain SkyBox Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81886"/>
		<updated>2015-03-05T01:41:17Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: /* Objective */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Non-stable}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|image =worldserver.png&lt;br /&gt;
|name = FlightGear SkyBox Server&lt;br /&gt;
|started= 03/2013 &lt;br /&gt;
|description = FlightGear-based SkyBox server &lt;br /&gt;
|status = Under active development as of 03/2015&lt;br /&gt;
|website = [http://www.garagegames.com/community/blogs/view/22269 garagegames.com]&lt;br /&gt;
|developers =  * chriscalef (since 03/2013) &lt;br /&gt;
&lt;br /&gt;
|topic-fg= {{Git link|gitorious|fg/chriscalef2-flightgear|worldDataSource}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebar&lt;br /&gt;
| name	= Related&lt;br /&gt;
| title = Related&lt;br /&gt;
| contentstyle= text-align: left;&lt;br /&gt;
&lt;br /&gt;
| content1 = IPC &amp;amp; RPC&lt;br /&gt;
* [[Improved_J661_support#Patch_prototype|Extending the built-in telnet protocol]]&lt;br /&gt;
* [[Howto:Add new fgcommands to FlightGear]]&lt;br /&gt;
| content2 = Scene to Texture&lt;br /&gt;
* [[Howto:Use_a_Camera_View_in_an_Instrument|Rendering a camera to a texture]]&lt;br /&gt;
* [[Howto:Start_core_development#JPEGFactory|FlightGear Screen Shot Factory]]&lt;br /&gt;
* [[Canvas_Development#Supporting_Cameras|Canvas Cameras]]&lt;br /&gt;
* [[Canvas_Development#Adding_a_new_Element|Creating a new Canvas Camera Element]]&lt;br /&gt;
* [[Canvas_Troubleshooting#Serializing_a_Canvas_to_disk_.28as_raster_image.29|Serializing a Canvas]]&lt;br /&gt;
| content3 = FlightGear Server&lt;br /&gt;
* [[FlightGear Headless]]&lt;br /&gt;
| content4 = IG&lt;br /&gt;
* [[Canvas_Development#Placement.2FElement_for_Streaming:_Computer_Vision|Streaming Live Imagery]]&lt;br /&gt;
* [[CompositeViewer Support]]&lt;br /&gt;
* [[FlightGear high-level architecture support]]&lt;br /&gt;
* [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
'''Notes from the author (Chris Calef) March 04, 2015:'''&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to make FlightGear's extensive library of world data, weather &amp;amp; environment logic, and map editing tools, available for the realtime use of other applications over a socket connection, either locally or over a network.&lt;br /&gt;
&lt;br /&gt;
The initial driving application for this ability is a first person game engine. When this project was initiated in 2013, the Unity engine was chosen for the flagship demo, but we have since switched back to T3D in order to maintain complete source access and a totally open license (and in recognition of the impressive work being done by the Torque3D steering committee and community).&lt;br /&gt;
&lt;br /&gt;
At present, only two types of data are transferred from FlightGear to the client game engine: skybox images and terrain data. A custom camera group has been created (skybox-cameras.xml) which creates a set of five images capable of being mapped to a skybox in the client (there is no bottom image at this time). Meanwhile, as the player moves around the world, the terrainPager class in T3D sends requests for terrain data, which are answered in FlightGear by the creation of binary float array files for heights and integer array files for texture reference. These are named with the protocol &amp;quot;hght.(coordinates).bin&amp;quot; and &amp;quot;text.(coordinates).bin&amp;quot; respectively.&lt;br /&gt;
 &lt;br /&gt;
The application is still under heavy development, but the current version uses a custom networking class called &amp;quot;dataSource&amp;quot;, which is responsible for opening and maintaining the socket connection, and sending a basic packet of information, and &amp;quot;worldDataSource&amp;quot; which inherits dataSource and handles all the real work. &lt;br /&gt;
&lt;br /&gt;
This structure is up for debate and it is very likely that it will be discarded in the future in favor of a more general networking base class, probably from SimGear.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Apologies, but the rest of this page is a group of somewhat random quotes on this subject, mostly from myself, helpfully assembled by Hooray who also created this page. I will attempt to make this a more organized presentation of the project at some point in the future.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |My ultimate goal here is a real-world-terrain-based MMO game using Unity for the FPS engine and FlightGear as a backend {{wikipedia|Skybox (video games)}} server.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would also like to make this skybox/terrain mechanism available to others, however, for many different types of projects.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Part of my plan here is to go off on a fork of terragear et al, at whatever level is necessary to change the interpretation of the GIS data, eg to substitute something more blasted and smoking where the urban areas are in the current flightgear world.  Once I get that handled I plan to use GIS shapefiles as a format for creative game-related mapping work, so we're not limited to just the existing real world data, but can paint towns and roads wherever we want.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180759#p180759&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Long story short, it's useful because I want to create a first person MMO game based in real life terrain, and I want to leverage flightgear's very long view distances, awesome weather and day/night simulation, GIS-based terrain texturing, tree shaders, etc. to give the player the sense of truly being immersed in a planetary scale game environment.  And, ultimately, to let them play the game right in their own home town, when I get all the parts put together.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm really aiming larger than just making a single game here, though.  Ultimately I would like to make this into an open source simulation tool / online metaverse explorer that could be used for many different purposes.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180766#p180766&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's also in no way locked to Unity, that's just the environment I'm focusing on right now, due to its ease of cross platform export, among other things.  I have already written a terrain pager in Torque, and could just as easily pipe these skybox images there, which would result in a 100% open source solution... but only for windows or possibly Mac at the moment, no linux.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180767#p180767&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |my skybox is working pretty well now, and I have the FG textures also imported into my Unity terrain, so if I can find a quick way to determine which texture goes where in flightgear when I load a new terrain, I will be a big step forward in the process of replicating my FG experience on the Unity terrain.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181292#p181292&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Easy way to find texcoords or texture for given lat/long?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sat Apr 13&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm in the process of retrofitting the above described prototype so as to allow it to save out an array of finished Unity terrains and skyboxes, using the data provided once by flightgear during development, and then page through this precompiled data at runtime.  This way the end user never has to have flightgear or terragear installed, they just run the Unity game, and only the developer has to deal with the flightgear side of things.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=187648#p187648&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Reporting back on some LiDAR research...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Jul 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm still working on my [http://www.flightgear.org/forums/viewtopic.php?f{{=}}19&amp;amp;amp;t{{=}}19626 &amp;quot;FlightGear World Server&amp;quot;], and the current mission is to replace my (achingly slow) skybox generator.  My previous method was to rotate the camera via PropertyTree changes, and save screenshots at each cardinal direction.  I finally got through the literature on CameraGroups and Cameras, however, and managed to hook up a set of five cameras which simultaneously record all five desired directions, with the correct field of view.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=183792#p183792&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Anybody got any handy OSG image manipulation tips?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Mon May 20&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed&amp;gt;&lt;br /&gt;
SkinnerButteSouth2.jpg&lt;br /&gt;
SkinnerButteEast2.jpg&lt;br /&gt;
WestEugeneWest.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |what I'm primarily doing is using flightgear to draw skyboxes for the Unity (or other FPS style) engine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All I get out of flightgear is five textures, which draw to the front, back, sides and top of the skybox.  The local terrain in Unity I'm actually handling on my own, at much higher resolution than flightgear's terrain (10m instead of 90m(?) for flightgear), although I would like to figure out how to also export the terrain height data from flightgear for the rest of the world beyond my current 50km area of high res data.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I would also like to be able to lift the terrain texture for a given area out of flightgear and inform Unity of it, but I'm taking it one step at a time...&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  | the way I have it designed at the moment is all over a TCP/IP socket, so we should be pretty much free and clear - the flightgear end stays GPL, and the other end doesn't have to really care, it just sends a world position and gets textures back through the socket. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180771#p180771&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There may be some overlap when it comes to objects - I may end up converting some of the .ac files in flightgear into FBX or collada, so I can load them into Unity, but more often I think I'll be going the other way and adding my FBX game models into flightgear, ala [http://www.flightgear.org/forums/viewtopic.php?f{{=}}18&amp;amp;amp;t{{=}}19250 this thread.]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As it is now, though, I can run and run across 2500 square km of area, and wherever I go I can refresh the skybox to see flightgear's view of my position.  Only a very limited region of terrain has to be actually instantiated in Unity at any given time.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |This is all done using Unity C# scripts, opening up sockets to communicate with  A) a tiny little terrain server I wrote in C++, which accepts a starting latitude/longitude and a width/height of the area, and returns height data from a giant ten-meter-resolution height data file I made from DEM maps.  In Unity I have a 3x3 set of tiny terrains (640m each) which page across the landscape, loading new data and moving as necessary to stay in front of the player.  And then, B) a modified flightgear instance, which takes a socket connection from which it reads latitude, longitude, and elevation, and returns five screenshots taken at 90 degree angles to each other, with a 90 degree field of view.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The result was actually better than I expected, although the lighting comes out pretty sharply different between the different camera angles.  There is no hiding the fact that I'm painting to a skybox - but for a first pass, it's actually pretty entertaining anyway.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Demo using Python ==&lt;br /&gt;
Using the Python code available at [http://new.math.uiuc.edu/im2010/schirle/skybox.pdf], the following snippet of code can be used to display a FlightGear-based SkyBox using Python:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |it's still using the chunky 90m terrain, and my height sampling gets glitchy here and there (hence the needle problem down by the corner of the skybox).  It's also slower than cold molasses when it comes to making the skyboxes and doing the terrain sampling, but I have a long list of planned optimizations and improvements going forward from here.  Even as is, however, it should still be adequate for a player moving at normal human speed.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181686#p181686&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 19&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There are several flightgear related tasks remaining to figure out.  (Warning, gross understatement.)  It would work much better if I could somehow turn off rendering for everything within a certain radius of the camera, so I would not accidentally fill half my sky with one tree. :-P  The best solution would be to somehow cut out the exact square that I'm rendering locally in Unity, but I'm quite willing to accept cheap hacks and half measures at this point.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I also need to figure out a quick &amp;amp;amp; easy way to raycast for a terrain height at any given place in the flightgear world.  And figure out enough of terragear to know how the terrain textures are placed.  And on and on and on... but I thought some folks here might get a laugh out of this little project, at least.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Rendering is done for a near camera and a far camera anyway, so I think all you need to do is not to render the near camera, and that's it... (I think this was specified somewhere in camera_group.cxx ). &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180788#p180788&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 05&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81885</id>
		<title>FlightGear WorldTerrain SkyBox Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81885"/>
		<updated>2015-03-05T01:39:18Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: /* Objective */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Non-stable}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|image =worldserver.png&lt;br /&gt;
|name = FlightGear SkyBox Server&lt;br /&gt;
|started= 03/2013 &lt;br /&gt;
|description = FlightGear-based SkyBox server &lt;br /&gt;
|status = Under active development as of 03/2015&lt;br /&gt;
|website = [http://www.garagegames.com/community/blogs/view/22269 garagegames.com]&lt;br /&gt;
|developers =  * chriscalef (since 03/2013) &lt;br /&gt;
&lt;br /&gt;
|topic-fg= {{Git link|gitorious|fg/chriscalef2-flightgear|worldDataSource}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebar&lt;br /&gt;
| name	= Related&lt;br /&gt;
| title = Related&lt;br /&gt;
| contentstyle= text-align: left;&lt;br /&gt;
&lt;br /&gt;
| content1 = IPC &amp;amp; RPC&lt;br /&gt;
* [[Improved_J661_support#Patch_prototype|Extending the built-in telnet protocol]]&lt;br /&gt;
* [[Howto:Add new fgcommands to FlightGear]]&lt;br /&gt;
| content2 = Scene to Texture&lt;br /&gt;
* [[Howto:Use_a_Camera_View_in_an_Instrument|Rendering a camera to a texture]]&lt;br /&gt;
* [[Howto:Start_core_development#JPEGFactory|FlightGear Screen Shot Factory]]&lt;br /&gt;
* [[Canvas_Development#Supporting_Cameras|Canvas Cameras]]&lt;br /&gt;
* [[Canvas_Development#Adding_a_new_Element|Creating a new Canvas Camera Element]]&lt;br /&gt;
* [[Canvas_Troubleshooting#Serializing_a_Canvas_to_disk_.28as_raster_image.29|Serializing a Canvas]]&lt;br /&gt;
| content3 = FlightGear Server&lt;br /&gt;
* [[FlightGear Headless]]&lt;br /&gt;
| content4 = IG&lt;br /&gt;
* [[Canvas_Development#Placement.2FElement_for_Streaming:_Computer_Vision|Streaming Live Imagery]]&lt;br /&gt;
* [[CompositeViewer Support]]&lt;br /&gt;
* [[FlightGear high-level architecture support]]&lt;br /&gt;
* [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
'''Notes from the author (Chris Calef) March 04, 2015:'''&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to make FlightGear's extensive library of world data, weather &amp;amp; environment logic, and map editing tools, available for the realtime use of other applications over a socket connection, either locally or over a network.&lt;br /&gt;
&lt;br /&gt;
The initial driving application for this ability is a first person game engine. When this project was initiated in 2013, the Unity engine was chosen for the flagship demo, but we have since switched back to T3D in order to maintain complete source access and a totally open license (and in recognition of the impressive work being done by the Torque3D steering committee and community).&lt;br /&gt;
&lt;br /&gt;
At present, only two types of data are transferred from FlightGear to the client game engine, skybox images and terrain data. A custom camera group has been created (skybox-cameras.xml) which creates a set of five images capable of being mapped to a skybox in the client (there is no bottom image currently). Meanwhile, as the player moves around the world, the terrainPager class in T3D sends requests for terrain data, which are answered in flightgear by the creation of binary float array files for heights and integer array files for texture reference. These are named with the protocol &amp;quot;hght.(coordinates).bin&amp;quot; and &amp;quot;text.(coordinates).bin&amp;quot; respectively.&lt;br /&gt;
 &lt;br /&gt;
The application is still under heavy development, but the current version uses a custom networking class called &amp;quot;dataSource&amp;quot;, which is responsible for opening and maintaining the socket connection, and sending a basic packet of information, and &amp;quot;worldDataSource&amp;quot; which inherits dataSource and handles all the real work. &lt;br /&gt;
&lt;br /&gt;
This structure is still up for debate and it is very likely that it will be discarded in the future in favor of a more general networking base class, probably from SimGear.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Apologies, but the rest of this page is a group of somewhat random quotes on this subject, mostly from myself, helpfully assembled by Hooray who also created this page. I will attempt to make this a more organized presentation of the project at some point in the future.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |My ultimate goal here is a real-world-terrain-based MMO game using Unity for the FPS engine and FlightGear as a backend {{wikipedia|Skybox (video games)}} server.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would also like to make this skybox/terrain mechanism available to others, however, for many different types of projects.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Part of my plan here is to go off on a fork of terragear et al, at whatever level is necessary to change the interpretation of the GIS data, eg to substitute something more blasted and smoking where the urban areas are in the current flightgear world.  Once I get that handled I plan to use GIS shapefiles as a format for creative game-related mapping work, so we're not limited to just the existing real world data, but can paint towns and roads wherever we want.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180759#p180759&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Long story short, it's useful because I want to create a first person MMO game based in real life terrain, and I want to leverage flightgear's very long view distances, awesome weather and day/night simulation, GIS-based terrain texturing, tree shaders, etc. to give the player the sense of truly being immersed in a planetary scale game environment.  And, ultimately, to let them play the game right in their own home town, when I get all the parts put together.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm really aiming larger than just making a single game here, though.  Ultimately I would like to make this into an open source simulation tool / online metaverse explorer that could be used for many different purposes.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180766#p180766&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's also in no way locked to Unity, that's just the environment I'm focusing on right now, due to its ease of cross platform export, among other things.  I have already written a terrain pager in Torque, and could just as easily pipe these skybox images there, which would result in a 100% open source solution... but only for windows or possibly Mac at the moment, no linux.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180767#p180767&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |my skybox is working pretty well now, and I have the FG textures also imported into my Unity terrain, so if I can find a quick way to determine which texture goes where in flightgear when I load a new terrain, I will be a big step forward in the process of replicating my FG experience on the Unity terrain.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181292#p181292&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Easy way to find texcoords or texture for given lat/long?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sat Apr 13&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm in the process of retrofitting the above described prototype so as to allow it to save out an array of finished Unity terrains and skyboxes, using the data provided once by flightgear during development, and then page through this precompiled data at runtime.  This way the end user never has to have flightgear or terragear installed, they just run the Unity game, and only the developer has to deal with the flightgear side of things.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=187648#p187648&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Reporting back on some LiDAR research...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Jul 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm still working on my [http://www.flightgear.org/forums/viewtopic.php?f{{=}}19&amp;amp;amp;t{{=}}19626 &amp;quot;FlightGear World Server&amp;quot;], and the current mission is to replace my (achingly slow) skybox generator.  My previous method was to rotate the camera via PropertyTree changes, and save screenshots at each cardinal direction.  I finally got through the literature on CameraGroups and Cameras, however, and managed to hook up a set of five cameras which simultaneously record all five desired directions, with the correct field of view.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=183792#p183792&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Anybody got any handy OSG image manipulation tips?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Mon May 20&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed&amp;gt;&lt;br /&gt;
SkinnerButteSouth2.jpg&lt;br /&gt;
SkinnerButteEast2.jpg&lt;br /&gt;
WestEugeneWest.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |what I'm primarily doing is using flightgear to draw skyboxes for the Unity (or other FPS style) engine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All I get out of flightgear is five textures, which draw to the front, back, sides and top of the skybox.  The local terrain in Unity I'm actually handling on my own, at much higher resolution than flightgear's terrain (10m instead of 90m(?) for flightgear), although I would like to figure out how to also export the terrain height data from flightgear for the rest of the world beyond my current 50km area of high res data.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I would also like to be able to lift the terrain texture for a given area out of flightgear and inform Unity of it, but I'm taking it one step at a time...&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  | the way I have it designed at the moment is all over a TCP/IP socket, so we should be pretty much free and clear - the flightgear end stays GPL, and the other end doesn't have to really care, it just sends a world position and gets textures back through the socket. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180771#p180771&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There may be some overlap when it comes to objects - I may end up converting some of the .ac files in flightgear into FBX or collada, so I can load them into Unity, but more often I think I'll be going the other way and adding my FBX game models into flightgear, ala [http://www.flightgear.org/forums/viewtopic.php?f{{=}}18&amp;amp;amp;t{{=}}19250 this thread.]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As it is now, though, I can run and run across 2500 square km of area, and wherever I go I can refresh the skybox to see flightgear's view of my position.  Only a very limited region of terrain has to be actually instantiated in Unity at any given time.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |This is all done using Unity C# scripts, opening up sockets to communicate with  A) a tiny little terrain server I wrote in C++, which accepts a starting latitude/longitude and a width/height of the area, and returns height data from a giant ten-meter-resolution height data file I made from DEM maps.  In Unity I have a 3x3 set of tiny terrains (640m each) which page across the landscape, loading new data and moving as necessary to stay in front of the player.  And then, B) a modified flightgear instance, which takes a socket connection from which it reads latitude, longitude, and elevation, and returns five screenshots taken at 90 degree angles to each other, with a 90 degree field of view.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The result was actually better than I expected, although the lighting comes out pretty sharply different between the different camera angles.  There is no hiding the fact that I'm painting to a skybox - but for a first pass, it's actually pretty entertaining anyway.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Demo using Python ==&lt;br /&gt;
Using the Python code available at [http://new.math.uiuc.edu/im2010/schirle/skybox.pdf], the following snippet of code can be used to display a FlightGear-based SkyBox using Python:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |it's still using the chunky 90m terrain, and my height sampling gets glitchy here and there (hence the needle problem down by the corner of the skybox).  It's also slower than cold molasses when it comes to making the skyboxes and doing the terrain sampling, but I have a long list of planned optimizations and improvements going forward from here.  Even as is, however, it should still be adequate for a player moving at normal human speed.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181686#p181686&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 19&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There are several flightgear related tasks remaining to figure out.  (Warning, gross understatement.)  It would work much better if I could somehow turn off rendering for everything within a certain radius of the camera, so I would not accidentally fill half my sky with one tree. :-P  The best solution would be to somehow cut out the exact square that I'm rendering locally in Unity, but I'm quite willing to accept cheap hacks and half measures at this point.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I also need to figure out a quick &amp;amp;amp; easy way to raycast for a terrain height at any given place in the flightgear world.  And figure out enough of terragear to know how the terrain textures are placed.  And on and on and on... but I thought some folks here might get a laugh out of this little project, at least.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Rendering is done for a near camera and a far camera anyway, so I think all you need to do is not to render the near camera, and that's it... (I think this was specified somewhere in camera_group.cxx ). &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180788#p180788&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 05&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81884</id>
		<title>FlightGear WorldTerrain SkyBox Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81884"/>
		<updated>2015-03-05T01:38:07Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: /* Objective */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Non-stable}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|image =worldserver.png&lt;br /&gt;
|name = FlightGear SkyBox Server&lt;br /&gt;
|started= 03/2013 &lt;br /&gt;
|description = FlightGear-based SkyBox server &lt;br /&gt;
|status = Under active development as of 03/2015&lt;br /&gt;
|website = [http://www.garagegames.com/community/blogs/view/22269 garagegames.com]&lt;br /&gt;
|developers =  * chriscalef (since 03/2013) &lt;br /&gt;
&lt;br /&gt;
|topic-fg= {{Git link|gitorious|fg/chriscalef2-flightgear|worldDataSource}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebar&lt;br /&gt;
| name	= Related&lt;br /&gt;
| title = Related&lt;br /&gt;
| contentstyle= text-align: left;&lt;br /&gt;
&lt;br /&gt;
| content1 = IPC &amp;amp; RPC&lt;br /&gt;
* [[Improved_J661_support#Patch_prototype|Extending the built-in telnet protocol]]&lt;br /&gt;
* [[Howto:Add new fgcommands to FlightGear]]&lt;br /&gt;
| content2 = Scene to Texture&lt;br /&gt;
* [[Howto:Use_a_Camera_View_in_an_Instrument|Rendering a camera to a texture]]&lt;br /&gt;
* [[Howto:Start_core_development#JPEGFactory|FlightGear Screen Shot Factory]]&lt;br /&gt;
* [[Canvas_Development#Supporting_Cameras|Canvas Cameras]]&lt;br /&gt;
* [[Canvas_Development#Adding_a_new_Element|Creating a new Canvas Camera Element]]&lt;br /&gt;
* [[Canvas_Troubleshooting#Serializing_a_Canvas_to_disk_.28as_raster_image.29|Serializing a Canvas]]&lt;br /&gt;
| content3 = FlightGear Server&lt;br /&gt;
* [[FlightGear Headless]]&lt;br /&gt;
| content4 = IG&lt;br /&gt;
* [[Canvas_Development#Placement.2FElement_for_Streaming:_Computer_Vision|Streaming Live Imagery]]&lt;br /&gt;
* [[CompositeViewer Support]]&lt;br /&gt;
* [[FlightGear high-level architecture support]]&lt;br /&gt;
* [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
'''Notes from the author (Chris Calef) March 04, 2015:'''&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to make FlightGear's extensive library of world data, weather &amp;amp; environment logic, and map editing tools, available for the realtime use of other applications over a socket connection, either locally or over a network.&lt;br /&gt;
&lt;br /&gt;
The initial driving application for this ability is a first person game engine. When this project was initiated in 2013, the Unity engine was chosen for the flagship demo, but we have since switched back to T3D in order to maintain complete source access and a totally open license (and in recognition of the impressive work being done by the Torque3D steering committee and community).&lt;br /&gt;
&lt;br /&gt;
At present, only two types of data are transferred from FlightGear to the client game engine, skybox images and terrain data. A custom camera group has been created (skybox-cameras.xml) which creates a set of five images capable of being mapped to a skybox in the client (there is no bottom image currently). Meanwhile, as the player moves around the world, the terrainPager class in T3D sends requests for terrain data, which are answered in flightgear by the creation of binary float array files for heights and integer array files for texture reference. These are named with the protocol &amp;quot;hght.(coordinates).bin&amp;quot; and &amp;quot;text.(coordinates).bin&amp;quot; respectively.&lt;br /&gt;
 &lt;br /&gt;
The application is still under heavy development, but the current version uses a custom networking class called &amp;quot;dataSource&amp;quot;, which is responsible for opening and maintaining the socket connection, and sending a basic packet of information, and &amp;quot;worldDataSource&amp;quot; which inherits dataSource and handles all the real work. &lt;br /&gt;
&lt;br /&gt;
This structure is still up for debate and it is very likely that it will be discarded in the future in favor of more general networking classes, probably from SimGear.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Apologies, but the rest of this page is a group of somewhat random quotes on this subject, mostly from myself, helpfully assembled by Hooray who also created this page. I will attempt to make this a more organized presentation of the project at some point in the future.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |My ultimate goal here is a real-world-terrain-based MMO game using Unity for the FPS engine and FlightGear as a backend {{wikipedia|Skybox (video games)}} server.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would also like to make this skybox/terrain mechanism available to others, however, for many different types of projects.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Part of my plan here is to go off on a fork of terragear et al, at whatever level is necessary to change the interpretation of the GIS data, eg to substitute something more blasted and smoking where the urban areas are in the current flightgear world.  Once I get that handled I plan to use GIS shapefiles as a format for creative game-related mapping work, so we're not limited to just the existing real world data, but can paint towns and roads wherever we want.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180759#p180759&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Long story short, it's useful because I want to create a first person MMO game based in real life terrain, and I want to leverage flightgear's very long view distances, awesome weather and day/night simulation, GIS-based terrain texturing, tree shaders, etc. to give the player the sense of truly being immersed in a planetary scale game environment.  And, ultimately, to let them play the game right in their own home town, when I get all the parts put together.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm really aiming larger than just making a single game here, though.  Ultimately I would like to make this into an open source simulation tool / online metaverse explorer that could be used for many different purposes.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180766#p180766&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's also in no way locked to Unity, that's just the environment I'm focusing on right now, due to its ease of cross platform export, among other things.  I have already written a terrain pager in Torque, and could just as easily pipe these skybox images there, which would result in a 100% open source solution... but only for windows or possibly Mac at the moment, no linux.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180767#p180767&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |my skybox is working pretty well now, and I have the FG textures also imported into my Unity terrain, so if I can find a quick way to determine which texture goes where in flightgear when I load a new terrain, I will be a big step forward in the process of replicating my FG experience on the Unity terrain.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181292#p181292&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Easy way to find texcoords or texture for given lat/long?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sat Apr 13&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm in the process of retrofitting the above described prototype so as to allow it to save out an array of finished Unity terrains and skyboxes, using the data provided once by flightgear during development, and then page through this precompiled data at runtime.  This way the end user never has to have flightgear or terragear installed, they just run the Unity game, and only the developer has to deal with the flightgear side of things.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=187648#p187648&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Reporting back on some LiDAR research...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Jul 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm still working on my [http://www.flightgear.org/forums/viewtopic.php?f{{=}}19&amp;amp;amp;t{{=}}19626 &amp;quot;FlightGear World Server&amp;quot;], and the current mission is to replace my (achingly slow) skybox generator.  My previous method was to rotate the camera via PropertyTree changes, and save screenshots at each cardinal direction.  I finally got through the literature on CameraGroups and Cameras, however, and managed to hook up a set of five cameras which simultaneously record all five desired directions, with the correct field of view.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=183792#p183792&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Anybody got any handy OSG image manipulation tips?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Mon May 20&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed&amp;gt;&lt;br /&gt;
SkinnerButteSouth2.jpg&lt;br /&gt;
SkinnerButteEast2.jpg&lt;br /&gt;
WestEugeneWest.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |what I'm primarily doing is using flightgear to draw skyboxes for the Unity (or other FPS style) engine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All I get out of flightgear is five textures, which draw to the front, back, sides and top of the skybox.  The local terrain in Unity I'm actually handling on my own, at much higher resolution than flightgear's terrain (10m instead of 90m(?) for flightgear), although I would like to figure out how to also export the terrain height data from flightgear for the rest of the world beyond my current 50km area of high res data.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I would also like to be able to lift the terrain texture for a given area out of flightgear and inform Unity of it, but I'm taking it one step at a time...&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  | the way I have it designed at the moment is all over a TCP/IP socket, so we should be pretty much free and clear - the flightgear end stays GPL, and the other end doesn't have to really care, it just sends a world position and gets textures back through the socket. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180771#p180771&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There may be some overlap when it comes to objects - I may end up converting some of the .ac files in flightgear into FBX or collada, so I can load them into Unity, but more often I think I'll be going the other way and adding my FBX game models into flightgear, ala [http://www.flightgear.org/forums/viewtopic.php?f{{=}}18&amp;amp;amp;t{{=}}19250 this thread.]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As it is now, though, I can run and run across 2500 square km of area, and wherever I go I can refresh the skybox to see flightgear's view of my position.  Only a very limited region of terrain has to be actually instantiated in Unity at any given time.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |This is all done using Unity C# scripts, opening up sockets to communicate with  A) a tiny little terrain server I wrote in C++, which accepts a starting latitude/longitude and a width/height of the area, and returns height data from a giant ten-meter-resolution height data file I made from DEM maps.  In Unity I have a 3x3 set of tiny terrains (640m each) which page across the landscape, loading new data and moving as necessary to stay in front of the player.  And then, B) a modified flightgear instance, which takes a socket connection from which it reads latitude, longitude, and elevation, and returns five screenshots taken at 90 degree angles to each other, with a 90 degree field of view.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The result was actually better than I expected, although the lighting comes out pretty sharply different between the different camera angles.  There is no hiding the fact that I'm painting to a skybox - but for a first pass, it's actually pretty entertaining anyway.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Demo using Python ==&lt;br /&gt;
Using the Python code available at [http://new.math.uiuc.edu/im2010/schirle/skybox.pdf], the following snippet of code can be used to display a FlightGear-based SkyBox using Python:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |it's still using the chunky 90m terrain, and my height sampling gets glitchy here and there (hence the needle problem down by the corner of the skybox).  It's also slower than cold molasses when it comes to making the skyboxes and doing the terrain sampling, but I have a long list of planned optimizations and improvements going forward from here.  Even as is, however, it should still be adequate for a player moving at normal human speed.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181686#p181686&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 19&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There are several flightgear related tasks remaining to figure out.  (Warning, gross understatement.)  It would work much better if I could somehow turn off rendering for everything within a certain radius of the camera, so I would not accidentally fill half my sky with one tree. :-P  The best solution would be to somehow cut out the exact square that I'm rendering locally in Unity, but I'm quite willing to accept cheap hacks and half measures at this point.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I also need to figure out a quick &amp;amp;amp; easy way to raycast for a terrain height at any given place in the flightgear world.  And figure out enough of terragear to know how the terrain textures are placed.  And on and on and on... but I thought some folks here might get a laugh out of this little project, at least.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Rendering is done for a near camera and a far camera anyway, so I think all you need to do is not to render the near camera, and that's it... (I think this was specified somewhere in camera_group.cxx ). &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180788#p180788&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 05&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81883</id>
		<title>FlightGear WorldTerrain SkyBox Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81883"/>
		<updated>2015-03-05T01:35:03Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: /* Objective */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Non-stable}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|image =worldserver.png&lt;br /&gt;
|name = FlightGear SkyBox Server&lt;br /&gt;
|started= 03/2013 &lt;br /&gt;
|description = FlightGear-based SkyBox server &lt;br /&gt;
|status = Under active development as of 03/2015&lt;br /&gt;
|website = [http://www.garagegames.com/community/blogs/view/22269 garagegames.com]&lt;br /&gt;
|developers =  * chriscalef (since 03/2013) &lt;br /&gt;
&lt;br /&gt;
|topic-fg= {{Git link|gitorious|fg/chriscalef2-flightgear|worldDataSource}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebar&lt;br /&gt;
| name	= Related&lt;br /&gt;
| title = Related&lt;br /&gt;
| contentstyle= text-align: left;&lt;br /&gt;
&lt;br /&gt;
| content1 = IPC &amp;amp; RPC&lt;br /&gt;
* [[Improved_J661_support#Patch_prototype|Extending the built-in telnet protocol]]&lt;br /&gt;
* [[Howto:Add new fgcommands to FlightGear]]&lt;br /&gt;
| content2 = Scene to Texture&lt;br /&gt;
* [[Howto:Use_a_Camera_View_in_an_Instrument|Rendering a camera to a texture]]&lt;br /&gt;
* [[Howto:Start_core_development#JPEGFactory|FlightGear Screen Shot Factory]]&lt;br /&gt;
* [[Canvas_Development#Supporting_Cameras|Canvas Cameras]]&lt;br /&gt;
* [[Canvas_Development#Adding_a_new_Element|Creating a new Canvas Camera Element]]&lt;br /&gt;
* [[Canvas_Troubleshooting#Serializing_a_Canvas_to_disk_.28as_raster_image.29|Serializing a Canvas]]&lt;br /&gt;
| content3 = FlightGear Server&lt;br /&gt;
* [[FlightGear Headless]]&lt;br /&gt;
| content4 = IG&lt;br /&gt;
* [[Canvas_Development#Placement.2FElement_for_Streaming:_Computer_Vision|Streaming Live Imagery]]&lt;br /&gt;
* [[CompositeViewer Support]]&lt;br /&gt;
* [[FlightGear high-level architecture support]]&lt;br /&gt;
* [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
'''Notes from the author (Chris Calef) March 04, 2015:'''&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to make FlightGear's extensive library of world data, weather &amp;amp; environment logic, and map editing tools, available for the realtime use of other applications over a socket connection, either locally or over a network.&lt;br /&gt;
&lt;br /&gt;
The initial driving application for this ability is a first person game engine. When this project was initiated in 2013, the Unity engine was chosen for the flagship demo, but we have since switched back to T3D in order to maintain complete source access and a totally open license (and in recognition of the impressive work being done by the Torque3D steering committee and community).&lt;br /&gt;
&lt;br /&gt;
At present, only two types of data are transferred from FlightGear to the client game engine, skybox images and terrain data. A custom camera group has been created (skybox-cameras.xml) which creates a set of five images capable of being mapped to a skybox in the client (there is no bottom image currently). Meanwhile, as the player moves around the world, the terrainPager class in T3D sends requests for terrain data, which are answered in flightgear by the creation of binary float array files for heights and integer array files for texture reference. These are named with the protocol &amp;quot;hght.(coordinates).bin&amp;quot; and &amp;quot;text.(coordinates).bin&amp;quot; respectively.&lt;br /&gt;
 &lt;br /&gt;
The application is still under heavy development, but the current version uses a custom networking class called &amp;quot;dataSource&amp;quot;, which is responsible for opening and maintaining the socket connection, and sending a basic packet of information, and &amp;quot;worldDataSource&amp;quot; which inherits dataSource and handles all the real work. &lt;br /&gt;
&lt;br /&gt;
This structure is still up for debate and it is very likely that it will be discarded in the future in favor of more general networking classes, probably from SimGear.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |My ultimate goal here is a real-world-terrain-based MMO game using Unity for the FPS engine and FlightGear as a backend {{wikipedia|Skybox (video games)}} server.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would also like to make this skybox/terrain mechanism available to others, however, for many different types of projects.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Part of my plan here is to go off on a fork of terragear et al, at whatever level is necessary to change the interpretation of the GIS data, eg to substitute something more blasted and smoking where the urban areas are in the current flightgear world.  Once I get that handled I plan to use GIS shapefiles as a format for creative game-related mapping work, so we're not limited to just the existing real world data, but can paint towns and roads wherever we want.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180759#p180759&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Long story short, it's useful because I want to create a first person MMO game based in real life terrain, and I want to leverage flightgear's very long view distances, awesome weather and day/night simulation, GIS-based terrain texturing, tree shaders, etc. to give the player the sense of truly being immersed in a planetary scale game environment.  And, ultimately, to let them play the game right in their own home town, when I get all the parts put together.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm really aiming larger than just making a single game here, though.  Ultimately I would like to make this into an open source simulation tool / online metaverse explorer that could be used for many different purposes.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180766#p180766&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's also in no way locked to Unity, that's just the environment I'm focusing on right now, due to its ease of cross platform export, among other things.  I have already written a terrain pager in Torque, and could just as easily pipe these skybox images there, which would result in a 100% open source solution... but only for windows or possibly Mac at the moment, no linux.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180767#p180767&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |my skybox is working pretty well now, and I have the FG textures also imported into my Unity terrain, so if I can find a quick way to determine which texture goes where in flightgear when I load a new terrain, I will be a big step forward in the process of replicating my FG experience on the Unity terrain.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181292#p181292&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Easy way to find texcoords or texture for given lat/long?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sat Apr 13&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm in the process of retrofitting the above described prototype so as to allow it to save out an array of finished Unity terrains and skyboxes, using the data provided once by flightgear during development, and then page through this precompiled data at runtime.  This way the end user never has to have flightgear or terragear installed, they just run the Unity game, and only the developer has to deal with the flightgear side of things.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=187648#p187648&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Reporting back on some LiDAR research...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Jul 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm still working on my [http://www.flightgear.org/forums/viewtopic.php?f{{=}}19&amp;amp;amp;t{{=}}19626 &amp;quot;FlightGear World Server&amp;quot;], and the current mission is to replace my (achingly slow) skybox generator.  My previous method was to rotate the camera via PropertyTree changes, and save screenshots at each cardinal direction.  I finally got through the literature on CameraGroups and Cameras, however, and managed to hook up a set of five cameras which simultaneously record all five desired directions, with the correct field of view.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=183792#p183792&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Anybody got any handy OSG image manipulation tips?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Mon May 20&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed&amp;gt;&lt;br /&gt;
SkinnerButteSouth2.jpg&lt;br /&gt;
SkinnerButteEast2.jpg&lt;br /&gt;
WestEugeneWest.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |what I'm primarily doing is using flightgear to draw skyboxes for the Unity (or other FPS style) engine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All I get out of flightgear is five textures, which draw to the front, back, sides and top of the skybox.  The local terrain in Unity I'm actually handling on my own, at much higher resolution than flightgear's terrain (10m instead of 90m(?) for flightgear), although I would like to figure out how to also export the terrain height data from flightgear for the rest of the world beyond my current 50km area of high res data.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I would also like to be able to lift the terrain texture for a given area out of flightgear and inform Unity of it, but I'm taking it one step at a time...&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  | the way I have it designed at the moment is all over a TCP/IP socket, so we should be pretty much free and clear - the flightgear end stays GPL, and the other end doesn't have to really care, it just sends a world position and gets textures back through the socket. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180771#p180771&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There may be some overlap when it comes to objects - I may end up converting some of the .ac files in flightgear into FBX or collada, so I can load them into Unity, but more often I think I'll be going the other way and adding my FBX game models into flightgear, ala [http://www.flightgear.org/forums/viewtopic.php?f{{=}}18&amp;amp;amp;t{{=}}19250 this thread.]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As it is now, though, I can run and run across 2500 square km of area, and wherever I go I can refresh the skybox to see flightgear's view of my position.  Only a very limited region of terrain has to be actually instantiated in Unity at any given time.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |This is all done using Unity C# scripts, opening up sockets to communicate with  A) a tiny little terrain server I wrote in C++, which accepts a starting latitude/longitude and a width/height of the area, and returns height data from a giant ten-meter-resolution height data file I made from DEM maps.  In Unity I have a 3x3 set of tiny terrains (640m each) which page across the landscape, loading new data and moving as necessary to stay in front of the player.  And then, B) a modified flightgear instance, which takes a socket connection from which it reads latitude, longitude, and elevation, and returns five screenshots taken at 90 degree angles to each other, with a 90 degree field of view.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The result was actually better than I expected, although the lighting comes out pretty sharply different between the different camera angles.  There is no hiding the fact that I'm painting to a skybox - but for a first pass, it's actually pretty entertaining anyway.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Demo using Python ==&lt;br /&gt;
Using the Python code available at [http://new.math.uiuc.edu/im2010/schirle/skybox.pdf], the following snippet of code can be used to display a FlightGear-based SkyBox using Python:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |it's still using the chunky 90m terrain, and my height sampling gets glitchy here and there (hence the needle problem down by the corner of the skybox).  It's also slower than cold molasses when it comes to making the skyboxes and doing the terrain sampling, but I have a long list of planned optimizations and improvements going forward from here.  Even as is, however, it should still be adequate for a player moving at normal human speed.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181686#p181686&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 19&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There are several flightgear related tasks remaining to figure out.  (Warning, gross understatement.)  It would work much better if I could somehow turn off rendering for everything within a certain radius of the camera, so I would not accidentally fill half my sky with one tree. :-P  The best solution would be to somehow cut out the exact square that I'm rendering locally in Unity, but I'm quite willing to accept cheap hacks and half measures at this point.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I also need to figure out a quick &amp;amp;amp; easy way to raycast for a terrain height at any given place in the flightgear world.  And figure out enough of terragear to know how the terrain textures are placed.  And on and on and on... but I thought some folks here might get a laugh out of this little project, at least.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Rendering is done for a near camera and a far camera anyway, so I think all you need to do is not to render the near camera, and that's it... (I think this was specified somewhere in camera_group.cxx ). &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180788#p180788&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 05&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81880</id>
		<title>FlightGear WorldTerrain SkyBox Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81880"/>
		<updated>2015-03-05T01:28:59Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: /* Objective */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Non-stable}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|image =worldserver.png&lt;br /&gt;
|name = FlightGear SkyBox Server&lt;br /&gt;
|started= 03/2013 &lt;br /&gt;
|description = FlightGear-based SkyBox server &lt;br /&gt;
|status = Under active development as of 03/2015&lt;br /&gt;
|website = [http://www.garagegames.com/community/blogs/view/22269 garagegames.com]&lt;br /&gt;
|developers =  * chriscalef (since 03/2013) &lt;br /&gt;
&lt;br /&gt;
|topic-fg= {{Git link|gitorious|fg/chriscalef2-flightgear|worldDataSource}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebar&lt;br /&gt;
| name	= Related&lt;br /&gt;
| title = Related&lt;br /&gt;
| contentstyle= text-align: left;&lt;br /&gt;
&lt;br /&gt;
| content1 = IPC &amp;amp; RPC&lt;br /&gt;
* [[Improved_J661_support#Patch_prototype|Extending the built-in telnet protocol]]&lt;br /&gt;
* [[Howto:Add new fgcommands to FlightGear]]&lt;br /&gt;
| content2 = Scene to Texture&lt;br /&gt;
* [[Howto:Use_a_Camera_View_in_an_Instrument|Rendering a camera to a texture]]&lt;br /&gt;
* [[Howto:Start_core_development#JPEGFactory|FlightGear Screen Shot Factory]]&lt;br /&gt;
* [[Canvas_Development#Supporting_Cameras|Canvas Cameras]]&lt;br /&gt;
* [[Canvas_Development#Adding_a_new_Element|Creating a new Canvas Camera Element]]&lt;br /&gt;
* [[Canvas_Troubleshooting#Serializing_a_Canvas_to_disk_.28as_raster_image.29|Serializing a Canvas]]&lt;br /&gt;
| content3 = FlightGear Server&lt;br /&gt;
* [[FlightGear Headless]]&lt;br /&gt;
| content4 = IG&lt;br /&gt;
* [[Canvas_Development#Placement.2FElement_for_Streaming:_Computer_Vision|Streaming Live Imagery]]&lt;br /&gt;
* [[CompositeViewer Support]]&lt;br /&gt;
* [[FlightGear high-level architecture support]]&lt;br /&gt;
* [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
'''Notes from the author (Chris Calef) March 04, 2015:'''&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to make FlightGear's extensive library of world data, weather &amp;amp; environment logic, and map editing tools, available for the realtime use of other applications over a socket connection, either locally or over a network.&lt;br /&gt;
&lt;br /&gt;
The initial driving application for this ability is a first person game engine. When this project was initiated in 2013, the Unity engine was chosen for the flagship demo, but we have since switched back to T3D in order to maintain complete source access and a totally open license (and in recognition of the impressive work being done by the Torque3D steering committee and community).&lt;br /&gt;
&lt;br /&gt;
At present, only two types of data are transferred from FlightGear to the client game engine, skybox images and terrain data. A custom camera group has been created (skybox-cameras.xml) which creates a set of five images capable of being mapped to a skybox in the client (there is no bottom image currently). Meanwhile, as the player moves around the world, the terrainPager class in T3D sends requests for terrain data, which are answered in flightgear by the creation of binary float array files for heights and integer array files for texture reference. These are named with the protocol &amp;quot;hght.(coordinates).bin&amp;quot; and &amp;quot;text.(coordinates).bin&amp;quot; respectively.&lt;br /&gt;
 &lt;br /&gt;
The application is still under heavy development, but the current version uses a custom networking class called &amp;quot;dataSource&amp;quot;, which is responsible for opening and maintaining the socket connection, and sending a basic packet of information, and &amp;quot;worldDataSource&amp;quot; which inherits dataSource and handles all the real work. &lt;br /&gt;
&lt;br /&gt;
This structure is still up for debate and it is very likely that it will be discarded in the future in favor of more general networking classes, probably from SimGear.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |My ultimate goal here is a real-world-terrain-based MMO game using Unity for the FPS engine and FlightGear as a backend {{wikipedia|Skybox (video games)}} server.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would also like to make this skybox/terrain mechanism available to others, however, for many different types of projects.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Part of my plan here is to go off on a fork of terragear et al, at whatever level is necessary to change the interpretation of the GIS data, eg to substitute something more blasted and smoking where the urban areas are in the current flightgear world.  Once I get that handled I plan to use GIS shapefiles as a format for creative game-related mapping work, so we're not limited to just the existing real world data, but can paint towns and roads wherever we want.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180759#p180759&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Long story short, it's useful because I want to create a first person MMO game based in real life terrain, and I want to leverage flightgear's very long view distances, awesome weather and day/night simulation, GIS-based terrain texturing, tree shaders, etc. to give the player the sense of truly being immersed in a planetary scale game environment.  And, ultimately, to let them play the game right in their own home town, when I get all the parts put together.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm really aiming larger than just making a single game here, though.  Ultimately I would like to make this into an open source simulation tool / online metaverse explorer that could be used for many different purposes.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180766#p180766&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's also in no way locked to Unity, that's just the environment I'm focusing on right now, due to its ease of cross platform export, among other things.  I have already written a terrain pager in Torque, and could just as easily pipe these skybox images there, which would result in a 100% open source solution... but only for windows or possibly Mac at the moment, no linux.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180767#p180767&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |my skybox is working pretty well now, and I have the FG textures also imported into my Unity terrain, so if I can find a quick way to determine which texture goes where in flightgear when I load a new terrain, I will be a big step forward in the process of replicating my FG experience on the Unity terrain.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181292#p181292&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Easy way to find texcoords or texture for given lat/long?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sat Apr 13&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm in the process of retrofitting the above described prototype so as to allow it to save out an array of finished Unity terrains and skyboxes, using the data provided once by flightgear during development, and then page through this precompiled data at runtime.  This way the end user never has to have flightgear or terragear installed, they just run the Unity game, and only the developer has to deal with the flightgear side of things.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=187648#p187648&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Reporting back on some LiDAR research...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Jul 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm still working on my [http://www.flightgear.org/forums/viewtopic.php?f{{=}}19&amp;amp;amp;t{{=}}19626 &amp;quot;FlightGear World Server&amp;quot;], and the current mission is to replace my (achingly slow) skybox generator.  My previous method was to rotate the camera via PropertyTree changes, and save screenshots at each cardinal direction.  I finally got through the literature on CameraGroups and Cameras, however, and managed to hook up a set of five cameras which simultaneously record all five desired directions, with the correct field of view.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=183792#p183792&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Anybody got any handy OSG image manipulation tips?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Mon May 20&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed&amp;gt;&lt;br /&gt;
SkinnerButteSouth2.jpg&lt;br /&gt;
SkinnerButteEast2.jpg&lt;br /&gt;
WestEugeneWest.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |what I'm primarily doing is using flightgear to draw skyboxes for the Unity (or other FPS style) engine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All I get out of flightgear is five textures, which draw to the front, back, sides and top of the skybox.  The local terrain in Unity I'm actually handling on my own, at much higher resolution than flightgear's terrain (10m instead of 90m(?) for flightgear), although I would like to figure out how to also export the terrain height data from flightgear for the rest of the world beyond my current 50km area of high res data.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I would also like to be able to lift the terrain texture for a given area out of flightgear and inform Unity of it, but I'm taking it one step at a time...&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  | the way I have it designed at the moment is all over a TCP/IP socket, so we should be pretty much free and clear - the flightgear end stays GPL, and the other end doesn't have to really care, it just sends a world position and gets textures back through the socket. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180771#p180771&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There may be some overlap when it comes to objects - I may end up converting some of the .ac files in flightgear into FBX or collada, so I can load them into Unity, but more often I think I'll be going the other way and adding my FBX game models into flightgear, ala [http://www.flightgear.org/forums/viewtopic.php?f{{=}}18&amp;amp;amp;t{{=}}19250 this thread.]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As it is now, though, I can run and run across 2500 square km of area, and wherever I go I can refresh the skybox to see flightgear's view of my position.  Only a very limited region of terrain has to be actually instantiated in Unity at any given time.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |This is all done using Unity C# scripts, opening up sockets to communicate with  A) a tiny little terrain server I wrote in C++, which accepts a starting latitude/longitude and a width/height of the area, and returns height data from a giant ten-meter-resolution height data file I made from DEM maps.  In Unity I have a 3x3 set of tiny terrains (640m each) which page across the landscape, loading new data and moving as necessary to stay in front of the player.  And then, B) a modified flightgear instance, which takes a socket connection from which it reads latitude, longitude, and elevation, and returns five screenshots taken at 90 degree angles to each other, with a 90 degree field of view.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The result was actually better than I expected, although the lighting comes out pretty sharply different between the different camera angles.  There is no hiding the fact that I'm painting to a skybox - but for a first pass, it's actually pretty entertaining anyway.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Demo using Python ==&lt;br /&gt;
Using the Python code available at [http://new.math.uiuc.edu/im2010/schirle/skybox.pdf], the following snippet of code can be used to display a FlightGear-based SkyBox using Python:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |it's still using the chunky 90m terrain, and my height sampling gets glitchy here and there (hence the needle problem down by the corner of the skybox).  It's also slower than cold molasses when it comes to making the skyboxes and doing the terrain sampling, but I have a long list of planned optimizations and improvements going forward from here.  Even as is, however, it should still be adequate for a player moving at normal human speed.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181686#p181686&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 19&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There are several flightgear related tasks remaining to figure out.  (Warning, gross understatement.)  It would work much better if I could somehow turn off rendering for everything within a certain radius of the camera, so I would not accidentally fill half my sky with one tree. :-P  The best solution would be to somehow cut out the exact square that I'm rendering locally in Unity, but I'm quite willing to accept cheap hacks and half measures at this point.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I also need to figure out a quick &amp;amp;amp; easy way to raycast for a terrain height at any given place in the flightgear world.  And figure out enough of terragear to know how the terrain textures are placed.  And on and on and on... but I thought some folks here might get a laugh out of this little project, at least.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Rendering is done for a near camera and a far camera anyway, so I think all you need to do is not to render the near camera, and that's it... (I think this was specified somewhere in camera_group.cxx ). &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180788#p180788&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 05&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81879</id>
		<title>FlightGear WorldTerrain SkyBox Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_WorldTerrain_SkyBox_Server&amp;diff=81879"/>
		<updated>2015-03-05T01:01:26Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: /* Gallery */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Non-stable}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|image =worldserver.png&lt;br /&gt;
|name = FlightGear SkyBox Server&lt;br /&gt;
|started= 03/2013 &lt;br /&gt;
|description = FlightGear-based SkyBox server &lt;br /&gt;
|status = Under active development as of 03/2015&lt;br /&gt;
|website = [http://www.garagegames.com/community/blogs/view/22269 garagegames.com]&lt;br /&gt;
|developers =  * chriscalef (since 03/2013) &lt;br /&gt;
&lt;br /&gt;
|topic-fg= {{Git link|gitorious|fg/chriscalef2-flightgear|worldDataSource}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebar&lt;br /&gt;
| name	= Related&lt;br /&gt;
| title = Related&lt;br /&gt;
| contentstyle= text-align: left;&lt;br /&gt;
&lt;br /&gt;
| content1 = IPC &amp;amp; RPC&lt;br /&gt;
* [[Improved_J661_support#Patch_prototype|Extending the built-in telnet protocol]]&lt;br /&gt;
* [[Howto:Add new fgcommands to FlightGear]]&lt;br /&gt;
| content2 = Scene to Texture&lt;br /&gt;
* [[Howto:Use_a_Camera_View_in_an_Instrument|Rendering a camera to a texture]]&lt;br /&gt;
* [[Howto:Start_core_development#JPEGFactory|FlightGear Screen Shot Factory]]&lt;br /&gt;
* [[Canvas_Development#Supporting_Cameras|Canvas Cameras]]&lt;br /&gt;
* [[Canvas_Development#Adding_a_new_Element|Creating a new Canvas Camera Element]]&lt;br /&gt;
* [[Canvas_Troubleshooting#Serializing_a_Canvas_to_disk_.28as_raster_image.29|Serializing a Canvas]]&lt;br /&gt;
| content3 = FlightGear Server&lt;br /&gt;
* [[FlightGear Headless]]&lt;br /&gt;
| content4 = IG&lt;br /&gt;
* [[Canvas_Development#Placement.2FElement_for_Streaming:_Computer_Vision|Streaming Live Imagery]]&lt;br /&gt;
* [[CompositeViewer Support]]&lt;br /&gt;
* [[FlightGear high-level architecture support]]&lt;br /&gt;
* [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |My ultimate goal here is a real-world-terrain-based MMO game using Unity for the FPS engine and FlightGear as a backend {{wikipedia|Skybox (video games)}} server.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would also like to make this skybox/terrain mechanism available to others, however, for many different types of projects.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Part of my plan here is to go off on a fork of terragear et al, at whatever level is necessary to change the interpretation of the GIS data, eg to substitute something more blasted and smoking where the urban areas are in the current flightgear world.  Once I get that handled I plan to use GIS shapefiles as a format for creative game-related mapping work, so we're not limited to just the existing real world data, but can paint towns and roads wherever we want.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180759#p180759&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Long story short, it's useful because I want to create a first person MMO game based in real life terrain, and I want to leverage flightgear's very long view distances, awesome weather and day/night simulation, GIS-based terrain texturing, tree shaders, etc. to give the player the sense of truly being immersed in a planetary scale game environment.  And, ultimately, to let them play the game right in their own home town, when I get all the parts put together.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm really aiming larger than just making a single game here, though.  Ultimately I would like to make this into an open source simulation tool / online metaverse explorer that could be used for many different purposes.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180766#p180766&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's also in no way locked to Unity, that's just the environment I'm focusing on right now, due to its ease of cross platform export, among other things.  I have already written a terrain pager in Torque, and could just as easily pipe these skybox images there, which would result in a 100% open source solution... but only for windows or possibly Mac at the moment, no linux.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180767#p180767&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |my skybox is working pretty well now, and I have the FG textures also imported into my Unity terrain, so if I can find a quick way to determine which texture goes where in flightgear when I load a new terrain, I will be a big step forward in the process of replicating my FG experience on the Unity terrain.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181292#p181292&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Easy way to find texcoords or texture for given lat/long?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sat Apr 13&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm in the process of retrofitting the above described prototype so as to allow it to save out an array of finished Unity terrains and skyboxes, using the data provided once by flightgear during development, and then page through this precompiled data at runtime.  This way the end user never has to have flightgear or terragear installed, they just run the Unity game, and only the developer has to deal with the flightgear side of things.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=187648#p187648&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Reporting back on some LiDAR research...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Jul 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'm still working on my [http://www.flightgear.org/forums/viewtopic.php?f{{=}}19&amp;amp;amp;t{{=}}19626 &amp;quot;FlightGear World Server&amp;quot;], and the current mission is to replace my (achingly slow) skybox generator.  My previous method was to rotate the camera via PropertyTree changes, and save screenshots at each cardinal direction.  I finally got through the literature on CameraGroups and Cameras, however, and managed to hook up a set of five cameras which simultaneously record all five desired directions, with the correct field of view.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=183792#p183792&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Anybody got any handy OSG image manipulation tips?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Mon May 20&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed&amp;gt;&lt;br /&gt;
SkinnerButteSouth2.jpg&lt;br /&gt;
SkinnerButteEast2.jpg&lt;br /&gt;
WestEugeneWest.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |what I'm primarily doing is using flightgear to draw skyboxes for the Unity (or other FPS style) engine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All I get out of flightgear is five textures, which draw to the front, back, sides and top of the skybox.  The local terrain in Unity I'm actually handling on my own, at much higher resolution than flightgear's terrain (10m instead of 90m(?) for flightgear), although I would like to figure out how to also export the terrain height data from flightgear for the rest of the world beyond my current 50km area of high res data.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I would also like to be able to lift the terrain texture for a given area out of flightgear and inform Unity of it, but I'm taking it one step at a time...&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  | the way I have it designed at the moment is all over a TCP/IP socket, so we should be pretty much free and clear - the flightgear end stays GPL, and the other end doesn't have to really care, it just sends a world position and gets textures back through the socket. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180771#p180771&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There may be some overlap when it comes to objects - I may end up converting some of the .ac files in flightgear into FBX or collada, so I can load them into Unity, but more often I think I'll be going the other way and adding my FBX game models into flightgear, ala [http://www.flightgear.org/forums/viewtopic.php?f{{=}}18&amp;amp;amp;t{{=}}19250 this thread.]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As it is now, though, I can run and run across 2500 square km of area, and wherever I go I can refresh the skybox to see flightgear's view of my position.  Only a very limited region of terrain has to be actually instantiated in Unity at any given time.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180765#p180765&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |This is all done using Unity C# scripts, opening up sockets to communicate with  A) a tiny little terrain server I wrote in C++, which accepts a starting latitude/longitude and a width/height of the area, and returns height data from a giant ten-meter-resolution height data file I made from DEM maps.  In Unity I have a 3x3 set of tiny terrains (640m each) which page across the landscape, loading new data and moving as necessary to stay in front of the player.  And then, B) a modified flightgear instance, which takes a socket connection from which it reads latitude, longitude, and elevation, and returns five screenshots taken at 90 degree angles to each other, with a 90 degree field of view.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The result was actually better than I expected, although the lighting comes out pretty sharply different between the different camera angles.  There is no hiding the fact that I'm painting to a skybox - but for a first pass, it's actually pretty entertaining anyway.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Demo using Python ==&lt;br /&gt;
Using the Python code available at [http://new.math.uiuc.edu/im2010/schirle/skybox.pdf], the following snippet of code can be used to display a FlightGear-based SkyBox using Python:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |it's still using the chunky 90m terrain, and my height sampling gets glitchy here and there (hence the needle problem down by the corner of the skybox).  It's also slower than cold molasses when it comes to making the skyboxes and doing the terrain sampling, but I have a long list of planned optimizations and improvements going forward from here.  Even as is, however, it should still be adequate for a player moving at normal human speed.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=181686#p181686&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 19&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |There are several flightgear related tasks remaining to figure out.  (Warning, gross understatement.)  It would work much better if I could somehow turn off rendering for everything within a certain radius of the camera, so I would not accidentally fill half my sky with one tree. :-P  The best solution would be to somehow cut out the exact square that I'm rendering locally in Unity, but I'm quite willing to accept cheap hacks and half measures at this point.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I also need to figure out a quick &amp;amp;amp; easy way to raycast for a terrain height at any given place in the flightgear world.  And figure out enough of terragear to know how the terrain textures are placed.  And on and on and on... but I thought some folks here might get a laugh out of this little project, at least.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180734#p180734&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;chriscalef&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Thu Apr 04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Rendering is done for a near camera and a far camera anyway, so I think all you need to do is not to render the near camera, and that's it... (I think this was specified somewhere in camera_group.cxx ). &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=180788#p180788&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: Flightgear and Unity3D&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Fri Apr 05&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:WestEugeneEast.jpg&amp;diff=81878</id>
		<title>File:WestEugeneEast.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:WestEugeneEast.jpg&amp;diff=81878"/>
		<updated>2015-03-05T00:56:23Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: User created page with UploadWizard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=={{int:filedesc}}==&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=WestEugeneEast}}&lt;br /&gt;
|date=2015-03-04 16:53:17&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Chriscalef|Chriscalef]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:WestEugeneWest.jpg&amp;diff=81877</id>
		<title>File:WestEugeneWest.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:WestEugeneWest.jpg&amp;diff=81877"/>
		<updated>2015-03-05T00:56:12Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: User created page with UploadWizard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=={{int:filedesc}}==&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=WestEugeneWest}}&lt;br /&gt;
|date=2015-03-04 16:53:19&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Chriscalef|Chriscalef]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:WestEugeneSouth.jpg&amp;diff=81876</id>
		<title>File:WestEugeneSouth.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:WestEugeneSouth.jpg&amp;diff=81876"/>
		<updated>2015-03-05T00:56:02Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: User created page with UploadWizard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=={{int:filedesc}}==&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=WestEugeneSouth}}&lt;br /&gt;
|date=2015-03-04 16:53:18&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Chriscalef|Chriscalef]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:SkinnerButteSouth.jpg&amp;diff=81875</id>
		<title>File:SkinnerButteSouth.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:SkinnerButteSouth.jpg&amp;diff=81875"/>
		<updated>2015-03-05T00:55:52Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: User created page with UploadWizard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=={{int:filedesc}}==&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=SkinnerButteSouth}}&lt;br /&gt;
|date=2015-03-04 16:53:16&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Chriscalef|Chriscalef]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:SkinnerButteSouth2.jpg&amp;diff=81874</id>
		<title>File:SkinnerButteSouth2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:SkinnerButteSouth2.jpg&amp;diff=81874"/>
		<updated>2015-03-05T00:55:42Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: User created page with UploadWizard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=={{int:filedesc}}==&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=SkinnerButteSouth2}}&lt;br /&gt;
|date=2015-03-04 16:53:16&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Chriscalef|Chriscalef]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:SkinnerButteEast.jpg&amp;diff=81873</id>
		<title>File:SkinnerButteEast.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:SkinnerButteEast.jpg&amp;diff=81873"/>
		<updated>2015-03-05T00:55:31Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: User created page with UploadWizard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=={{int:filedesc}}==&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=SkinnerButteEast}}&lt;br /&gt;
|date=2015-03-04 16:53:16&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Chriscalef|Chriscalef]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:Preview.jpg&amp;diff=81872</id>
		<title>File:Preview.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:Preview.jpg&amp;diff=81872"/>
		<updated>2015-03-05T00:55:21Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: User created page with UploadWizard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=={{int:filedesc}}==&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=thumbnail 180x120}}&lt;br /&gt;
|date=2015-03-04 16:53:10&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Chriscalef|Chriscalef]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:SkinnerButteEast2.jpg&amp;diff=81871</id>
		<title>File:SkinnerButteEast2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:SkinnerButteEast2.jpg&amp;diff=81871"/>
		<updated>2015-03-05T00:55:11Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: User created page with UploadWizard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=={{int:filedesc}}==&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=SkinnerButteEast2}}&lt;br /&gt;
|date=2015-03-04 16:53:10&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Chriscalef|Chriscalef]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_wiki:Village_pump&amp;diff=75309</id>
		<title>FlightGear wiki:Village pump</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_wiki:Village_pump&amp;diff=75309"/>
		<updated>2014-08-18T02:00:21Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: /* readability and quality of articles - quoting statements from the forum useful? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archives|[[/Archive 2012|2012]], [[/Archive 2013|2013]]}}&lt;br /&gt;
Welcome to the '''Village Pump'''. This page is used to discuss the technical issues, operations and guidelines of the [[FlightGear wiki]].&lt;br /&gt;
&lt;br /&gt;
: Please [{{fullurl:{{FULLPAGENAME}}|action=edit&amp;amp;section=new}} add new topics] to the '''bottom''' of this page.&lt;br /&gt;
&lt;br /&gt;
: Old discussion should be moved to a [[FlightGear wiki:Village pump/Archive YEAR]]. These discussions can then be moved to a relevant talk page if appropriate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== MediaWiki updated to 1.22.0 ==&lt;br /&gt;
I've updated MediaWiki to the latest stable, 1.22.0 today. Please report bugs if you find any. For a list of changes, see https://www.mediawiki.org/wiki/Release_notes/1.22&lt;br /&gt;
&lt;br /&gt;
[[User:Gijs|Gijs]] ([[User talk:Gijs|talk]]) 15:00, 26 December 2013 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Found bugs ===&lt;br /&gt;
* Clicking the category link at the bottom of some articles will give a fatal error.  For clicking the [[:Category:FlightGear]] at [[FlightGear]] will give the error message: ''Fatal error: Class 'Services_JSON' not found in /home/wiki/wiki/extensions/CategoryTree/CategoryTreeFunctions.php on line 224''.&lt;br /&gt;
: —[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 03:44, 28 December 2013 (UTC)&lt;br /&gt;
:: The CategoryTree extension relies on a function that was removed as of 1.22.0, so the extensions needs some fixing. I've disabled it for now.&lt;br /&gt;
:: [[User:Gijs|Gijs]] ([[User talk:Gijs|talk]]) 13:01, 28 December 2013 (UTC)&lt;br /&gt;
::: Yay, CategoryTree is back.  Thanks Gijs!&lt;br /&gt;
::: —[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 19:50, 6 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
* Also, the mobile theme results in an error: ''Fatal error: Call to undefined method MobileFormatter::setHtmlMode() in /home/wiki/wiki/extensions/MobileFrontend/includes/MobileFormatter.php on line 62'' (works fine after selecting desktop mode).&lt;br /&gt;
: Thanks,&lt;br /&gt;
: [[User:Philosopher|—Philosopher]] ([[User talk:Philosopher|talk]]) 03:59, 28 December 2013 (UTC)&lt;br /&gt;
:: I forgot to update the mobile extension. Works again ;-)&lt;br /&gt;
:: [[User:Gijs|Gijs]] ([[User talk:Gijs|talk]]) 13:01, 28 December 2013 (UTC)&lt;br /&gt;
&lt;br /&gt;
* In the CategoryTree the FlightGear category [[:Category:Documentation|appears empty]]. The solution is reported at [[mw:Extension:CategoryTree#Member counts are wrong, gray arrows ► are shown instead of ►]]. It's a minor problem but the solution looks easy, for what I can tell.&lt;br /&gt;
: --[[User:Bigstones|Bigstones]] ([[User talk:Bigstones|talk]]) 00:27, 11 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: Unfortunately that doesn't seem to help...&lt;br /&gt;
:: [[User:Gijs|Gijs]] ([[User talk:Gijs|talk]]) 11:11, 11 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Got any ideas for a better name for this page? ==&lt;br /&gt;
As this is for this page in particular, see the [[FlightGear wiki talk:Village pump#Any ideas for a better name|talk page]].&lt;br /&gt;
&lt;br /&gt;
—[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 15:44, 5 March 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Template for announcement of changes and new features ==&lt;br /&gt;
&lt;br /&gt;
From a forum PM from Hooray (posted here with his permission):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background: #fafaf0; padding: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
hi, whenever we announce a new feature, we typically need to do this in three places:&lt;br /&gt;
&lt;br /&gt;
* newsletter&lt;br /&gt;
* changelog&lt;br /&gt;
* the docs (corresponding wiki articles)&lt;br /&gt;
&lt;br /&gt;
so far, we have always copied &amp;amp; pasted things, I would prefer to have a single template for this instead, something like&lt;br /&gt;
{{tlx|Announce|version|description}}&lt;br /&gt;
&lt;br /&gt;
This could add announcements to each release cycle (i.e. 3.2 currently), and we could maybe automatically add things to the newsletter and the release changelog.&lt;br /&gt;
&lt;br /&gt;
Like I said, I would like to avoid redundant efforts, i.e. less copy &amp;amp; paste&lt;br /&gt;
&lt;br /&gt;
Do you have any ideas on how to implement this using existing wiki means ?&lt;br /&gt;
&lt;br /&gt;
Ideally, we would create a new announcement, like for example &amp;quot;canvas mouse button support&amp;quot;, and could then use this announcement in all 3 places by calling the corresponding template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
My take is that to use a separate template for each new feature is not a good idea, but if I understand him correctly his intention is to gather up each months new features in one template.&lt;br /&gt;
&lt;br /&gt;
Any thoughts on this?&lt;br /&gt;
&lt;br /&gt;
—[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 17:14, 5 March 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
{{WIP}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;white-space: pre-wrap; margin-left: 1.5em;&amp;quot;&amp;gt;I am thinking of restructuring the way we're writing our newsletter by focusing on our &amp;quot;ugly stepchild&amp;quot;, namely the &amp;quot;changelog&amp;quot; - as others like Torsten have pointed out, we should ideally be writing the changelog as early as possible - but the truth is, it's mostly forum people contributing to it, and it's not seen too many edits. The newsletter is working a bit better for us. So I was thinking of how to unify both worlds - especially keeping in mind that our changelog encompasses basically 6 months, i.e. 6 newsletter editions. &lt;br /&gt;
&lt;br /&gt;
So I am considering to split up our newsletter into a handful of building blocks and use a few templates, so that additions are added through a few custom templates, that would automatically add things to the changelog.&lt;br /&gt;
&lt;br /&gt;
The changelog would then be written by contributing to the newsletter  and using the proper templates, such as e.g.:&lt;br /&gt;
&lt;br /&gt;
{{changelog|version=3.2|category:aircraft|type=updated|announcement=The 747-400 and 777-200 have received extensive updates, and are now both using the new MapStructure-based NavDisplay framework|screenshots=|videos=}}&lt;br /&gt;
&lt;br /&gt;
The changelog would then  be procedurally assembled by processing all templates for the corresponding release cycle.&lt;br /&gt;
&lt;br /&gt;
I would even consider locking the changelog itself, and making it just a template that references the stuff included via templates.&lt;br /&gt;
&lt;br /&gt;
We may however benefit from a few additional mediawiki extensions. But otherwise, I am hoping that the changelog is going to be more comprehensive, while the wiki would become more &amp;quot;formal&amp;quot; - we could obviously still support additions without using changelog-templates, i.e. those would be excluded.&lt;br /&gt;
&lt;br /&gt;
thoughts / ideas ?&lt;br /&gt;
&lt;br /&gt;
(CC'ing Philosopher, because he's been doing some template stuff, too)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:Need to come up with a template that handles announcements, primarily for the changelog and the newsletter. There's a mutual relationship here, but the newsletter is much more popular, i.e. sees more contributions and more activity overall. Changelog writing is still a chore. But basically 6 months worth of newsletters are equivalent to a single changelog, we only need to establish some framework around this - and then the whole changelog could be mostly based on newsletter contributions. It would greatly help to request people to make announcements ALWAYS using 3rd person speech, so that things can be directly copied from the forum/devel list to the newsletter/changelog. That's kinda the idea here. It would reduce our workload quite significantly&lt;br /&gt;
&lt;br /&gt;
:* Changelog&lt;br /&gt;
:* Newsletter&lt;br /&gt;
:* Devel List&lt;br /&gt;
:* Forum&lt;br /&gt;
:* Website&lt;br /&gt;
&lt;br /&gt;
:{{unsigned|21:25, 24 April 2014‎|Hooray}}&lt;br /&gt;
&lt;br /&gt;
::I will probably have to take a look at this now and again to think about if and how this could be done.  I assume Hooray is aiming at having each newsletter and change log built up mostly from &amp;quot;instances&amp;quot; of a template like in the above comments.&lt;br /&gt;
&lt;br /&gt;
::There are pros and cons with this approach, as with any.  I think that one of the cons is that even the slightest overhead and/or complication might scare away a few contributors.  But at the other hand I fully understand that reading through six months of newsletters + forum posts + devel list posts are not that fun either (though I would guess that is not how things are done ;-).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::''Slightly off topic'' is that I would like to see a section in the change log mentioning changes that will break backwards compatibility.  I first saw such a section, &amp;quot;Breaking changes&amp;quot;, in the [https://www.mediawiki.org/w/index.php?title=Release_notes/1.22&amp;amp;oldid=848518#MediaWiki_1.22.0 change log of MedeiaWiki 1.22] when the software of this wiki was updated, and figured it would be a good idea.  This could be useful for things like for example figuring out whether FlightGear x.x can use World Scenery y.y.&lt;br /&gt;
&lt;br /&gt;
::''Even more off topic'' I think that the wiki/newsletter/devel list/etc are rather blunt tools for keeping an up to date change log.  My gut feeling is that there are tools for that around, and even if we do not use them we might borrow some ideas from them, hopefully without bringing a lot of red tape(!).&lt;br /&gt;
&lt;br /&gt;
::—[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 20:14, 27 April 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
::: Interesting subject! I think going through just 6 newsletters by hand is more rewarding than coming up with complex templates that will increase the entry barrier of the newsletter and still require summarising/rewordings afterwards to fit the concise format of a changelog. Introducing a template on the wiki won't take away the forum/devel list scanning that's required as not everyone contributes to the wiki.&lt;br /&gt;
::: I do support the &amp;quot;breaking changes&amp;quot; idea though ;-)&lt;br /&gt;
::: [[User:Gijs|Gijs]] ([[User talk:Gijs|talk]]) 19:18, 1 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Very dispersed Boeing 777 articles! ==&lt;br /&gt;
&lt;br /&gt;
Hi, I got interested in Flightgear and was taking a look at the Boeing 777 articles and noticed that it was incredibly spread out. &lt;br /&gt;
&lt;br /&gt;
Each aircraft has it's own page with information to varying degrees of completeness. Having a look at the A330 articles, they are much more 'aligned' and it's a lot easier to find stuff. Maybe this could be something that could be done with the Boeing.  Since both seem to be very similar, I'm thinking that there could be a common page on help and tutorials respectively, with the individual type pages catering to unique information. I started on some stuff but pretty quickly figured out it was a better idea to check here first :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Manfred|Manfred]] ([[User talk:Manfred|talk]]) 11:55, 25 March 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
: Doing a simple search for pages containing &amp;quot;777&amp;quot; (see [http://wiki.flightgear.org/index.php?search=777&amp;amp;title=Special%3ASearch&amp;amp;fulltext=1 this link]) I quickly see what you mean.&lt;br /&gt;
&lt;br /&gt;
: I assume that the different versions may have different authors and thus probably are slightly different from each other when it comes to handling and completeness.  It might be a good idea to start by going through each of the help pages and tutorials (preferably while playing with the different aircraft at the same time), as well as having a look at help dialogues and any readmes in the aircraft packages.&lt;br /&gt;
&lt;br /&gt;
: Making a common page, while highlighting differences between the different versions, could probably help other users a lot and may perhaps be a help for aircraft developers to use features from more complete versions to improve the other ones as well as help motivate harmonizing handling like for example key bindings.&lt;br /&gt;
&lt;br /&gt;
: If I understand your intention I can not see why anyone would do anything but trying to give you helpful hints, after all this is a wiki. :-)&lt;br /&gt;
&lt;br /&gt;
: One hint for starters is to begin working on a page as a subpage to your user page, like for example [[User:Manfred/Boeing 777 Autopilot]] (I just moved it) and then moving it to the article namespace when you feel it has reached the level where you are comfortable with it (though this is not by any means necessary, it's just that I like doing so myself).&lt;br /&gt;
&lt;br /&gt;
: —[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 16:40, 28 March 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
: I am interested to help, this page could be a model of what we could offer : [http://wiki.flightgear.org/Boeing_787-8_Dreamliner 777-8 Dreamliner]&lt;br /&gt;
: -- [[User:F-JYL|F-JYL]] 21 April 2014 09:32&lt;br /&gt;
&lt;br /&gt;
== Bash and DOS syntax highlighting ==&lt;br /&gt;
&lt;br /&gt;
[[User:Daemonburrito|Daemonburrito]] found that we can use syntax highlighting for Bash.  I guess that means that we could use syntax highlighting for most Linux (and possibly also Mac) command lines.  Looking at [[mediawikiwiki:Extension:SyntaxHighlight_GeSHi]] I find that we also also probably can use that for DOS prompts.&lt;br /&gt;
&lt;br /&gt;
—[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 07:24, 5 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
: We've had that extension installed for a while now. Everything that's listed at [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi#Supported_languages Supported languages] is supported, plus Nasal.&lt;br /&gt;
: [[User:Gijs|Gijs]] ([[User talk:Gijs|talk]]) 11:23, 5 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: I'm aware of the list, but was not aware that syntax highlighting could be used for shell programming (and hence shell promts) and guessed I was not alone.&lt;br /&gt;
:: Basically added the topic to highlight (pun intended) the possibility to do so.  I should probably also mention it in [[Help:Formatting#Syntax highlighting]].&lt;br /&gt;
:: —[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 13:53, 5 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
== A plan for a reorganization of the wiki ==&lt;br /&gt;
&lt;br /&gt;
There is an ongoing discussion on [[User:Bigstones/Essay:A plan for a reorganization of the wiki]]. Please comment on its talk page, to avoid scattering the discussion. This &amp;quot;section&amp;quot; is only intended to inform about it.&lt;br /&gt;
--[[User:Bigstones|Bigstones]] ([[User talk:Bigstones|talk]]) 12:53, 7 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
== The new progress bar icons ==&lt;br /&gt;
&lt;br /&gt;
I just changed icons that {{tl|progressbar}} is using and would like some constructive feedback.&lt;br /&gt;
&lt;br /&gt;
Some things I have noted myself is that while I used a blend of the colours used in the old icons and in some of [[Special:ListFiles/Johan_G|my other icons]], these icons have a much larger coloured area and thus might have a little high contrast.&lt;br /&gt;
&lt;br /&gt;
In any way I am going to let this rest for a week or two and follow it up then.&lt;br /&gt;
&lt;br /&gt;
—[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 01:05, 10 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
: After having made them a tiny pixel smaller (from 16 px to 15 px) and having done no other changes I seem to be liking them more and more, so I leave them in their current state.&lt;br /&gt;
: —[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 18:13, 24 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Category:Support ==&lt;br /&gt;
As it seems that support organization is a priority, I created [[:Category:Support]]. I hope the name is generic enough to avoid misunderstandings... but I thought better to have a bad one, than nothing. I'll try to put there everything on support I find so that it can be better organized (merged/split and then cleaned up).&lt;br /&gt;
--[[User:Bigstones|Bigstones]] ([[User talk:Bigstones|talk]]) 13:06, 11 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Hi,&lt;br /&gt;
:&lt;br /&gt;
:I didn't read through all of your ideas yet, but isn't &amp;quot;Support&amp;quot; a rather obscure term? Everything could fit under that branch, so we'll end up with yet another giant category; which you tried to prevent, right? Or maybe I'm just missing the bigger picture...&lt;br /&gt;
&lt;br /&gt;
:[[User:Gijs|Gijs]] ([[User talk:Gijs|talk]]) 13:23, 11 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: Hi, I figured out (''edit: led to figure out'') that support organization is a major problem. There's a lot of &amp;quot;support&amp;quot; related articles, 2-3 articles only on OpenGL. I hoped that this name could indeed be wide enough, and that in case it could just be renamed. Troubleshooting seemed to narrow to me on the other side, but if you think that would be better I can change it now (waiting for response before proceeding).--[[User:Bigstones|Bigstones]] ([[User talk:Bigstones|talk]]) 13:29, 11 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
::: Take [[Settings for slower graphics cards]] for example. It's categorised under [[:Category:Performance tuning]]. I would expect that to be a sub of [[:Category:Support]]. Anyone looking for articles on how to improve performance can check that category then. I don't expect anyone to go through a very broad category with 100s of articles to find info on a rather specific subject.&lt;br /&gt;
::: Or maybe I should reword my comment into a question: What would be the use case of [[:Category:Support]]?&lt;br /&gt;
::: [[User:Gijs|Gijs]] ([[User talk:Gijs|talk]]) 13:39, 11 May 2014 (UTC)&lt;br /&gt;
::: PS: I know we have a lot of bloated categories on this wiki, so I'm glad you've brought all this back on the agenda ;-)&lt;br /&gt;
&lt;br /&gt;
:::: With the example: I confess I was probably deceived by the presence of some development related stuff in [[:Category:Performance tuning]]. I thought it would be better to separate development and usage. Framerate is either a user issue, or a developer's aim. I think the two can be separated. The problem is I moved out the most of it! I should consider the contrary. I'll undo. (I currently have like 20 open browser tabs so it might take me some time).&lt;br /&gt;
:::: The use case however is: gather support articles so that a maintainer can split/merge them to make them more organized. Once that's done, there won't probably be more than 10 articles, and if there are, still one can subcategorize. In the above case, I just took the longest path, but given the lack of tools I confess I just wanted to get started.&lt;br /&gt;
:::: --[[User:Bigstones|Bigstones]] ([[User talk:Bigstones|talk]]) 14:00, 11 May 2014 (UTC)&lt;br /&gt;
:::: ... I must confess also that after undoing, I feel the urge to redo that again. The two non-support related articles, [[GIT Performance Tests]] and [[Howto:Use the system monitor]] (where btw, the &amp;quot;profiling&amp;quot; section might be directed to ''core'' developers?) would have no place if I move this category into support. That's also why I moved it into Development. Let me know what you think, also regarding the Support category name.&lt;br /&gt;
:::: --[[User:Bigstones|Bigstones]] ([[User talk:Bigstones|talk]]) 14:24, 11 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
== FlightGear screenshot categories ==&lt;br /&gt;
&lt;br /&gt;
I have been thinking about this for quite a while.  When I was categorising the images, I gave the categories with the FlightGear screenshots quite cumbersome and long names.&lt;br /&gt;
&lt;br /&gt;
I guess the discussions with Bigstones, in particular [http://wiki.flightgear.org/index.php?title=User_talk:Bigstones/Essay:A_plan_for_a_reorganization_of_the_wiki&amp;amp;diff=70678&amp;amp;oldid=70675 my reply here] (see second paragraph under 2.) might have stirred up some old dust for me. :-)&lt;br /&gt;
&lt;br /&gt;
The cumbersome and long names has a couple negative effects.  Firstly they are way longer to type than should be necessary, secondly, and more important I think, the probability that they show up in the upload wizard probably is rather low as they all begin with &amp;quot;FlightGear...&amp;quot; (what was I thinking, like if someone would upload a bunch of X-Plane screenshots here).  I ''guess'' that by beginning most if not all screenshot category names with &amp;quot;Screenshots of...&amp;quot; the chances they would be used will increase.&lt;br /&gt;
&lt;br /&gt;
In addition to that some of those categories are way too large and need to be diffused (broken down into smaller categories).&lt;br /&gt;
&lt;br /&gt;
I have noted that a lot of aircraft images have been added to the aircraft article categories.  I would prefer if the screenshot categories associated with different kinds of aircraft (e.g. fighters or airliners) would be subcategories to the screenshot categories ''and'' that those screenshot categories would be a subcategory to the category for those kinds of aircraft.  I have at some point started to try mimic the structure of [[:Category:Aircraft by type]] in Category:FlightGear screenshots of aircraft by type, but got distracted or forgot about it for a while.  Someting similar might be needed for the cockpit screenshots.&lt;br /&gt;
&lt;br /&gt;
The note about intended contents should also mention that these categories are intended only for in-sim screenshots from FlightGear.&lt;br /&gt;
&lt;br /&gt;
In conclusion I suggest, and would like feedback on, the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current category !! Suggested new category !! Alternative new category !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| [[:Category:FlightGear cockpit screenshots‎]] || [[:Category:Screenshots of cockpits]] || Cockpit screenshots ||&lt;br /&gt;
|-&lt;br /&gt;
| [[:Category:FlightGear cockpit close-up screenshots‎]] || [[:Category:Screenshots of cockpit details]] || Cockpit close-up screenshots ||&lt;br /&gt;
|-&lt;br /&gt;
| [[:Category:FlightGear dialogue screenshots‎]]&lt;br /&gt;
| &amp;lt;s&amp;gt;Category:Screenshots of ‎dialogues&amp;lt;/s&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[:Category:Screenshots of FlightGear dialogs‎]]&lt;br /&gt;
| &amp;lt;s&amp;gt;Dialogue&amp;lt;/s&amp;gt; Dialog box screenshots ||&lt;br /&gt;
|-&lt;br /&gt;
| [[:Category:FlightGear exterior screenshots]]‎ || [[:Category:Screenshots of aircraft]] || Exterior screenshots ||&lt;br /&gt;
|-&lt;br /&gt;
| [[:Category:FlightGear interior screenshots]] || [[:Category:Screenshots of cabins]] || Cabin screenshots ||&lt;br /&gt;
|-&lt;br /&gt;
| [[:Category:FlightGear scenery screenshots]]‎ || [[:Category:Screenshots of scenery]] || Scenery screenshots ||&lt;br /&gt;
|-&lt;br /&gt;
| Category:FlightGear screenshots of aircraft by type || [[:Category:Screenshots of aircraft by type]] || &amp;amp;mdash; || Should only contain categories&lt;br /&gt;
|-&lt;br /&gt;
| Category:FlightGear screenshots of vehicles || [[:Category:Screenshots of vehicles]] || Vehicle screenshots ||&lt;br /&gt;
|-&lt;br /&gt;
| [[:Category:FlightGear weather screenshots]]‎ || [[:Category:Screenshots of weather]] || Weather screenshots ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In essence it is a huge bot job, except for the diffusion of the largest screenshot categories.&lt;br /&gt;
&lt;br /&gt;
—[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 15:57, 12 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
: As I might have said already, I'm ok with it and in particular I agree that images would be easier to find if in their own branch. The only thing, I think it's not going to last if the upload wizard doesn't enforce the use of a subcat of &amp;quot;Files&amp;quot;, or at least, suggests that area in some handy way (i.e. not a written notice). Maybe the CategoryTree could be included (like with templates) to help finding the right category? It's hard to figure out a good one by typing characters one by one.&lt;br /&gt;
: --[[User:Bigstones|Bigstones]] ([[User talk:Bigstones|talk]]) 21:49, 12 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: Created the category pages as above, except for Category:Screenshots of ‎dialogues, which I found a bit ambiguous.  I named that one Category:Screenshots of dialogues in FlightGear‎ instead.&lt;br /&gt;
:: I have also added a request at the [[User talk:BotFlightGear#FlightGear screenshot categories|bot talk page]] ([http://wiki.flightgear.org/index.php?title=User_talk:BotFlightGear&amp;amp;oldid=71130#FlightGear_screenshot_categories permalink])&lt;br /&gt;
:: —[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 17:59, 13 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
::: Did the move to [[:Category:Screenshots of aircraft by type]] by hand. Was only a few files.&lt;br /&gt;
::: —[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 18:46, 13 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
::: I hope I'm not late, I noticed only now, but ''dialogue'' tends to be used more as in &amp;quot;discussion between two&amp;quot;, while the GUI elements are usually spelled ''dialogs''. I guess that more than real confusion this distinction would cause just minor hilarity, but... you never know, you might find in there screenshots of radio chat with ATC. (being not a native english speaker, [http://english.stackexchange.com/questions/59640/what-is-the-difference-between-dialogue-and-dialog here's my ref.]) --[[User:Bigstones|Bigstones]] ([[User talk:Bigstones|talk]]) 19:20, 13 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::: Well spotted, good reference as well and most important not too late.  Thank you!  I was wondering a bit but guessed that dialog was more or less colloquial as dialogue seemed correct with both my browsers English and American English dictionaries.  Swedish schools teaching (very!) British English probably have something to do with my spelling as well.&lt;br /&gt;
:::: Changed the request on the [[User talk:BotFlightGear#FlightGear screenshot categories|bot page]] from Category:Screenshots of dialogues in FlightGear‎ to  [[:Category:Screenshots of FlightGear dialogs]].&lt;br /&gt;
:::: —[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 14:06, 14 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Having separate image categories or not? ===&lt;br /&gt;
One thing that keeps nagging me is that all Wikipedias I have been able to read and some I can hardly read (English, Swedish + German and French) have separate categories for files/images.  There is probably a reason for that (I am guessing at mainly ease of finding images for articles and possibly also for bandwidth reasons).&lt;br /&gt;
&lt;br /&gt;
The upload wizard is borrowed from Wikimedia Commons &amp;lt;small&amp;gt;(but is it properly attributed?)&amp;lt;/small&amp;gt; where pretty much all categories are for files/images.  While I am not aware of its technical details I see few if any efficient ways it could be modified to only or primarily suggest image categories.  As I see it it would require a ''fresh and updated'' list of categories that in one way or another would require some manual intervention.&lt;br /&gt;
&lt;br /&gt;
Two things I have done so far is to re-categorize images and that I have begun trying to link the nodes to the nodes in the branch with the article categories by putting the image categories in the article categories (this is done on a very small scale though).&lt;br /&gt;
&lt;br /&gt;
Questions is though:  What is in the best interest of the users?  Should I keep on having them separate or should I just let it grow wild(er)?  It could be an interesting experiment though it would require a lot of work if it turns out less favourable.&lt;br /&gt;
&lt;br /&gt;
—[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 22:02, 10 July 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:I saw you implementing this at some of my airport screen-shots and immediately adopted it on other images. I think your idea of separating those categories would help us puting a link at the end of each article which says: &amp;quot;Media about :XY&amp;quot;. Thats why I think all the other wikis provide separated categories. That's the only way to get linkable categories which only contain media.&lt;br /&gt;
&lt;br /&gt;
:--[[User:August|August]] ([[User talk:August|talk]]) 22:18, 10 July 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Conventions on discussion conclusions ==&lt;br /&gt;
Sometimes proposals don't get the attention the proposer might have hoped for. Of course, everyone's involved in their projects, and following discussions in &amp;quot;recent changes&amp;quot; isn't easy, so nothing personal, my question is ''very practical''. &lt;br /&gt;
&lt;br /&gt;
Sometimes these proposals need help from others (like my [[User_talk:Bigstones/Essay:A plan for a reorganization of the wiki#Bot proposal .28request.3F.29|&amp;quot;remove redundant categories&amp;quot;]]) so it's pretty clear that one will have to wait and retry/insist for that. Some other times though (like my above &amp;quot;Category:Support&amp;quot; topic - with which btw I did some mess moving messages around) one could easily continue on his/her own. In such cases, I feel that lack/loss of attention means &amp;quot;Ok, I don't mind if you do that, in case, we'll discuss the results&amp;quot; (like for the FAQ update - btw, thanks to the reviewers of [http://wiki.flightgear.org/index.php?title=Frequently_asked_questions&amp;amp;oldid=71015 my cuts]). If this is correct, I'd like to add it to the [[Help:Maintenance]] page, because it could help getting more things done and avoid misunderstandings. Oh, and by what I said, if I don't get answers, I'll take it for granted :D&lt;br /&gt;
&lt;br /&gt;
--[[User:Bigstones|Bigstones]] ([[User talk:Bigstones|talk]]) 12:43, 13 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
: I have found the lack of feedback to be discouraging at times, but at other times I have just went ahead and done things the way I would like to have them done, like for example my reorganisation and extension of the help pages, as well as adding the &amp;quot;[[FlightGear wiki:Village pump|Discuss!]]&amp;quot; link to the left side menu.&lt;br /&gt;
&lt;br /&gt;
: I would guess that you draw the right conclusion with the statement that &amp;quot;Ok, I don't mind if you do that, in case, we'll discuss the results&amp;quot;.  The very most of the times that is the way to go.  The good thing with a wiki is that it is so easy to revert a change (i.e &amp;quot;View history&amp;quot; tab &amp;amp;rarr; Go to topmost edit &amp;amp;rarr; Click the &amp;quot;undo&amp;quot; link).  If if things go really wrong most things can be salvaged from the page history (though it can be a lot of work at times). ;-)&lt;br /&gt;
&lt;br /&gt;
: —[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 17:03, 13 May 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Editing JavaScript files ? ==&lt;br /&gt;
&lt;br /&gt;
: ''Moved here from [[Talk:Portal:Wiki#Editing JavaScript files ?]] ([http://wiki.flightgear.org/index.php?title=Talk:Portal:Wiki&amp;amp;oldid=72290 permalink]) since this might affect all users.''&lt;br /&gt;
&lt;br /&gt;
I think, at some point, I saw someone editing JavaScript files here (Johan_G or Gijs probably) - what is involved to do that ? Any links/pointers ? Okay, found something at [[MediaWiki:Common.js]] Is it also possible to create custom JS/plain text files without any wiki markup ? Are my privileges even sufficient ? --[[User:Hooray|Hooray]] ([[User talk:Hooray|talk]]) 21:11, 2 June 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
: Nope, was not me.  Javascript files is as far as I know currently limited to [[MediaWiki:Common.js]].  It is apparently possible to change some settings so that one can add &amp;quot;user javascript pages&amp;quot; (as well as &amp;quot;user Cascading Style Sheets&amp;quot;), see the WikiMedia Wiki pages [http://www.mediawiki.org/wiki/Manual:$wgAllowUserJs Manual:$wgAllowUserJs] (and [http://www.mediawiki.org/wiki/Manual:$wgAllowUserCss Manual:$wgAllowUserCss]).&lt;br /&gt;
&lt;br /&gt;
: Both can be useful for testing stuff before including them in the &amp;quot;common&amp;quot; (i.e. site wide) files, as well as for personalizing the look, feel and functionality.  I do not know what issues they could cause or if we have the permissions to change it.  Maybe Simon and Gijs are the ones who can do it.&lt;br /&gt;
&lt;br /&gt;
: —[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 04:40, 3 June 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
== MediaWiki updated to 1.23.0 ==&lt;br /&gt;
&lt;br /&gt;
I've updated MediaWiki to the latest stable release (1.23.0) today. I'm now updating all extensions, so some things may be broken temporarily. Please report bugs if you find any. For a list of changes, see https://www.mediawiki.org/wiki/Release_notes/1.23&lt;br /&gt;
&lt;br /&gt;
[[User:Gijs|Gijs]] ([[User talk:Gijs|talk]]) 12:04, 8 June 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
== readability and quality of articles - quoting statements from the forum useful? ==&lt;br /&gt;
&lt;br /&gt;
In the last two weeks I'm trying to debug something so I wanted to find some needed information in the wiki. Instead I stumbled on articles full of quoting meaningless and partly false) statements from the forum. I don't see the meaning of this, as it influences the readability of the wiki more and more in a negative way. And I don't see why this is in any way important or helpful to users. I guess this known user wants simply highlight some certain facts, but the way he is doing this is far away from any quality standard known from wikipedia.org, educational books and similar stuff on the web. As I could see former discussions about this issue had been useless. I have two articles about helicopter flying and helicopter-fdm in the pipeline, but I fear that those articles will be also filled up with useless quotes from the forum. So what quality standards the wiki is using?&lt;br /&gt;
Wouldn't be a simple footer with a link to the statement better than inserting quotes?&lt;br /&gt;
--[[User:HHS|HHS]] ([[User talk:HHS|talk]]) 09:33, 17 August 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: Hi HHS, assuming that you are referring to my edits: those are primarily about coding issues, so it may not be obvious to you if/how those are useful, but there are a number of very concrete features that have materialized by &amp;quot;bootstrapping&amp;quot; things like this over the last years. &lt;br /&gt;
&lt;br /&gt;
: Now, whenever you start an article, or add significantly to it, you are obviously free to take over maintenance and &amp;quot;veto&amp;quot; any changes that you disagree with.&lt;br /&gt;
 &lt;br /&gt;
: As you can easily verify, I am not at all involved in anything relating to helicopters, so be assured that I won't interfere with any of your contributions in that department - that is, unless there's relevant feature requests and discussions to be summarized - in which case, I would consider any relevant additions to be outside the scope of the two topics you mention. &lt;br /&gt;
&lt;br /&gt;
: If in doubt, I'll hereby promise to get in touch with you upfront, should I desire to contribute to any of &amp;quot;your&amp;quot; articles. So there's no need to use any blackmailing tactics by making any of your potential contributions dependent on whether a certain contributor agrees with you or not.&lt;br /&gt;
&lt;br /&gt;
: The discussions you are referring to were specifically about the newsletter, where it was primarily Gijs who stated that such quotes should be cleaned up, and I have stated that I won't interfere with any such quality standards, but -like you- I would simply prefer to have such quality standards established first.&lt;br /&gt;
 &lt;br /&gt;
: Like I said elsewhere, I do not even disagree with the arguments made, but obviously it takes much more time to rephrase and summarize discussions than copying relevant statements directly to the wiki. Still, some concrete features (in terms of code) were very much based on such summarized discussions.&lt;br /&gt;
&lt;br /&gt;
: Besides, I am really not sure why some people are turning into drama queens, and even attention junkies when it comes to certain contributions - especially people who have no significant/visible track record of contributing to the wiki in any major way? &lt;br /&gt;
: Obviously, this doesn't apply to people like Gijs, Johan_G and Thorsten whose feedback is obviously valuable-but I find it hard to believe that someone who -allegedly- &amp;quot;wanted to find some needed information in the wiki&amp;quot; would be affected by contributions, or even discussions/flame wars, in completely unrelated wiki articles-if that's the case, I would suggest that you may need help to properly use the wiki-for which you can get in touch with any of the admins, including myself - we'll  be glad to provide all the assistance that you may need, including help with editing/improving articles. &lt;br /&gt;
&lt;br /&gt;
: As a fellow wiki contributor, I happen to find massive edit histories confusing, i.e. all the maintenance work done by Gijs and Johan_G is hard to keep track of-but otherwise, I don't usually participate in discussions that I am not affected by. So, I find it kinda fascinating how you are apparently affected by flamewars taking place on very much unrelated talk pages ? &lt;br /&gt;
&lt;br /&gt;
: Thus, I am looking forward to your contributions and I am offering to walk you through the necessary steps to integrate your changes properly, without being affected by completely unrelated articles, and their discussions. If there are any helicopter related articles that contain &amp;quot;meaningless quotes&amp;quot; in your opinion, please do feel free to either remove those (you can add a note or HTML comments tag to easily hide huge sections), raise the issue on the article's talk page (using civil language preferably), or simply point out those articles here, so that I can take a look.&lt;br /&gt;
&lt;br /&gt;
: Once again, like I previously said, flame wars and disagreements are always unfortunate, but they come with the territority, and usually it takes at least '''two''' - and certain language is more likely to elicit behavior that we as a community find destructive - but apparently, there's also quite a bit of behind-the-scenes networking going on, so that subjectivity gets lost quickly. &lt;br /&gt;
&lt;br /&gt;
: As I previously said, on wikipedia (or even just the FlightGear forum), your language would have gotten your comments censored, and your account quite possibly banned temporarily - so whatever your intentions were, you were almost certainly contributing to the problem, not the solution. &lt;br /&gt;
&lt;br /&gt;
: Now, I didn't take any actions, because I am obviously not objective, and because I don't normally get involved in moderating stuff - but whenever two parties (like i4dnf and myself) decide to escalate a discussion beyond a certain point, it is up to '''them''' to deal with the terms - you shouldn't just show up and get involved without also expecting to be treated accordingly, especially given your choice of language - no matter if your hobby/profession is psychology or not, the kind of name calling you started would have been absolutely inappropriate elsewhere, especially for someone who's trying to be authoritative about a discussion that he hasn't even be involved in at all. &lt;br /&gt;
&lt;br /&gt;
: And exactly the same thing happened a couple of days ago on the P51d's talk page where you were trying to &amp;quot;moderate&amp;quot; things in a rather blunt fashion - in the meantime, I have been in touch with hvengel via PM and exchanged a number of PMs with concrete suggestions on potential '''Nasal''' related issues (that you seem to be entirely unaware of, but still feel qualified to comment on ...), so that I simply disregarded your edits and tone. &lt;br /&gt;
&lt;br /&gt;
: Finally, if  you're interested in becoming a moderator to help moderate the wiki or forum, I suggest to get in touch with Gijs or Curt to get you set up - help is always needed and appreciated (I never asked for any of those &amp;quot;privileges&amp;quot;, I prefer unencumbered discussions personally) - and I am more than willing to hand over the corresponding duties to you if they agree - but would suggest that you try to follow your own advice about applying good quality standards, but also an appropriate tone - while resisting the temptation to get involved in debates that you don't fully understand. &lt;br /&gt;
 &lt;br /&gt;
: All this doesn't mean however that I wouldn't agree with your comments on having a quality standard established. Or that I wouldn't appreciate your contributions. --[[User:Hooray|Hooray]] ([[User talk:Hooray|talk]]) 14:23, 17 August 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:: I am a strong believer in that a text (including illustrations), and more so a large collection of text like for example this wiki, should be both descriptive, concise and well structured.  As for articles being concise, I am not a big fan of all the quotes, though I can see ''some'' of them useful.  There is a lot to say about lengths of articles, sections and paragraphs, and the sometimes unfortunately combined lack of both being not very concise and not very descriptive, that really, really does not help reading those articles.  There is also a lot to say about structure in articles by the use of section and subsection headings and in particular between articles.&lt;br /&gt;
&lt;br /&gt;
:: Many articles strongly related to each other leave a lot to be wished for.  There is often a huge amount of overlap and in addition there is often a horrendous need for having to read through related articles that in turn would require reading through the first article and then some to be understandable.  I consider it totally unacceptable.  Together with the diffuse verbosity of some articles it makes it really hard to penetrate the subject in question.&lt;br /&gt;
&lt;br /&gt;
:: As for my many small edits with rather large summaries, I have my preferences set up so that my edits by default is marked as minor.  While it may not be obvious at first, those edits can quickly be hidden by clicking ''Hide minor edits'' at the top of a history page.  Unless I forget to uncheck ''This is a minor edit'', only edits that will be visible, in particular in articles, will not be submitted as minor edits.&lt;br /&gt;
&lt;br /&gt;
:: ''Finally, as for the a bit too heated debates about edits on this wiki (dare I say quibbles) that has little or nothing to do with the discussion pages they were posted on, I have actually considered putting an identical message on a few users discussion pages asking them to '''take a few steps back''', '''calm down''' and consider '''what''' they have posted, '''where''' they posted (i.e. will a post there be useful), and '''if''' that really had to be posted, '''as well as blocking each user for 24 hours''' (three users I will not name, you can figure out who you are, and I pretty much do not care who started).''&lt;br /&gt;
&lt;br /&gt;
:: —[[User:Johan G|Johan G]] ([[User_talk:Johan_G|Talk]] | [[Special:Contributions/Johan_G|contribs]]) 17:09, 17 August 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
: As can be seen in the logs, Gijs has just begun drafting some kind of style guide - I guess some more feedback would be good. But no matter the outcome, I don't mind adjusting my behavior/contributions accordingly, or adapting the [[Instant-Cquotes]] according to the requirements laid out there.&lt;br /&gt;
 &lt;br /&gt;
: However, overall, I'd suggest to keep a healthy balance here - some wiki maintainers have increasingly strict requirements, and are obviously trying to adopt wp's best practices. Then again, our main issue is not having good ideas and coming up with guidelines, it's having the manpower -and time- to actually apply/enforce those. &lt;br /&gt;
&lt;br /&gt;
: Which is something that also applies in the core/fgdata/scripting department: There's an increasing amount of contributions that wouldn't have passed a review a few years ago - but like I've mentioned a few days ago: some &amp;quot;immature&amp;quot; contributions have meanwhile allowed &amp;quot;unskilled&amp;quot; (=new) contributors to become domain experts. &lt;br /&gt;
&lt;br /&gt;
: The same thing could very well happen in the context of the wiki: Back when we discussed certain wiki changes (such as making you, Johan_G, a wiki admin) - the whole idea was about turning an avid contributor into an '''expert''' over time, by providing the time, expertise -but also a playground and &amp;quot;grace period&amp;quot;- to experiment with changes, even if those may be relatively immature in the beginning. Meanwhile, you have become an expert when it comes to wiki templates - and I'm always grateful for any advice/help in this area.&lt;br /&gt;
: And this can be seen in many other FG areas. We've seen this particular debate come up a number of times on the forum, and generally end-users are not too happy about having stringent requirements. &lt;br /&gt;
: And there'd be at least half a dozen features that wouldn't be in FG today if fgdata requirements were similarly elevated/enforced (including the PFD/ND, Avidyne code etc). &lt;br /&gt;
: Likewise, censorship/banning is a questionable measure, too - it has rarely, if ever, served us really well when dealing with real end-users (i.e. not just bots). Besides, in that case, you may want to get in touch with Gijs/Simon to have my account status downgraded/revoked, because I am not sure if you can really ban a fellow admin (I think I am in the same group as you). &lt;br /&gt;
: But regardless if I remain involved in wiki maintenance or not, if any admin considers to use banning on real users, banning guidelines would probably be appropriate, too - i.e. could be based on wp (verbatim). Which would help ensure that certain tactics/language remain off limits. And it should also help to move such discussions to the User: namespace, so that people don't stumble across them accidentally - even though I am not sure that this would have prevented the 3rd user from interfering like he did...&lt;br /&gt;
: But even apart from the fact that I generally don't consider censorship/banning appropriate tools, I would have been in a bad position to make this judgement, given that I was the one responding to those attacks in an equally-heated tone. &lt;br /&gt;
: Never mind, I'll check if I can ban myself right away :-) --[[User:Hooray|Hooray]] ([[User talk:Hooray|talk]]) 17:37, 17 August 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
::: Hello Johan&lt;br /&gt;
::: Thanks for your answer. I'm studying to get a vocational school teacher, the last 6 months I was working as a freelance lecturer at a nursing school. So I not only have to read a lot of books, text and writing informative handouts, also had to create a lot of educational text for my students. Not always easy. For both sides, the students and me, it is important to get the needed information in a short time. At my university text is considered as scientific when the language is: comprehendible using short easy-to-read sentences , objective and unemotional. Though this wiki of course does not have to be seen scientific, we probably want the same: spreading knowledge. So I think the same rules applies to this wiki.&lt;br /&gt;
:::So in my eyes text full of quotes from the forum doesn't help here. Sometimes (but only sometimes!) it is needed to highlight certain facts with statements, therefor a quote can be helpful. As you said. But articles like [[http://wiki.flightgear.org/Status_of_AI_in_FlightGear]] aren't very helpful, not for user or (future) developers, and wasting space.&lt;br /&gt;
:::So I'm totally against such articles and especially the useless use of quotes. &lt;br /&gt;
:::How to deal? Proposal: www.wikipedia.org has a nice feature, they sign good articles with a star. Maybe we should do the same, so it is an orientation for those writing an article here. I think it is better then setting up &amp;quot;rules&amp;quot;, especially as readability is also subjective.  &lt;br /&gt;
:::--[[User:HHS|HHS]] ([[User talk:HHS|talk]]) 19:13, 17 August 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::: Oh, I just read through the whole Manual of Style. Everything is said there, especially about quotations and the use of it. Thanks!&lt;br /&gt;
--[[User:HHS|HHS]] ([[User talk:HHS|talk]]) 19:20, 17 August 2014 (UTC)&lt;br /&gt;
 &lt;br /&gt;
Just as input from one fairly new FG user/developer, to answer the original question: I did find one of the articles with many quotations from the forum to be quite useful. The Status of AI page (http://wiki.flightgear.org/Status_of_AI_in_FlightGear) had a lot of bits of discussion pulled in from the forums that I probably never would have taken the time to find on my own, and it helped me quickly wrap my head around the different aspects and approaches to AI in FlightGear and what kinds of improvements have been talked about. I suppose this type of article could need to be either pruned or updated as time went on, though, as the content would become less and less relevant as the discussion moves on.&lt;br /&gt;
&lt;br /&gt;
--[[User:chriscalef|chriscalef]] &lt;br /&gt;
&lt;br /&gt;
[[Category:FlightGear wiki]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_high-level_architecture_support&amp;diff=74625</id>
		<title>FlightGear high-level architecture support</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_high-level_architecture_support&amp;diff=74625"/>
		<updated>2014-08-03T05:51:56Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Non-stable}}&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|name = HLA Support&lt;br /&gt;
|started= 05/2009&lt;br /&gt;
|description = Implementing support for the High Level Architecture to modularize FlightGear&lt;br /&gt;
|status = Under active development (2009-2013)&lt;br /&gt;
|developers = Mathias Fröhlich, James Turner&lt;br /&gt;
|folders = &lt;br /&gt;
* [https://gitorious.org/openrti OpenRTI] &lt;br /&gt;
* [https://gitorious.org/fg/simgear/trees/next/simgear/hla HLA in SimGear]&lt;br /&gt;
* [https://gitorious.org/fg/flightgear/trees/next/src/Network/HLA HLA in FlightGear]&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{AI Navbar}}&lt;br /&gt;
&lt;br /&gt;
= Objective =&lt;br /&gt;
[[File:Dedicated-aircraft-subsystem-group-for-fgcanvas.png|600px|thumb|checking how difficult it would be to put all aircraft related subsystems (fdm, replay, history, controls etc) into a single SGSubsystemGroup named &amp;quot;main-aircraft&amp;quot; to easily make the whole shebang optional using a single --prop for &amp;quot;FGCanvas&amp;quot; use, but also to check if it's feasible to prepare things for later reuse by the AI traffic system (for AI traffic that uses actual FDMs, APs and RMs - but also so that things are affected by the environment) , and it's actually working - even though reset/re-init is obviously hard-coded currently, which I am breaking by shuffling around subsystems, but as long as  each SGSubsystemGroup implements the full SGSubsystem interface (postinit, reinit, shutdown etc), this could help clean up fg_init.cxx quite considerably [http://forum.flightgear.org/viewtopic.php?f=71&amp;amp;t=23499]]]&lt;br /&gt;
&lt;br /&gt;
Also see [[Developing with HLA]].&lt;br /&gt;
&lt;br /&gt;
Document the ongoing HLA effort, to help people better understand how this affects a number of related FlightGear efforts and projects (particularly related to [[Modularizing, parallelizing and distributing FlightGear|improved modularization, concurrency support]] and the [[Distributed Interactive Simulation|multiplayer]]/[[Decoupling the AI Traffic System|AI system]]). FlightGear related limitations have been extensively discussed over the years, for a comprehensive summary, please see [[Modularizing, parallelizing and distributing FlightGear]].&lt;br /&gt;
&lt;br /&gt;
Although the FlightGear design fairly modular it's provided as a single binary. Everyone who wants to create a new I/O module must patch the FlightGear sources and compile the FlightGear binary from scratch. This may discourage those who want to use FlightGear as a tool and extend it in some way. Moreover, it's not always possible to include all functions in a single binary. Some functions may be mutually exclusive.&lt;br /&gt;
&lt;br /&gt;
The plan is to use HLA/RTI as an aid to parallelize flightgear on a local machine. The basic advantage is that each federate is strictly programmed single threaded. All the thread synchronization is handled by the rti library and hidden in that thing. The trick is that each of these threads must be done in a way that you can just compile that alternatively in a single standalone binary and run the same component in a networked rti - the LinuxTag booth for example.&lt;br /&gt;
&lt;br /&gt;
Basically, better HLA support will make it possible for FlightGear to be split into &amp;quot;components&amp;quot; (each running in a dedicated process or in separate thread within the main FlightGear process), making better use of multi-core architectures (SMP), while decoupling the flight simulation from the &amp;quot;viewer&amp;quot; part (i.e. visualization), so that steady/reliable frame rates can be achieved (see [[FGViewer]]), but also to formalize the concept of master/slave instances and synchronizing state among multiple instances (think AI traffic/weather).&lt;br /&gt;
&lt;br /&gt;
{{cquote|I will provide a different renderer  sometime in the future where I aim to provide better isolation of this kind of renderer options so that people with very different aims can probably coexist better.&amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39180.html |title=Color-shifts for textures|author=Mathias Fröhlich |date= Sun, 27 Jan 2013 08:45:22 -0800}}&amp;lt;/ref&amp;gt;|Mathias Fröhlich}}&lt;br /&gt;
&lt;br /&gt;
{{cquote|supporting the option of different viewer / rasterizer front-ends is by far the best solution here, since there are different requirements for different use-cases and target users. Plenty of people are interested in the kind of effects Thorsten's uber-shader and atmospheric model can provide, but plenty of others care more about a solid 60Hz (or even higher), and still others would prefer a solution that works with the fixed-function pipeline. And then there's Rembrandt as yet another rendering configuration. My plan in parallel with / after 2.12 is to work with Mathias' HLA code to make &lt;br /&gt;
this separation possible, unless of course he beats me to it :)&amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39181.html |title=Color-shifts for textures|author=James Turner |date=Sun, 27 Jan 2013 09:35:43 -0800}}&amp;lt;/ref&amp;gt;|James Turner}}&lt;br /&gt;
&lt;br /&gt;
{{cquote|There's a larger issue here, that 'soon' (likely during the summer) I want to start restructuring the codebase into multiple processes, so we can support different rendering architectures (and use multiple CPUs) better. That's Mathias Fröhlich's HLA/RTI work, and indeed he has done the recent work on extending fgviewer to test changes to the current terrain system. &amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39693.html |title=Generating ground textures on the fly?|author=James Turner |date=Mon, 11 Mar 2013 15:24:07 -0700}}&amp;lt;/ref&amp;gt;|James Turner}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{cquote|concerning the larger issue of different rendering pipelines / approaches, my opinion is, and remains, that the long-term solution is separate viewer codebases - while a plethora would be bad, we would already benefit from a 'fixed-function, no shaders' renderer codebase distinct from a Rembrandt renderer and modern, forward-rendering OpenGL 3.x pipeline. This needs the  viewer to be cleanly split out from the simulation backend, via HLA, which is exactly what Mathias (and soon, myself) are working towards, but slowly.&amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39922.html |title=Atmospheric Light Scattering|author=James Turner |date=Thu, 25 Apr 2013 08:09:08 -0700}}&amp;lt;/ref&amp;gt;|James Turner}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Status 04/2013 = &lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Currently, there is exactly one FDM controlling exactly one aircraft model in one session of FlightGear. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
We have a very clever guy working on integrating HLA into FlightGear. Once that is implemented, the idea is already there to be able to virtually walk along a number of parked aircraft on the apron, click on any of them, enter the cockpit and go for a flight. But that's definitely still a long way to go. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=151228#p151228&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: how can I control two aircraft?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Torsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Wed Feb 22&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |there are many scenarios and situations where support for multiple FDM instances would be really useful. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Just think about the AI traffic system which has meanwhile come up with its own &amp;quot;pseudo FDM&amp;quot; in C++ space, i.e. using a performance database.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
At the moment, AI traffic will be basically agnostic to anything weather related. Think about turbulences etc - But, it would be possible to actually instantiate a separate FDM process/thread and use it to control AI traffic realistically, so that local weather effects would have an impact on AI traffic, too.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=151633#p151633&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: how can I control two aircraft?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Hooray&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sun Feb 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Simgear already has some RTI abstraction library that should help to implement HLA federates. Both, SimGear and FlightGear need to be configured/rebuilt with -DENABLE_RTI (after first installing openRTI).&lt;br /&gt;
&lt;br /&gt;
Flightgear git already has an alternative multiplayer implementation in place that uses HLA. But that is only thought as a proof of concept. The next step is probably to provide a seperate hla federate that runs the [[Decoupling the AI Traffic System|AI traffic]] and feeds that into an rti federation (see the fgai section below).&lt;br /&gt;
&lt;br /&gt;
Also see:&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg32045.html&lt;br /&gt;
* http://www.mail-archive.com/search?q=fgai&amp;amp;l=flightgear-devel%40lists.sourceforge.net&lt;br /&gt;
* https://gitorious.org/fg/flightgear/commit/d79b2385b4f4a64a2460c32e6123ea399bfa83d6&lt;br /&gt;
* https://gitorious.org/fg/flightgear/trees/next/utils/fgai&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also see [[FlightGear CIGI Support (Common Image Generator Interface)]].&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
When you start up FlightGear on a 8-12-core machine, you'll find that most cores aren't really utilized at all. This is in stark contrast to X-Plane for example. There are many computations being run as part of the FG main loop, that don't stricly belong there, and which could obviously run outside the main loop, either in a separate thread or a dedicated process. &lt;br /&gt;
&lt;br /&gt;
We have been adding more and more threading to FG because of this, but we are also seeing more and more segfaults related to multithreaded code in FG. Just look at some of the recently reported bugs (issue tracker), many of them are directly related to concurrency issues and multiple threads doing things in a fashion which isn't threadsafe.&lt;br /&gt;
&lt;br /&gt;
Fixing this is something that requires explicit re-architecting, it cannot be just delegated to OSG assuming that it will just magically work. OSG parallelization is specifically related to rendering and following certain coding patterns and protocols, it will not directly help you otherwise. Even if you could run 99% of the rendering work asynchronously, that will not have any positive effect, because obviously it's our main loop that's becoming the showstopper here. &lt;br /&gt;
&lt;br /&gt;
The HLA approach is different and more promising in that a process-based parallelization effort actually forces people to think about the problem at hand. Also, using an existing industry standard (such as i.e. HLA or CIGI) is going to make FlightGear increasingly relevant and attractive to industry leaders.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The idea is to divide parts of the FlightGear architecture such that multiple simulations collaborate and can be run in different threads or even processes. Basically, you would not have a single monolithic FG application with a conventional main loop, but rather a handful of modules (FDM, AI, weather/environment, scripting) that get to communicate with each other by using a central managing component, called a &amp;quot;Real-Time Infrastructure&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Normally, a process-based modularization strategy would inevitably mean that modules need to be run as separate processes, but Mathias mentioned a clever scheme to directly run certain &amp;quot;component subsystems&amp;quot; in worker threads, which would then be a part of the main FG process, while still using HLA and a central RTI to handle the communications across all HLA federates.&lt;br /&gt;
&lt;br /&gt;
For professional users, it is extremely important to guarantee reliable frame rates, ideally separating the visualization from the underlying computation, so that separate computers can be used for different systems [http://forum.flightgear.org/viewtopic.php?f=18&amp;amp;t=15755&amp;amp;p=153295&amp;amp;hilit=hla+relevant#p153288].&lt;br /&gt;
&lt;br /&gt;
== OSG Threading vs. HLA ==&lt;br /&gt;
Distributed multi-process configurations are in fact exactly the way professional simulators work, too: They are distributed and communicate using sockets. Mathias' ongoing HLA work is going to make that increasingly feasible.&lt;br /&gt;
&lt;br /&gt;
OSG threading is neat and dandy, but obviously it is only directly useful for rendering related parallelization and related work. On the other hand, none of this comes for free. OSG's threading support really is impressive, but all those OSG threads must be kept busy. Properly. That's exactly the work that FlightGear is responsible for in its main loop.&lt;br /&gt;
&lt;br /&gt;
OSG's multithreading support doesn't just come &amp;quot;automagically&amp;quot;, just because FlightGear uses OSG. The multithreading support in OSG must be explicitly supported by following certain OSG coding patterns and coding protocols. Otherwise, you won't benefit at all.&lt;br /&gt;
&lt;br /&gt;
Obviously, OSG really is extremely powerful and also pretty good at parallelizing things, but you cannot necessarily see that when running FlightGear now, but there is other OSG-based software which is making really good use of this.&lt;br /&gt;
&lt;br /&gt;
Correct multithreading is incredibly hard to get right in any non-trivial application. &lt;br /&gt;
&lt;br /&gt;
Especially in complex systems like FlightGear. This holds even more true because FlightGear is implemented in C and C++, none of which has language-level support for concurrency and parallelism. &lt;br /&gt;
&lt;br /&gt;
Basically, there's no language-level support for multithreading in the C-family of languages. Everything needs to be built and emulated using library-functions and classes such as Boost (this is less so in Java). &lt;br /&gt;
&lt;br /&gt;
Still, coding a threaded design in C or C++ with more than 3-5 threads is incredibly tricky to get right (this will also be a problem once more threading will be used in Nasal code, because it also lacks language-level threading support). &lt;br /&gt;
&lt;br /&gt;
There are languages far better suited for multithreaded programming, such as Ada - because they have language-level primitives to create &amp;quot;tasks&amp;quot; and &amp;quot;protected types&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== What is HLA/RTI ==&lt;br /&gt;
&lt;br /&gt;
HLA/RTI is message distribution API used for distributed and paralell real time simulation systems. There are&lt;br /&gt;
a few API variants out there where the newest two ones are an IEEE standard known as rti1516 and rti1516e. This api is used in some open source simulation systems and in plenty simulation systems you can buy on the market. The api might look difficult at the first time, but it provides a carefully designed set of communication methods that avoid communication latencies - the worst problem in real time simulations - for a distributed simulation system.&lt;br /&gt;
&lt;br /&gt;
The API is standardized by an IEEE standard and used with commercial simulation systems as well, and depending on the RTI implementation, available with different language bindings like C++, java, ada. Additionally there are implementations hooking on to of those given ones for matlab, python, fortran and probably more. This should also extend the abilities to communicate with components using the tools and languages we cannot handle currently in any sensible way.&lt;br /&gt;
&lt;br /&gt;
== HLA vs. Shared Memory/IPC ==&lt;br /&gt;
The nice thing is that the ipc is hidden behind something that is also able to distribute this across multiple machines. A local network connect is mostly sufficient. But doing the same by an infniband connect is possible too. Experimenting with shared memory did not bring notable improvements over a system local network connect. At least not on linux...&lt;br /&gt;
&lt;br /&gt;
In any case I think this could be fast enough to do this stuff.&lt;br /&gt;
&lt;br /&gt;
Also this stuff is based on a standard that is probably enables us to be a little more connective in the end. At least this is a slight hope from me.&lt;br /&gt;
&lt;br /&gt;
While the interface is providing more than you need today, I think the major benefit is that it shields away a lot of synchronization stuff from you in a &lt;br /&gt;
way that you can still program your local component in a single threaded way. The coupling of components *can* be that tight so that you can get deterministic time slicing for some of the components. Say you want to simulate glider towing you can do that with each fdm running in its own process while still deterministically exchanging simulation results at a the fdm's rate and st time step boundaries.&lt;br /&gt;
The same goes for components within the aircraft which I consider a possible  use case for your kind of application.&lt;br /&gt;
In contrast to that, You can still run the viewers asynchronously to the simulation core providing hopefully 60 stable frames without being disturbed &lt;br /&gt;
by synchronization needs of specific components.&lt;br /&gt;
&lt;br /&gt;
So, you might have an Idea how to to that by ipc directly, and trust me I have considered this at some time. But what this standard provides is really &lt;br /&gt;
driven by exactly those problems that need to be solved once you dig into such kind of implementation. So one of the benefits is that you gain a encapsulated communication library that does what you need. This library can be tested independently of such an application beast like flightgear. And this is IMO a huge benefit.&lt;br /&gt;
&lt;br /&gt;
== Benefits ==&lt;br /&gt;
the RTI c++ interface is defined in a way that you do not need to recompile anything. Everything is done with pure virtual classes and factories to get them. So however this is implemented in the shared object/dll you should just need to get a 'standard' implementation dependent RTI header and compile with that. So you should in theory be able to change the RTI library of an already compiled binary. For the case that a particular RTI implementation does not follow this rule,  you need to compile flightgear explicitly for this particular library. &lt;br /&gt;
&lt;br /&gt;
The spatial indices implemented in the RTI regions will be a huge benefit, since you will only receive the messages that are relevant near the region of your interest.&lt;br /&gt;
&lt;br /&gt;
Also the way an RTI provides time management and time stamped messages, is beneficial. This enables hard synchronized HLA federates, exchanging data at relatively high rates with the least possible communication latency.&lt;br /&gt;
&lt;br /&gt;
Regarding the ongoing threading discussion and the amount of cores an average cpu has today, an RTI will provide a way to implement components of the simulation in a single threaded way, living in its own process.&lt;br /&gt;
&lt;br /&gt;
This can be done while still having a deterministic and tight coupling with other federates simulating in the same federation. This kind of coupling is required for example for a good simulation of glider towing.&lt;br /&gt;
&lt;br /&gt;
The communications infrastructure based on RTI provides a huge potential to split the simulation into components that run on different cores or even machines but still being tight coupled.&lt;br /&gt;
&lt;br /&gt;
Major benefits would be to move some code, such as the [[Decoupling the AI Traffic System|AI code out of the main loop]] - may be even &lt;br /&gt;
into a separate process/thread. Also running one instance of that [[Decoupling the AI Traffic System|AI traffic]] for installations like we used to have at the linux tag booth would be a major  advantage there.&lt;br /&gt;
&lt;br /&gt;
Anyway, I also consider an RTI a possible multiplayer replacement. Even if we would handle local RTI federations different than internet wide stuff. But yes, an RTI provides almost all we would need to get that right.&lt;br /&gt;
&lt;br /&gt;
What is to be committed is in this step is an alternative to the multiplayer protocol which does not cover really all what the multiplayer protocol can do today. But there is a proof of concept and some playground to start with.&lt;br /&gt;
The current implementation in flightgear is flexible enough to adapt to the needs of very different simulation systems. The default object model that you get is adapted to the needs of flightgear, but the implementation is&lt;br /&gt;
flexible enough to change the object model to the AviationSim object model for example at startup time.&lt;br /&gt;
&lt;br /&gt;
So, this should not only provide a way to distribute flightgear's simulation systems across cpus or maybe machines, this should also provide a way to increase connectivity of flightgear to other simulation systems.&lt;br /&gt;
&lt;br /&gt;
Also included is an RTI variant abstraction layer inside simgear to help with some common tasks that are often needed in an HLA/RTI implementation. One of the design goals of this layer was to provide a framework where&lt;br /&gt;
interaction with the RTI api consumes as little overhead as possible. &lt;br /&gt;
&lt;br /&gt;
In particular, this means that indies (fast mappings) are used wherever possible and allocations are minimized.&lt;br /&gt;
&lt;br /&gt;
Currently the only implemented RTI variant is the old nonstandard HLA-1.3 api, which was the only api I had available from an open source project at the time I began with that work. But it should be straightforward to extend that to the two IEEE standard RTI variants.&lt;br /&gt;
&lt;br /&gt;
I personally think that there are still too much opportunities to break stuff. Well, with break I do not mean that it does not run or compile. With break I mean that people just put something together that works either for their private needs and they do not care further, or break in the sense that if you would know the bigger picture it would already be very clear that this cannot scale for the kind of  use that will most probably happen in the not so distant future. &lt;br /&gt;
I can really observe this in the scene and model area. I have really seen incredibly fast osg applications with stable framerates and nifty looking &lt;br /&gt;
models. But the way we use osg and put together models leaves osg and below  that the driver only little chance to be fast. Which leaves only little &lt;br /&gt;
headroom for sensible further development.&lt;br /&gt;
&lt;br /&gt;
Getting back to components: Latencies are a critical part of running in multiple threads/applications. This is not a particular problem of hla, this &lt;br /&gt;
is a generic problem when running real time applications in parallel. I know a lot of really smart people who can even understand complex environments very well, but have no clue about the problems introduced by round trips. Seen this, this is the reason why I started that hla stuff, since this provides a framework which supports and even encourages a programming model that is able to hide latencies as good as possible. Anyway, there is a chance that you even use this api in a way that really hurts in this corner. And this is actually the really bad thing I want to avoid: If you are the first component that does not get that right you might just notice little to nothing - especially if you are running on extremely fast hardware. But when the next kind of problem is introduced this really starts to hurt more and more. And most people do not have any chance to see what happens and why.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
== Weather Simulation ==&lt;br /&gt;
We can have a completely independent weather module using the HLA stuff that runs in an own process/thread. So, at that time you might be able to do more sophisticated stuff. May be it will then be possible to do a full cfd for subparts of the scene. That might be a good thing for a glider scene where you might want to have a more detailed fluid behavior ...&lt;br /&gt;
&lt;br /&gt;
A weather module running in a different process/thread/machine that computes positions for clouds that are consistently displayed on each attached viewer. &lt;br /&gt;
That being a module that is exchangeable. The simple version just interpolates metars like today, but more sophisticated versions might do a local weather &lt;br /&gt;
simulation to get good results for thermals in some small area. The same goes for every component you can think of splitting out.&lt;br /&gt;
&lt;br /&gt;
== AI Traffic ==&lt;br /&gt;
A simple [[Decoupling the AI Traffic System|AI  model]] does just the trick what it does today. But more sophisticated modules might contain an own fdm so that these machines really live in the same fluid that the weather module provides data for.Note that the RTI API already provides a subscriber model that ensures that you don't feed data to participants that don't need that.May ba a radar controller screen that can be attached there to see the machines in this word. But sure that radar screen is not interested in flap animations for the aircraft ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For over a decade, we've been talking about moving the AI traffic subsystem out of the fgfs main loop, not just to free computing resources, but also to make it easier to synchronize AI traffic with multiple instances, i.e. using multiplayer or master/slave setups with possibly dozens of computers (see [[Decoupling the AI Traffic System]]) and the link at [http://wiki.flightgear.org/images/1/1e/New_FG_architecture.pdf]. This requirement has been also extensively discussed over at the fgms project, and in the [[Distributed Interactive Simulation]] article.&lt;br /&gt;
&lt;br /&gt;
The [https://gitorious.org/fg/flightgear/trees/next/utils/fgai fgai proof-of-concept], is just a brief sketch chat could be done in that corner. It already  contains most if what is needed in complex infrastructure. You can inject vehicles and you can now get ground queries. I am for a long time running here also a brief python script which does about  the same than [https://gitorious.org/fg/flightgear/trees/next/utils/fgai fgai]. While a scripting language is not fast enough to drive a lot of ai traffic, it is rather nice to do only a few such objects without much  worries.&lt;br /&gt;
&lt;br /&gt;
The basic idea to have an external component that drives ai traffic, or at least a thread that does the same is a good one I think. For the long term I do not care about the multiplayer protocol since it has severe limitations that would require a very similar solution that one the OpenRTI implementation does. For the short term, I am not sure if we are already at the point where I can just switch over. Therefore this bridge component bridging the mp protocol with hla. For the ADS-B traffic, packing this into a module that you can attach to your  simulation instead of an artificial traffic component is an nice addition. Having &lt;br /&gt;
&lt;br /&gt;
Whatever happens here, if you are really driving a lot of ai models it  requires a huge amount of thoughts to get that scalable. Updates to specific &lt;br /&gt;
models as well as specific parts of those need to be updated in an sparse and  intelligent way to make this somehow work. This includes the basic part of the  [https://gitorious.org/fg/flightgear/trees/next/utils/fgai fgai] implementation which aims to have steady and differentiable movements.  This is at this time not made use of so much, but the classes that I called  something like *Physics* in there are mostly there to make sure that all  components can see and even extrapolate the same steady movements than the  originating component does. There is also infrastructure there to play some  tricks with timing so that nobody needs to wait for ai traffic updates to  arrive  - they should just already be there.&lt;br /&gt;
&lt;br /&gt;
There is also a small gatweay application translating between the old  multiplayer and hla that might go into the utils directory past the next &lt;br /&gt;
release.&lt;br /&gt;
&lt;br /&gt;
== Standalone Viewers ==&lt;br /&gt;
Or take the viewers (also see [[FGViewer]]), if you just exchange data by a shared memory segment, you are limited to a single machine. So that's nice for the 3-chanel thing you have. But I know of installs with 9 chanels I have been visiting some few time ago. They run flightgear on that beast by the way. Or I know of installs that currently run 14 or 16 chanels within a single view. For that reason I thought: better have a technology that is also extensible for this kind of installs instead of programming everything on top of something limited machine local.&lt;br /&gt;
&lt;br /&gt;
== Standalone GUIs / Managers  ==&lt;br /&gt;
In thinking about it a bit and being reminded of the existing HLA interface that FlightGear has, I'm leaning toward proposing something built with Python and the PyQT4 GUI library.  Both components are cross-platform and there is a Python binding for the CERTI HLA library (PyHLA).&lt;br /&gt;
&lt;br /&gt;
The idea here is to create a stand-alone application that replaces all the  built-in GUI functionality and communicates with FlightGear via the HLA &lt;br /&gt;
interface.  When the manager application meets that goal, the existing GUI can be either removed completely or simply &amp;quot;unbound&amp;quot; at compile time so &lt;br /&gt;
it's not available.&lt;br /&gt;
&lt;br /&gt;
Such a gui manager application must be included somehow in the basic set of functionality that is still running in the threaded mode. You would just &lt;br /&gt;
control your simulation with that component. May be restart with a different aircraft by just shutting down the running federate and start up a new one &lt;br /&gt;
with a different fdm.&lt;br /&gt;
And as such, doing this core component in python is something I am not sure about.&lt;br /&gt;
&lt;br /&gt;
So, python in the area of *optional* rti components, is a great tool. If I remember well, you do have some bigger install at home that might benefit &lt;br /&gt;
from such components very much! And in fact this is one reasons I am pushing this direction.&lt;br /&gt;
&lt;br /&gt;
Python also has one major problem with threads. There is the big interpreter lock in python which makes python essentially single threaded. While this is &lt;br /&gt;
not a problem when such a component runs in its own process, python in core components that need to run in threaded mode is essentially a no go.&lt;br /&gt;
&lt;br /&gt;
== Instructor Station ==&lt;br /&gt;
The management application wouldn't be running any of the sub-systems, just &amp;quot;observing&amp;quot; them. One of the issues that caught me up short was the requirement to sift through the chosen aircrafts configuration and Nasal files in order to take into account all the little custom menu items and controls that would have to be replicated on the manager interface. That was pretty discouraging all by itself.&lt;br /&gt;
&lt;br /&gt;
My initial concept would essentially perform the same functions as the instructor console in a commercial FFS. You could tweak any parameter of the simulator from that point, including aircraft selection, position, configuration, etc. This app wouldn't be running on the same machine as the simulator &amp;amp; scene generator itself. (What would be neat is a three machine setup - one for the scene generator, one for the flight/systems model and one for the instructor/manager console.)&lt;br /&gt;
&lt;br /&gt;
== FDM Server ==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.flightgear.org/flightgear_wiki/images/1/1e/New_FG_architecture.p We've toyed with the idea of an FDM server for a while], and there was even some work done on JSBSim towards making that happen. Recently, HDWysong has added the capability to use FlightGear as a visual front end for JSBSim as a separate, scripted application. It certainly would be a huge paradigm shift.&lt;br /&gt;
&lt;br /&gt;
== Multiplayer ==&lt;br /&gt;
The author of fgms would be pretty much interrested to implement fgms as part of a HLA infrastructur. What detained me from going that way is, that I found no free (as is free  beer) documentation on HLA specifications and the quite complex structure  (too complex for a one-man-show). Additionaly I'm not sure about license  issues involved. Are we allowed to publish all parts of (our) HLA  infrastructur under the GPL (which will kind of undermine cash-flow of documentation providers like the IEEE)? &lt;br /&gt;
&lt;br /&gt;
Regarding the multiplayer in FlightGear I see two options: 1) Either to implement a FlightGear proprietary protocol for multiplayer with a &lt;br /&gt;
gateway to HLA, or 2) to actually use native HLA as a multiplayer protocol.&lt;br /&gt;
&lt;br /&gt;
The solution 1) means a new protocol and a new server (updated fgms) needs to be implemented, but the implementation requires no IEEE standards and the &lt;br /&gt;
solution doesn't depend on a 3rd party framework.The solution 2) doesn't require any new protocol nor HLA gateway to be implemented (HLA RTI will be used instead of fgms), but introduces an additional dependency on a 3rd party software.&lt;br /&gt;
&lt;br /&gt;
I see no point in implementing our own protocol and an additional gateway, when we can directly use HLA. As long as we can implement and redistribute the federate code under GPL (or  compliant license) we can make flightgear act as a HLA federate and use an open-source RTI (instead of fgms).&lt;br /&gt;
&lt;br /&gt;
I also consider an RTI a possible multiplayer replacement. Even if we would handle local RTI federations different than internet wide stuff. But yes, an RTI provides almost all we would need to get that right.&lt;br /&gt;
&lt;br /&gt;
I have thought about the use cases and needs for communication that I can see. I came to the conclusion that the RTI abstracts away the communication stuff in a way that is highly matching exactly the needs of a distributed simulation. Where distributed is just the same if it's distributed across processes, threads or machines. That's the reason I did prepare the groundwork by starting that own project with OpenRTI. So this project is purely driven by distributing flightgear across more computation power.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What will come in the shorter term is a standalone viewer (see [[FGViewer]] that can sit on any of the configured views. There are beginnings of that checked in but there is a  lot more in preparation.&lt;br /&gt;
&lt;br /&gt;
= OpenRTI =&lt;br /&gt;
Source: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg32973.html&lt;br /&gt;
&lt;br /&gt;
The RTI implementation from www.certi.org was used most of the time during development. &lt;br /&gt;
While this one works somehow, it is sometimes difficult to handle and relatively slow. &lt;br /&gt;
&lt;br /&gt;
Meanwhile, this has been replaced almost entirely with [https://gitorious.org/openrti/openrti OpenRTI], a new RTI from https://gitorious.org/openrti/openrti that is way easier to set up and use and that provides way more features we might make use of with flightgear.&lt;br /&gt;
&lt;br /&gt;
OpenRTI provides one mode where you can just access a process local federation from multiple threads. There is no network configuration needed and you do not setup any server in this operation mode (sure it also provides the usual networking mode). So the plan is to use this mode as an aid to paralellize flightgear on a local machine. The basic advantage is that each federate is strictly programmed single threaded. All the thread syncronization is handled by the rti library and hidden in that thing. The trick is that each of these threads must be done in a way that you can just compile that alternatively in a single standalone binary and run the same component in a networked rti - the LinuxTag booth for example.&lt;br /&gt;
&lt;br /&gt;
= Testing =&lt;br /&gt;
What do you need:&lt;br /&gt;
* Latest simgear and flightgear as well as the data package.&lt;br /&gt;
* An RTI-1.3 implementation (such as [[OpenRTI]])&lt;br /&gt;
&lt;br /&gt;
libHLA is part of simgear (see simgear/hla). To build flightgear with &amp;quot;-D ENABLE_RTI=ON&amp;quot;, you'll first need to build simgear with &amp;quot;-D ENABLE_RTI=ON&amp;quot;. Before building SG and FG, you should build and install OpenRTI. &lt;br /&gt;
&lt;br /&gt;
So, the implementation in flightgear does not make any assumptions about some internal features of the RTI implementation, except the way the rti is configured to connect to its federation server. That means,&lt;br /&gt;
that you can use any RTI implementation you like, if you care for the apropriate connection setup. But for the default setup that we might choose, I intent to provide a configuration that makes use of some&lt;br /&gt;
properties of OpenRTI. So in theory, you should not need to know anything about that, until you make sophisticated use of these features.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Start flightgear with '''--hla=bi,&amp;lt;hz&amp;gt;,&amp;lt;federateType&amp;gt;,&amp;lt;federationName&amp;gt;,&amp;lt;profile&amp;gt;&amp;quot;,''' where &amp;lt;hz&amp;gt; is the communication frequency, &amp;lt;federateType&amp;gt; is the name of your federate - note that this must be unique with certi - and &amp;lt;federationName&amp;gt; is the federation you want to join. The &amp;lt;profile&amp;gt; argument defaults to the top level configuration file mp-aircraft.xml, which defines some flightgear adapted RTI/HLA federation definition. But there is already an alternate av-&lt;br /&gt;
aircraft.xml top level configuration file that should enable flightgear being used in an AviationSim federation that is the c++ hardcoded federation type of the other flightgear hla implementation out there.&lt;br /&gt;
&lt;br /&gt;
You still can use the the --hla= commands, but there is a shortcut --hla-local  which optimizes away a lot of successive ,,, in the command line that I &lt;br /&gt;
usually had. So, --hla-local=rti://localhost/FlightGear is a shortcut for a longer --hla= line.&lt;br /&gt;
&lt;br /&gt;
= Additional info =&lt;br /&gt;
Just search the archives (list/forum) for &amp;quot;HLA&amp;quot; or &amp;quot;RTI&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
* http://www.mail-archive.com/search?q=hla&amp;amp;l=flightgear-devel%40lists.sourceforge.net&lt;br /&gt;
* http://forum.flightgear.org/search.php?st=0&amp;amp;sk=t&amp;amp;sd=d&amp;amp;sr=posts&amp;amp;keywords=hla&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39181.html&lt;br /&gt;
&lt;br /&gt;
= Related =&lt;br /&gt;
* http://wiki.flightgear.org/images/1/1e/New_FG_architecture.pdf&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg16023.html&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37646.html&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37647.html&lt;br /&gt;
* http://virtualair.sourceforge.net/flightgear.html&lt;br /&gt;
* http://www.chromium.org/developers/design-documents/multi-process-architecture&lt;br /&gt;
* http://blog.chromium.org/2008/09/multi-process-architecture.html&lt;br /&gt;
* http://news.softpedia.com/news/Multi-Processes-in-Browsers-Chrome-Internet-Explorer-Firefox-and-WebKit-140535.shtml&lt;br /&gt;
* http://blog.mozilla.org/products/2011/07/15/goals-for-multi-process-firefox/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HLA]]&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_high-level_architecture_support&amp;diff=74624</id>
		<title>FlightGear high-level architecture support</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_high-level_architecture_support&amp;diff=74624"/>
		<updated>2014-08-03T05:49:43Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Non-stable}}&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|name = HLA Support&lt;br /&gt;
|started= 05/2009&lt;br /&gt;
|description = Implementing support for the High Level Architecture to modularize FlightGear&lt;br /&gt;
|status = Under active development (2009-2013)&lt;br /&gt;
|developers = Mathias Fröhlich, James Turner&lt;br /&gt;
|folders = &lt;br /&gt;
* [https://gitorious.org/openrti OpenRTI] &lt;br /&gt;
* [https://gitorious.org/fg/simgear/trees/next/simgear/hla HLA in SimGear]&lt;br /&gt;
* [https://gitorious.org/fg/flightgear/trees/next/src/Network/HLA HLA in FlightGear]&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{AI Navbar}}&lt;br /&gt;
&lt;br /&gt;
= Objective =&lt;br /&gt;
[[File:Dedicated-aircraft-subsystem-group-for-fgcanvas.png|600px|thumb|checking how difficult it would be to put all aircraft related subsystems (fdm, replay, history, controls etc) into a single SGSubsystemGroup named &amp;quot;main-aircraft&amp;quot; to easily make the whole shebang optional using a single --prop for &amp;quot;FGCanvas&amp;quot; use, but also to check if it's feasible to prepare things for later reuse by the AI traffic system (for AI traffic that uses actual FDMs, APs and RMs - but also so that things are affected by the environment) , and it's actually working - even though reset/re-init is obviously hard-coded currently, which I am breaking by shuffling around subsystems, but as long as  each SGSubsystemGroup implements the full SGSubsystem interface (postinit, reinit, shutdown etc), this could help clean up fg_init.cxx quite considerably [http://forum.flightgear.org/viewtopic.php?f=71&amp;amp;t=23499]]]&lt;br /&gt;
&lt;br /&gt;
Also see [[Developing with HLA]].&lt;br /&gt;
&lt;br /&gt;
Document the ongoing HLA effort, to help people better understand how this affects a number of related FlightGear efforts and projects (particularly related to [[Modularizing, parallelizing and distributing FlightGear|improved modularization, concurrency support]] and the [[Distributed Interactive Simulation|multiplayer]]/[[Decoupling the AI Traffic System|AI system]]). FlightGear related limitations have been extensively discussed over the years, for a comprehensive summary, please see [[Modularizing, parallelizing and distributing FlightGear]].&lt;br /&gt;
&lt;br /&gt;
Although the FlightGear design fairly modular it's provided as a single binary. Everyone who wants to create a new I/O module must patch the FlightGear sources and compile the FlightGear binary from scratch. This may discourage those who want to use FlightGear as a tool and extend it in some way. Moreover, it's not always possible to include all functions in a single binary. Some functions may be mutually exclusive.&lt;br /&gt;
&lt;br /&gt;
The plan is to use HLA/RTI as an aid to parallelize flightgear on a local machine. The basic advantage is that each federate is strictly programmed single threaded. All the thread synchronization is handled by the rti library and hidden in that thing. The trick is that each of these threads must be done in a way that you can just compile that alternatively in a single standalone binary and run the same component in a networked rti - the LinuxTag booth for example.&lt;br /&gt;
&lt;br /&gt;
Basically, better HLA support will make it possible for FlightGear to be split into &amp;quot;components&amp;quot; (each running in a dedicated process or in separate thread within the main FlightGear process), making better use of multi-core architectures (SMP), while decoupling the flight simulation from the &amp;quot;viewer&amp;quot; part (i.e. visualization), so that steady/reliable frame rates can be achieved (see [[FGViewer]]), but also to formalize the concept of master/slave instances and synchronizing state among multiple instances (think AI traffic/weather).&lt;br /&gt;
&lt;br /&gt;
{{cquote|I will provide a different renderer  sometime in the future where I aim to provide better isolation of this kind of renderer options so that people with very different aims can probably coexist better.&amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39180.html |title=Color-shifts for textures|author=Mathias Fröhlich |date= Sun, 27 Jan 2013 08:45:22 -0800}}&amp;lt;/ref&amp;gt;|Mathias Fröhlich}}&lt;br /&gt;
&lt;br /&gt;
{{cquote|supporting the option of different viewer / rasterizer front-ends is by far the best solution here, since there are different requirements for different use-cases and target users. Plenty of people are interested in the kind of effects Thorsten's uber-shader and atmospheric model can provide, but plenty of others care more about a solid 60Hz (or even higher), and still others would prefer a solution that works with the fixed-function pipeline. And then there's Rembrandt as yet another rendering configuration. My plan in parallel with / after 2.12 is to work with Mathias' HLA code to make &lt;br /&gt;
this separation possible, unless of course he beats me to it :)&amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39181.html |title=Color-shifts for textures|author=James Turner |date=Sun, 27 Jan 2013 09:35:43 -0800}}&amp;lt;/ref&amp;gt;|James Turner}}&lt;br /&gt;
&lt;br /&gt;
{{cquote|There's a larger issue here, that 'soon' (likely during the summer) I want to start restructuring the codebase into multiple processes, so we can support different rendering architectures (and use multiple CPUs) better. That's Mathias Fröhlich's HLA/RTI work, and indeed he has done the recent work on extending fgviewer to test changes to the current terrain system. &amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39693.html |title=Generating ground textures on the fly?|author=James Turner |date=Mon, 11 Mar 2013 15:24:07 -0700}}&amp;lt;/ref&amp;gt;|James Turner}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{cquote|concerning the larger issue of different rendering pipelines / approaches, my opinion is, and remains, that the long-term solution is separate viewer codebases - while a plethora would be bad, we would already benefit from a 'fixed-function, no shaders' renderer codebase distinct from a Rembrandt renderer and modern, forward-rendering OpenGL 3.x pipeline. This needs the  viewer to be cleanly split out from the simulation backend, via HLA, which is exactly what Mathias (and soon, myself) are working towards, but slowly.&amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39922.html |title=Atmospheric Light Scattering|author=James Turner |date=Thu, 25 Apr 2013 08:09:08 -0700}}&amp;lt;/ref&amp;gt;|James Turner}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Status 04/2013 = &lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Currently, there is exactly one FDM controlling exactly one aircraft model in one session of FlightGear. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
We have a very clever guy working on integrating HLA into FlightGear. Once that is implemented, the idea is already there to be able to virtually walk along a number of parked aircraft on the apron, click on any of them, enter the cockpit and go for a flight. But that's definitely still a long way to go. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=151228#p151228&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: how can I control two aircraft?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Torsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Wed Feb 22&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |there are many scenarios and situations where support for multiple FDM instances would be really useful. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Just think about the AI traffic system which has meanwhile come up with its own &amp;quot;pseudo FDM&amp;quot; in C++ space, i.e. using a performance database.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
At the moment, AI traffic will be basically agnostic to anything weather related. Think about turbulences etc - But, it would be possible to actually instantiate a separate FDM process/thread and use it to control AI traffic realistically, so that local weather effects would have an impact on AI traffic, too.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=151633#p151633&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: how can I control two aircraft?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Hooray&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sun Feb 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Simgear already has some RTI abstraction library that should help to implement HLA federates. Both, SimGear and FlightGear need to be configured/rebuilt with -DENABLE_RTI (after first installing openRTI).&lt;br /&gt;
&lt;br /&gt;
Flightgear git already has an alternative multiplayer implementation in place that uses HLA. But that is only thought as a proof of concept. The next step is probably to provide a seperate hla federate that runs the [[Decoupling the AI Traffic System|AI traffic]] and feeds that into an rti federation (see the fgai section below).&lt;br /&gt;
&lt;br /&gt;
Also see:&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg32045.html&lt;br /&gt;
* http://www.mail-archive.com/search?q=fgai&amp;amp;l=flightgear-devel%40lists.sourceforge.net&lt;br /&gt;
* https://gitorious.org/fg/flightgear/commit/d79b2385b4f4a64a2460c32e6123ea399bfa83d6&lt;br /&gt;
* https://gitorious.org/fg/flightgear/trees/next/utils/fgai&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also see [[FlightGear CIGI Support (Common Image Generator Interface)]].&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
When you start up FlightGear on a 8-12-core machine, you'll find that most cores aren't really utilized at all. This is in stark contrast to X-Plane for example. There are many computations being run as part of the FG main loop, that don't stricly belong there, and which could obviously run outside the main loop, either in a separate thread or a dedicated process. &lt;br /&gt;
&lt;br /&gt;
We have been adding more and more threading to FG because of this, but we are also seeing more and more segfaults related to multithreaded code in FG. Just look at some of the recently reported bugs (issue tracker), many of them are directly related to concurrency issues and multiple threads doing things in a fashion which isn't threadsafe.&lt;br /&gt;
&lt;br /&gt;
Fixing this is something that requires explicit re-architecting, it cannot be just delegated to OSG assuming that it will just magically work. OSG parallelization is specifically related to rendering and following certain coding patterns and protocols, it will not directly help you otherwise. Even if you could run 99% of the rendering work asynchronously, that will not have any positive effect, because obviously it's our main loop that's becoming the showstopper here. &lt;br /&gt;
&lt;br /&gt;
The HLA approach is different and more promising in that a process-based parallelization effort actually forces people to think about the problem at hand. Also, using an existing industry standard (such as i.e. HLA or CIGI) is going to make FlightGear increasingly relevant and attractive to industry leaders.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The idea is to divide parts of the FlightGear architecture such that multiple simulations collaborate and can be run in different threads or even processes. Basically, you would not have a single monolithic FG application with a conventional main loop, but rather a handful of modules (FDM, AI, weather/environment, scripting) that get to communicate with each other by using a central managing component, called a &amp;quot;Real-Time Infrastructure&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Normally, a process-based modularization strategy would inevitably mean that modules need to be run as separate processes, but Mathias mentioned a clever scheme to directly run certain &amp;quot;component subsystems&amp;quot; in worker threads, which would then be a part of the main FG process, while still using HLA and a central RTI to handle the communications across all HLA federates.&lt;br /&gt;
&lt;br /&gt;
For professional users, it is extremely important to guarantee reliable frame rates, ideally separating the visualization from the underlying computation, so that separate computers can be used for different systems [http://forum.flightgear.org/viewtopic.php?f=18&amp;amp;t=15755&amp;amp;p=153295&amp;amp;hilit=hla+relevant#p153288].&lt;br /&gt;
&lt;br /&gt;
== OSG Threading vs. HLA ==&lt;br /&gt;
Distributed multi-process configurations are in fact exactly the way professional simulators work, too: They are distributed and communicate using sockets. Mathias' ongoing HLA work is going to make that increasingly feasible.&lt;br /&gt;
&lt;br /&gt;
OSG threading is neat and dandy, but obviously it is only directly useful for rendering related parallelization and related work. On the other hand, none of this comes for free. OSG's threading support really is impressive, but all those OSG threads must be kept busy. Properly. That's exactly the work that FlightGear is responsible for in its main loop.&lt;br /&gt;
&lt;br /&gt;
OSG's multithreading support doesn't just come &amp;quot;automagically&amp;quot;, just because FlightGear uses OSG. The multithreading support in OSG must be explicitly supported by following certain OSG coding patterns and coding protocols. Otherwise, you won't benefit at all.&lt;br /&gt;
&lt;br /&gt;
Obviously, OSG really is extremely powerful and also pretty good at parallelizing things, but you cannot necessarily see that when running FlightGear now, but there is other OSG-based software which is making really good use of this.&lt;br /&gt;
&lt;br /&gt;
Correct multithreading is incredibly hard to get right in any non-trivial application. &lt;br /&gt;
&lt;br /&gt;
Especially in complex systems like FlightGear. This holds even more true because FlightGear is implemented in C and C++, none of which has language-level support for concurrency and parallelism. &lt;br /&gt;
&lt;br /&gt;
Basically, there's no language-level support for multithreading in the C-family of languages. Everything needs to be built and emulated using library-functions and classes such as Boost (this is less so in Java). &lt;br /&gt;
&lt;br /&gt;
Still, coding a threaded design in C or C++ with more than 3-5 threads is incredibly tricky to get right (this will also be a problem once more threading will be used in Nasal code, because it also lacks language-level threading support). &lt;br /&gt;
&lt;br /&gt;
There are languages far better suited for multithreaded programming, such as Ada - because they have language-level primitives to create &amp;quot;tasks&amp;quot; and &amp;quot;protected types&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== What is HLA/RTI ==&lt;br /&gt;
&lt;br /&gt;
HLA/RTI is message distribution API used for distributed and paralell real time simulation systems. There are&lt;br /&gt;
a few API variants out there where the newest two ones are an IEEE standard known as rti1516 and rti1516e. This api is used in some open source simulation systems and in plenty simulation systems you can buy on the market. The api might look difficult at the first time, but it provides a carefully designed set of communication methods that avoid communication latencies - the worst problem in real time simulations - for a distributed simulation system.&lt;br /&gt;
&lt;br /&gt;
The API is standardized by an IEEE standard and used with commercial simulation systems as well, and depending on the RTI implementation, available with different language bindings like C++, java, ada. Additionally there are implementations hooking on to of those given ones for matlab, python, fortran and probably more. This should also extend the abilities to communicate with components using the tools and languages we cannot handle currently in any sensible way.&lt;br /&gt;
&lt;br /&gt;
== HLA vs. Shared Memory/IPC ==&lt;br /&gt;
The nice thing is that the ipc is hidden behind something that is also able to distribute this across multiple machines. A local network connect is mostly sufficient. But doing the same by an infniband connect is possible too. Experimenting with shared memory did not bring notable improvements over a system local network connect. At least not on linux...&lt;br /&gt;
&lt;br /&gt;
In any case I think this could be fast enough to do this stuff.&lt;br /&gt;
&lt;br /&gt;
Also this stuff is based on a standard that is probably enables us to be a little more connective in the end. At least this is a slight hope from me.&lt;br /&gt;
&lt;br /&gt;
While the interface is providing more than you need today, I think the major benefit is that it shields away a lot of synchronization stuff from you in a &lt;br /&gt;
way that you can still program your local component in a single threaded way. The coupling of components *can* be that tight so that you can get deterministic time slicing for some of the components. Say you want to simulate glider towing you can do that with each fdm running in its own process while still deterministically exchanging simulation results at a the fdm's rate and st time step boundaries.&lt;br /&gt;
The same goes for components within the aircraft which I consider a possible  use case for your kind of application.&lt;br /&gt;
In contrast to that, You can still run the viewers asynchronously to the simulation core providing hopefully 60 stable frames without being disturbed &lt;br /&gt;
by synchronization needs of specific components.&lt;br /&gt;
&lt;br /&gt;
So, you might have an Idea how to to that by ipc directly, and trust me I have considered this at some time. But what this standard provides is really &lt;br /&gt;
driven by exactly those problems that need to be solved once you dig into such kind of implementation. So one of the benefits is that you gain a encapsulated communication library that does what you need. This library can be tested independently of such an application beast like flightgear. And this is IMO a huge benefit.&lt;br /&gt;
&lt;br /&gt;
== Benefits ==&lt;br /&gt;
the RTI c++ interface is defined in a way that you do not need to recompile anything. Everything is done with pure virtual classes and factories to get them. So however this is implemented in the shared object/dll you should just need to get a 'standard' implementation dependent RTI header and compile with that. So you should in theory be able to change the RTI library of an already compiled binary. For the case that a particular RTI implementation does not follow this rule,  you need to compile flightgear explicitly for this particular library. &lt;br /&gt;
&lt;br /&gt;
The spatial indices implemented in the RTI regions will be a huge benefit, since you will only receive the messages that are relevant near the region of your interest.&lt;br /&gt;
&lt;br /&gt;
Also the way an RTI provides time management and time stamped messages, is beneficial. This enables hard synchronized HLA federates, exchanging data at relatively high rates with the least possible communication latency.&lt;br /&gt;
&lt;br /&gt;
Regarding the ongoing threading discussion and the amount of cores an average cpu has today, an RTI will provide a way to implement components of the simulation in a single threaded way, living in its own process.&lt;br /&gt;
&lt;br /&gt;
This can be done while still having a deterministic and tight coupling with other federates simulating in the same federation. This kind of coupling is required for example for a good simulation of glider towing.&lt;br /&gt;
&lt;br /&gt;
The communications infrastructure based on RTI provides a huge potential to split the simulation into components that run on different cores or even machines but still being tight coupled.&lt;br /&gt;
&lt;br /&gt;
Major benefits would be to move some code, such as the [[Decoupling the AI Traffic System|AI code out of the main loop]] - may be even &lt;br /&gt;
into a separate process/thread. Also running one instance of that [[Decoupling the AI Traffic System|AI traffic]] for installations like we used to have at the linux tag booth would be a major  advantage there.&lt;br /&gt;
&lt;br /&gt;
Anyway, I also consider an RTI a possible multiplayer replacement. Even if we would handle local RTI federations different than internet wide stuff. But yes, an RTI provides almost all we would need to get that right.&lt;br /&gt;
&lt;br /&gt;
What is to be committed is in this step is an alternative to the multiplayer protocol which does not cover really all what the multiplayer protocol can do today. But there is a proof of concept and some playground to start with.&lt;br /&gt;
The current implementation in flightgear is flexible enough to adapt to the needs of very different simulation systems. The default object model that you get is adapted to the needs of flightgear, but the implementation is&lt;br /&gt;
flexible enough to change the object model to the AviationSim object model for example at startup time.&lt;br /&gt;
&lt;br /&gt;
So, this should not only provide a way to distribute flightgear's simulation systems across cpus or maybe machines, this should also provide a way to increase connectivity of flightgear to other simulation systems.&lt;br /&gt;
&lt;br /&gt;
Also included is an RTI variant abstraction layer inside simgear to help with some common tasks that are often needed in an HLA/RTI implementation. One of the design goals of this layer was to provide a framework where&lt;br /&gt;
interaction with the RTI api consumes as little overhead as possible. &lt;br /&gt;
&lt;br /&gt;
In particular, this means that indies (fast mappings) are used wherever possible and allocations are minimized.&lt;br /&gt;
&lt;br /&gt;
Currently the only implemented RTI variant is the old nonstandard HLA-1.3 api, which was the only api I had available from an open source project at the time I began with that work. But it should be straightforward to extend that to the two IEEE standard RTI variants.&lt;br /&gt;
&lt;br /&gt;
I personally think that there are still too much opportunities to break stuff. Well, with break I do not mean that it does not run or compile. With break I mean that people just put something together that works either for their private needs and they do not care further, or break in the sense that if you would know the bigger picture it would already be very clear that this cannot scale for the kind of  use that will most probably happen in the not so distant future. &lt;br /&gt;
I can really observe this in the scene and model area. I have really seen incredibly fast osg applications with stable framerates and nifty looking &lt;br /&gt;
models. But the way we use osg and put together models leaves osg and below  that the driver only little chance to be fast. Which leaves only little &lt;br /&gt;
headroom for sensible further development.&lt;br /&gt;
&lt;br /&gt;
Getting back to components: Latencies are a critical part of running in multiple threads/applications. This is not a particular problem of hla, this &lt;br /&gt;
is a generic problem when running real time applications in parallel. I know a lot of really smart people who can even understand complex environments very well, but have no clue about the problems introduced by round trips. Seen this, this is the reason why I started that hla stuff, since this provides a framework which supports and even encourages a programming model that is able to hide latencies as good as possible. Anyway, there is a chance that you even use this api in a way that really hurts in this corner. And this is actually the really bad thing I want to avoid: If you are the first component that does not get that right you might just notice little to nothing - especially if you are running on extremely fast hardware. But when the next kind of problem is introduced this really starts to hurt more and more. And most people do not have any chance to see what happens and why.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
== Weather Simulation ==&lt;br /&gt;
We can have a completely independent weather module using the HLA stuff that runs in an own process/thread. So, at that time you might be able to do more sophisticated stuff. May be it will then be possible to do a full cfd for subparts of the scene. That might be a good thing for a glider scene where you might want to have a more detailed fluid behavior ...&lt;br /&gt;
&lt;br /&gt;
A weather module running in a different process/thread/machine that computes positions for clouds that are consistently displayed on each attached viewer. &lt;br /&gt;
That being a module that is exchangeable. The simple version just interpolates metars like today, but more sophisticated versions might do a local weather &lt;br /&gt;
simulation to get good results for thermals in some small area. The same goes for every component you can think of splitting out.&lt;br /&gt;
&lt;br /&gt;
== AI Traffic ==&lt;br /&gt;
A simple [[Decoupling the AI Traffic System|AI  model]] does just the trick what it does today. But more sophisticated modules might contain an own fdm so that these machines really live in the same fluid that the weather module provides data for.Note that the RTI API already provides a subscriber model that ensures that you don't feed data to participants that don't need that.May ba a radar controller screen that can be attached there to see the machines in this word. But sure that radar screen is not interested in flap animations for the aircraft ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For over a decade, we've been talking about moving the AI traffic subsystem out of the fgfs main loop, not just to free computing resources, but also to make it easier to synchronize AI traffic with multiple instances, i.e. using multiplayer or master/slave setups with possibly dozens of computers (see [[Decoupling the AI Traffic System]]) and the link at [http://wiki.flightgear.org/images/1/1e/New_FG_architecture.pdf]. This requirement has been also extensively discussed over at the fgms project, and in the [[Distributed Interactive Simulation]] article.&lt;br /&gt;
&lt;br /&gt;
The [https://gitorious.org/fg/flightgear/trees/next/utils/fgai fgai proof-of-concept], is just a brief sketch chat could be done in that corner. It already  contains most if what is needed in complex infrastructure. You can inject vehicles and you can now get ground queries. I am for a long time running here also a brief python script which does about  the same than [https://gitorious.org/fg/flightgear/trees/next/utils/fgai fgai]. While a scripting language is not fast enough to drive a lot of ai traffic, it is rather nice to do only a few such objects without much  worries.&lt;br /&gt;
&lt;br /&gt;
The basic idea to have an external component that drives ai traffic, or at least a thread that does the same is a good one I think. For the long term I do not care about the multiplayer protocol since it has severe limitations that would require a very similar solution that one the OpenRTI implementation does. For the short term, I am not sure if we are already at the point where I can just switch over. Therefore this bridge component bridging the mp protocol with hla. For the ADS-B traffic, packing this into a module that you can attach to your  simulation instead of an artificial traffic component is an nice addition. Having &lt;br /&gt;
&lt;br /&gt;
Whatever happens here, if you are really driving a lot of ai models it  requires a huge amount of thoughts to get that scalable. Updates to specific &lt;br /&gt;
models as well as specific parts of those need to be updated in an sparse and  intelligent way to make this somehow work. This includes the basic part of the  [https://gitorious.org/fg/flightgear/trees/next/utils/fgai fgai] implementation which aims to have steady and differentiable movements.  This is at this time not made use of so much, but the classes that I called  something like *Physics* in there are mostly there to make sure that all  components can see and even extrapolate the same steady movements than the  originating component does. There is also infrastructure there to play some  tricks with timing so that nobody needs to wait for ai traffic updates to  arrive  - they should just already be there.&lt;br /&gt;
&lt;br /&gt;
There is also a small gatweay application translating between the old  multiplayer and hla that might go into the utils directory past the next &lt;br /&gt;
release.&lt;br /&gt;
&lt;br /&gt;
== Standalone Viewers ==&lt;br /&gt;
Or take the viewers (also see [[FGViewer]]), if you just exchange data by a shared memory segment, you are limited to a single machine. So that's nice for the 3-chanel thing you have. But I know of installs with 9 chanels I have been visiting some few time ago. They run flightgear on that beast by the way. Or I know of installs that currently run 14 or 16 chanels within a single view. For that reason I thought: better have a technology that is also extensible for this kind of installs instead of programming everything on top of something limited machine local.&lt;br /&gt;
&lt;br /&gt;
== Standalone GUIs / Managers  ==&lt;br /&gt;
In thinking about it a bit and being reminded of the existing HLA interface that FlightGear has, I'm leaning toward proposing something built with Python and the PyQT4 GUI library.  Both components are cross-platform and there is a Python binding for the CERTI HLA library (PyHLA).&lt;br /&gt;
&lt;br /&gt;
The idea here is to create a stand-alone application that replaces all the  built-in GUI functionality and communicates with FlightGear via the HLA &lt;br /&gt;
interface.  When the manager application meets that goal, the existing GUI can be either removed completely or simply &amp;quot;unbound&amp;quot; at compile time so &lt;br /&gt;
it's not available.&lt;br /&gt;
&lt;br /&gt;
Such a gui manager application must be included somehow in the basic set of functionality that is still running in the threaded mode. You would just &lt;br /&gt;
control your simulation with that component. May be restart with a different aircraft by just shutting down the running federate and start up a new one &lt;br /&gt;
with a different fdm.&lt;br /&gt;
And as such, doing this core component in python is something I am not sure about.&lt;br /&gt;
&lt;br /&gt;
So, python in the area of *optional* rti components, is a great tool. If I remember well, you do have some bigger install at home that might benefit &lt;br /&gt;
from such components very much! And in fact this is one reasons I am pushing this direction.&lt;br /&gt;
&lt;br /&gt;
Python also has one major problem with threads. There is the big interpreter lock in python which makes python essentially single threaded. While this is &lt;br /&gt;
not a problem when such a component runs in its own process, python in core components that need to run in threaded mode is essentially a no go.&lt;br /&gt;
&lt;br /&gt;
== Instructor Station ==&lt;br /&gt;
The management application wouldn't be running any of the sub-systems, just &amp;quot;observing&amp;quot; them. One of the issues that caught me up short was the requirement to sift through the chosen aircrafts configuration and Nasal files in order to take into account all the little custom menu items and controls that would have to be replicated on the manager interface. That was pretty discouraging all by itself.&lt;br /&gt;
&lt;br /&gt;
My initial concept would essentially perform the same functions as the instructor console in a commercial FFS. You could tweak any parameter of the simulator from that point, including aircraft selection, position, configuration, etc. This app wouldn't be running on the same machine as the simulator &amp;amp; scene generator itself. (What would be neat is a three machine setup - one for the scene generator, one for the flight/systems model and one for the instructor/manager console.)&lt;br /&gt;
&lt;br /&gt;
== FDM Server ==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.flightgear.org/flightgear_wiki/images/1/1e/New_FG_architecture.p We've toyed with the idea of an FDM server for a while], and there was even some work done on JSBSim towards making that happen. Recently, HDWysong has added the capability to use FlightGear as a visual front end for JSBSim as a separate, scripted application. It certainly would be a huge paradigm shift.&lt;br /&gt;
&lt;br /&gt;
== Multiplayer ==&lt;br /&gt;
The author of fgms would be pretty much interrested to implement fgms as part of a HLA infrastructur. What detained me from going that way is, that I found no free (as is free  beer) documentation on HLA specifications and the quite complex structure  (too complex for a one-man-show). Additionaly I'm not sure about license  issues involed. Are we allowed to publish all parts of (our) HLA  infrastructur under the GPL (which will kind of undermine cash-flow of documentation providers like the IEEE)? &lt;br /&gt;
&lt;br /&gt;
Regarding the multiplayer in FlightGear I see two options: 1) Either to implement a FlightGear proprietary protocol for multiplayer with a &lt;br /&gt;
gateway to HLA, or 2) to actually use native HLA as a multiplayer protocol.&lt;br /&gt;
&lt;br /&gt;
The solution 1) means a new protocol and a new server (updated fgms) needs to be implemented, but the implementation requires no IEEE standards and the &lt;br /&gt;
solution doesn't depend on a 3rd party framework.The solution 2) doesn't require any new protocol nor HLA gateway to be implemented (HLA RTI will be used instead of fgms), but introduces an additional dependency on a 3rd party software.&lt;br /&gt;
&lt;br /&gt;
I see no point in implementing our own protocol and an additional gateway, when we can directly use HLA. As long as we can implement and redistribute the federate code under GPL (or  compliant license) we can make flightgear act as a HLA federate and use an open-source RTI (instead of fgms).&lt;br /&gt;
&lt;br /&gt;
I also consider an RTI a possible multiplayer replacement. Even if we would handle local RTI federations different than internet wide stuff. But yes, an RTI provides almost all we would need to get that right.&lt;br /&gt;
&lt;br /&gt;
I have thought about the use cases and needs for communication that I can see. I came to the conclusion that the RTI abstracts away the communication stuff in a way that is highly matching exactly the needs of a distributed simulation. Where distributed is just the same if it's distributed across processes, threads or machines. That's the reason I did prepare the groundwork by starting that own project with OpenRTI. So this project is purely driven by distributing flightgear across more computation power.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What will come in the shorter term is a standalone viewer (see [[FGViewer]] that can sit on any of the configured views. There are beginnings of that checked in but there is a  lot more in preparation.&lt;br /&gt;
&lt;br /&gt;
= OpenRTI =&lt;br /&gt;
Source: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg32973.html&lt;br /&gt;
&lt;br /&gt;
The RTI implementation from www.certi.org was used most of the time during development. &lt;br /&gt;
While this one works somehow, it is sometimes difficult to handle and relatively slow. &lt;br /&gt;
&lt;br /&gt;
Meanwhile, this has been replaced almost entirely with [https://gitorious.org/openrti/openrti OpenRTI], a new RTI from https://gitorious.org/openrti/openrti that is way easier to set up and use and that provides way more features we might make use of with flightgear.&lt;br /&gt;
&lt;br /&gt;
OpenRTI provides one mode where you can just access a process local federation from multiple threads. There is no network configuration needed and you do not setup any server in this operation mode (sure it also provides the usual networking mode). So the plan is to use this mode as an aid to paralellize flightgear on a local machine. The basic advantage is that each federate is strictly programmed single threaded. All the thread syncronization is handled by the rti library and hidden in that thing. The trick is that each of these threads must be done in a way that you can just compile that alternatively in a single standalone binary and run the same component in a networked rti - the LinuxTag booth for example.&lt;br /&gt;
&lt;br /&gt;
= Testing =&lt;br /&gt;
What do you need:&lt;br /&gt;
* Latest simgear and flightgear as well as the data package.&lt;br /&gt;
* An RTI-1.3 implementation (such as [[OpenRTI]])&lt;br /&gt;
&lt;br /&gt;
libHLA is part of simgear (see simgear/hla). To build flightgear with &amp;quot;-D ENABLE_RTI=ON&amp;quot;, you'll first need to build simgear with &amp;quot;-D ENABLE_RTI=ON&amp;quot;. Before building SG and FG, you should build and install OpenRTI. &lt;br /&gt;
&lt;br /&gt;
So, the implementation in flightgear does not make any assumptions about some internal features of the RTI implementation, except the way the rti is configured to connect to its federation server. That means,&lt;br /&gt;
that you can use any RTI implementation you like, if you care for the apropriate connection setup. But for the default setup that we might choose, I intent to provide a configuration that makes use of some&lt;br /&gt;
properties of OpenRTI. So in theory, you should not need to know anything about that, until you make sophisticated use of these features.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Start flightgear with '''--hla=bi,&amp;lt;hz&amp;gt;,&amp;lt;federateType&amp;gt;,&amp;lt;federationName&amp;gt;,&amp;lt;profile&amp;gt;&amp;quot;,''' where &amp;lt;hz&amp;gt; is the communication frequency, &amp;lt;federateType&amp;gt; is the name of your federate - note that this must be unique with certi - and &amp;lt;federationName&amp;gt; is the federation you want to join. The &amp;lt;profile&amp;gt; argument defaults to the top level configuration file mp-aircraft.xml, which defines some flightgear adapted RTI/HLA federation definition. But there is already an alternate av-&lt;br /&gt;
aircraft.xml top level configuration file that should enable flightgear being used in an AviationSim federation that is the c++ hardcoded federation type of the other flightgear hla implementation out there.&lt;br /&gt;
&lt;br /&gt;
You still can use the the --hla= commands, but there is a shortcut --hla-local  which optimizes away a lot of successive ,,, in the command line that I &lt;br /&gt;
usually had. So, --hla-local=rti://localhost/FlightGear is a shortcut for a longer --hla= line.&lt;br /&gt;
&lt;br /&gt;
= Additional info =&lt;br /&gt;
Just search the archives (list/forum) for &amp;quot;HLA&amp;quot; or &amp;quot;RTI&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
* http://www.mail-archive.com/search?q=hla&amp;amp;l=flightgear-devel%40lists.sourceforge.net&lt;br /&gt;
* http://forum.flightgear.org/search.php?st=0&amp;amp;sk=t&amp;amp;sd=d&amp;amp;sr=posts&amp;amp;keywords=hla&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39181.html&lt;br /&gt;
&lt;br /&gt;
= Related =&lt;br /&gt;
* http://wiki.flightgear.org/images/1/1e/New_FG_architecture.pdf&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg16023.html&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37646.html&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37647.html&lt;br /&gt;
* http://virtualair.sourceforge.net/flightgear.html&lt;br /&gt;
* http://www.chromium.org/developers/design-documents/multi-process-architecture&lt;br /&gt;
* http://blog.chromium.org/2008/09/multi-process-architecture.html&lt;br /&gt;
* http://news.softpedia.com/news/Multi-Processes-in-Browsers-Chrome-Internet-Explorer-Firefox-and-WebKit-140535.shtml&lt;br /&gt;
* http://blog.mozilla.org/products/2011/07/15/goals-for-multi-process-firefox/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HLA]]&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_high-level_architecture_support&amp;diff=74623</id>
		<title>FlightGear high-level architecture support</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_high-level_architecture_support&amp;diff=74623"/>
		<updated>2014-08-03T05:23:01Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Non-stable}}&lt;br /&gt;
&lt;br /&gt;
{{infobox subsystem&lt;br /&gt;
|name = HLA Support&lt;br /&gt;
|started= 05/2009&lt;br /&gt;
|description = Implementing support for the High Level Architecture to modularize FlightGear&lt;br /&gt;
|status = Under active development (2009-2013)&lt;br /&gt;
|developers = Mathias Fröhlich, James Turner&lt;br /&gt;
|folders = &lt;br /&gt;
* [https://gitorious.org/openrti OpenRTI] &lt;br /&gt;
* [https://gitorious.org/fg/simgear/trees/next/simgear/hla HLA in SimGear]&lt;br /&gt;
* [https://gitorious.org/fg/flightgear/trees/next/src/Network/HLA HLA in FlightGear]&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{AI Navbar}}&lt;br /&gt;
&lt;br /&gt;
= Objective =&lt;br /&gt;
[[File:Dedicated-aircraft-subsystem-group-for-fgcanvas.png|600px|thumb|checking how difficult it would be to put all aircraft related subsystems (fdm, replay, history, controls etc) into a single SGSubsystemGroup named &amp;quot;main-aircraft&amp;quot; to easily make the whole shebang optional using a single --prop for &amp;quot;FGCanvas&amp;quot; use, but also to check if it's feasible to prepare things for later reuse by the AI traffic system (for AI traffic that uses actual FDMs, APs and RMs - but also so that things are affected by the environment) , and it's actually working - even though reset/re-init is obviously hard-coded currently, which I am breaking by shuffling around subsystems, but as long as  each SGSubsystemGroup implements the full SGSubsystem interface (postinit, reinit, shutdown etc), this could help clean up fg_init.cxx quite considerably [http://forum.flightgear.org/viewtopic.php?f=71&amp;amp;t=23499]]]&lt;br /&gt;
&lt;br /&gt;
Also see [[Developing with HLA]].&lt;br /&gt;
&lt;br /&gt;
Document the ongoing HLA effort, to help people better understand how this affects a number of related FlightGear efforts and projects (particularly related to [[Modularizing, parallelizing and distributing FlightGear|improved modularization, concurrency support]] and the [[Distributed Interactive Simulation|multiplayer]]/[[Decoupling the AI Traffic System|AI system]]). FlightGear related limitations have been extensively discussed over the years, for a comprehensive summary, please see [[Modularizing, parallelizing and distributing FlightGear]].&lt;br /&gt;
&lt;br /&gt;
Although the FlightGear design fairly modular it's provided as a single binary. Everyone who wants to create a new I/O module must patch the FlightGear sources and compile the FlightGear binary from scratch. This may discourage those who want to use FlightGear as a tool and extend it in some way. Moreover, it's not always possible to include all functions in a single binary. Some functions may be mutually exclusive.&lt;br /&gt;
&lt;br /&gt;
The plan is to use HLA/RTI as an aid to parallelize flightgear on a local machine. The basic advantage is that each federate is strictly programmed single threaded. All the thread synchronization is handled by the rti library and hidden in that thing. The trick is that each of these threads must be done in a way that you can just compile that alternatively in a single standalone binary and run the same component in a networked rti - the LinuxTag booth for example.&lt;br /&gt;
&lt;br /&gt;
Basically, better HLA support will make it possible for FlightGear to be split into &amp;quot;components&amp;quot; (each running in a dedicated process or in separate thread within the main FlightGear process), making better use of multi-core architectures (SMP), while decoupling the flight simulation from the &amp;quot;viewer&amp;quot; part (i.e. visualization), so that steady/reliable frame rates can be achieved (see [[FGViewer]]), but also to formalize the concept of master/slave instances and synchronizing state among multiple instances (think AI traffic/weather).&lt;br /&gt;
&lt;br /&gt;
{{cquote|I will provide a different renderer  sometime in the future where I aim to provide better isolation of this kind of renderer options so that people with very different aims can probably coexist better.&amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39180.html |title=Color-shifts for textures|author=Mathias Fröhlich |date= Sun, 27 Jan 2013 08:45:22 -0800}}&amp;lt;/ref&amp;gt;|Mathias Fröhlich}}&lt;br /&gt;
&lt;br /&gt;
{{cquote|supporting the option of different viewer / rasterizer front-ends is by far the best solution here, since there are different requirements for different use-cases and target users. Plenty of people are interested in the kind of effects Thorsten's uber-shader and atmospheric model can provide, but plenty of others care more about a solid 60Hz (or even higher), and still others would prefer a solution that works with the fixed-function pipeline. And then there's Rembrandt as yet another rendering configuration. My plan in parallel with / after 2.12 is to work with Mathias' HLA code to make &lt;br /&gt;
this separation possible, unless of course he beats me to it :)&amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39181.html |title=Color-shifts for textures|author=James Turner |date=Sun, 27 Jan 2013 09:35:43 -0800}}&amp;lt;/ref&amp;gt;|James Turner}}&lt;br /&gt;
&lt;br /&gt;
{{cquote|There's a larger issue here, that 'soon' (likely during the summer) I want to start restructuring the codebase into multiple processes, so we can support different rendering architectures (and use multiple CPUs) better. That's Mathias Fröhlich's HLA/RTI work, and indeed he has done the recent work on extending fgviewer to test changes to the current terrain system. &amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39693.html |title=Generating ground textures on the fly?|author=James Turner |date=Mon, 11 Mar 2013 15:24:07 -0700}}&amp;lt;/ref&amp;gt;|James Turner}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{cquote|concerning the larger issue of different rendering pipelines / approaches, my opinion is, and remains, that the long-term solution is separate viewer codebases - while a plethora would be bad, we would already benefit from a 'fixed-function, no shaders' renderer codebase distinct from a Rembrandt renderer and modern, forward-rendering OpenGL 3.x pipeline. This needs the  viewer to be cleanly split out from the simulation backend, via HLA, which is exactly what Mathias (and soon, myself) are working towards, but slowly.&amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39922.html |title=Atmospheric Light Scattering|author=James Turner |date=Thu, 25 Apr 2013 08:09:08 -0700}}&amp;lt;/ref&amp;gt;|James Turner}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Status 04/2013 = &lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Currently, there is exactly one FDM controlling exactly one aircraft model in one session of FlightGear. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
We have a very clever guy working on integrating HLA into FlightGear. Once that is implemented, the idea is already there to be able to virtually walk along a number of parked aircraft on the apron, click on any of them, enter the cockpit and go for a flight. But that's definitely still a long way to go. &lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=151228#p151228&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: how can I control two aircraft?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Torsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Wed Feb 22&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |there are many scenarios and situations where support for multiple FDM instances would be really useful. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Just think about the AI traffic system which has meanwhile come up with its own &amp;quot;pseudo FDM&amp;quot; in C++ space, i.e. using a performance database.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
At the moment, AI traffic will be basically agnostic to anything weather related. Think about turbulences etc - But, it would be possible to actually instantiate a separate FDM process/thread and use it to control AI traffic realistically, so that local weather effects would have an impact on AI traffic, too.&lt;br /&gt;
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=151633#p151633&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: how can I control two aircraft?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Hooray&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;Sun Feb 26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Simgear already has some RTI abstraction library that should help to implement HLA federates. Both, SimGear and FlightGear need to be configured/rebuilt with -DENABLE_RTI (after first installing openRTI).&lt;br /&gt;
&lt;br /&gt;
Flightgear git already has an alternative multiplayer implementation in place that uses HLA. But that is only thought as a proof of concept. The next step is probably to provide a seperate hla federate that runs the [[Decoupling the AI Traffic System|AI traffic]] and feeds that into an rti federation (see the fgai section below).&lt;br /&gt;
&lt;br /&gt;
Also see:&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg32045.html&lt;br /&gt;
* http://www.mail-archive.com/search?q=fgai&amp;amp;l=flightgear-devel%40lists.sourceforge.net&lt;br /&gt;
* https://gitorious.org/fg/flightgear/commit/d79b2385b4f4a64a2460c32e6123ea399bfa83d6&lt;br /&gt;
* https://gitorious.org/fg/flightgear/trees/next/utils/fgai&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also see [[FlightGear CIGI Support (Common Image Generator Interface)]].&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
When you start up FlightGear on a 8-12-core machine, you'll find that most cores aren't really utilized at all. This is in stark contrast to X-Plane for example. There are many computations being run as part of the FG main loop, that don't stricly belong there, and which could obviously run outside the main loop, either in a separate thread or a dedicated process. &lt;br /&gt;
&lt;br /&gt;
We have been adding more and more threading to FG because of this, but we are also seeing more and more segfaults related to multithreaded code in FG. Just look at some of the recently reported bugs (issue tracker), many of them are directly related to concurrency issues and multiple threads doing things in a fashion which isn't threadsafe.&lt;br /&gt;
&lt;br /&gt;
Fixing this is something that requires explicit re-architecting, it cannot be just delegated to OSG assuming that it will just magically work. OSG parallelization is specifically related to rendering and following certain coding patterns and protocols, it will not directly help you otherwise. Even if you could run 99% of the rendering work asynchronously, that will not have any positive effect, because obviously it's our main loop that's becoming the showstopper here. &lt;br /&gt;
&lt;br /&gt;
The HLA approach is different and more promising in that a process-based parallelization effort actually forces people to think about the problem at hand. Also, using an existing industry standard (such as i.e. HLA or CIGI) is going to make FlightGear increasingly relevant and attractive to industry leaders.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The idea is to divide parts of the FlightGear architecture such that multiple simulations collaborate and can be run in different threads or even processes. Basically, you would not have a single monolithic FG application with a conventional main loop, but rather a handful of modules (FDM, AI, weather/environment, scripting) that get to communicate with each other by using a central managing component, called a &amp;quot;Real-Time Infrastructure&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Normally, a process-based modularization strategy would inevitably mean that modules need to be run as separate processes, but Mathias mentioned a clever scheme to directly run certain &amp;quot;component subsystems&amp;quot; in worker threads, which would then be a part of the main FG process, while still using HLA and a central RTI to handle the communications across all HLA federates.&lt;br /&gt;
&lt;br /&gt;
For professional users, it is extremely important to guarantee reliable frame rates, ideally separating the visualization from the underlying computation, so that separate computers can be used for different systems [http://forum.flightgear.org/viewtopic.php?f=18&amp;amp;t=15755&amp;amp;p=153295&amp;amp;hilit=hla+relevant#p153288].&lt;br /&gt;
&lt;br /&gt;
== OSG Threading vs. HLA ==&lt;br /&gt;
Distributed multi-process configurations are in fact exactly the way professional simulators work, too: They are distributed and communicate using sockets. Mathias' ongoing HLA work is going to make that increasingly feasible.&lt;br /&gt;
&lt;br /&gt;
OSG threading is neat and dandy, but obviously it is only directly useful for rendering related parallelization and related work. On the other hand, none of this comes for free. OSG's threading support really is impressive, but all those OSG threads must be kept busy. Properly. That's exactly the work that FlightGear is responsible for in its main loop.&lt;br /&gt;
&lt;br /&gt;
OSG's multithreading support doesn't just come &amp;quot;automagically&amp;quot;, just because FlightGear uses OSG. The multithreading support in OSG must be explicitly supported by following certain OSG coding patterns and coding protocols. Otherwise, you won't benefit at all.&lt;br /&gt;
&lt;br /&gt;
Obviously, OSG really is extremely powerful and also pretty good at parallelizing things, but you cannot necessarily see that when running FlightGear now, but there is other OSG-based software which is making really good use of this.&lt;br /&gt;
&lt;br /&gt;
Correct multithreading is incredibly hard to get right in any non-trivial application. &lt;br /&gt;
&lt;br /&gt;
Especially in complex systems like FlightGear. This holds even more true because FlightGear is implemented in C and C++, none of which has language-level support for concurrency and parallelism. &lt;br /&gt;
&lt;br /&gt;
Basically, there's no language-level support for multithreading in the C-family of languages. Everything needs to be built and emulated using library-functions and classes such as Boost (this is less so in Java). &lt;br /&gt;
&lt;br /&gt;
Still, coding a threaded design in C or C++ with more than 3-5 threads is incredibly tricky to get right (this will also be a problem once more threading will be used in Nasal code, because it also lacks language-level threading support). &lt;br /&gt;
&lt;br /&gt;
There are languages far better suited for multithreaded programming, such as Ada - because they have language-level primitives to create &amp;quot;tasks&amp;quot; and &amp;quot;protected types&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== What is HLA/RTI ==&lt;br /&gt;
&lt;br /&gt;
HLA/RTI is message distribution API used for distributed and paralell real time simulation systems. There are&lt;br /&gt;
a few API variants out there where the newest two ones are an IEEE standard known as rti1516 and rti1516e. This api is used in some open source simulation systems and in plenty simulation systems you can buy on the market. The api might look difficult at the first time, but it provides a carefully designed set of communication methods that avoid communication latencies - the worst problem in real time simulations - for a distributed simulation system.&lt;br /&gt;
&lt;br /&gt;
The API is standardized by an IEEE standard and used with commercial simulation systems as well, and depending on the RTI implementation, available with different language bindings like C++, java, ada. Additionally there are implementations hooking on to of those given ones for matlab, python, fortran and probably more. This should also extend the abilities to communicate with components using the tools and languages we cannot handle currently in any sensible way.&lt;br /&gt;
&lt;br /&gt;
== HLA vs. Shared Memory/IPC ==&lt;br /&gt;
The nice thing is that the ipc is hidden behind something that is also able to distribute this across multiple machines. A local network connect is mostly sufficient. But doing the same by an infniband connect is possible too. Experimenting with shared memory did not bring notable improovements over a system local network connect. At least not on linux...&lt;br /&gt;
&lt;br /&gt;
In any case I think this could be fast enough to do this stuff.&lt;br /&gt;
&lt;br /&gt;
Also this stuff is based on a standard that is probably enables us to be a little more connective in the end. At least this is a slight hope from me.&lt;br /&gt;
&lt;br /&gt;
While the interface is providing more than you need today, I think the major benefit is that it shields away a lot of synchronization stuff from you in a &lt;br /&gt;
way that you can still program your local component in a single threaded way. The coupling of components *can* be that tight so that you can get deterministic time slicing for some of the components. Say you want to simulate glider towing you can do that with each fdm running in its own process while still deterministically exchanging simulation results at a the fdm's rate and st time step boundaries.&lt;br /&gt;
The same goes for components within the aircraft which I consider a possible  use case for your kind of application.&lt;br /&gt;
In contrast to that, You can still run the viewers asynchronously to the simulatoin core providing hopefully 60 stable frames without being disturbed &lt;br /&gt;
by synchonization needs of specific components.&lt;br /&gt;
&lt;br /&gt;
So, you might have an Idea how to to that by ipc directly, and trust me I have considered this at some time. But what this standdard provides is really &lt;br /&gt;
driven by exactly those problems that need to be solved once you dig into such kind of implementation. So one of the benefits is that you gain a encapsulated communication library that does what you need. This library can be tested independently of such an application beast like flightgear. And this is IMO a huge benefit.&lt;br /&gt;
&lt;br /&gt;
== Benefits ==&lt;br /&gt;
the RTI c++ interface is defined in a way that you do not need to recompile anything. Everyting is done with pure virtual classes and factories to get them. So however this is implemented in the shared object/dll you should just need to get a 'standard' implementation dependent RTI header and compile with that. So you should in theory be able to change the RTI library of an already compiled binary. For the case that a particular RTI implementation does not follow this rule,  you need to compile flightgear explicitly for this particular library. &lt;br /&gt;
&lt;br /&gt;
The spatial indices implemented in the RTI regions will be a huge benefit, since you will only recieve the messages that are relevant near the region of your interest.&lt;br /&gt;
&lt;br /&gt;
Also the way an RTI provides time management and time stamped messages, is benefitial. This enables hard syncronized HLA federates, exchanging data at relatively high rates with the least possible communication latency.&lt;br /&gt;
&lt;br /&gt;
Regarding the ongoing threading discussion and the amount of cores an average cpu has today, an RTI will provide a way to implement components of the simulation in a single threaded way, living in its own process.&lt;br /&gt;
&lt;br /&gt;
This can be done while still having a deterministic and tight coupling with other federates simulating in the same federation. This kind of coupling is required for example for a good simulation of glider towing.&lt;br /&gt;
&lt;br /&gt;
The communications infrastructure based on RTI provides a huge potential to split the simulation into components that run on different cores or even machines but still being tight coupled.&lt;br /&gt;
&lt;br /&gt;
Major benefits would be to move some code, such as the [[Decoupling the AI Traffic System|AI code out of the main loop]] - may be even &lt;br /&gt;
into a seperate process/thread. Also runnig one instance of that [[Decoupling the AI Traffic System|AI traffic]] for installations like we used to have at the linux tag booth would be a major  advantage there.&lt;br /&gt;
&lt;br /&gt;
Anyway, I also consider an RTI a possible multiplayer replacement. Even if we would handle local RTI federations different than internet wide stuff. But yes, an RTI provides almost all we would need to get that right.&lt;br /&gt;
&lt;br /&gt;
What is to be commited is in this step is an alternative to the multiplayer protocol which does not cover really all what the multiplayer protocol can do today. But there is a proof of concept and some playground to start with.&lt;br /&gt;
The current implementation in flightgear is flexible enough to adapt to the needs of very different simulation systems. The default object model that you get is adapted to the needs of flightgear, but the implementation is&lt;br /&gt;
flexible enough to change the object model to the AviationSim object model for example at startup time.&lt;br /&gt;
&lt;br /&gt;
So, this should not only provide a way to distribute flightgears simulation systems across cpus or may be machines, this should also provide a way to increase connectivity of flightgear to other simulation systems.&lt;br /&gt;
&lt;br /&gt;
Also included is an RTI variant abstraction layer inside simgear to help with some common tasks that are often needed in an HLA/RTI implementation. One of the design goals of this layer was to provide a framework where&lt;br /&gt;
interaction with the RTI api consumes as little overhead as possible. &lt;br /&gt;
&lt;br /&gt;
In particular, this means that indies (fast mappings) are used wherever possible and allocations are minimized.&lt;br /&gt;
&lt;br /&gt;
Currently the only implemented RTI variant is the old nonstandard HLA-1.3 api, which was the only api I had available from an open source project at the time I began with that work. But it should be straight forward to extend that to  the two IEEE standard RTI variants.&lt;br /&gt;
&lt;br /&gt;
I personally think that there are still too much opportunities to break stuff. Well, with break I do not mean that it does not run or compile. With break I mean that people just put something together that works either for their private needs and they do not care further, or break in the sense that if you would know the bigger picture it would already be very clear that this cannot scale for the kind of  use that will most probably happen in the not so distant future. &lt;br /&gt;
I can really observe this in the scene and model area. I have really seen incredibly fast osg applications with stable framerates and nifty looking &lt;br /&gt;
models. But the way we use osg and put together models leaves osg and below  that the driver only little chance to be fast. Which leaves only little &lt;br /&gt;
headroom for sensible further development.&lt;br /&gt;
&lt;br /&gt;
Getting back to components: Latencies are a critical part of running in multiple threads/applications. This is not a particular problem of hla, this &lt;br /&gt;
is a generic problem when running real time applications in parallel. I know a lot of really smart people who can even understand complex environments very well, but have no clue about the problems introduced by round trips. Seen this, this is the reason why I started that hla stuff, since this provides a framework which supports and even encourages a programming model that is able to hide latencies as good as possible. Anyway, there is a chance that you even use this api in a way that really hurts in this corner. And this is actually the really bad thing I want to avoid: If you are the first component that does not get that right you might just notice little to nothing - especially if you are running on extrem fast hardware. But when the next kind of problem is introduced this really starts to hurt more and more. And most people do not have any chance to see what happens and why.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
== Weather Simulation ==&lt;br /&gt;
We can have a completely independent weather module using the HLA stuff that runs in an own process/thread. So, at that time you might be able to do more sophisticated stuff. May be it will then be possible to do a full cfd for subparts of the scene. That might be a good thing for a glider scene where you might want to have a more detailed fluid behaviour ...&lt;br /&gt;
&lt;br /&gt;
A weather module running in a different process/thread/machine that computes positions for clouds that are consistenly displayed on each attached viewer. &lt;br /&gt;
That being a module that is exchangable. The simple version just interploates metars like today, but more sphisticated versions might do a local weather &lt;br /&gt;
simulation to get good results for thermals in some small area. The same goes for every component you can think of splitting out.&lt;br /&gt;
&lt;br /&gt;
== AI Traffic ==&lt;br /&gt;
A simple [[Decoupling the AI Traffic System|AI  model]] does just the trick what it does today. But more sophisticated modules might contain an own fdm so that these machines really live in the same fluid that the weather module provides data for.Note that the RTI API already provides a subsriber model that ensures that you don't feed data to participants that dont' need that.May ba a radar controller screen that can be attached there to see the machines in this word. But sure that radar screen is not interrested in flap animations for the aircraft ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For over a decade, we've been talking about moving the AI traffic subsystem out of the fgfs main loop, not just to free computing resources, but also to make it easier to synchronize AI traffic with multiple instances, i.e. using multiplayer or master/slave setups with possibly dozens of computers (see [[Decoupling the AI Traffic System]]) and the link at [http://wiki.flightgear.org/images/1/1e/New_FG_architecture.pdf]. This requirement has been also extensively discussed over at the fgms project, and in the [[Distributed Interactive Simulation]] article.&lt;br /&gt;
&lt;br /&gt;
The [https://gitorious.org/fg/flightgear/trees/next/utils/fgai fgai proof-of-concept], is just a brief sketch chat could be done in that corner. It already  contains most if what is needed in complex infrastructure. You can inject vehicles and you can now get ground queries. I am for a long time running here also a brief python script which does about  the same than [https://gitorious.org/fg/flightgear/trees/next/utils/fgai fgai]. While a scripting language is not fast enough to drive a lot of ai traffic, it is rather nice to do only a few such objects without much  worries.&lt;br /&gt;
&lt;br /&gt;
The basic idea to have an external component that drives ai traffic, or at least a thread that does the same is a good one I think. For the long term I do not care about the multiplayer protocol since it has severe limitations that would require a very similar solution that one the OpenRTI implementation does. For the short term, I am not sure if we are already at the point where I can just switch over. Therefore this bridge component bridging the mp protocol with hla. For the ADS-B traffic, packing this into a module that you can attach to your  simulation instead of an artificial traffic component is an nice addition. Having &lt;br /&gt;
&lt;br /&gt;
Whatever happens here, if you are really driving a lot of ai models it  requires a huge amount of thoughts to get that scalable. Updates to specific &lt;br /&gt;
models as well as specific parts of those need to be updated in an sparse and  intelligent way to make this somehow work. This includes the basic part of the  [https://gitorious.org/fg/flightgear/trees/next/utils/fgai fgai] implementation which aims to have steady and differentiable movements.  This is at this time not made use of so much, but the classes that I called  something like *Physics* in there are mostly there to make sure that all  components can see and even extrapolate the same steady movements than the  originating component does. There is also infrastructure there to play some  tricks with timing so that nobody needs to wait for ai traffic updates to  arrive  - they should just already be there.&lt;br /&gt;
&lt;br /&gt;
There is also a small gatweay application translating between the old  multiplayer and hla that might go into the utils directory past the next &lt;br /&gt;
release.&lt;br /&gt;
&lt;br /&gt;
== Standalone Viewers ==&lt;br /&gt;
Or take the viewers (also see [[FGViewer]]), if you just exchange data by a shared memory segment, you are limited to a single machine. So that's nice for the 3-chanel thing you have. But I know of installs with 9 chanels I have been visiting some few time ago. They run flightgear on that beast by the way. Or I know of installs that currently run 14 or 16 chanels within a single view. For that reason I thought: better have a technology that is also extensible for this kind of installs instead of programming everything on top of something limited machine local.&lt;br /&gt;
&lt;br /&gt;
== Standalone GUIs / Managers  ==&lt;br /&gt;
In thinking about it a bit and being reminded of the existing HLA interface that FlightGear has, I'm leaning toward proposing something built with Python and the PyQT4 GUI library.  Both components are cross-platform and there is a Python binding for the CERTI HLA library (PyHLA).&lt;br /&gt;
&lt;br /&gt;
The idea here is to create a stand-alone application that replaces all the  built-in GUI functionality and communicates with FlightGear via the HLA &lt;br /&gt;
interface.  When the manager application meets that goal, the existing GUI can be either removed completely or simply &amp;quot;unbound&amp;quot; at compile time so &lt;br /&gt;
it's not available.&lt;br /&gt;
&lt;br /&gt;
Such a gui manager application must be included somehow in the basic set of functionality that is still running in the threaded mode. You would just &lt;br /&gt;
control your simulation with that component. May be restart with a different aircraft by just shutting down the running federate and start up a new one &lt;br /&gt;
with a different fdm.&lt;br /&gt;
And as such, doing this core component in python is something I am not sure about.&lt;br /&gt;
&lt;br /&gt;
So, python in the area of *optional* rti components, is a great tool. If I remember well, you do have some bigger install at home that might benefit &lt;br /&gt;
from such components very much! And in fact this is one reasons I am pushing this direction.&lt;br /&gt;
&lt;br /&gt;
Python also has one major problem with threads. There is the big interpreter lock in python which makes python essentially single threaded. While this is &lt;br /&gt;
not a problem when such a component runs in its own process, python in core components that need to run in threaded mode is essentially a no go.&lt;br /&gt;
&lt;br /&gt;
== Instructor Station ==&lt;br /&gt;
The management application wouldn't be running any of the sub-systems, just &amp;quot;observing&amp;quot; them. One of the issues that caught me up short was the requirement to sift through the chosen aircrafts configuration and Nasal files in order to take into account all the little custom menu items and controls that would have to be replicated on the manager interface. That was pretty discouraging all by itself.&lt;br /&gt;
&lt;br /&gt;
My initial concept would essentially perform the same functions as the instructor console in a commercial FFS. You could tweak any parameter of the simulator from that point, including aircraft selection, position, configuration, etc. This app wouldn't be running on the same machine as the simulator &amp;amp; scene generator itself. (What would be neat is a three machine setup - one for the scene generator, one for the flight/systems model and one for the instructor/manager console.)&lt;br /&gt;
&lt;br /&gt;
== FDM Server ==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.flightgear.org/flightgear_wiki/images/1/1e/New_FG_architecture.p We've toyed with the idea of an FDM server for a while], and there was even some work done on JSBSim towards making that happen. Recently, HDWysong has added the capability to use FlightGear as a visual front end for JSBSim as a separate, scripted application. It certainly would be a huge paradigm shift.&lt;br /&gt;
&lt;br /&gt;
== Multiplayer ==&lt;br /&gt;
The author of fgms would be pretty much interrested to implement fgms as part of a HLA infrastructur. What detained me from going that way is, that I found no free (as is free  beer) documentation on HLA specifications and the quite complex structure  (too complex for a one-man-show). Additionaly I'm not sure about license  issues involed. Are we allowed to publish all parts of (our) HLA  infrastructur under the GPL (which will kind of undermine cash-flow of documentation providers like the IEEE)? &lt;br /&gt;
&lt;br /&gt;
Regarding the multiplayer in FlightGear I see two options: 1) Either to implement a FlightGear proprietary protocol for multiplayer with a &lt;br /&gt;
gateway to HLA, or 2) to actually use native HLA as a multiplayer protocol.&lt;br /&gt;
&lt;br /&gt;
The solution 1) means a new protocol and a new server (updated fgms) needs to be implemented, but the implementation requires no IEEE standards and the &lt;br /&gt;
solution doesn't depend on a 3rd party framework.The solution 2) doesn't require any new protocol nor HLA gateway to be implemented (HLA RTI will be used instead of fgms), but introduces an additional dependency on a 3rd party software.&lt;br /&gt;
&lt;br /&gt;
I see no point in implementing our own protocol and an additional gateway, when we can directly use HLA. As long as we can implement and redistribute the federate code under GPL (or  compliant license) we can make flightgear act as a HLA federate and use an open-source RTI (instead of fgms).&lt;br /&gt;
&lt;br /&gt;
I also consider an RTI a possible multiplayer replacement. Even if we would handle local RTI federations different than internet wide stuff. But yes, an RTI provides almost all we would need to get that right.&lt;br /&gt;
&lt;br /&gt;
I have thought about the use cases and needs for communication that I can see. I came to the conclusion that the RTI abstracts away the communication stuff in a way that is highly matching exactly the needs of a distributed simulation. Where distributed is just the same if it's distributed across processes, threads or machines. That's the reason I did prepare the groundwork by starting that own project with OpenRTI. So this project is purely driven by distributing flightgear across more computation power.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What will come in the shorter term is a standalone viewer (see [[FGViewer]] that can sit on any of the configured views. There are beginnings of that checked in but there is a  lot more in preparation.&lt;br /&gt;
&lt;br /&gt;
= OpenRTI =&lt;br /&gt;
Source: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg32973.html&lt;br /&gt;
&lt;br /&gt;
The RTI implementation from www.certi.org was used most of the time during development. &lt;br /&gt;
While this one works somehow, it is sometimes difficult to handle and relatively slow. &lt;br /&gt;
&lt;br /&gt;
Meanwhile, this has been replaced almost entirely with [https://gitorious.org/openrti/openrti OpenRTI], a new RTI from https://gitorious.org/openrti/openrti that is way easier to set up and use and that provides way more features we might make use of with flightgear.&lt;br /&gt;
&lt;br /&gt;
OpenRTI provides one mode where you can just access a process local federation from multiple threads. There is no network configuration needed and you do not setup any server in this operation mode (sure it also provides the usual networking mode). So the plan is to use this mode as an aid to paralellize flightgear on a local machine. The basic advantage is that each federate is strictly programmed single threaded. All the thread syncronization is handled by the rti library and hidden in that thing. The trick is that each of these threads must be done in a way that you can just compile that alternatively in a single standalone binary and run the same component in a networked rti - the LinuxTag booth for example.&lt;br /&gt;
&lt;br /&gt;
= Testing =&lt;br /&gt;
What do you need:&lt;br /&gt;
* Latest simgear and flightgear as well as the data package.&lt;br /&gt;
* An RTI-1.3 implementation (such as [[OpenRTI]])&lt;br /&gt;
&lt;br /&gt;
libHLA is part of simgear (see simgear/hla). To build flightgear with &amp;quot;-D ENABLE_RTI=ON&amp;quot;, you'll first need to build simgear with &amp;quot;-D ENABLE_RTI=ON&amp;quot;. Before building SG and FG, you should build and install OpenRTI. &lt;br /&gt;
&lt;br /&gt;
So, the implementation in flightgear does not make any assumptions about some internal features of the RTI implementation, except the way the rti is configured to connect to its federation server. That means,&lt;br /&gt;
that you can use any RTI implementation you like, if you care for the apropriate connection setup. But for the default setup that we might choose, I intent to provide a configuration that makes use of some&lt;br /&gt;
properties of OpenRTI. So in theory, you should not need to know anything about that, until you make sophisticated use of these features.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Start flightgear with '''--hla=bi,&amp;lt;hz&amp;gt;,&amp;lt;federateType&amp;gt;,&amp;lt;federationName&amp;gt;,&amp;lt;profile&amp;gt;&amp;quot;,''' where &amp;lt;hz&amp;gt; is the communication frequency, &amp;lt;federateType&amp;gt; is the name of your federate - note that this must be unique with certi - and &amp;lt;federationName&amp;gt; is the federation you want to join. The &amp;lt;profile&amp;gt; argument defaults to the top level configuration file mp-aircraft.xml, which defines some flightgear adapted RTI/HLA federation definition. But there is already an alternate av-&lt;br /&gt;
aircraft.xml top level configuration file that should enable flightgear being used in an AviationSim federation that is the c++ hardcoded federation type of the other flightgear hla implementation out there.&lt;br /&gt;
&lt;br /&gt;
You still can use the the --hla= commands, but there is a shortcut --hla-local  which optimizes away a lot of successive ,,, in the command line that I &lt;br /&gt;
usually had. So, --hla-local=rti://localhost/FlightGear is a shortcut for a longer --hla= line.&lt;br /&gt;
&lt;br /&gt;
= Additional info =&lt;br /&gt;
Just search the archives (list/forum) for &amp;quot;HLA&amp;quot; or &amp;quot;RTI&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
* http://www.mail-archive.com/search?q=hla&amp;amp;l=flightgear-devel%40lists.sourceforge.net&lt;br /&gt;
* http://forum.flightgear.org/search.php?st=0&amp;amp;sk=t&amp;amp;sd=d&amp;amp;sr=posts&amp;amp;keywords=hla&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39181.html&lt;br /&gt;
&lt;br /&gt;
= Related =&lt;br /&gt;
* http://wiki.flightgear.org/images/1/1e/New_FG_architecture.pdf&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg16023.html&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37646.html&lt;br /&gt;
* http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37647.html&lt;br /&gt;
* http://virtualair.sourceforge.net/flightgear.html&lt;br /&gt;
* http://www.chromium.org/developers/design-documents/multi-process-architecture&lt;br /&gt;
* http://blog.chromium.org/2008/09/multi-process-architecture.html&lt;br /&gt;
* http://news.softpedia.com/news/Multi-Processes-in-Browsers-Chrome-Internet-Explorer-Firefox-and-WebKit-140535.shtml&lt;br /&gt;
* http://blog.mozilla.org/products/2011/07/15/goals-for-multi-process-firefox/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HLA]]&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FGViewer&amp;diff=60229</id>
		<title>FGViewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FGViewer&amp;diff=60229"/>
		<updated>2013-05-17T07:38:26Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Also see: [[FlightGear HLA support (High Level Architecture)]] and [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
&lt;br /&gt;
There is now a small tool in flightgear that can be used just like osgviewer. The huge difference is that it also works for btg and with some knowledge about the internals of the model loading process also for stg files.&lt;br /&gt;
The tool is aimed at people working on scenery and willing to see how their  scenery modifications will look like. They can do so now without starting &lt;br /&gt;
flightgear. One of the main ideas behind the tool had been to create a lightweight viewer component '''without''' pulling in tons of inter-dependencies which are so omnipresent in FlightGear.&lt;br /&gt;
&lt;br /&gt;
So the idea behind the 'fgviewer' tool is to create a distinct viewer component (still in the early stages of development) which, while still remaining compliant with the FlightGear environment, is trying to adopt as few dependencies from FlightGear as possible and therefore does not necessarily have to follow every rule of &amp;quot;how things are done in fgfs&amp;quot; in order to achieve its fine goal. It's a good idea to factor out the dependencies that the visual&lt;br /&gt;
part of flightgear has on the whole flightgear implementation.  A large fraction of the time that was spent for the OSG port was required simply to detangle a pile of quite obscure interdependencies between the former viewer code and the so-called FlightGear core. &lt;br /&gt;
&lt;br /&gt;
Actually I'm convinced that carefully cutting some of the old ties (some call them &amp;quot;cruft&amp;quot;), for example by keeping the viewer part as independent from the FlightGear core as possible, might serve as a good platform for future development. It's obvious that FlightGear, as every visual simulation, has to depend on the viewer. But the opposite way of depending the viewer part heavily on core FlightGear components is certainly not going into the outlined direction.&lt;br /&gt;
&lt;br /&gt;
This is a basic version of that tool that might grow if there is a need. I hope to include more flightgear internal scenery loading stuff so that you can  at some time also load aircraft models and see if the static parts  / animations / transforms / postprocessing steps are as expected without the need to start the whole simulation.&lt;br /&gt;
&lt;br /&gt;
You need to set the environment variable FG_ROOT like you should have in flightgear. And then for example load a btg.gz file of your interrest.&lt;br /&gt;
&lt;br /&gt;
You can get the fgviewer functionality by starting fgfs with the --fgviewer argument. This code doesn't do nearly as much initialization as the full fgfs, so it is quick to start up, but it does read preferences.xml and autosave.xml and understands the fgfs command line arguments. You can, for example, set property values on the command line.&lt;br /&gt;
&lt;br /&gt;
'''FGViewer''' is a utility to load a lightweight [[OSG]] viewer instead of loading the entire simulator. Useful for checking aircraft models, scenery tiles and airport layouts.&lt;br /&gt;
&lt;br /&gt;
To launch FGViewer, you run the following command:&lt;br /&gt;
 fgfs --fg-root=[[$FG_ROOT]] --fgviewer [path]&lt;br /&gt;
where [path] is the path to the thing that you want to view. An example of a possible path is &amp;lt;tt&amp;gt;Scenery/Terrain/w130n30/w123n37/KSFO.btg.gz&amp;lt;/tt&amp;gt;. The full command, will show the layout of [[San Francisco International Airport]]: &lt;br /&gt;
 fgfs --fg-root=[[$FG_ROOT]] --fgviewer Scenery/Terrain/w130n30/w123n37/KSFO.btg.gz&lt;br /&gt;
&lt;br /&gt;
FGVviewer is not at the point where this is already usable as the viewer is not complete and the code I am talking about is not yet in a usable &lt;br /&gt;
state. But If you have just a single configured viewpoint this already works by adding the apropriate [[HLA]] objects and attaching the viewer to them.&lt;br /&gt;
In the long term this is probably the viewer to use as it is designed to be  used in an environment like this.&lt;br /&gt;
&lt;br /&gt;
== Controls ==&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
!Key&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
|Esc&lt;br /&gt;
|Quit FGViewer&lt;br /&gt;
|-&lt;br /&gt;
|LMB&lt;br /&gt;
|Rotate view&lt;br /&gt;
|-&lt;br /&gt;
|MMB&lt;br /&gt;
|Pan view&lt;br /&gt;
|-&lt;br /&gt;
|RMB&lt;br /&gt;
|Zoom view&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Status =&lt;br /&gt;
Currently, fgviewer is not at the point where this is already usable as the viewer is not complete and the code I am talking about is not yet in a usable &lt;br /&gt;
state. But If you have just a single configured viewpoint this already works by adding the apropriate hla objects and attaching the viewer to them.&lt;br /&gt;
In the long term this is probably the viewer to use as it is designed to be used in an environment like this.&lt;br /&gt;
&lt;br /&gt;
fgviewer gained a lot of unfinished hla code that enables fgviewer to sit on a hla configured view - more or less. At least a python script that I &lt;br /&gt;
regularily use for development providing this works fine.&lt;br /&gt;
&lt;br /&gt;
Together with fgviewer there is also some work done on the scenegraph that is used there. fgviewer is since some time just able to display a whole world &lt;br /&gt;
paged model that has the stg/btg files in the leafs. With this work there is also some level of detail work done in the leaf nodes that is used by the &lt;br /&gt;
usual fgfs scene.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
The spt loader used in fgviewer also has lod hierarchies built in. You can  already load - may be I need to push this series to the latest version - lower level of detail huger tiles if you put them into the right directories. That's in preparation and has no upstream support form the scenery yet.&lt;br /&gt;
&lt;br /&gt;
There is a meta loader for these spt files that encode the area they should  cover in the file name before the spt extension.&lt;br /&gt;
&lt;br /&gt;
There are problems with the tiles near the poles. But this is something that the original stg database covers very bad. So the spt loader just reflects this weakness.&lt;br /&gt;
&lt;br /&gt;
In fgviewer there's a  PagedLOD whole world database tree running. This is similar to osg's marble dataset but carefully designed around our tile structure. Using this I think we can really replace a lot of our fine structured scenery tiles with something more croase that is used for tiles more far away.Drawback with our current codebase: Our integration of the particle systems need to be rethought as this contains geometry with culling disabled which makes a pagedlod just never expire. Switching the particle systems off works pretty good so far. &lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FGViewer&amp;diff=60228</id>
		<title>FGViewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FGViewer&amp;diff=60228"/>
		<updated>2013-05-17T07:31:00Z</updated>

		<summary type="html">&lt;p&gt;Chriscalef: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Also see: [[FlightGear HLA support (High Level Architecture)]] and [[FlightGear CIGI Support (Common Image Generator Interface)]]&lt;br /&gt;
&lt;br /&gt;
There is now a small tool in flightgear that can be used just like osgviewer. The huge difference is that it also works for btg and with some knowledge about the internals of the model loading process also for stg files.&lt;br /&gt;
The tool is aimed at people working on scenery and willing to see how their  scenery modifications will look like. They can do so now without starting &lt;br /&gt;
flightgear. One of the main ideas behind the tool had been to create a lightweight viewer component '''without''' pulling in tons of inter-dependencies which are so omnipresent in FlightGear.&lt;br /&gt;
&lt;br /&gt;
So the idea behind the 'fgviewer' tool is creating a distinct viewer component (yet still in the early stage of development) which, while still remaining compilant with the FlightGear environment, is trying to adopt as little dependencies from FlightGear as possible and therefore does not necessarily has to follow every rule of &amp;quot;how things are done in fgfs&amp;quot; in order to achieve its fine goal. It's a good idea to factor out the dependencies that the visual&lt;br /&gt;
part of flightgear has on the whole flightgear implementation, a large fraction of the time that was spent for the OSG port was required simply to detangle a pile of quite obscure interdependencies between the former viewer code and the so-called FlightGear core. &lt;br /&gt;
&lt;br /&gt;
Actually I'm convinced that carefully cutting some of the old ties (some call them &amp;quot;cruft&amp;quot;), for example by keeping the viewer part as independent from the FlightGear core as possible, might serve as a good platform for future development. It's obvious that FlightGear, as every visual simulation, has to depend on the viewer. But the opposite way of depending the viewer part heavily on core FlightGear components is certainly not going into the outlined direction.&lt;br /&gt;
&lt;br /&gt;
This is a basic version of that tool that might grow it there is a need. I hope to include more flightgear internal scenery loading stuff so that you &lt;br /&gt;
can  at some time also load aircraft models an see if the static parts  animations/transforms/postprocessing steps are as expected without the need to &lt;br /&gt;
start the whole simulation.&lt;br /&gt;
&lt;br /&gt;
You need to set the environment variable FG_ROOT like you should have in flightgear. And then for example load a btg.gz file of your interrest.&lt;br /&gt;
&lt;br /&gt;
You can get the fgviewer functionality by starting fgfs with the --fgviewer argument. This code doesn't do nearly as much initialization as the full fgfs, so it is quick to start up, but it does read preferences.xml and autosave.xml and understands the fgfs command line arguments. You can, for example, set property values on the command line.&lt;br /&gt;
&lt;br /&gt;
'''FGViewer''' is a utility to load a lightweight [[OSG]] viewer instead of loading the entire simulator. Useful for checking aircraft models, scenery tiles and airport layouts.&lt;br /&gt;
&lt;br /&gt;
To launch FGViewer, you run the following command:&lt;br /&gt;
 fgfs --fg-root=[[$FG_ROOT]] --fgviewer [path]&lt;br /&gt;
where [path] is the path to the thing that you want to view. An example of a possible path is &amp;lt;tt&amp;gt;Scenery/Terrain/w130n30/w123n37/KSFO.btg.gz&amp;lt;/tt&amp;gt;. The full command, will show the layout of [[San Francisco International Airport]]: &lt;br /&gt;
 fgfs --fg-root=[[$FG_ROOT]] --fgviewer Scenery/Terrain/w130n30/w123n37/KSFO.btg.gz&lt;br /&gt;
&lt;br /&gt;
FGVviewer is not at the point where this is already usable as the viewer is not complete and the code I am talking about is not yet in a usable &lt;br /&gt;
state. But If you have just a single configured viewpoint this already works by adding the apropriate [[HLA]] objects and attaching the viewer to them.&lt;br /&gt;
In the long term this is probably the viewer to use as it is designed to be  used in an environment like this.&lt;br /&gt;
&lt;br /&gt;
== Controls ==&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
!Key&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
|Esc&lt;br /&gt;
|Quit FGViewer&lt;br /&gt;
|-&lt;br /&gt;
|LMB&lt;br /&gt;
|Rotate view&lt;br /&gt;
|-&lt;br /&gt;
|MMB&lt;br /&gt;
|Pan view&lt;br /&gt;
|-&lt;br /&gt;
|RMB&lt;br /&gt;
|Zoom view&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Status =&lt;br /&gt;
Currently, fgviewer is not at the point where this is already usable as the viewer is not complete and the code I am talking about is not yet in a usable &lt;br /&gt;
state. But If you have just a single configured viewpoint this already works by adding the apropriate hla objects and attaching the viewer to them.&lt;br /&gt;
In the long term this is probably the viewer to use as it is designed to be used in an environment like this.&lt;br /&gt;
&lt;br /&gt;
fgviewer gained a lot of unfinished hla code that enables fgviewer to sit on a hla configured view - more or less. At least a python script that I &lt;br /&gt;
regularily use for development providing this works fine.&lt;br /&gt;
&lt;br /&gt;
Together with fgviewer there is also some work done on the scenegraph that is used there. fgviewer is since some time just able to display a whole world &lt;br /&gt;
paged model that has the stg/btg files in the leafs. With this work there is also some level of detail work done in the leaf nodes that is used by the &lt;br /&gt;
usual fgfs scene.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
The spt loader used in fgviewer also has lod hierarchies built in. You can  already load - may be I need to push this series to the latest version - lower level of detail huger tiles if you put them into the right directories. That's in preparation and has no upstream support form the scenery yet.&lt;br /&gt;
&lt;br /&gt;
There is a meta loader for these spt files that encode the area they should  cover in the file name before the spt extension.&lt;br /&gt;
&lt;br /&gt;
There are problems with the tiles near the poles. But this is something that the original stg database covers very bad. So the spt loader just reflects this weakness.&lt;br /&gt;
&lt;br /&gt;
In fgviewer there's a  PagedLOD whole world database tree running. This is similar to osg's marble dataset but carefully designed around our tile structure. Using this I think we can really replace a lot of our fine structured scenery tiles with something more croase that is used for tiles more far away.Drawback with our current codebase: Our integration of the particle systems need to be rethought as this contains geometry with culling disabled which makes a pagedlod just never expire. Switching the particle systems off works pretty good so far. &lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Chriscalef</name></author>
	</entry>
</feed>