Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Shael

Member Since 30 Nov 2004
Offline Last Active May 21 2013 11:46 PM
-----

Topics I've Started

Multiple Inheritance vs. Composition

09 October 2012 - 12:32 AM

I'm curious to know if other developers think multiple inheritance is bad practice and if composition should be used instead or if it's a case of "the right tool for the job". The question came about as I recently started work on my entity system again and have found myself with an entity class that has grown inheriting 4 other objects - most times I've only ever needed single inheritance. In my mind this doesn't seem too bad in terms of what is being inherited but I thought I'd just see what others have to say and perhaps improve on my design/skills.

My entity class at its most basic:

class Entity : public ComponentContainer, public PropertyContainer, public Serializable, public NetworkObject
{
public:
};

Basically an entity contains a list of components and properties, can be serialized and is networked. I suppose I could use composition and have the ComponentContainer and PropertyContainer as members of an Entity instead, but I found it more practical to be able to do the following:

entity.AddComponent<MyComponent>();

The Serializable and NetworkObject objects allow the Entity to implement it's own logic for file de/serialization , etc and for network de/serialization. A Component object also inherits these objects.

GPU Terrain Physics

20 August 2012 - 11:00 PM

How can terrain physics be handled when a lot of modern terrain rendering is done via the GPU?

Normally for brute force approach and small heightmaps you could create vertices on the CPU and load them into a physics engine as a collision mesh but with GPU approaches there isn't always a 1:1 mapping of vertex data on the CPU to whats displayed on screen (eg. hardware tessellation or vertex morphing). One idea was to generate a low-medium resolution version on the CPU to form the collision mesh but I'm not sure how practical this is as it may cause visual artifacts with physics objects sinking into the terrain or perhaps even floating.

What is the modern approach to this that games like BF3 are using?

Multiple Spatial Views

15 August 2012 - 10:31 PM

I'm wondering if there is any merit in using multiple spatial algorithms for visibility determination. What do more modern game engines do? Do they have "one system to rule them all" or various systems that specialize in different types of renderables/geometry present in the engine?

PARTNERS