Sansar Creator Interview: Galen

Note: This interview, conducted by Sansar user GranddadGotMojo, originally appeared in Chris Jackson’s News One blog, which has since shut down. Chris was kind enough to give me a copy of this interview, and Granddad consented to have it republished here in the Sansar Newsblog so it wouldn’t be lost. Thank you, Christ and Granddad!

Interview With Galen “The Programmer”, by GranddadGotMojo

Galen, who is one of Sansar’s most prolific and talented programmer/creators, sat down with me to answer some questions and share his thoughts.

Granddad: What is your programming background? What did you program in before Sansar?

Galen: I’ve been a software engineer my entire career. I started programming in high school in the late 1980’s. Like many senior programmers, I’ve worked with a lot of platforms and languages. Much of my more recent career has been in Microsoft’s mainline platform. For most of 2017, I’ve been developing software and some other content for both Second Life and Sansar, focusing on LSL, C#, T-SQL, and JavaScript.

Granddad: Tell us about Reflex and Clockwork and your ideas for creating frameworks of programs that interact? Where do you see this going to?

Galen: From day one upon arrival to Sansar during the closed alpha, it was clear to me that the main thing people felt was lacking was interactivity. By my third day, I had created the very first working door script.

My goal was to create a fleet of simple scripts that could be hooked together, LEGO-style, by non-programmers to create interactive behaviors. It took a couple of weeks to release the first version of the Reflex scripts for that purpose. Then a few more weeks to release a second version that revamped the communication and programming style.

It also featured a website with a detailed user guide to help users understand how to use the scripts. I also documented the approach that other programmers could take to write their own Reflex-compatible scripts. I genuinely wanted to set an early standard to encourage everyone to work together.

Granddad: I have looked at that site and will probably try to create an actuator. What kind of actuators or sensors do you think other programmers should try?

Galen: For now, I think I have the basic options covered because there’s not much we have access to in the existing Script API, but that will change over time. And chances are I won’t keep up with it all, so it’ll be good for others to contribute new types of sensor scripts. There are endless types of actuators people could make.

My initial goal was to cover some of the obvious basics, like making sounds, opening and closing doors, switching on lights, etc. Honestly, I have expected the first Reflex scripts other than my own to be what you might call “beadboard controllers”. By that, I mean scripts that listen to standard sensors and put together more complex responses. Like if you’ve visited three required spots, now you can open a door.

I have plans to add a bunch more features to Reflex in the near future, too. Most notably, I’d like to add a sort of personal inventory box. Picture the many video games where walking over a coin or weapon causes you to instantly add it to your inventory. Instead of your avatar having to carry a 3D object around or wait for Linden Labs to introduce a new local-inventory feature, this would just remember what you’ve acquired for you while you’re in that scene. I think that hints at the potential we have for creating sophisticated games, even now, despite Sansar’s limitations.

In my Clockworks Club demo, I have about 100 objects running the unit script that keeps them in constant motion. They compute complex motions at a rate of 50 updates per second. That’s about 5,000 total updates per second. And these are not simple computations, either. So Clockworks is all about dynamic motion.

One day I visited a nightclub styled experience. I was impressed with the feel, but I immediately noticed everything was motionless except the music video playing. It occurred to me that I had everything I needed to make a sort of light show system. I’ve already released two versions of Clockworks now. The second one introduced the idea of multi-segmented machines.

Right now, you can’t assemble a teddy bear and get scripts to move its arms in relation to its body, for example. You have to compute the motions of every single piece of it and make it act like it’s all connected together. That’s what Clockworks does. Reflex and Clockworks represent my foray into the broad field of dynamics in Sansar.

My Hoverpark experience is a next step. Reflex and Clockworks solve a nasty problem of what I call “jitter”, where gravity keeps pulling massy objects down while your script keeps putting them back in place, by setting the mass of those objects to zero so they won’t fall.

That solves one problem but creates another: You can’t really interact with those objects. Most notably, you can’t stand on them. My hover platforms are my first attempt to solve that problem using “real physics” instead of the simulated motions involved in rapidly calling Body.SetPosition() and Body.SetOrientation(). Right now, there is a huge complexity barrier plaguing all scripters hoping to deal with getting objects to move in stable, predictable ways like my hover platforms do. It took a lot of research to get them to work as I wanted.

The basic problem has to do with dynamic balance. Think of the classic problem of balancing an upside-down broomstick on your finger. The so-called “inverted pendulum problem”. The good news for scripters is that there are algorithms that solve the inverted pendulum problem. I found and deployed one. The resulting dynamic behavior with the Hoverpark is not perfect and I would argue that that’s largely due to limitations of Sansar’s physics engine right now. I hope Linden Labs is using that experience as a testing environment.

