Sign in to follow this  

Entities

This topic is 3414 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 3414 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this