Entities

Started by
2 comments, last by kbrizs 15 years, 8 months ago
I am looking for ideas on a hierarchy. If anyone has any suggestions, thanks. In the design plan that I have, I have a character profession that inherits from a character race. I am not looking for source code, so don't misunderstand, but I would like to model the process so I can ask some questions. I have an ORC that can choose to be a Mage or a Warrior. I am new to this. I decided that when I create objects I make the race the base class and the class the derived class. This is simple enough when the objects are instantiated, but I am looking for any suggestions on changing the hierarchy or making it more complex. You can include ideas for what functions and methods you would recommend since this is an OOP question. I don't want to move this question into a programming thread because I am only looking for design ideas. Has anyone organized something like this?
Advertisement
This is a game design forum. As such, questions about class hierarchies and object-oriented programming are off topic—a more appropriate forum for software design would have been the Software Engineering forum, although I suspect the problem is practical enough to be in Game Programming instead.

The part of your question that is relevant to game design here is the fact that, in your model, a class seems to be a type of race. That is, a Mage or a Warrior is a type of Orc (meaning that humans or elves can't be mages or warriors, because those are always orcs). Is this really what you intend? Most games actually make classes and races independent (meaning you can pick several races for each class and several classes for each race).
Are you going to use a scripting language?
If yes you might want to skip this OOP approach and instead register scripts as callbacks for a entity type and let the scripts decide how to use that specific entity.
Maybe a rough representation is required:
such as
Entity

NPC->Entity
Item->Entity
Effect->Entity
Player->Entity

The entities just serve as a state container then.
A player asset would look like this

Player:
takedamage: playertakedamage.script
spawn: playerspawn.script
....

Thats just an idea I had, because I am also thinking about this sort of thing for my engine right now.
http://www.8ung.at/basiror/theironcross.html
Sorry, I'll ask in a programming channel.

This topic is closed to new replies.

Advertisement