Granddad: The Reflex, Clockwork and Hover Scripts are available on the Sansar Store aren’t they?

Galen: Yes they are.

Granddad: Speaking of Linden Labs, what do you feel are the 3 top features they should add to help programmers/scripters?

Galen: I guess the HTTP request capability will have the greatest impact on what we do. As most people know, there is no long-term persistence available to scripts right now. When the last person leaves a scene and some time has elapsed, the server running it shuts down. This is a brilliant cost-saving measure that also differentiates Sansar from Second Life in several surprising ways. But it presents a nasty challenge for us, too. I think we are all waiting for the most obvious solution to this problem is HTTP requests. That is, we expect our scripts to eventually be able to make requests out to web servers.

This would let us store data on our own custom databases, for example. And have additional computing power outside Sansar. Linden Labs has not announced exactly how or when they plan to enable this or any other external communications. I suspect they are concerned about some of the abuses that happened early on in SL’s history when they enabled scripts to send and receive emails. In general, my sense is that Linden Labs is trying to take their time when introducing new features. By contrast, LL used to introduce features very rapidly and, arguably, without much careful forethought in Second Life’s first 7 years or so.

“Touch” type interactions will have a huge impact as well. But let me expand that to say “hand and mouse interactivity”, more broadly. Right now, the closest thing we have to a touch interface is asking people to walk around. It’s like a primitive mouse. Step on this teleporter pad. Walk left or right to tilt this hover platform.

What we really need is to be able to use a mouse (or laser pointer in VR mode) to point and click. Ideally, to be able to register mouse/controller movements, too. Imagine if my hover platforms could be steered just by waving your hand or moving your mouse around. Combine that with precision pointer clicking (“touch”) and you can create complex UI panels.

One thing I want to advocate for, that Linden Labs may balk at, is text-on-a-surface. Linden Labs never really implemented this in Second Life properly, so people had to come up with torturous, clever solutions. Sadly, one of the biggest problems is that they don’t scale well to multiple languages. Ideally, Linden Labs would implement Unicode text as a form of dynamic texture. Including basic text formatting (font sizes, italics) and hyperlinks.

Let me add at this point that Sansar’s scripting capability is amazing in many ways. I don’t want to sound negative by just mentioning new features. One thing that blows my mind is how fast scripts can run.

Granddad: I think most of us programmers are glad to have your willingness to make available what you have programmed and also your willingness to help in the forums and Discord. Any last advice to the Programmers?

Galen: I guess the first is to approach it with a positive attitude. I’ve noticed there are quite a few people who complain loudly about the things Sansar doesn’t have yet. Not that asking for things is a bad idea, of course, but when you conclude that Sansar is doomed to failure because of those limitations, you’re bound to give up trying to create anything. I get frustrated by Sansar’s limitation, of course, and I put in my feature requests and bug reports. I try to make sure they are down-to-Earth achievable, too. But most importantly, I prefer to look at what we have available right now and say to myself: what cool things could I do with this now?

Honestly, that’s the main reason I’ve been so focused on dynamics in the short time I’ve been in Sansar. I don’t have a lifelong passion for it. It’s just that the combination of rapid script execution and a basic ability to move stuff around led me down that path. In a way, I’m grateful for some of the limitations. If I could do all the basic things I think Sansar’s script API should offer, I would probably be focused more on business systems and less on fun dynamics projects.

Another piece of advice for scripters is: reach out to other creators. Make friends. Offer all you can to help them. Honestly, most of us are stuck in our hidey-holes creating stuff on our own. This isn’t always good. One sad outcome is that people seem to be flexing their own skills brilliantly and not really collaborating enough with one another. Collaboration should be one of our rallying cries for the rest of 2017. Linden Labs should rush to support and encourage it.

Granddad: Great advice. One last question, If we came to your house for dinner, what would you prepare for us?

Galen: Man. Save the hard questions for last, will ya? Just going on what I have in my kitchen now, I’d probably make fresh tacos from scratch. First thing that comes to mind.

Granddad: Sounds good. We will be right over. I will bring the Cervezas.

Galen: Awesome.


Pick of the Day: Clockworks Club

Yes, I know, an older version of the Clockworks Club was my Pick of the Day back on August 8th, 2017. But Galen has updated his experience and it’s just so good it’s worth a revisit.

Clockworks Club 17 Sept 2017.png

In the description of the new Clockworks Club experience, Galen says:

This rave-like club design demonstrates just some of the incredible dynamics you can have in Sansar, even before animated mesh makes its debut. All the animated objects keep perfect time with the dance music. Learn more about Clockworks scripts at:

Here’s a link to Galen’s scripts available through the Sansar Store.