3D Asset Export and Sharing

There have been concerns expressed about getting from a point cloud to imported animation data tied to a skeletal model.

I accept that this may not be trivial…particularly tying a set of points in a moving cloud to control points for bones in a skeletal animation.

Collada

It does appear that there are defined interchange formats (I’ll have to look and see if these are supported bu Unity and Blender) that may make this more straightforward. Being able to export the skeleton for an animation and then inhale it into a processing application seems helpful. Being able to tag points in a cloud for consumption by Unity seems even more helpful.

I looked here and got a pointer to collada which appears to be getting developed by Khronos at this point. This appears to be a general purpose, open, XML based standard for interchange of 3D information. There is also an OpenCollada code archive out there…that link appears to be dead…but it is on GitHub and a project home page.

Wikipedia article here.

FBX

Filmbox is a more proprietary option with information at Wikipedia, Blender, More Blender, and AutoDesk (who created it and still owns the format). The AutoDesk link connects to SDK downloads that support C++ and Python manipulation of these files.

More Motion Capture Thoughts…

Looking at cameras and possible target parts.

The solutions I see out there tend to use active or passive targets attached to the actor and tracked by multiple cameras. Most seem to favor faster cameras rather than higher quality cameras.

I’m looking at the $8.00-ish Fosmon USB 6 LED 1.2 Megapixel USB PC Webcam and the $7.00-sh Sony PlayStation Eye for fast capture. The Fosmon camera also seems to see in IR and thus may be usable with high output IR LEDs for tracking points. The PS3 Eye camera is fast and there are directions on the web for removing the IR filter to make it IR sensitive as well.

I’ve got a couple of Logitech C930e cameras already to cover the slower but higher resolution (and visible light) part of the spectrum. When the budget recharges I’ll likely pick up a third (they’re also tripod compatible which is nice) to better cover registration of objects in three-space. I’m also considering the Microsoft LifeCam HD-3000 as a middle of the road option…much cheaper than the high end Logitech, but likely faster than it as well (at 720 rather than 1080 resolution).

I’m really thinking that an array of several different cameras might be interesting…with faster and more plentiful cameras providing tracking and disambiguation and higher resolution cameras locking samples more tightly in position when images are available.

I’m also wondering whether a visible timing device might help. Thinking an rPI driven grey counter facing in several directions and running at a decent clip so that each camera can pull the timing information for its images from the picture taken.

Add in some IR and/or visible LED targets powered by something small and capable like a CR2032 battery or two and I suspect that interesting things may be possible. Whether it works or not it seems like an interesting challenge to take on and the learning experience alone should be interesting.

If the cheap cameras work decently (I’m ordering one of each to try out) then I’ll probably pick up a group of them to work with. I’ll probably try to see if Malcolm can 3D print some sort of appropriate brackets for the cheap cameras as they do not have screw mounts (and a fixed mount would be nice to preserve calibrations between runs). First pass is likely to involve several cameras and OpenCV acquisition of data to track a single beacon.

If that works out, I’ll likely move to fabricate a timing device that can provide the time information to the frames and see how that goes. I’d like to avoid the frame synchronization game that I saw one demo engage in where all cameras are wired into an electrical sync system. Embedding the timing information into each frame optically and using that to place them in sequence seems much better. I’d rather have a few extra cameras to fill in the gaps than run wires everywhere.

If all of the above goes well, I expect to move to looking at recording data streams separately and then doing the beacon registration offline. On the fly operation would be nice, but the power of handling things separately seems likely to be easier and allow multiple computers to get involved in the recording process to ensure high frame rates and few drop-outs.

Unity Stars and Textures

This weekend, Malcolm and Sam came over for a day to move our various Unity investigations forward.

Malcolm made some very nice pieces of furniture and architectural bits. I think the end result has much more feeling of place and I’m moving forward from there.

The Cluster Control Room

Sam was working on his own project and looking at getting his motion working properly on Daydream with the Daydream controller.

I added some interactivity to my prototype. Attaching a ‘stick’ to the controller and hanging a small sphere with a collider attached makes it straightforward to select objects by touching them with the stick. It took a surprisingly long time to find the appropriate code to implement haptic feedback when a star is touched. I’m still looking at adding a short positional sound queue on touch as well.

The code lives on my github account here. This supports Vive only (I think) at the moment. It certainly supports Vive best. At some point I’ll likely look at making this work with DayDream and flat screens.

Some Sample Textured Spheres…

