Paving the Golden Path

Babylon.js
6 min readDec 9, 2021
A path in golden lighting.
Photo by Nick Fewings on Unsplash

Or, golden paths, more accurately. Let me back up.

Babylon.js 5.0 Is Coming…

…and this will be, by far, the biggest release we’ve ever had. We have more features than ever, more tools than ever, more speed than ever, and more supported platforms than ever.

And yet, overwhelmingly, we keep seeing Babylon used in the same sorts of ways — most prominently for various types of “viewer” apps on the Web. We do see some examples of other usages, of course; but overall, we don’t really see many Flash-style 2D games, first-person experiences, mobile apps, custom CADs, or VFX mechanisms made in Babylon. Why? Babylon has tons of potential to do and be all these things. So, when it comes to usage, why isn’t Babylon living up to its full potential?

Mind the Gaps

A man jumping over a canyon.
Photo by Alex Radelich on Unsplash

After quite a lot of thinking, my theory on this is that, even when Babylon supports every major feature needed to create a certain kind of experience, we still have “gaps in the road” that make it difficult for developers to get where they’re going. The nature and severity of these gaps varies from developer to developer — an insurmountable obstacle for one person might not even be a problem for another — but when you have enough of these gaps in sufficiently common scenarios, they can make entire application types very difficult to create.

The most obvious example of such a gap is first-person character control. Over and over, we see questions on the forum asking how to create walking simulators and FPS games; and while Babylon does have some partial answers to this question (some of our utility cameras have rudimentary FPS features and various Community members have taken stabs at this over the years), there is no canonical Babylon-recommended approach to creating a full-featured first-person character controller. Consequently, it falls to the experience developers to “bridge the gap” by creating such a character controller themselves, and this in turn makes developing first-person Babylon.js experiences much, much harder than it should be.

Different gaps affect different people, and for a long time I underestimated the severity of the character controller gap because I personally have prior experience implementing camera controls. For me, figuring out how to use Web tools like NPM and webpack was much more of a gap because, as a predominantly non-Web developer, I’d simply never gotten familiar with them. But once I realized that I had allowed my gaps to suppress my own usage of Babylon.js — that I’d spent three years on the Babylon team without having created a single standalone experience — only then did I really start understanding the problem.

Road work ahead.
Photo by Andrew Ball on Unsplash

The Golden Paths

To mitigate these gaps and make it easier for the Community to create all sorts of experiences, the Babylon Team is launching an effort to establish new golden paths for various Babylon.js usages. Colloquially, a golden path is a well-defined, well-maintained, and well-documented set of steps one can take to reach a certain goal. For Babylon, we want our golden paths to have the following traits:

  • They lead to a destination. The Babylon.js golden paths should always end in a full-fledged experience. They won’t be complicated experiences, but they will be more than just demos. The hope is that, as we pave more and more of these paths, it will become common for developers who come to Babylon with an idea in mind to find that there’s already a golden path leading close to where they want to go.
  • We’ve walked them ourselves. Every golden path must have been followed end-to-end by a Babylon Team or Community member who can verify that it actually is a golden path. In some ways, this will serve as a forcing function for bridging gaps: there should be no obstacles on a golden path that we haven’t crossed ourselves, and when we crossed them we documented how we did so and, when appropriate, added helpful features to Babylon itself.
  • They are objective-oriented. The majority of Babylon’s documentation is focused on learning Babylon, so it organizes information by topic and tries to cover all the details that might be needed for any use case. The golden path documentation, by contrast, will be focused on doing something specific with Babylon, so information will be organized by task and will only emphasize details pertinent to the task at hand.
  • They are inspectable open-source. Generally speaking, the golden paths aren’t expected to be coding-focused. While they may touch upon coding practices occasionally, more typically the emphasis should be on usage rather than implementation. However, since every golden path will be backed by a working experience, that experience itself — code, assets, deployment, and all — also serves as a resource to be inspected, tested, forked, etc. to help those trying to follow the golden path.
  • They are recommended. Any given task can be solved in many different ways, and the golden paths are not intended to suggest that alternative approaches are bad or wrong. However, the golden paths will suggest a good approach, one we believe will serve developers well, because we’ve used it ourselves and can verify its positive qualities. These paths won’t show how something must be done; they simply show how we did it.

With all the above in mind, the process of “paving” a golden path involves coming up with an example of a certain type of experience, then actually making it. As we make it, we figure out what all of the steps of the golden path are: if we already have the needed features, we use them; if we don’t have all the needed features, we add them; and if reaching our objective requires using other tools as well as Babylon, we learn those tools and incorporate their use into the path. Once we’ve created the experience and are satisfied with the process of doing so, we then document the whole creation process in the form of a Dev Story. Dev Stories are a new addition to the Babylon.js docs which serve as the formal documentation for golden paths. Each Dev Story will document the entire process of creating an experience, so each Dev Story will describe a complete golden path.

A paved path in a gold-hued cave.
Photo by Robert Thiemann on Unsplash

When Does This Start?

Now! As of today, the very first Babylon golden path — a Flash-style 2D game illustrating the use of the Template Repository Workflow to take a Playground idea and develop it into a shippable Web or mobile app — is available in the Babylon.js docs. This is a great path to get started with, particularly if you have ideas you’ve explored in the Playground that you now want to develop into independent experiences.

But this is just the beginning — the very beginning, in fact. In the coming months, we plan to add several new golden paths focusing on scenarios like object viewers, video/image post-processors, and first-person character controllers. As we continue to fill in gaps, we’ll move on to more sophisticated scenarios, building upon the additions we’ve made and the paths we’ve paved.

So come tell us what you want to make! Which golden paths should we pave first? The types of experiences to target and the order in which we target them are being discussed on the forum right now. Come join the conversation, and let’s pave new paths into Babylon’s future!

A path in golden lighting.
Photo by Patrick Fore on Unsplash

Justin Murray — Babylon.js Team

https://twitter.com/syntheticmagus

--

--

Babylon.js

Babylon.js: Powerful, Beautiful, Simple, Open — Web-Based 3D At Its Best. https://www.babylonjs.com/