14 Oct, 2006, ThomasB wrote in the 1st comment:
Votes: 0
Originally I was gung-ho SQL, but at the moment it might be hard to access while at school, and that will severely limit the work I get done. I'm now trying to come up with ways of just having the rooms made in Java, or something similar.

class Rooms
{
static String roomName = "None.";
static String roomShortDescription = "A void.";
static String roomLongDescription = "A really big void.";

static boolean shortDescription = true;

public static void setRoom(int zoneNumber, int roomNumber)
{
switch(zoneNumber)
{
case 1:
switch(roomNumber)
{
case 1:
roomName = "A Peaceful Meadow.";
roomShortDescription = "This place is beautiful";
roomLongDescription = "Really beautiful.";
break;
case 2:
roomName = "A Quiet Glade.";
roomShortDescription = "This place is super quiet.";
roomLongDescription = "Really quiet.";
break;
default:
roomName = "None.";
roomShortDescription = "1 - A void.";
roomLongDescription = "1 - A really big void.";
break;
}
break;
case 2:
switch(roomNumber)
{
case 1:
roomName = "A Craggy Mountain.";
roomShortDescription = "This is a craggy place.";
roomLongDescription = "Really craggy.";
break;
case 2:
roomName = "A steep trail.";
roomShortDescription = "This is a steep trail.";
roomLongDescription = "Really steep.";
break;
default:
roomName = "None.";
roomShortDescription = "2 - A void.";
roomLongDescription = "2 - A really big void.";
}
break;
default:
roomName = "None.";
roomShortDescription = "3 - A void.";
roomLongDescription = "3 - A really big void.";
break;
}
}
}


The breakdown: A zone will be a collection of rooms. A highway might be zone 1 and the forest adjacent to it might be zone 2. So whenever I call to change a room I would sent Rooms.setRoom(1,1); and I'll now be in Zone 1 and at "A Peaceful Meadow." Obviously, this file will become obscenely once I start writing rooms etc., but this seems to be one of the easiest alternatives. Is this going to become absurdly slow and god awful in a matter of 50-70 rooms?

I figured this was a better alternative than just reading from .dat files which would require objects and more files etc. etc. This allows for me to call whatever, whenever (not worrying about cursosrs), I don't need to make any objects and it's only one file. Suggestions?
14 Oct, 2006, kiasyn wrote in the 2nd comment:
Votes: 0
You could try looking for an java sqlite. SQlite is an embedded database (correct me if i'm wrong) that you can distribute with your application. Or I would prefer reading from a .dat file. I prefer not to mess up my code with stuff like that if i can. :P
14 Oct, 2006, Brinson wrote in the 3rd comment:
Votes: 0
You said you have little experience in muds?

I just wanted to point out that 50-70 rooms might not be where you need to worry, because most muds have over 10,000 rooms and the bigger ones can be over 40,000.
14 Oct, 2006, Omega wrote in the 4th comment:
Votes: 0
over 40,000… (prods his mud with 9billion rooms)
14 Oct, 2006, ThomasB wrote in the 5th comment:
Votes: 0
Brinson said:
You said you have little experience in muds?

I just wanted to point out that 50-70 rooms might not be where you need to worry, because most muds have over 10,000 rooms and the bigger ones can be over 40,000.


Haha, I meant will I notice the slowness at that few number of rooms, not that that's how many I want.

And 9 billions rooms?! :stare: Do they each have unique room names and descriptions? Or do you have the user wander around on an ASCII map? My goal is to have every unique be entirely different.
14 Oct, 2006, Asylumius wrote in the 6th comment:
Votes: 0
It wouldn't be too hard to write some code to parse a traditional MUD area file and simply throw away all the data you don't want. That way, even if only for testing, you could throw in a copy of Midgaard or something.
14 Oct, 2006, Omega wrote in the 7th comment:
Votes: 0
9 bil ascii-map, however i am working towards giving each room its own description and name aswell, tis a long-term goal :)
15 Oct, 2006, Brinson wrote in the 8th comment:
Votes: 0
Some day someone's going to make a program that analyze's google maps and builds rooms based off of the real world. Now…that would be kickass.
16 Oct, 2006, Conner wrote in the 9th comment:
Votes: 0
It'd certainly be HUGE mud world… Wonder if it'd recognize death traps and auto insert them.. *eg*
16 Oct, 2006, Justice wrote in the 10th comment:
Votes: 0
ThomasB said:
Originally I was gung-ho SQL, but at the moment it might be hard to access while at school, and that will severely limit the work I get done. I'm now trying to come up with ways of just having the rooms made in Java, or something similar.

