One World
The thing I've been passion about my entire career has been games.
I taught myself to program because I played Lunar Lander on an HP65 and it hooked me.
The first several programs I wrote on the Apple II were all games, including a first-person driving game ("pedestrian invaders") where your goal was to run down pedestrians, an adventure / D&D inspired text-based adventure game with inventory management and combat (I wrote a text parser without knowing what a text parser was, adventure on the Apple II didn't have inventory or combat, and adventure on the DEC10 didn't have combat), and a naval simulation based on the tabletop wargame Sea Strike.
In college I realized computers simply weren't up to running the kinds of games I really wanted to play. The best personal computer you could get had 128kB of memory. You couldn't even represent a Squad Leader map board accurately with that much memory.
So I designed tabletop games, starting with ForeSight, using a Macintosh. This godly machine was too intimidating to program at first (Apple never got the hang of creating nice developer APIs, but Steve Jobs and the crew at NeXT did and then Apple acquired them.)
Using the Mac taught me to understand and respect usability at a gut level before I really understood it properly. Don Norman's "The Design of Everyday Things" and Bruce Tognazzini's "Tog on Interface" (now hard to get) were life-changing. The first showed you how things go wrong, and Tog showed you how to get them right.
I spent the next 35 years being a programmer—sorry, "software engineer"—almost always working on user-facing software, and constantly encountering the same problems in different and ever more complex forms, and finding certain principles that seemed obvious and simplifying became more and more valuable over time.
- DRY don't repeat yourself
- good programming is applied laziness (pure math is pure laziness!)
- figure out how not to do the thing you hate doing
- figure out how users can avoid doing things they hate doing
- all sincere feedback, even if it's wrong, is valuable
Games
The first 3D engine that was both fun to work with and performant enough to ship good games was, in my opinion, Unity. (Althought honorable mention should go to the late Mark Sibly's Blitz3D.)
Unity started out quite expensive, but today it's become effectively free for anyone not making their living from it. The real cost is in API thrash. If you're not a fulltime Unity coder it changes so fast that it feels like you're learning everything from scratch constantly. And it's big and clunky and heavy.
And the programming language is C# which I've tried to love, but I just don't. It's everything I hate about Typescript but worse: not surprising given Typescript was designed by the same guy, trying to make JavasScript more like C# (and C# was basically Microsoft's take on Java).
If you want the last word in graphics, it's not quite there. That's Unreal.
And if you want simplicity, it's definitely not there. Just configuring a single input surface is a pain.
Now, there's Godot, which is free and open source and has its own half-assed language. The last thing I want to do is learn a new DSL that's in the process of being replaced.
And one thing no 3D game engine out there does is handle the different 3D use cases cleanly. E.g. a VR version of a game, a touch version, a console version, and a desktop version tend to be complete different builds. If you're Rockstar that's fine—maybe even a Good Thing—but if you're me it sucks. I want to do as little work as possible for the greatest result. Applied laziness.
I like owning my stack, i.e. having as few dependencies as possible and the onces I have should be open source and generously licensed.
tosijs-3d
Because building user interfaces is my day-job, I've built powerful libraries to do this well. But they're focused on the DOM, and the DOM is an inconvenience in 3D and basically useless in VR. So that means building out three complete user interfaces at minimum (computer, touch device, and goggles).
So when I started building out tosijs-3d, I knew I had a lot of ugly UI work to do because I needed to solve three messy problems on the surface level (rendering UI in three different contexts), and four ugly problems on the input side (keyboard + mouse/trackpad), gamepad, "glass" controls, and VR controllers. Just handling mouse/keyboard in Unity was a pain. The solution used in AAA games for many years was Scaleform, a Flash runtime that rendered into a texture layer. This outlived Flash (I think it's still in use!) This is literally one of the most garbage tools ever made, being emulated by more garbage to solve a problem badly.
But then I had an idea.
Wouldn't it be nice if we could just implement one user interface and it worked, as expected, everywhere? The developer only has to think about one world. The user only has to think about one world.
Today, even if you're just playing a game, you probably need to quit and restart just to switch from "flat" 3D to VR. And when you're testing you're switching from goggles to laptop in the debug loop for the simplest thing.
tosijs already does what we want, but it's tied to the DOM. Or is it?
- tosijs works in the DOM and SVGs are basically an extension of the DOM
- tosijs already has an svgElements proxy
- SVGs can render into canvases really easily
- canvases can be turned into bitmap images and those can be turned into 3d textures really easily
And on the input side, GTAV et al basically has the best controls around and almost everyone knows how to use them. Let's map the keyboard and XR controls through the default gamepad mappings inspired by GTA. And let's provide a virtual SVG-powered gamepad you can just overlay on 3D surfaces in whole or part.
And let's create our basic scene so it by default supports "flat" 3D and XR.
This shows the tosijs-3d user virtual table example, the SVG (DOM version) is running side-by-side with the one embedded in the BabylonJS scene. Note how it's a virtual list (so only the minimum necessary elements are in the DOM) but state is maintained on items scrolled in and out of view.
One world, one interface. Want to fix a minor UI bug you found in VR, you can probably fix it in the DOM and test it there without touching your goggles. And you can play the game in "flat" 3D and just dip into VR when you feel like it.
In a browser.
Anywhere.