I grabbed some textures from around the house and yard and slapped them on some random spheres and capsules. Those are here and there are separate branches for DayDream, Vive and flat screen (master). The Vive version looks much better than the DayDream version and I expect that is to be expected.

I spent some more time chopping up texture tiles. Not a lot of time to clean them up though. I really need to better understand the impacts of the various extra texture functions that are available. I think there are some options missing from the default material such as displacement maps that can genuinely move vertices. Lots to learn along the way and getting there with the Vive is pretty cool.

Watching more Unity Video Sessions

I’m looking for more best development practices ideas, future direction information and some bits on existing subsystems so I expect to spend a chunk of today watching sessions from 2018 ‘Unite’ conferences and related video segments. I’ll likely add links and comments here as I run through them…

Yesterday

Yesterday I watched a bunch of videos roaming around the unity event system (a bit disappointing), possible enhanced event systems (pretty interesting), futures (ECS and the job system) and some singleton/scriptable object bits. I ended with a unite session that also touched on some best practices areas where I want to see more.

Unite Austin 2017 – Game Architecture with Scriptable Objects – A talk by game developer Ryan Hipple from Schell Games. It covered quite a bit of best practices material with extensive suggestions for ways to leverage tools in Unity to provide developer accessible dependency injection in game internals. This talk got me started thinking that there might be a decent amount of best practices information available out there.

Unity3D Mistakes I wish I’d known to avoid – This talk covers a number of built in facilities that can provide capabilites without scripting involved that the presenter has seen many people implement in script. Understanding the tools that are already available in Unity as it currently exists is clearly worthwhile and likely a bit challenging as this is also clearly a moving target.

Unity ECS Basics – Getting Started – With 100,000 Tacos – A quick demonstration of the entity component system. This does seem like a nice new facility to accelerate things in Unity games. At this point (not sure about in the 2019 beta) it seems to lack physics and some other functionality that are presumably in the works. This and the jobs system appear to be the next frontier for unity game development.

Today

I expect to poke into scriptable objects, perhaps a little ECS and Job stuff, as much best practices advice as I can find (likely a bunch of unify sessions) and some serialization (particularly saved game issues where the saved game can be sent to a web server) and web remoting if I get to that.

Introduction to Scriptable Objects – Looking at the Unity provided introduction to scriptable objects. These seem to be largely game objects without transforms essentially. Data wrappers that can hold game related information without pulling in the rest of the overhead of a full game object.

Interesting serialization blogs here and here and here .

Serialization in-depth with Tim Cooper: a Unite Nordic 2013 presentation -Hopped over here from the above presentation…older but still interesting. Shows some of the attribute controls that make finer grained serialization possible.

I suspect that much of this material has evolved since 2013 but I’m looking at this as a baseline and some visibility into the back-ends of things. This talk provides lots of detail about the advantages of using scriptable objects for stored data in a unity project. They are far more reliably serializable than game objects and editor to game transitions won’t properly save and restore game objects in many cases.

The presenter is also discussing custom editor UI implementation. Look at CustomPropertyDrawer. Need to look into assets and SubAssets, [serializable] and asset trees. AddObjectToAsset(…). Need to remember HideFlags. Interesting items: HideAndDontSave. Selection.ActiveGameObject().

Best Practices for fast game design in Unity – Unite LA – More best practices. This one is oriented towards fast prototypes of mobile games so I’m suspecting that it won’t apply well to my personal use-cases.

Mentioned AssetForge as a way to build models. Potentially interesting. Houdini. mentioned. Jenkins builds for Unity games also mentioned. Cinemachine Odin Amplify Shader Effectcore.

Unite 2016 – Overthrowing the MonoBehaviour Tyranny in a Glorious Scriptable Object Revolution – Talk by the head of sustaining engineering at Unity. A detailed look at ScriptableObject. I feel as if I’m definitely getting closer to understanding how things hang together…not there yet, but closer.

Scriptable object don’t get most callbacks. Same type in the core system but cannot have gameobject or transform attached. Scriptable objects don’t have to get reset during play mode transitions. OnEnable, OnDisable and OnDestroy only. ScriptableObject.CreateInstance<>(). AssetDatabase.CreateAsset() and AssetDatabase.AddObjectToAsset(). [CreateAssetMenu]

Empty scriptable objects as extensible enums. Derivation from a common base? JsonSerializable by JsonUtility and as built-ins. Look at LoadAsset<>(“”); FronJsonOverwrite(json, item); Can patch part of an object with this.

