News for hackers. Stuff that matters.
Re:The IDE as a value by snprbob86 on Friday January 25, 2013 @02:14PM (#5117104)
> games built on top of Unity

For the curious, here is Unity's components reference page:

http://docs.unity3d.com/Documentation/Components/index.html

Re:The IDE as a value by reitzensteinm on Friday January 25, 2013 @03:07PM (#5117345)
Though, if anyone's actually interested in coding a game in this style in Unity3D, I would heavily recommend against using Unity Components directly if you're at all concerned about performance and code clarity.

Instead, have one MonoBehavior and a base properties class which you can delegate your events to (usually only a half dozen). That way you're not relying on undefined behavior on the Unity side, and you can, eg, new and clone properties without issue.

I use something similar for Under the Ocean (http://www.underthegarden.com), which has to deal in worst case with hundreds of objects with potentially tens of behaviors that cannot be known ahead of time.

The system works damn well - for my type of game, perhaps it's the only way to do it. But performance is forever a concern. Monobehaviors are nice (eg, you can edit its variables in the editor), but they're heavy weight.

Re:The IDE as a value by Impossible on Friday January 25, 2013 @05:34PM (#5118099)
There are shipping AAA games and game engines that use some variation of a component system for entities, including Unreal Engine 3 and CryEngine.

In practice, "component entity system" simply means favor composition over inheritance. There are different ways you can architect your code to fit the definition, some of them efficient and cache friendly.

Re:The IDE as a value by Tuna-Fish on Saturday January 26, 2013 @12:31AM (#5119383)
And to elaborate more: The reason for this shift is that the current-gen consoles (xbox360 and PS3) are really, really bad at random access into memory.

Chasing pointers on PC is bad, chasing pointers on them is suicidal. With them, it's better to do a linear copy of ~3kb than it is to reference one more uncached pointer. And this is especially bad because they don't have any kind of decent prefetchers -- if you haven't actually touched an object, it's probably uncached.

Becaus of this, if you use traditional OoO to structure your code, you leave an order of magnitude or more of performance on the table. And since the CPUs are slow as it is, you can't afford to do this.