Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

Thanks

share|improve this question
1  
Try "Unit" as a class name, –  Vaughan Hilts Mar 26 '13 at 16:38
    
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. –  Graham Mar 26 '13 at 16:46
4  
@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. –  Nicol Bolas Mar 26 '13 at 16:51
2  
@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. –  ClassicThunder Mar 26 '13 at 17:10
2  
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. –  Byte56 Mar 26 '13 at 17:34
show 8 more comments

closed as not constructive by Nicol Bolas, ClassicThunder, bummzack, Sean Middleditch, Byte56 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 Answer

up vote -1 down vote accepted

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.

share|improve this answer
add comment

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