Hopefully this will be a nice easy question :-

I am building an RTS as a way of learning OOP techniques.

Currently the code has the following classes

Class MustInherit GameUnit

Class MustInherit Building
  Inherits GameUnit

Class MustInherit Vehicle
  Inherits GameUnit

Class MustInherit ??????
  Inherits GameUnit

Class Jeep
  Inherits Vehicle

Class WeaponsFactory
  Inherits Building

Class Grenadier
  Inherits ??????

I am looking for the generic name for people to replace the ?????, ideally a word that describes people of any race or culture - humanoid or otherwise. As this is a learning exercise I would like to get it right - using the ...Is A... idea of class inheritance.

For Example: Jeep IS A Vehicle, Vehicle IS A GameUnit.



closed as not constructive by Nicol Bolas, ClassicThunder, bummzack, Sean Middleditch, MichaelHouse Mar 26 '13 at 21:03

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    \$\begingroup\$ Try "Unit" as a class name, \$\endgroup\$ – Vaughan Hilts Mar 26 '13 at 16:38
  • \$\begingroup\$ Hi, Thanks for your input, but I would think that Unit would be too vague, eg. Grenadier IS A Unit, but equally a Jeep could be seen as a unit, for example Jeep Is A Unit would pass as acceptable when reading, but Jeep IS A Soldier would not, as its obvious that a Jeep is NOT a Soldier. \$\endgroup\$ – Graham Mar 26 '13 at 16:46
  • 4
    \$\begingroup\$ @Graham: BTW, I hope your "learning exercise" teaches you the folly of using inheritance for this. In many RTS games, different types of units have different properties. Terran buildings in StarCraft can fly. In SC2, Spine/Spore Crawlers can uproot and move. Vehicles can transform into infantry. And so on. Hard, static inheritance can't handle this. \$\endgroup\$ – Nicol Bolas Mar 26 '13 at 16:51
  • 2
    \$\begingroup\$ @Graham I would say the question in too localized, not constructive, and off topic. It is a question that would better be answered by a historian or English major than a game developer. \$\endgroup\$ – ClassicThunder Mar 26 '13 at 17:10
  • 2
    \$\begingroup\$ The point is there is no proper name. You can call it whatever you want. Just pick a name and move on. Learning game development isn't about what to name things. You are learning something very important with this question: Don't sweat the small things, just make a decision and move on. Design indecision is something that cripples the development of many games. Getting hung up on something this small means you've identified design indecision as an improvement area for yourself. \$\endgroup\$ – MichaelHouse Mar 26 '13 at 17:34

When a Jeep is a Vehicle, then a Grenadier seems to differs from it by the fact that it moves on foot. So I would recommend to name the base-class for these units Infantry.

Infantry comes from the latin word infans which describes a child which has learned to walk on its own. It was used to describe a soldier who walks into battle instead of using a horse or charriot.


Not the answer you're looking for? Browse other questions tagged or ask your own question.