Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 06-10-2002, 11:39 AM   #1
snowfruit
New Member
 
Join Date: Jun 2002
Posts: 12
snowfruit is on a distinguished road
Cool

I know there is code out there to create virtual areas. that is you define the size and shape and seupply all the descriptions and such, but the code virtually creates the rooms so that they dont all have to be created seperately.
Does anyone know where i could find the code for this? Its for an amylaar LP mud btw
snowfruit is offline   Reply With Quote
Old 06-10-2002, 01:53 PM   #2
Cougar Khan
New Member
 
Join Date: Apr 2002
Location: Texas
Posts: 19
Cougar Khan is on a distinguished road
Send a message via Yahoo to Cougar Khan
Snowfruit,

Why on Earth would you want to create a "virtual area?"

It is possible to do in LP and I have some examples I could send you - but I've never had anything but problems from them.

In the end it is easier to code up the rooms and just drop them into your directory.

Good luck and if you still want the code send me an IM where I can send some samples to you.

-C...
Cougar Khan is offline   Reply With Quote
Old 06-10-2002, 04:21 PM   #3
Eddy
New Member
 
Join Date: May 2002
Posts: 5
Eddy is on a distinguished road
This won't answer you question, but I felt an urge to reply anyway.

Your question makes me shiver almost as much as when I read some mud ad recently where they claimed to have 1,000,000 rooms. When you code a quality area the time it will take to create the actual files is marginal compared to them it takes to write it's content. Virtual rooms end up (in my experience) either as mazes or as hack 'n slash forests where every room is identical to the last.
"Well says the coder: It is a forest, what else do I need besides trees?"

Neither of those 2 results appeal to me as a coder and they are a huge turnoff for almost all players. Any 20 room area that was coded with care and detail will beat a 1000 room virtual area.

Perhaps I'm wrong in my assumption where you want to use it for. If so provide some details as to what you are trying to accomplish with it and I'm sure I can give you some ideas how to realise it (with or more likely without) the use of virtual rooms.

Greetings,
Eddy
Eddy is offline   Reply With Quote
Old 06-10-2002, 06:24 PM   #4
snowfruit
New Member
 
Join Date: Jun 2002
Posts: 12
snowfruit is on a distinguished road
Post

Heh well the first time i was told of the existence of a daemon to create virtual rooms on themud i coded on I must admit I had the same thoughts as expresed by you But after some thinking I have actually found a few good uses of such areas. 1st-ly an admin on the mud created a sort of overland from which all the specific areas are accesible. Its about a 800 rooms i think, and even though you may find it hard to believe, it is not repetitive, because the 'continent ' has been divided into different zones with their own descriptions (forest, mountains, etc.) and every area has a number of unique descriptions which are randomly assigned to the virtual rooms.
Personally I have creates a rather complex maze with directional exits in which there are also slight diffferences in the descriptions, although no mayor ones because it is a maze after all. this is about 500 rooms. In progress i have an ocean, now you can say what you like but creatin a 1000 room+ ocean to act as a logical transistion between various island areas is no fun if you have to create each room individualy. With the possiblity of having an number of unique descriptions and then assigning these randomly between all the rooms in the area it is a lot easier, And of course in the places within that area that i want something special, hard coded rooms will be added (which believ me will number several 100 at least, so no one can say I dont spend time at my areas ) And lastly another posibilty that is on my todo list is a desert area. The same problem as the sea, most rooms in a desert are going to be similar if not identical. Enter vr, the perfect way of creating an area like that, allowing you to spend time at the rooms where things happen.

Now I must admit that the possibiliyt of lazy coders abusing a system like this are of course massive. But it all depend on the mentality od the coder, if they are going to abuse a system like this to create hundreds of repetitive rooms, they are going to do the same even without vr.

I like this idea, even so I only use it rarely. I prefer smaller areas, with diverse content. But some areas are just that much easir to make this way, and may even be better for it.

Thats just my reasoning however. Besides I like the challenge of actually trying to code a system like this that actually works


-- Snowfruit
snowfruit@eircom.net
snowfruit is offline   Reply With Quote
Old 06-10-2002, 07:57 PM   #5
Eddy
New Member
 
Join Date: May 2002
Posts: 5
Eddy is on a distinguished road
Without having seen it or knowing about the context of the game you code for it's impossible to cast a 'good' or 'bad' judgement on your work. It does however still leaves me with the same questions and worries.