class Rooms
{
static String roomName = "None.";
static String roomShortDescription = "A void.";
static String roomLongDescription = "A really big void.";

static boolean shortDescription = true;

public static void setRoom(int zoneNumber, int roomNumber)


The breakdown: A zone will be a collection of rooms. A highway might be zone 1 and the forest adjacent to it might be zone 2. So whenever I call to change a room I would sent Rooms.setRoom(1,1); and I'll now be in Zone 1 and at "A Peaceful Meadow." Obviously, this file will become obscenely once I start writing rooms etc., but this seems to be one of the easiest alternatives. Is this going to become absurdly slow and god awful in a matter of 50-70 rooms?

I figured this was a better alternative than just reading from .dat files which would require objects and more files etc. etc. This allows for me to call whatever, whenever (not worrying about cursosrs), I don't need to make any objects and it's only one file. Suggestions?


This approach doesn't look very good to me. Using static members of a class restricts you to at most 1 room being active at any moment. You'll run into issues supporting characters and objects in different rooms. This approach does not avoid writing classes, since the static class is still required.

Is there any reason you're avoiding storing each room as an instance of an object?

As for SQL, it's not difficult to get an SQL server at home. With windows, you can use any access database using the JET engine and ODBC. MySQL and PostgreSQL are both freely available and MS releases a restricted version of SQL Server for download (MSDE i think). FYI though. I wrote a java app to convert the smaug social file into SQL. Using the resortmud socials.dat uploading to an Access database locally took over 5 minutes, to a remote MySQL over dialup took less than 20 seconds.

An alternative I use over SQL is XML. The java.xml package has been availble since 1.4 and JAXP since 1.3. You'll run into longer read/write times with XML, but it's easier to develop tools to work with the files.
A little xslt and you've got an html page, or an xsl-fo that can be turned into a word or pdf document.
17 Oct, 2006, ThomasB wrote in the 11th comment:
Votes: 0
I noticed that with using the variable names, as it stands (just for testing and making some progress), ever player object has a variable named "room_currentRoomName" etc. That's extremely cumbersome though, so I'll be going back to MySQL soon so I don't have to have an excess of 500000000000000000000000000000000000000000000000000 variables per person.
17 Oct, 2006, kiasyn wrote in the 12th comment:
Votes: 0
O_o
In Drazon:
class Room : public Entity, Instance
{
private:
Room( const Room &copy );
Room operator=( const Room &copy );
public:
Room * next;
Room * next_sort;
Room *next_in_area;
Room *prev_in_area;
Character * first_person; /* people in the room */
Character * last_person; /* .. */
Object * first_content; /* objects on floor */
Object * last_content; /* .. */
ExtraDesc<Room *> * first_extradesc; /* extra descriptions */
ExtraDesc<Room *> * last_extradesc; /* .. */
Area * area;
Exit * first_exit; /* exits from the room */
Exit * last_exit; /* .. */
Affect * first_affect; /* effects on the room */
Affect * last_affect; /* .. */
MUDProgList * mpact; /* mudprogs */
int mpactnum; /* mudprogs */
MUDProg * mudprogs; /* mudprogs */
short mpscriptpos;
char * name;
char * description;
int vnum;
ExtBV room_flags;
ExtBV progtypes; /* mudprogs */
short light;
char sector;
int tele_vnum;
short tele_delay;
short tunnel; /* max people that will fit */
Map * omap;
short x;
short y;
short z;
Shop * shop;
Room( int v, Area *a );
Room( int v, Area *a, Room *clone );
char *getName();
char *getDesc();
bool isDark();
bool isPrivate();
long getSize( bool children = false );
~Room();
};
19 Oct, 2006, Justice wrote in the 13th comment:
Votes: 0
Just curious, since it appears that you're using C++. Is there any reason you didn't use the standard library for lists, instead of manually building a linked list?
19 Oct, 2006, kiasyn wrote in the 14th comment:
Votes: 0
personal preference, and it won't compile with -Weffc++
19 Oct, 2006, Justice wrote in the 15th comment:
Votes: 0
Interesting. Hadn't used that option before, did a little research. While I agree with alot of those guidelines, I'm not sure I'd use them strictly.
19 Oct, 2006, kiasyn wrote in the 16th comment:
Votes: 0
yeah my base actually doesn't compile with it either >_> but yeah
0.0/16