Page 1 of 2

OpenSimEarth rumblings...

Posted: Fri Sep 11, 2015 9:46 pm
by chriscalef
OpenSimEarth Approaches!

TL;DR: I have a T3D build on github that incorporates the animation recording and saving functionality from Ecstasy Motion, so you can blow up ragdolls and save them out to dsqs.

So, this hardly qualifies as a proper "Show-off" yet, it's not anywhere near done or anything, but since it's been pretty quiet around here, and I did just commit up some code that could be potentially useful to somebody, I thought I'd share a bit about what I'm doing anyway.

Before I forget, the repos in question are here (for the engine): ... _sim_earth

and here (for the game directory):

Don't get too excited yet, like I said they're in no state for distribution... but bookmark those babies, I have a LOT of plans for them!


(Sorry for the most boring screenshot ever, but I'll explain the one interesting feature in a minute.)

Sooo.... what am I doing, anyway?

Basically, if you've been around these parts for any length of time, you must have heard me go on and on about Ecstasy Motion. (If you're a newcomer, go check out my blogs at, if you have all day.) Long story short, the idea has always been to make a T3D build enabled with ragdoll physics, animation editing capability, and a bunch of AI tools like navmeshes and behavior trees, and aim it at the independent filmmaker market, to generate animations for export to Maya or other movie making software. My projected price point has always been in the $99 to $199 range.

This has appeared to be a viable plan for some number of years, even though I knew it was taking me way too long to finish, but recent research has convinced me that at least in terms of Maya, I may have less of a niche than I previously thought. (Hint: google Miarmy).

No final decisions have been made, but at the same time, I've also been finding myself very powerfully drawn to my OpenSimEarth project idea, starting with this blog from a couple of years ago:

And then more recently this one:

Meanwhile, however, I'm still working on the movie project that has gone hand in hand with EM from the beginning:

This film still needs the logic from EM in order to be completed, and I'm still convinced that there is a lot I could offer to other indie film producers. However, I've decided to go ahead and merge as much of my EM functionality as possible with my OpenSimEarth branch, making it fit in more properly into the engine, and make as much as possible available to Torque developers. Wherever relevant and desirable, I'd love to PR specific items into the T3D trunk.

So anyway, back to that boring screenshot above. The one new thing you can see there is a "Scenes" dropdown menu, with "+" and "-" buttons next to it. What's going on there is the ability to load and unload (unload isn't plugged in yet) physicsShape actors into a scene, from my sqlite database. Once there, the new and exciting bit as mentioned above is the ability to record sequences. A call to my script function "startRecording()" will cause all actors to start saving their current node rotations and base node translation to internal arrays. Then a call to "makeSequences()" will cause them all to save these rotations into dsqs, named after their database sceneShape id.

This ability is not limited to physics ragdoll effects, you can also use it to record an actor running around the world and performing various actions, such that you could play back a whole scene from only canned anims and not have to run the physics and AI on those characters anymore.

It may seem crazy for me to be giving away the crown jewels of EM like this, but I'd rather have the participation and help of the Torque community than whatever money I could make off of this code around here. I am considering adding something along the lines of "Pro Tools" for OpenSimEarth, however, where I will enable export to FBX and/or BVH, and that could be where I get to charge my hundred bucks or so from the indie filmmakers.

Anyway, that's basically it for the moment. Expect more functionality and some working web presence at sooner or later.

And, because you made it this far, here's another screenshot, this time with some violence in it. I did shoot those guys, and I'm not even sorry.


Re: OpenSimEarth rumblings...

Posted: Sat Sep 12, 2015 7:48 am
by JeffR
Wow, very nice.

The 'record as sequences' thing sounds pretty similar to Valve's method of doing the really big showpiece physics stuff in the HL2 episodes, where you run the physics sim with hundreds and hundreds of parts in a complicated ordeal, and then bake it all out to a canned animation for ultra-lightweight playback during the actual game.

Definitely something that a lot of people could find useful!

Re: OpenSimEarth rumblings...

Posted: Sat Sep 12, 2015 5:59 pm
by chriscalef
Ah cool, I didn't know they did that in HL2. But yeah, that's the idea!

Re: OpenSimEarth rumblings...

Posted: Sat Sep 12, 2015 7:24 pm
by Duion
What features are currently in there and how can I test them?

Re: OpenSimEarth rumblings...

Posted: Sun Sep 13, 2015 1:26 am
by JeffR
Ah cool, I didn't know they did that in HL2. But yeah, that's the idea!
Yep, they talk about it in their dev commentary.

