Mailbag: Civilization and ContentRefs

Sometimes, there are questions. And sometimes they happen to be in e-mails I receive through this blog. I usually take the time to answer them if I’m not too busy and occasionally, these answers can get very long. This time it’s about Civilization and referencing content in Duality.

Read more …

Prefabs: Implementation details

During my time at Limbic Entertainment I mostly worked on a project that was using the Unity game engine. In my eyes, Unity is a great piece of game authoring software, but nobody’s perfect; there still were some missing or imperfect features. Take the Prefab system: Its great to have something like this and it works flawlessly in most cases. Want to use a specific enemy type over and over again? Just make it a Prefab and re-using it boils down to a single dragdrop operation. When changing the Prefab later on, all instances are affected properly. But here’s the imperfect part:

Read more …

Serialization pitfall: Post-Deserialization

If you use .Net Serialization, especially Deserialization, you might want to have an object perform a specific action as soon as it has been deserialized, initialize some cache data, resolve references or something.

Read more …

Clone Wars

Tightly connected to Prefabs is the ability to clone GameObjects. If a Prefab is just a boxed and isolated GameObject hierarchy, instantiating a GameObject from a Prefab means to create a deep copy of the internal GameObject and pass the cloned version as a return value. Cloning an object might also come in handy for actual ingame usage, but either way, the possibility to do that is absolutely necessary.

But how?

Read more …

Prefabs and Serialization

Component-based GameObjects are a really cool concept. However, when it comes to setting one up, you’ll have a lot more to do than in a classic inheritance tree approach. In the latter one, something like that might be sufficient:

When trying to do the same with a component-based approach, there’s a lot more to do: Create a GameObject, then create needed Components one by one, setting their properties to the appropriate values.. wouldn’t a shortcut be handy? This is where Prefabs come in.

Read more …