Example of building a robust singleton ScriptableObject that recovers properly on reload. The demo project here looks kind of interesting…on bitbucket.

StartCoroutine() looks interesting.

Interesting session. Getting enough food for thought to make it worth mucking about with some code soon.

Unite ’17 Seoul – ScriptableObjects What they are and why to use them – The next year’s talk on scriptable objects…

AddComponent() for monobehavior. Monobehavior is always attached to a gameobject and transform along with any other components attached. [Range(min, max)] as ranged variable. Look at CreateAssetMenu attribute. Custom property drawer.

ScriptableObject.CreateInstance()

AssetDatabase.CreateAsset() or AddObjectToFile()

Diablo: A Classic Game Postmortem – A nice break hearing the lead developer of Diablo talk about the development of the game…

I also watched a session on game pitches that I never expect to have a use for. Playing with games in my spare time appeals, but I can’t currently see any chance that I’d want to try working in the industry.

Interesting blog post What is the purpose of ScriptableObject versus normal class? Talks a bit more about scriptable objects.

Fast worldbuilding with Unity’s updated Terrain System & ProBuilder – Unite LA – Interesting items here as terrain and such makes for interesting tactical and strategic games. Assets, tiles and patches oh my!

A rather cool set of tools I had not encountered before. Looks like an amazingly quick way to create credible terrain. Got to look at some of the relevant demos as well.

Probuilder looks like an interesting tool for creating geometry and painting geometry. All free asset store items. Probuilder, Progrids, Polybrush. Currently available in the package manager except for the brush. Looks as if this provides a good bit of capability to create and modify geometry in the smaller scale than the terrain tool. ProBuilder-API-Examples looks like the next step to allow this stuff to happen at runtime.

Introducing the new Prefab Workflow – Unite LA – The first in a set of ‘Editor Sessions’ grouped on youtube. I don’t expect to have time tonight to watch all eight of these, but hopefully I’ll get to them in the near future.

These are the workflows that exist in 2018.3 that we’re currently working with so this is likely to be very relevant.

First item is true prefab nesting support. Variants were mentioned, but I think they’ve been around longer than the nesting support. Prior versions appear to have exploded prefabs within prefabs when apply was clicked. Variants as derived prefabs essentially…the overidden parameters stay overidden but changes to the base propagate.

What are prefab models? Blue cube with a page symbol. Looks like they’re an early import thing for models coming in from outside. Ah…looks as if variants allow external meshes to be imported in a way that they can still be replaced after the prefab is rigged.

Improved Prefab Workflows: the new way to work with Prefabs – Unite LA

Material I Don’t Expect to get to Tonight…

Unity Cinematic-ish Tools

I was bumping around youtube and the Unity site and ran across references to the Timeline feature and the free Cinemachine plugin.

Timeline

Timeline has an intro video here and allows recording of scripted motion with triggered playback. It seems to have originated as a way to play out cut-scenes, but looks like it would also be useful to provide background activity in a scene with objects and ‘extras’ moving about to provide additional color.

I probably won’t play with this too much this weekend as I’ve got some work items to get a few hours on and I want to look deeper into the areas that my VR board-game needs.

Cinemachine

Cinemachine is a free camera management plugin. This looks like a wonderful way to manage a dynamic camera following a moving object. You lock the camera to a transform and set its parameters to keep the following process fluid. The introductory video is here. This one is also likely a ‘later’ item as I’m not currently planning much in the way of free motion or background animations in the cluster project.

Transitions with Animation

Interesting video showing how to use animations to create no-code transitions.

Scriptable Objects and Game Architecture

Watching this video on scriptable objects and game architecture. It seems as if I could stand to know more about these and their place in unity game architecture. I’m actually interested in non-unity assemblies as bolt-ons for a unity game. These would allow ‘business logic’ to be provided externally and tested using nUnit or something similar while providing services to the game as a black-box-like component. As they’re C# they should be readily debuggable along with the built in C# code in game objects and such.

This is one of the big steps to take…I would like a better feel for how the unity system works best. Building flexible, scalable things is always more fun…

Event System Ideas

Here is a talk that details an event system where the event grouping is handled by the type of the event object. The listener subscribes to notification based on the type thrown and the core event system throws based on the type passed to the event firing method. Keeps things clean and moves type mismatch errors cleanly into compile time.

