Out of Curiosity

  • zusuk
  • zusuk's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
  • LuminariMUD Developer
More
6 years 1 month ago #670 by zusuk
Out of Curiosity was created by zusuk
Is there a post listing the limits of tba in cocerns to # of rooms, mobiles objects... stuff of that nature?

Someone was talking about having a mud with 4million room wilderness and I was curious what would need to be changed in stock code to accept those kind of numbers

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago - 5 years 8 months ago #671 by Rumble
Replied by Rumble on topic Out of Curiosity
World size is currently limited by the usage of an unsigned short integer which allows for 65,535 rooms/mobs/objs/etc.

You'd have to change the data type to go above that number. I've heard of people converting it to a long integer giving you billions.... but who would ever want to explore a 4 million room wilderness? Most builder's can not complete a 100 vnum zone. There have been a few discussions on this topic that are probably on the CircleMUD or CWG forums.

Rumble
The Builder Academy
tbamud.com 9091
Last edit: 5 years 8 months ago by Rumble.

Please Log in or Create an account to join the conversation.

  • Vatiken
  • Vatiken's Avatar
  • Offline
  • Administrator
  • Administrator
  • tbaMUD Programmer
More
6 years 1 month ago #674 by Vatiken
Replied by Vatiken on topic Out of Curiosity
TbaMUD actually uses an unsigned SHORT int for the world index which allows for amount of rooms/mobs/obj that rumblke listed. Changing it to an unsigned INT will give you 4.2 million possible vnums. There are significant changes required to go that route though as many ingame variables are of the INT type and would be incompatible with an unsigned int.

In my MUD I went with just a plain INT which allows for 2.1 million vnums which is more then enough. The only changes necessary were in structs.h, and a couple save/load functions that natively used unsigned short for vnums.

65535 rooms is more then enough for hand written rooms but when using an overhead map for a continent, a 100x100 area is a decent sprint for a player and it takes up 10,000 rooms. Upping the limit allows for multiple continents, and written zones without concern for the possibke limitation. Plus, it's easier to organize IMO.

tbaMUD developer/programmer
The following user(s) said Thank You: zusuk

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
  • LuminariMUD Developer
More
6 years 1 month ago #681 by zusuk
Replied by zusuk on topic Out of Curiosity
Thanks as usual Vatiken... I'm adding that to my ToDo list then.

Is your MUD open for scoping out? I'd love to check out what you've done with it so far.

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

  • Vatiken
  • Vatiken's Avatar
  • Offline
  • Administrator
  • Administrator
  • tbaMUD Programmer
More
6 years 1 month ago #683 by Vatiken
Replied by Vatiken on topic Out of Curiosity
Not open yet, but I'm hoping to open up shortly. I'll let you know if/when I do.

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #685 by Gahan
Replied by Gahan on topic Out of Curiosity
Just figured "What the heck." I'm going to try to do the unsigned int vnum structure to test the waters... I've noticed that the mud is freezing / crashing now all the time when a player loads...

#0 0x081a6a3f in load_skills (fl=0xa9c71d0, ch=0xa9c6160) at players.c:1227
1227 SET_SKILL(ch, num, num2);

i'm kind of curious as to what the issue would be.

Set skill is:
#define SET_SKILL(ch, i, lvl) { if ((ch)->char_specials.saved.skills) ((ch)->char_specials.saved.skills).level = lvl; }

Shouldn't matter that the vnum values have chagned...

Kind of perplexing.

Please Log in or Create an account to join the conversation.

  • Vatiken
  • Vatiken's Avatar
  • Offline
  • Administrator
  • Administrator
  • tbaMUD Programmer
More
6 years 1 month ago #687 by Vatiken
Replied by Vatiken on topic Out of Curiosity
Something didn't load right, make sure all your index types are set right in struct.h.

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #688 by Gahan
Replied by Gahan on topic Out of Curiosity
I hate to Hijack a thread, but everything is set properly..

#define CIRCLE_UNSIGNED_INDEX 1

#if CIRCLE_UNSIGNED_INDEX
# define IDXTYPE unsigned int
# define IDXTYPE_MAX UINT_MAX
# define IDXTYPE_MIN 0
# define NOWHERE ((IDXTYPE)~0)
# define NOTHING ((IDXTYPE)~0)
# define NOBODY ((IDXTYPE)~0)
# define NOFLAG ((IDXTYPE)~0)

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
  • LuminariMUD Developer
More
6 years 1 month ago #689 by zusuk
Replied by zusuk on topic Out of Curiosity
It isn't hi-jacking :P I pinned this thread because in my not too far future I plan on doing the same thing...

Let me know how you solve the issue :)

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago - 5 years 8 months ago #1268 by Nerian
Replied by Nerian on topic Out of Curiosity
I got the 2 billion snippet to work on Gicker's D20 using the following from TBAmud

here is the website
cwg.lazuras.org/modules.php?name=Forums&...ight=billion&start=0

and here is the code quote

welcor wrote: Complete diff from tbamud.com to switch to 2bill room numbers:

Index: db.c
===================================================================
--- db.c        (revision 217)
+++ db.c        (working copy)
@@ -1072,9 +1072,6 @@
        log("SYSERR: Format error after %s #%d", modes[mode], last);
        exit(1);
       }
