Tutorial 1: Attaching parts rigidly

Here’s the first in a series of tutorial videos I’m making that will explain in more depth how to build constructions in the game. This one covers rigid attachments, that is, how to connect parts together rigidly.

The next one will talk about rotating (i.e. hinged) attachments.

Alignment indicators

When aligning a selected part to another (frozen) part, prior to attachment, the game now shows where the available attachment points are.  These indicators reflect the type of attachment, either “surface” (e.g. as in block to block) or “interior” (e.g. as in block to axle).  The idea is that this should make it easier to accurately position parts where you want them.

Other stuff

In order to implement the alignment indicators I had to refactor a bunch of code, one side effect of which was that I was able to slightly reduce the per-rigidbody network data by calculating more stuff on the client side.  I also fixed a bug in explore mode, that was causing parts to not spawn.

Playable build – updated

Playable build – updated

Playable build – updated controls

Playable build – updated controls

New time-of-day / sky system in game

I felt like I needed a change after being bogged down with the construction mechanic and physics issues for so long, so I decided to do some rendering stuff over the last week or so.  As of the latest build, I have integrated Mod Monkeys’ fantastic Time of Day system (available on the Unity asset store: http://u3d.as/4fg) into the game.  It implements atmospheric scattering, dynamic time-of-day, clouds, weather etc. and is really nicely done, a quality asset.  It wasn’t quite a straight drop in for me, as I had to apply the scattering to my terrain shaders and make a couple of minor mods, but overall it was very easy to integrate.  So far I have the time of day changing as you play, but the weather doesn’t do anything yet, I’ll have to look at hooking that up later.

Next up for me is back to the construction mechanic.  Still no word on that Unity collision bug…

Non-collision bug update

I’ve been away on vacation for a couple of weeks, but after getting back I’ve been looking further into that non-collision bug. After some further investigation, it turned out that not only was my “on collision stay” callback not being called, but collisions between the parts were not happening altogether. I also managed to reproduce the issue in the editor as well as standalone / web-player builds.

I haven’t found a work around yet (not sure if I even can), but I put together a special cut down version of my game project and sent it off to Unity to help them reproduce the bug. In the meantime, the game is still broken unfortunately, the only way to get around the issue is by removing and re-adding parts to your construction until Unity physics corrects itself. I hope the Unity devs can fix this issue soon, but I guess we’ll just have to wait and see!

Release build only, game breaking bug, oh joy

Gah, bloody typical.  It’s Friday evening and I’ve just discovered a game breaking bug.  In both the standalone and web-player builds, it seems Unity sometimes decides not to call my “on collision stay” callback, which breaks the whole construction mechanic – it means you can’t attach parts together!  I’m not sure how long it’s been like this, I usually test the game in the editor, which naturally enough doesn’t have this issue.  Lesson learned: I really should properly test the standalone builds more often!  Hrm, it could be a while before I figure this one out… 🙁