There may be downsides (and I need to look more closely at the current unity event system as this may be similar to what we have in the 2018.3.6f1 version…

I think I’m going to wind up watching many more of these sessions to get a better feel for what works well in unity-land at the architectural level and from a finer grained point of view.

Working Through the Technical Side of Unity

Sam, Malcolm and I have been diving into the more technical side of Unity development for the last couple of weeks. I expect this will go on for a while to come as well. There will probably be items on this side now and again as the Cluster game hits plateaus along the way and there are graphical bits and game play decisions to talk about.

Currently the technical content is being written up on my career blog. Perhaps a less than ideal naming choice as it gets most of the hard technical content yet I’m never likely to take a job in the games industry.

I’m currently working out a new scheme for partitioning up the pieces of the game and making the cross platform support (Daydream VR, Vive VR and flat screen PC) workable. I’m also likely to rebuild some of my spaceship assets as run-time created prefabs rather than manual prefabs.

Cluster Game Description

Inspired by SPI Stellar Conquest but with a somewhat different spin as this is computer mediated.

I’m looking to keep the game rules relatively simple so only a limited number of tech options, a few ship types, a couple of planets per star (tops). If all of this comes together well, I might add a few embellishments to the thing later on.

  • Multiplayer (up to four initially, likely two in early development, more possible later)
  • Semi three dimensional star placement.
  • Three kinds of warships along with scouts and colony transports.
  • PC screen, daydream vr and vive vr support initially. Might look at direct web interface as well (three.js perhaps) at some point.
  • Industrial production system.
  • Build ships.
  • Develop technology.
  • Grow populations.
  • Goal is to dominate the star cluster.

The Rationale

The ancients built massive stargates capable of flinging ships far across the universe to places far beyond the reach of conventional warp drives. The cataclysm that ended their presence in the galaxy may have destroyed their planets but their gates remain, orbiting stars amid the rubble of their shattered worlds.

No one understands why but these gates open at times for a short span providing access to distant parts of the universe. Many of the younger races station small colonization fleets near known gates in order to colonize the far flung places that a gate opening gives access to.

When the gates open, several gates generally connect to the same target area. Only a few ships can make it through before the gate closes so each race engages in a scramble to dominate the new star cluster before the others can gain a foothold. The gates only allow limited technology through (whether this is an inherent limitation or a security feature, no one knows) so the initial task force consists of a few simpler vessels.

Nothing prevents the construction of more capable ships and equipment once established colonies can produce the necessary infrastructure. This adds another facet to the struggle as each species works to enable use of the technologies they brought with them, in this new place.

In the end, the victor will eventually build the tools to force the gate open to their home galaxy and re-establish contact and trade. By the time this task is complete the control of the cluster will have been long ago resolved and a thriving web of colonies established.

February 7, 2019

Looking at Blender and Unity as tools.

Spent some time last night playing with prefabs for the Cluster game I’m prototyping. Not too much detail yet, just looking to create prefabs that are distinct enough to make it clear what is going on with each and have them look interesting.

Got the google daydream headset in from Amazon and got my phone configured to use it. So far I’ve only loaded the software on my phone and played with it a little bit. In the short time that my wife and I played with it, it burned through 50% of my phone battery and left my Pixel XL quite warm. Eventually this may be the item that causes me to upgrade phones…

At lunch today there was a discussion about the awkwardness involved in working with blender and some discussions around working with UV mapped textures directly in VR. Potentially interesting thing to try. Should be possible to implement a visual airbrush…particularly with the vive where the artist can walk around the model being worked on and see it from various angles. This is an interesting idea, but if I spend any time on it at the moment, I’ll never complete the game work I’m messing with so on the shelf it goes.

Spent some time looking at game rules last night…

I spent some time looking at miniatures and wargame rules last night (and bought a discounted Unity book from Packt that I’m hoping will give me more insights into areas of interest).

I need to take the next step on build-out of my ‘Cluster’ game in the next few days and generate a population of stars from a prefab and then get hit-testing of mouse clicks to star working. I think I have most of the bits in had to carry this off, but I need to test it out.

In the initial pass, I’m not looking to implement anything overly fancy in the star generation and positioning code. I may even simply walk them around the board with reckless abandon at first.

I found some examples here that seem to show how to take a mouse click position on the UI and hit-test the viewport normal from that position. This code even does (or suggests) the zoom function I was thinking about implementing in order to view individual systems.

I expect in the longer run, there will also want to be various control panels supplied with information that is more classically UI style to make managing the overall effort easier. Ideally this could be done without these, but I’m not quite sure how to get there at this point.

I think I may set up the board game tonight and look at running a few turns solo just to get back into the feel of the game. If I do, I’ll post pictures of the board with counters on it and related items.