Skip to 4:10 to see the bridge collapse, and then shortly after he goes and activates the dev comment node that talks about how they did it, but the tl;dr is they simulated a couple hundred physics objects, then baked it into a skeleton animation so it could actually work on the average gamer's computer.

Good stuff :)

Re: OpenSimEarth rumblings...

Posted: Sun Sep 13, 2015 2:14 am
by chriscalef
Nice, yeah that sounds like a much larger version of something I did with a door once:

I'm also envisioning my stuff here as being useful for baking out AI behaviors, for ambient background anims, eg a field full of rabbits foraging and occasionally hiding or running away or something - you could design a fairly intensive behavior tree for a lot of agents, and then bake out a good one and turn all that off at game time.

Re: what features are there and how to test them... my apologies but the most important feature of OpenSimEarth - the flightgear-based terrain paging system - isn't really packaged up and ready to distribute at the moment, I've had it packaged up before but I'm back into a bit of a mess with it at the moment. Hope to have it ready to go in the next couple of weeks though.

In the meantime, what you can do is download the game directory repo, and run the executable (OpenSimEarthGame.exe), and then pick Empty Room for your mission. You should get a flat plane with a little tower thing on it with a messed up texture (orange no material). :-P

Once there, you should be able to open the world editor and in the library tab, find a new dropdown box, with my two scenes named PRTL_BLDG and PRTL_TEST. Both of them simply create a handful of my Michael4 actors (dude in black underwear), with a very simple BadBehavior behavior tree attached that has them run back and forth between the one health object and their starting position, sort of.

Not too exciting at this point, but if you go into openSimEarth.cs, line 300 or so, and uncomment the following:

//schedule(40, 0, "startRecording");

Then you will start recording everything that your actors do. At this point you can shoot them in realtime, or go into the behavior trees and add setDynamic(1) somewhere to make them ragdoll, or add forces to them, or add more complicated behaviors, and all will be recorded.

When you are ready, then you can hit "alt g" or type stopRecording() into the console, and then after that hit "alt b" or type makeSequences(), and then you will get a dump of scene sequences into the folder art/shapes/m4_optimized/scenes/ and then a number representing the database id of your current scene.

Also, you can make more scenes and sceneShapes in the database itself, best way to do that is to open the sqlitestudio executable I included with the build in the main game directory.

Finally, I also created a handy little system called actionSequences, wherein I make it possible to assign a particular sequence name at the shape instance level to a generic category, ie you can say %shape.setActionSeq("run","my_particular_run"), and then later on in the code or in behavior tree scripts you can call actionSeq("run") without having to know or care which particular run anim this shape is currently using. I find it makes a lot of things easier, and you can expand the system infinitely with as many actions as you like.

I fixed the scene unload button now as well (the "-" button by the dropdown) so be sure you do a fresh update before you try anything. I also added a global position per scene, which gets added to the local position of each scene shape, with intent that I can start making "scene templates" where you could reproduce a common scene with it's common shapes many times over on a map. (i.e., fill in a single family dwelling with a typical family doing their typical things, in whichever house you walk into.)

My next easy low hanging fruit trick is going to be loading/unloading scenes based on proximity, so you can cross a landscape and instantiate/deinstantiate little active scenes as you travel.

Many apologies if you can't get it to work at all, this stuff is beyond bleeding edge at the moment, but do let me know and I'll try to figure it out for you!

Re: OpenSimEarth rumblings...

Posted: Sun Sep 13, 2015 7:28 am
by chriscalef
Okay just as a quick update, the other low hanging fruit is accomplished. You can now load scenes by running around the world and getting within (currently) 5.0 meters of the scene's origin. When you get up to (currently) 20x the load threshold, so 100.0 meters, the scene unloads.

Re: OpenSimEarth rumblings...

Posted: Sun Sep 13, 2015 11:14 pm
by HeadClot
Questions for you @ chriscalef - Do you have any plans on porting Open Sim Earth and Ecstasy Motion this over to Tourqe6 as a Plugin or what ever?

Just curious :)

Re: OpenSimEarth rumblings...

Posted: Mon Sep 14, 2015 2:30 am
by chriscalef
Oh, absolutely! I'm just waiting for Andrew to call it ready. :-)

Re: OpenSimEarth rumblings...

Posted: Wed Sep 16, 2015 9:23 am
by HeadClot
Oh, absolutely! I'm just waiting for Andrew to call it ready. :-)
Awesome :)