Recently I have decided to pursue the task of creating a text based rpg. I won't over extend my abilities just yet and try something crazy like writing a MUD engine or anything like that. (Maybe eventually). I was wondering though if anyone had any documentation on text based game class structures. So far my system seems to work (which is shown below) but I'm not sure if it'll be helpful in the long run, when I add data importing and saving functions. If anyone has any information that would be greatly appreciated.
Justicepanda
Here's my class structure so far...
World : This holds a Player and a Room called CurrentRoom.
Player: Holds an array of items, has properties like weight, level, name, etc. (This is you as the player)
Room: Holds an array of items, an array of NPCs, and has a name and description.
NPC: Like a player, but isn't controlled by you, and has less properties (Naturally).
There's more but that's the gist of it.
Text Based Game Class Structure
Started by justicepanda, Apr 23 2010 03:36 PM
1 reply to this topic
#1
Posted 23 April 2010 - 03:36 PM
|
|
|
#2
Posted 25 April 2010 - 04:39 AM
Your best bet is to read the source code of existing programs, although I'm not sure how many open source text-based RPGs there are out there which aren't effectively MUDs. :)
No one design is "correct", it's whatever keeps your code manageable. If you're working with the code and really feeling "pain" in the form of changes being difficult or error-prone, try to figure out why and think how you might restructure your code to make things hurt less.
No one design is "correct", it's whatever keeps your code manageable. If you're working with the code and really feeling "pain" in the form of changes being difficult or error-prone, try to figure out why and think how you might restructure your code to make things hurt less.


Sign In
Create Account

Back to top