Quote:
Originally Posted by
Its about a 800 rooms i think, and even though you may find it hard to believe, it is not repetitive, because the 'continent ' has been divided into different zones with their own descriptions (forest, mountains, etc.) and every area has a number of unique descriptions which are randomly assigned to the virtual rooms.
If you split it up in like 10 different types it does still leave 80 room 'blocks' with little difference. It leads me to the conclusion that the game you code for is set up to be rather wide and spacy. Are players actually exploring these places or are they just taking it as 'the way it is' and speedwalk through it? If it's the latter then what does it really add?

Quote:
Originally Posted by
Personally I have creates a rather complex maze with directional exits in which there are also slight diffferences in the descriptions, although no mayor ones because it is a maze after all. this is about 500 rooms.
I think almost all of us coders have coded mazes at least once (if not more). It's fun to code them. But do players like them or hate them? Are players in there for the maze challenge or because they have to (for one reason or another)?

Quote:
Originally Posted by
In progress i have an ocean, now you can say what you like but creatin a 1000 room+ ocean to act as a logical transistion between various island areas is no fun if you have to create each room individualy.
True, but will the player enjoy having to walk (erm swim) through them day in day out? Isn't it an option to forget the swimming part ("You better not a shark might eat you") and create a sailing service (hop on and the captain sails you to the next island)? If you want you can even let the player do the sailing. Keep track of x,y coordinates of the boat and have 1 object taking care of the descriptions for that position when the player 'looks out'. Perception wise you can create the 'distance' between the island by changes in the sailing time. The amount of things you can implement around the boat concept are endless, making each trip almost a unique experience for the player instead of a speedwalking 'must'. All in all do you _really_ need all those rooms to create the perceptions you want and is this really the only/best way to do it?

Quote:
Originally Posted by
Besides I like the challenge of actually trying to code a system like this that actually works
Don't we all Question remains if the things that are most fun to code also leads to the things most fun to play. In my experience the opposite it true more often.

Regards,
Eddy
Eddy is offline   Reply With Quote
Old 06-10-2002, 10:02 PM   #6
thelenian
Member
 
Join Date: Apr 2002
Posts: 122
thelenian is on a distinguished road
Virtual area generators like the one being described are good for generating large tracks of uninteresting wilderness for RPI MUDs. While the ship hack described by Eddy will give the minimal illusion of travel needed for SoD on an average MUD, RPI MUDs need to think of the next step... What happens if someone throws you overboard? How far can you/your eq sink? At this point having a virtual room daemon starts to look mighty appealing.
thelenian is offline   Reply With Quote
Old 06-11-2002, 03:14 AM   #7
Kastagaar
Member
 
Join Date: Apr 2002
Location: Hampshire, UK
Posts: 117
Kastagaar is on a distinguished road
Send a message via Yahoo to Kastagaar
Talking

Quote:
Originally Posted by
Your question makes me shiver almost as much as when I read some mud ad recently where they claimed to have 1,000,000 rooms. When you code a quality area the time it will take to create the actual files is marginal compared to them it takes to write it's content.
So, because it can be done badly, it must always be done badly?

Kas.
Kastagaar is offline   Reply With Quote
Old 06-11-2002, 06:43 AM   #8
snowfruit
New Member
 
Join Date: Jun 2002
Posts: 12
snowfruit is on a distinguished road
Exclamation

Phew I had no idea my simple question coudl generate som uch respons

Anyway, I think I totally agree with Thelenium. In a role playing environment just getting told you are on a ship and it has instantaneously transported you to that island many leagues away just doesn't do it for me.
Its the having to find a row/sail boat or whatever that can take me out there and trying not to fall overboard, or at least no outside of swimming distance of land. And if you do, how am i going to get my eq back form the bottom of the ocean floor. Thats the kind of thing i was aiming for rather than just a 1000 fille rooms. People don't enjoy going through room after identical room, however I have always hated muds where one 7-mile step takes you from a freezing tundra into a tropical island. The bits in between are necesarry in my opinion.
So I like to create them, and preferably spend my time making them interesting with the extra bits of code instead of spending hours saving all those repetetive room files - believe me I have tried it that way, and after a while the temptation to just leave them all the same is very large. I personally, find that if i don't have to worry about the actual creation of the files and leave it to the vr system, the overall quality of a large area like for example an ocean improves by leaps and bounds.

So to get back to the original question, does anyone have any ideas of how to go about this? I have actually managed to get together a fair bit of code already, but any outside input would be most appreciated.

--Snowfruit
snowfruit is offline   Reply With Quote
Old 06-11-2002, 07:19 AM   #9
Eddy
New Member
 
