I am learning
Java (well, do you ever finish learning?), and decided to try and make a simple textbased game to set myself an interesting task. I have some idea of what text games are all about (played "The hobbit" a couple of decades ago, and have since tried MUDs for example, but don't know much about their internal design.
I intend to make a single-player game to begin with, and have made a GUI terminal with a textfield for entering commands and a display for the text to display. I can enter commands, and the world object uses multithreading to allow time to pass (one minute itrl = one hour in my game), and the weather to change. When events happen (e.g. the church bell rings every hour), this is described in the scrolling text.
However, I am unsure how best to organize room objects. I imagine having a room object that can contain item objects, non-playable character objects and even other rooms possibly. But how best to arrange this? Is it an idea to put room objects in a 2D (or even 3D) array, or is there a better way? Maybe I'm going about it the wrong way.
I imagine saving all rooms and items, and the stats for the player object to a file (autosave every five minutes), so the player can continue from the same point next time s/he starts the game. I also imagine having a login, so you can have different games underway. Finally, if you log in as admin, you can also edit rooms, add rooms, etc.
The next step I guess is to create the world as a separate program, and then let people connect - I'm thinking perhaps RMI might be a way to let me run the main program as a sort of "server" program and then let more than one player enter the game at once (on a LAN). Of course, this is not as good as having it run on an Internet server and using a proper MUD library, but hey - I'm only just starting out and like the challenge of making it from scratch...
Thanks for any hints!