Global flight in a mobile simulator doesn't come without a few caveats. One of them is that we must stream scenery (imagery + topography data) and other aircraft to you as they come into view. By today's device standards, this is the only way we can give you the world at your fingertips. There just isn't the storage space required to accurately represent the entire planet at a reasonable quality.
Our job is to prepare the data for streaming and make sure that it gets to your device as fast and as reliably as possible. Let’s dive into some Infinite Flight tech and look at how we do that.
In Infinite Flight, we use a "quad sphere" to partition our data. Flat earth people, this bit is as close as we'll get to siding (get it?) with you.
To prepare our scenery data for streaming, it is first projected to each face of a cube in a way that minimizes distortion (projecting a sphere to a 2D representation always creates some distortion).
In our case, face 0 is the one that contains Africa, face 1 contains Australia and sections of Asia, face 2 is mostly the Pacific Ocean, face 3 is the Americas, face 4 is the top (containing most of Europe, Russia, and the North Pole), and face 5 is bottom.
Data in each face is then split further in tiles using a quadtree structure. At level 0 of the quadtree, we have 1 tile representing one whole face of the cube, at level 1 we have 4 tiles, at level 2 we have 16, and so forth. For example, our 15m/px imagery data is split up to level 11, which represents a maximum of 4,194,304 tiles per face.
Partitioning it in this way helps to reduce the amount of data we need to fetch in order to display the scenery around the aircraft. As you fly, we only fetch the visible tiles based on their distance to the camera. For closeup terrain we will fetch the highest level tiles. For distant terrain we fetch the lower level ones since we don't need as much detail there until we get closer to them.
Since we have users connecting from all over the world, it is essential that requesting a tile is fast regardless of where they are. Our tiles are in a server cluster (multiple servers that share the load) located in the US, but are cached all over the world by using a CDN (Content Delivery Network).
When a tile is requested, that request first goes to a CDN server that is physically close to you. If it is the first time this CDN server sees this exact request, it will download the tile from our server cluster in the US, cache it locally and send you the tile. If the tile was requested recently by someone else in your region using Infinite Flight, then the tile is already in the cache and will be sent to you right away, without having to request it from our servers. Depending on your physical location, a tile request could take a few hundreds milliseconds to complete if it is not cached. If the CDN server closest to you already has a copy of the tile, that same request usually completes in less than 10 milliseconds.
Our CDN provider has a network of 150+ servers located all around the world, ensuring that scenery streaming is fast and reliable no matter where you are using Infinite Flight from. It's important to note that we also cache the scenery tiles locally on your device. The local cache has a maximum size of 512MB at the moment, and will automatically delete tiles that haven't been used in a long time when you reach that limit.
At the time of this post being published, our CDN saw more than 2 billion requests and delivered more than 70 TB of data in one month. That's 64.5 million requests per day, 2.6 million requests per hour, 44,800 requests per minute, and 746 requests per second. Roughly! We are always looking for ways to deliver higher quality and more content, while minimizing the requests required to the servers.
Of course all of this streaming comes at a cost. A frustration for some users is the cost of a Pro subscription to Infinite Flight. As you can see, as the number of users increases, so too does our cost to deliver content to those users. We are charged with finding the balance between serving quality content quickly, adding new streamable features such as aircraft (and one day other 3D objects), and keeping costs down.