Hello! I'm a beginner in game programming, obviously. I recently grabbed a copy of "C++ Primer, 5th Edition" because me and a couple of serious friends want to get into game development. Of course, we do know our limitations and that to even see a simple game like Pong on the screen, it will take time. We decided to first work independently on the specific sectors we are interested in (for example, one of my friends is good at producing digital art) and I chose programming. I do have some programming experience from some classes in high school in C++, but I decided to take it a step further and delve into more advanced techiniques and OOP. Since I believe that the best way to learn is by doing, I decided to slowly start writing a simple text-based game.
My game will be a very simple one, where you, the player (full with a name, an inventory, gold and later simple levelling) will be able to choose a monster type (vampire, troll, orc etc.) and fight it for gold and XP, advancing your character to fight more difficult monsters. Since I have no prior game development experience, I decided to take the simplest approach: write my game in small chunks that execute, and then start adding more and more functionality. Right now, I've got a single header file that contains a Player class, responsible for storing the player's stats (level, max health etc.) and a source file which presents a 'main menu' (New Game and Quit Game only!), and a starter speech from an 'Arena Host'. I plan on moving that functionality to a Game class later, so as to keep my main function simple.
On to the actual question, though. As I said, the players will have to choose from a selections of monsters they can fight. I want to organize this selection somehow, in a structure that can keep all the monster types, their levels, their skills (later), and their level and XP classes (useful for giving the player the XP he deserves). I got three ideas that, to be honest, I'm not completely sure how to implement, but I can find the way:
- Store the above monster variables in a text file, seperated by a coma (ie. vampire,2,4), have the player type a string, search for that in the file and retrieve the variables that match the monster. This presents me with the problem of keeping the skillset of each monster later.
- Use a vector. I don't actually know how to hold an object and subsequent variables for it, though.
- Use an external database. I'm totally in the dark about how to do that.
I know that there might be a very simple solution for that, but I can't see it. I don't know, maybe my game design is still too complex for a beginner. I even thought of storing each monster in separate header file, inheriting functionality from a main Monster class.
What do you think?