Join Date: May 2002
Posts: 5
Eddy is on a distinguished road
Quote:
Originally Posted by
Anyway, I think I totally agree with Thelenium. In a role playing environment just getting told you are on a ship and it has instantaneously transported you to that island many leagues away just doesn't do it for me.
Whoa I never used 'instantaneously' in my post. No problem with having it take 10 minutes if you want. You definately can guarantee 'time to travel' this way and not let it depends on how good the client used is in speedwalking.

Quote:
Originally Posted by
So, because it can be done badly, it must always be done badly?
Let me get myself into more trouble here. Let's take a look at the coding issue on this. A 1000 room vitual area will (worse case) end up creating 1000 loaded objects. One for each virtual location. On all of the examples I've seen so far in this thread (exception _perhaps_ being the central area connector) this is overkill. All of the examples can be coded in such a way that only a handfull of objects (per user actually in the area) is actually required. Why is everybody so fixed on the concept that things actually have to exist. The biggest merit when coding for text based adventures is that it's all about perception and not about actual things. What you must do is create the perception of a lot of space, you don't actually have to create it.

This is an approach from the top of my mind how to handle it.
File A: Central ocean handler
- Contains all data on descriptions and whatever else is needed.
File B: Ocean room
- Local vars for the current virtual x and y location
File C Underwater room
- Same as ocean room but used when you fall overboard
File D storage room
- Safekeeping place for items that were left in 'another' virtual location

Now the handling part when a player enters the ocean
-> Clone a new instance of the ocean room
-> Move player into the clone
-> Get descriptions from central handler (based on x,y)
-> Get exits for central handler (based on x,y) exits actually only change x,y, refresh the descriptions and move any items to and from the storage room.

If you want players to be able to run into eachother you will have to keep track of x,y locations in the central handler and add moving logic in there.

The number of actual objects loaded in this scenario will be
1 central handler object
1 storage room object (add a mapping of x,y locations and the items that belong there)
1 object per player (either an ocean or or underwater room)

Hopes this helps and awaiting your responses ,
Eddy
Eddy is offline   Reply With Quote
Old 06-11-2002, 10:23 AM   #10
Cougar Khan
New Member
 
Join Date: Apr 2002
Location: Texas
Posts: 19
Cougar Khan is on a distinguished road
Send a message via Yahoo to Cougar Khan
On the MUD - I work on, we've gone to great lengths to try and remove many of the virtual areas in play. One they looked bad and two - they broke and players got stuck.

One of the situations we came up with was the ability to have a ship that moved in "real time" (or something less then instant.)

The ship is 8 rooms large - aft rooms, port rooms, starboard....
plus we have a room for water, where the player could "jump" off.  If the player jumped off, it is possible for the ship to leave them, and the player is stranded in the water until another ship came by. The ship is controled by slaves rowing, if you kill the slaves - the ship stops to row.

Here are my examples of making this work. In this first file - is the ship speed controller.

[code] /* Coded by Zor 05/98 */

#include <shadow.h>

#define SLAVEROOM               SHIP"slaveroom"

int query_speed();
int change_speed();

int howfast;

int change_speed(){
       object *inv;
       int count;
       int slavecount;
   object slave_room;

   slave_room = find_object_or_load(SLAVEROOM);
   if(!objectp(slave_room)) {
       howfast = 13;
       return howfast;
   }

   inv = all_inventory(slave_room);

   slavecount = 0;
   count = 0;
   while(count<sizeof(inv)) {
       if((int)inv[count]->query_is_slave() == 1) slavecount+=1;
   count++;
       }
      howfast=slavecount;
      howfast += 15;
      if(howfast == 0)  howfast = 6;
      if(howfast > 24)  howfast = 40;
       return howfast;
}

int query_speed() { return howfast; }

[/quote]

Here is the actual ship controller:

[code] /* Coded by Zor 12/98 */

#include <shadow.h>
#include "speed_m.h"

#define WATER       SHIP"water"
#define S_AFT        SHIP"star_aft"
#define P_AFT        SHIP"port_aft"
#define S_FORE      SHIP"star_fore"
#define P_FORE      SHIP"port_fore"
#define S_DECK      SHIP"star_deck"
#define P_DECK      SHIP"port_deck"
#define CABIN        SHIP"cabin"
#define SLAVEROOM   SHIP"slaveroom"

#define ATHENS1      SPATH"pier"
#define CRETE1        CRETE"pier"
#define FOOTPAD1    FOOTPAD"pier"
#define DANIEROS1   DANIEROS"Danae_pier1"
#define ATHENSCITY ATHENS"port3"

#define AT_DOCK     30
#define DISTANCE    40

inherit TREASURE;

void arrive();
void tell_ship(string);

string *ports, *port_paths;
int count, num_ports, from, distance_gone,speed;

