Jump to content
  • Advertisement
Sign in to follow this  
kbrizs

Entities

This topic is 3628 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
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).

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!