-      if (nr >= 99999)
-       return;
-      else
        switch (mode) {
        case DB_BOOT_WLD:
          parse_room(fl, nr);
@@ -2023,7 +2021,7 @@

   line_num += get_line(fl, buf);

-  if (sscanf(buf, "#%hd", &Z.number) != 1) {
+  if (sscanf(buf, "#%d", &Z.number) != 1) {
     log("SYSERR: Format error in %s, line %d", zname, line_num);
     exit(1);
   }
@@ -2045,15 +2043,15 @@

   line_num += get_line(fl, buf);
   /* Look for 10 items first (new tbaMUD), if not found, try 4 (old tbaMUD) */
-  if  (sscanf(buf, " %hd %hd %d %d %s %s %s %s %d %d", &Z.bot, &Z.top, &Z.lifespan,
+  if  (sscanf(buf, " %d %d %d %d %s %s %s %s %d %d", &Z.bot, &Z.top, &Z.lifespan,
       &Z.reset_mode, zbuf1, zbuf2, zbuf3, zbuf4, &Z.min_level, &Z.max_level) != 10)
   {
-    if (sscanf(buf, " %hd %hd %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) {
+    if (sscanf(buf, " %d %d %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) {
       /* This may be due to the fact that the zone has no builder.  So, we just
        * attempt to fix this by copying the previous 2 last reads into this
        * variable and the last one. */
       log("SYSERR: Format error in numeric constant line of %s, attempting to fix.", zname);
-      if (sscanf(Z.name, " %hd %hd %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) {
+      if (sscanf(Z.name, " %d %d %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) {
         log("SYSERR: Could not fix previous error, aborting game.");
         exit(1);
       } else {
@@ -3297,7 +3295,7 @@

   obj->item_number = NOTHING;
   IN_ROOM(obj) = NOWHERE;
-  obj->worn_on = NOWHERE;
+  obj->worn_on = -1;
 }

 /* Called during character creation after picking character class (and then
Index: structs.h
===================================================================
--- structs.h   (revision 217)
+++ structs.h   (working copy)
@@ -35,17 +35,17 @@
 #define CIRCLE_UNSIGNED_INDEX  1

 #if CIRCLE_UNSIGNED_INDEX
-# define IDXTYPE       ush_int          /** Index types are unsigned short ints */
-# define IDXTYPE_MAX USHRT_MAX     /** Used for compatibility checks. */
+# define IDXTYPE unsigned int          /** Index types are unsigned short ints */
+# define IDXTYPE_MAX UINT_MAX     /** Used for compatibility checks. */
 # define IDXTYPE_MIN 0             /** Used for compatibility checks. */
 # define NOWHERE       ((IDXTYPE)~0)    /** Sets to ush_int_MAX, or 65,535 */
 # define NOTHING       ((IDXTYPE)~0)    /** Sets to ush_int_MAX, or 65,535 */
 # define NOBODY                ((IDXTYPE)~0)    /** Sets to ush_int_MAX, or 65,535 */
 # define NOFLAG   ((IDXTYPE)~0)    /** Sets to ush_int_MAX, or 65,535 */
 #else
-# define IDXTYPE       sh_int           /** Index types are unsigned short ints */
-# define IDXTYPE_MAX SHRT_MAX      /** Used for compatibility checks. */
-# define IDXTYPE_MIN SHRT_MIN      /** Used for compatibility checks. */
+# define IDXTYPE signed int           /** Index types are unsigned short ints */
+# define IDXTYPE_MAX INT_MAX      /** Used for compatibility checks. */
+# define IDXTYPE_MIN INT_MIN      /** Used for compatibility checks. */
 # define NOWHERE       ((IDXTYPE)-1)    /** nil reference for rooms */
 # define NOTHING       ((IDXTYPE)-1)    /** nil reference for objects */
 # define NOBODY                ((IDXTYPE)-1)      /** nil reference for mobiles  */
Index: genzon.c
===================================================================
--- genzon.c    (revision 217)
+++ genzon.c    (working copy)
@@ -51,24 +51,22 @@
 {
   FILE *fp;
   struct zone_data *zone;
-  int i, max_zone;
+  int i, max_zone = IDXTYPE_MAX/100;
   zone_rnum rznum;
   char buf[MAX_STRING_LENGTH];

 #if CIRCLE_UNSIGNED_INDEX
-  max_zone = 655;
   if (vzone_num == NOWHERE) {
 #else
-  max_zone = 327;
   if (vzone_num < 0) {
 #endif
     *error = "You can't make negative zones.\r\n";
     return NOWHERE;
    } else if (vzone_num > max_zone) {
 #if CIRCLE_UNSIGNED_INDEX
-    *error = "New zone cannot be higher than 655.\r\n";
+    *error = "New zone cannot be higher than 42949672.\r\n";
 #else
-    *error = "New zone cannot be higher than 327.\r\n";
+    *error = "New zone cannot be higher than 21474836.\r\n";
 #endif
     return NOWHERE;
   } else if (bottom > top) {

I believe it's the old 99999 sanity check that's causing you trouble.

This fix in db.c is actually a general bugfix:
@@ -3297,7 +3295,7 @@ 

   obj->item_number = NOTHING; 
   IN_ROOM(obj) = NOWHERE; 
-  obj->worn_on = NOWHERE; 
+  obj->worn_on = -1; 
 } 

 /* Called during character creation after picking character class (and then 







I hope this helps somebody!
Last edit: 5 years 8 months ago by Nerian.
The following user(s) said Thank You: zusuk

Please Log in or Create an account to join the conversation.

Time to create page: 1.634 seconds