Traffic Global for X-Plane Dev Diary – May

Originally published on https://www.justflight.com/articles/developers-diary-traffic-global-for-xplane-11

Once again, welcome! This has been a busy month to say the least. Firstly, the beta was announced last month which puts a certain amount of pressure on. More than that, it’s been a time of gathering threads together and trying to join them together without using too many granny knots.

As I’ve discussed in previous diaries, there are quite a few major underlying systems that needed to be written to make this all come together. All of them are now pretty much in place, which means that they need to start co-operating with each other. Naturally that’s been the goal all along and they’ve been written with that in mind, but “the best laid plans of mice and men” etc. (If you’ve never read Rabbie Burns’ “To A Mouse”, do, and follow up with “To a Louse”, which might have been written with Instagram in mind if it wasn’t a couple of hundred years old). Things that worked perfectly with a small number of test cases fall apart when they’re faced with the much more complicated scenarios of the entire traffic database, different aircraft, airports, runways in use and so on, and what seems like a very minor change then messes up everything else that’s already been connected to it. And so on.

An old geek joke says that there’s 10 kinds of people in the world; those who understand binary and those who don’t. There’s a similar way of looking a programmers, that I’d describe as creators versus builders. Builders will mostly take already-written sections of code, either as reusable components or copied and pasted from the web, and connect them together to quickly get something that works, while creators are the ones who originally write those reusable components and put the code snippets online for others to read. It’s like the difference between a French cabinet maker and someone building a flat-pack bookshelf.

There’s absolutely nothing wrong with the “builder” way of doing things! If your end goal is a quick, cheap, sturdy bookshelf then this is the way to go, but – and here’s the point – no matter how good their Ikea-fu is, a builder doesn’t have the same understanding of the materials and construction methods as the creator who actually designed it in the first place. There’s no point in reinventing the wheel, but if you need a wheel that behaves differently then re-using an existing one doesn’t help.

Which leads, finally, to the main point for this month: The Rabbit-Hole of Detail.

That 777 pilot must be an Audi driver! Separation is one of the final bits that needs written.

Programmer creator-types tend to be detail-obsessed. It’s pretty much a given, there’s no way to do something like that without being detail-obsessed. Even the simplest task needs to be broken down into ever smaller chunks until even a dumb machine can’t possibly need any more detail, and a modern PC’s capacity for detail is stunning. This is simply catnip for coders though; a never-ending cascade of detail, any and all of which can be refined and improved ad infinitum, is a powerful and dangerous draw.

Right now there are still a couple of important things that haven’t been started and which absolutely must be done. If your mind’s not in the right place then the bigger tasks can be a bit overwhelming, so it’s easy to fall into the trap of doing something small as a bit of a warm-up, a nice little no-brainer to do when things get a bit much. With never-ending detail, though…

A quick example. At the start of the month I was looking at making a significant change to the way aircraft moved, which would probably break a lot of connected things. So, naturally, I started subconsciously casting around for distractions and found one – the way that airliners move on final approach. I happened to be watching a 737 approaching on a windy day and it was perfectly smooth, like it was running on rails. Hmm… people are going to notice that. “OK, I can fix that as a quickie”, and did, so now there was a nice bit of side-to-side drift and roll. On a still day it looked too much though, so maybe I should also take the wind gust speed into account? “OK, I can fix that as a quickie”. Done. The next plane I checked happened to be an A380, and it looked plain wrong because it was moving around too much in general. “OK, I can fix that as a quickie” by making the drift behave differently depending on the mass of the aircraft. But wait! How about on takeoff? “OK, I can fix that…”. No, wait, there would be more fuel on board on takeoff so the drift would be less! “OK, I…”. But what if the wind’s straight down the runway, it wouldn’t be rolling so much? “OK, …”. And so went a couple of days until the voice at the back of my head gave me One Of Those Looks and I started on the bigger task that I’d been avoiding.

There’s been quite a lot of that this month.

Monitoring display with Heathrow, parked and moving planes, active taxiways, and routes.

On the plus side, I’ve got a load of little side-tasks done! I won’t list them until they’ve been tested by more people and are definitely going to be in the final released version but a lot of the “nice-to-have” tasks have been done or mostly done. I know I do this kind of side-tracking and plan for it, and leave a load of little distractions like this around specifically to give me something constructive to do when the real task at hand is just getting a bit too much to deal with. Go do something else, get the little dopamine hit of ticking a task off, build up a bit of morale and go back to the dreaded whatever-it-is with more energy and new ideas.

As long as you’re aware of what’s going on and remain in control of it, these distractions can be turned into a very useful tool! It’s the old adage “a little bit of what you fancy does you good” in action. Just like Alice’s original trip down the rabbit-hole to Wonderland after her encounter with a frankly suspicious bottle labelled “Drink Me”, giving in to the dopamine hits is dangerous because they can just lead ever downward. The short-term “hit” can easily become the main goal, in just the same way that Facebook and friends trained an entire generation to react to the sound of a bell and drop what they’re doing to get the little “hit” of getting a “like”. Pavlov would be proud, and hopefully a little scared.

And the end result of a bit of self-administered mental coaxing? Taxying is done, moving around complex airports is done, transitions between flight stages are much improved, there are more animations, the groundwork is laid for aircraft avoiding each other, multiple runways can be in use at a time, some model bugs are fixed. Plus a bunch of other bonus features. Yay for procrastination, carefully applied!

The main drive now is to get an internal beta out to people that have been patiently waiting for some time, and get them actually hands-on, albeit minus a couple of important things. By the time next month’s diary comes around I expect to have had some good feedback from the first people to see the traffic in action, and learned a whole lot more about how jet engines sound! Thanks for reading, and check in again; this month’s seen some interesting course corrections but we’re turning this thing onto final approach.

About the Author: jimkeir