   Text RPG Planning : Round 2
  Hola!Im creating my first Text RPG, and this is my second edit to the little plans I have. I know there is still a lot of work and planning to be done to my RPG, but the first step im trying to accomplish is finishing the Enemy, Player, and Boss Classes. So, without further a do, heres my plansPlease help me come up with better design and plans. Thanks for any Help! any critism is great!Wraith ( still havent came up with a better name )://///////////////////////Class Enemy : Base Class/////////////////////////Private member functions -Enemy   - initializes all data members~Enemy  - announces the enemy has diedPublic member functions -void Attack  - simulates an attackvoid Taunt   - says a threatning messageint GetHealth- returns health pointsProtected data members -int m_Attack - the strength of the enemyint m_Health - the health points of the enemy//////////////////////////////////Class Player : derived from Enemy//////////////////////////////////Public Member Functions -Player  - initializes all data members~Player - announces the player has diedstring Inventory  - returns all the items in the players inventorystring Skills- returns all the players abilitiesvoid UpgradeSkills- upgrades the players skills ( adding new powers )void UseItem - uses an item from the users inventorybool Fight   - if player wants to fight, returns trueint Armor    - returns the players armor pointsint Xp  - returns the players experience pointsPrivate Data Members -int m_Armor  - the amount of armor the user hasint m_Xp- represents the level the user hasint m_Magic  - magic attack pointsint m_Item   - item attack pointsvector<string> m_Inventory  - holds all the items the player hasvector<string> m_Skills- holds all the skills the player hasstring m_Item- current item the player is usingstring m_Name- players name////////////////////////////////Class Boss : derived from Enemy////////////////////////////////Public Member Functions -Boss    - initializes all data members~Boss   - announces the death of the bossvoid SpecialAttack- the boss' special attackPrivate data members -int m_SpecialAttack    - special attack pointsint m_EarnXp - XP the player gains from defeating the bossstring m_Name- boss' name
  I'm still a major newbie, so take the following with a grain of salt:When you have vectors of strings to hold things like items and skills, wouldn't it be better to make a class for skills and a class for items (with, for example, an  "effect" method inside) and make a vector of that class? Because otherwise you are going to need to have some way to attach that skill string to an effect, or attach that item sting to a set of stats.You also might want to change your base class "Enemy" to a more general "Entity". I was confused at first, how does a player inherit from an enemy? A player character isn't a type of enemy.If you XP system uses a lot of multiplication or division, you might have very small or decimal Xp values. Depending if you want to round or how big these values are going to be, you might want to use a float. (2.5 to 2 is a big difference.)You might want to change m_XP to m_Level, to not get confused. For the same reason, I would change m_SpecialAttack to m_SpecialAttack points. You might have a function named SpecialAttack down the road, no sense getting confused.You also might to add more stats (like an intelligence stat for magic attacks).Good Luck!   ;  As Melpomene mentioned you may want to make a generic Entity class and derive both your Enemy and Player classes from that. Then provide basic virtual interfaces in the Entity class and overide them if needed in the derived classes.For example, both players and enemies should have the ability to pick something up. In the Entity class you provide the interface and a generic implementation of picking something up. Then in your Enemy or Player classes you can overide the base class implementation if you need to do some extra stuff.Another point I agree with Melpomene on is how you are defining skills and items. I would imagine items could be a pretty complex class. Depending on if it is a weapon, armor or scroll of parchment they will have different attributes and ways to interact with them and using a string to identify them probably won't work out so well once you have a bunch of different item types in your game.As for skills a simple structure like:struct skill_type{    string name;    int skill_level;};inside a vector ( vector<skill_type> skills; ) could be more all you need to make it work.Hope that helps.;  For my RPG, though a bit more advanced and elaborate, I use classes for many things.  Personally, me and inheritance dont get along, so I group as many things together as possible, while still maintaining a good level of control.For example, I have the character class (the player), the NPC class (includes mobs and NPCs that you can interact with), and also Spells, Items, Quests, Resources, Land Zones and Effects.  The effect class is contained in spells and items.  What it does is handle things like Stun for 2 seconds, 15 fire damage, 10 life leech, etc.You of course could include the effects in the spells/items themselves, which will work too, but I have quite a bit of variables within it so I thought it to best to make a seperate class for it.Also, I'd look into using <map>s because theyre extremelyy useful and helps 10 fold with readability.What it looks like is://includes#include <map>#include <string>map<string, jItem> Items;/* Now you can access the Items by a string, rather than a number.  Granted, its not *hard* to use a standard array, but for doing things such as a map will help when you're dealing with Quests and such where a player needs x amount of item y and will get item z for completing it.  What I do (and you dont have to), is read data from files in a predesigned format and then as I read them, I set the filename equal to the key, which is what you access the map with.  So let's say I read a item from 'shortsword.txt' and read all the data.  Now, I can it by doing:Items["shortsword"] but I can also use a variable.. let's say you assign string s to be "shortsword", I can do Items as well now.  It is important to have a special variable in your Item classes to represent the filename if you load items from files.<br><br>I actually wrote a pretty nice system for databasing various class objects so let me know if you'd like me to go further into detail with this*/<br><br><br>-Suker   ;  Ok, I made some changes, please tell me what you think. Should I keep the SkillnItems class, or should i make 2 seperate classes?//////////////////////////Class Entity : Bass Class//////////////////////////Member functions -void Attack  - simulates an attackvoid Taunt   - says a threatning messageint GetHealth- returns health pointsProtected data members -int m_Attack - the strength of the entityint m_Health - the health points of the entity//////////////////////////Class SkillnItems //////////////////////////data members -string m_ItemName   - Name of Itemstring m_SkillName  - Name of Skillint m_SkillLevel    - Increases or Decreases skill levelvector<SkillnItems> m_Skills  - Holds all the players skillsvector<SkillnItems> m_Items   - Holds all the players items/////////////////////////Class Enemy : derived from Entity/////////////////////////Private member functions -Enemy   - initializes all data members~Enemy  - announces the enemy has died//////////////////////////////////Class Player : derived from Entity//////////////////////////////////Public Member Functions -Player  - initializes all data members~Player - announces the player has diedvoid UseItem - uses an item from the users inventorybool Fight   - if player wants to fight, returns trueint GetArmor    - returns the players armor pointsPrivate Data Members -int m_Armor  - the amount of armor the user hasstring m_CurrentItem   - current item the player is usingstring m_Name- players name////////////////////////////////Class Boss : derived from Entity////////////////////////////////Public Member Functions -Boss    - initializes all data members~Boss   - announces the death of the bossvoid SpecialAttack- the boss' special attackPrivate data members -int m_SpecialAttackPoints   - special attack pointsint m_EarnXp - XP the player gains from defeating the bossstring m_Name- boss' name;  Depends on what you need/want to do with it.  Each of my item and spell classes habve quite a few members that are different(in fact, there's only like 2 that are the same), so for me, it has to be 2 seperate classes.If what you're doing accomplishes your task, then use it!   