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.

More Games in my Collection

The bigger, mostly newer games I have.

Star fleet battles. Big, complex, huge number of ships and options. I haven’t had anyone around who knows the game in decades and it is a really hard game to get people started on with the rather massive basic rules set.

My original star fleet battles set. Simpler rules from simpler days. The game has become so much larger since then. Better balanced and with far more options. I haven’t cut the counter sheets for the newer edition as I have plenty of these older counters to use should the opportunity arise.

Federation commander is a simplified version of star fleet battles. I picked it up with hopes that it might be a simpler option. May be at some point.

Federation and Empire (and the earlier Federation Space) are both strategic level old series Star Trek combat. A complex game and one that I’ve never yet had a chance to play against a real opponent. Seems like another game that badly wants computer support to really play. It would be pretty amazing to get a real play through of this though.

And StarFire is the truly huge scale strategic game with massive scope but also massive complexity. On balance I’ve found this game fascinating to read through and containing well though out technologies and mechanics, but without computer support I can’t really imagine finding the time to play it.

Traveller isn’t primarily a wargame, but it is full of ideas for space game trading and space combat. Add in Striker with tactical ground combat and the possibilities for inspiration are pretty extensive. Lots to play with here.

I’d also love to run a traveller game sometime. Perhaps far in the future in retirement…

The core of my wargame collection

Here’s the core of my wargame collection. These are all rather old and I still regret not having bought more back when they were readily available (but the back then I had much less money to spend).

I also had two of the core GDW Europa series games, Fire in the East and Scorched earth covering the eastern front through the entire second world war. I tried setting them up to play with a friend and circumstances resulted in the counters and some other related parts being left with the friend when we lost touch. I still might try to replace these at some point, but that is likely to be pretty expensive.

I also have a batch of metagaming micro-games that are interesting.

I expect that my copy of Chitin-I is also around somewhere but it isn’t with my core collection. I’d be interested in getting my hands on a copy of battlesuit if circumstances permit.

I have an extensive starfleet battles collection including a full set of federation and empire. I’ve played a lot of SFB in the past but never yet found an opportunity to try out F&E.

I have various editions of starfire around though while the game is fascinating to read, I’m not at all convinced that it is playable without a major amount of computer assist.

I expect to be trying to build some simple wargame-like games using unity over the next year or so. I expect to take inspiration from the games in my collection, but as these are still under copyright I’ll not be directly cloning content.

I expect to post some more information here as I get to coding and I’ll try to post some more detailed comments on the individual games as I get to them and time permits. I’m also making a concerted effort to ensure that all relevant parts are reunited with their game boxes.

Permeability and Permittivity of free space…

I’ve known for a very long time that the permeability (µ0) and permittivity (ε0) of free space determine the speed of light in a vacuum. I had not realized that this would interact with E=mc2 to alter the mass/energy relationship and thus the balance between matter and energy in the universe. This would seem to have some strange implications (aside from all of the other bad things that happen if the fine structure constant is not a constant) for changes to the way the universe works if either of these constants changes over time (or perhaps even in very high energy environments as were present in the early universe).

Ice VII!

Interesting new solid phase for the water molecule mentioned at ArsTechnica.

Not an issue here on earth, but the potential for very high speed transitions from liquid to solid phase (and I have to wonder about energy and volume differences in such cases as well) makes for interesting movie plot options…