void create() {
   ports = ({
   "South Port",
   "Crete",
   "Footpad Isle",
   "Danieros",
   "Athens City"
 });
   port_paths = ({
   ATHENS1,
   CRETE1,
   FOOTPAD1,
   DANIEROS1,
   ATHENSCITY,
 });
   ;;create();
   set_id("ship");
   set_alias("galley");
   set_alt_name("slave_galley");
   set_short("Slave Galley");
   set_long(
@DESC
The vessel before you is a large slave galley which has been known to ferry adventurers from island to island. Be warned however, although the captain does not ask for payment, money often goes missing from this ship's passengers.
DESC
   );
   count = 0;
   num_ports = sizeof(ports);
   from = count - 1;
   if(from < 0)
       from = num_ports - 1;
   this_object()->move_me(WATER);
   call_out("water", 20, 0);
}

int get(){
   return 0;
}

void init() {
   ;;init();
   add_action("board", "enter");
   add_action("board", "board");
}

int board(string str) {

   if(str != "ship" && str != "vessel" && str != "slave galley")
       return 0;
   if( random(10) > 3) {
       write("Someone on the boarding plank brushes up against
you\n");
       this_player()->add_money(-(random(70)));
   }
   write("You board the Slave Galley!\n");
   tell_room(environment(TO),sprintf("%s boards the slave galley.\n",
       NAME),this_player());
   tell_room(P_DECK,sprintf("%s boards the slave galley.\n",NAME));
   this_player()->move_me(P_DECK);
   this_player()->command("look brief");
   return 1;
}

void water(int distance_gone) {
   if(distance_gone < DISTANCE){
       speed=change_speed();
       distance_gone+=speed;
       if(speed>12) tell_ship(sprintf("The slaves are whipped and
beaten as they row to %s.\n",ports[count]));
       if(speed<13 && speed>2)tell_ship(sprintf("With effort the
slaves row to %s.\n",ports[count]));
       if(speed==2)tell_ship(sprintf("The currents carry the ship
towards %s.\n",ports[count]));
       remove_call_out("water");
       call_out("water", 20, distance_gone);
   }
   else {
       remove_call_out("water");
       distance_gone=0;
       arrive();
   }
}

void arrive() {
   tell_room(port_paths[count],sprintf(
       "A Slave Galley arrives from %s.\n", ports[from]));
   tell_room(WATER, "The slaves forced efforts carry the galley over
the horizon.\n");
   tell_ship(sprintf("The slave galley arrives at
%s.\n",ports[count]));
   TO->move_me(port_paths[count]);
   count++;
   if(count > num_ports - 1)
       count = 0;
   from = count - 1;
   if(from < 0) from = num_ports - 1;
   call_out("sail", AT_DOCK);
}


void sail() {
   remove_call_out("sail");
   tell_room(environment(TO), sprintf(
       "A whip cracks and the slaves begin rowing for
%s.\n",ports[count]));
   tell_room(WATER,sprintf(
       "A slave galley pulls in from %s.\n",ports[count]));
   tell_ship(sprintf("The slave galley continues on to
%s.\n",ports[count]));
   this_object()->move_me(WATER);
   call_out("water", 20,0);
}

void tell_ship(string mesg) {
   tell_room(S_FORE, mesg);
   tell_room(P_FORE, mesg);
   tell_room(S_DECK, mesg);
   tell_room(P_DECK, mesg);
   tell_room(S_AFT, mesg);
   tell_room(P_AFT, mesg);
   tell_room(CABIN, mesg);
   tell_room(SLAVEROOM, mesg);
}

int clean_up(){
   return 1;
}


string query_location() {
   return ports[count];
[/quote]


Good luck - and this is just one of the examples we have. Many of the other ones have been a bit tweaked. Let me know if we can help out with anything else.

-C...

P.S. I need to thank the Admin and Zor of GateWay MUD for letting me show this code.
Cougar Khan is offline   Reply With Quote
Reply


Thread Tools


Implementing Virtual rooms/areas - Similar Threads
Thread Thread Starter Forum Replies Last Post
Jail time for virtual violence? KaVir Legal Issues 15 12-20-2006 04:13 PM
Virtual Worlds - The Rules of Engagement the_logos Tavern of the Blue Hand 3 05-04-2006 12:36 PM
Virtual blood SolViLune Tavern of the Blue Hand 0 10-11-2003 05:53 AM
230+ zones, 25.000+ rooms, millions of wilderness Hephos Advertising for Players 5 05-05-2003 06:03 PM
Season-Changing Rooms? Faye Advanced MUD Concepts 12 09-26-2002 01:57 PM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 10:41 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014