World "Re-Factoring"

  • zusuk
  • zusuk's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
  • LuminariMUD Developer
More
6 years 1 month ago #614 by zusuk
World "Re-Factoring" was created by zusuk
Lets say I doubled my levels in my game, so I wanted to double all the stats of all the MOBs in the stock world. What would be the easiest way of doing that?

Or for example, I changed the "balance" of the game and I want to cap all my weapons to have 4D4 maximum.

Things of this nature, are they built into stock TBA, or is this something I would have to develop? Any thoughts?

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 #615 by Liko
Replied by Liko on topic World "Re-Factoring"

zusuk wrote: Lets say I doubled my levels in my game, so I wanted to double all the stats of all the MOBs in the stock world. What would be the easiest way of doing that?

Or for example, I changed the "balance" of the game and I want to cap all my weapons to have 4D4 maximum.

Things of this nature, are they built into stock TBA, or is this something I would have to develop? Any thoughts?


You can cap your weapons in oasis.h

Honestly if your wanting to do a change like that..I would world wipe and start clean. That is my own opinion.

DragonBall: Tournament (1.2.0)
Owner/Developer

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

More
6 years 1 month ago #616 by Rumble
Replied by Rumble on topic World "Re-Factoring"
There is no existing solution. But you could either rewrite and check the levels/standards you want via a script/code solution or do it with some fancy client triggers/automation in game. Years ago when I "balanced" tbaMUD I set zmud to edit every existing mob and set the defaults stats by resetting mob level. Both will take some time.

Rumble
The Builder Academy
tbamud.com 9091

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 #627 by zusuk
Replied by zusuk on topic World "Re-Factoring"
I couldn't imagine writing ZMud triggers to do a whole world. You are a beast :P

Maybe that would be an ideal feature though, considering that most people whom nab up a stock codebase are about to mess around with the game mechanics one way or another.

I have no objections with having to wipe the world clean. Although it sure would be tragic if I couldn't refine my game mechanics with a stock world, that way any player testers I had would have a world to explore.

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 #628 by Liko
Replied by Liko on topic World "Re-Factoring"

zusuk wrote: I couldn't imagine writing ZMud triggers to do a whole world. You are a beast :P

Maybe that would be an ideal feature though, considering that most people whom nab up a stock codebase are about to mess around with the game mechanics one way or another.

I have no objections with having to wipe the world clean. Although it sure would be tragic if I couldn't refine my game mechanics with a stock world, that way any player testers I had would have a world to explore.


If you do decided to wipe keep 0.zon, and all 0 stuff. It has great examples and everything.

DragonBall: Tournament (1.2.0)
Owner/Developer

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

More
6 years 1 month ago #632 by Halenbane
Replied by Halenbane on topic World "Re-Factoring"
Yeah, agreed. I kept 0 & 12. And temporarily 30,31,32 for Midgaard just as a place holder. But once the new zones go in, Midgaard is no more :D

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 #635 by Vatiken
Replied by Vatiken on topic World "Re-Factoring"
Zones to keep:
0, 1, 2, 3, 12

Core Changes:
The easiest way of going about massive changes to the world files is to do a back-up of your world, and then have them altered upon loading. There are many examples in the loading of mobiles and objects where a conversion has taken place.
  if (((retval = sscanf(line, "%s %s %s %s %s %s %s %s %d %c", f1, f2, f3, f4, f5, f6, f7, f8, t + 2, &letter)) != 10) && (bitwarning == TRUE)) {
    /* Let's make the implementor read some, before converting his world files. */
    log("WARNING: Conventional mobile files detected. See config.c.");
    exit(1);
  } else if ((retval == 4) && (bitwarning == FALSE)) {
    log("Converting mobile #%d to 128bits..", nr);
    MOB_FLAGS(mob_proto + i)[0] = asciiflag_conv(f1);
    MOB_FLAGS(mob_proto + i)[1] = 0;
    MOB_FLAGS(mob_proto + i)[2] = 0;
    MOB_FLAGS(mob_proto + i)[3] = 0;
    check_bitvector_names(MOB_FLAGS(mob_proto + i)[0], action_bits_count, buf2, "mobile");

    AFF_FLAGS(mob_proto + i)[0] = asciiflag_conv_aff(f2);
    AFF_FLAGS(mob_proto + i)[1] = 0;
    AFF_FLAGS(mob_proto + i)[2] = 0;
    AFF_FLAGS(mob_proto + i)[3] = 0;

    GET_ALIGNMENT(mob_proto + i) = atoi(f3);

    /* Make some basic checks. */
    REMOVE_BIT_AR(AFF_FLAGS(mob_proto + i), AFF_CHARM);
    REMOVE_BIT_AR(AFF_FLAGS(mob_proto + i), AFF_POISON);
    REMOVE_BIT_AR(AFF_FLAGS(mob_proto + i), AFF_GROUP);
    REMOVE_BIT_AR(AFF_FLAGS(mob_proto + i), AFF_SLEEP);
    if (MOB_FLAGGED(mob_proto + i, MOB_AGGRESSIVE) && MOB_FLAGGED(mob_proto + i, MOB_AGGR_GOOD))
      REMOVE_BIT_AR(MOB_FLAGS(mob_proto + i), MOB_AGGR_GOOD);
    if (MOB_FLAGGED(mob_proto + i, MOB_AGGRESSIVE) && MOB_FLAGGED(mob_proto + i, MOB_AGGR_NEUTRAL))
      REMOVE_BIT_AR(MOB_FLAGS(mob_proto + i), MOB_AGGR_NEUTRAL);
    if (MOB_FLAGGED(mob_proto + i, MOB_AGGRESSIVE) && MOB_FLAGGED(mob_proto + i, MOB_AGGR_EVIL))
      REMOVE_BIT_AR(MOB_FLAGS(mob_proto + i), MOB_AGGR_EVIL);

    check_bitvector_names(AFF_FLAGS(mob_proto + i)[0], affected_bits_count, buf2, "mobile affect");

    /* This is necessary, since if we have conventional world files, &letter is
     * loaded into f4 instead of the letter characters. So what we do, is copy
     * f4 into letter. Disadvantage is that &letter cannot be longer then 128
     * characters, but this shouldn't occur anyway. */
    letter = *f4;

    if(bitsavetodisk) {
      add_to_save_list(zone_table[real_zone_by_thing(nr)].number, 0);
      converting =TRUE;
    }

  log("   done.");
If I were for example doubling stats on mobiles, I would just put a x2 on everything after loading the mobile and then add the mob zone data to the save list.

On another note, I took a look into the loading code and it wouldn't be too much hassle to add VERSION # following the vnum of a mob/obj/room etc.. This might make upgrading/changing mobs/obj/etc a little easier for developers.

Example:
  .. parse mobile code

  if (version != CURRENT_MOB_VERSION) {
    int former_version = version;
    switch (version) {
      case 1: version = upgrade_to_version_2(mob);
      case 2: version = upgrade_to_version_3(mob);
      case 3: version = upgrade_to_version_4(mob);
      break;
    }
    mudlog(CMP, TRUE, LVL_GOD, "Upgraded vnum %d from version %d to version %d.", vnum, former_version, version);
  }

tbaMUD developer/programmer
The following user(s) said Thank You: bakarus, 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 #645 by zusuk
Replied by zusuk on topic World "Re-Factoring"
That would load the mobs with the correct adjustments, but I would have to force a save somehow then remove that code before the next load?

Would it be better to do the opposite, and instead of loading it with the adjustments, save it with the adjustments?

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 #648 by Vatiken
Replied by Vatiken on topic World "Re-Factoring"
By adding the corrected zone to the save table you'll be able to do a mass save with "saveall", then just remove the "convert()" function, compile, copyover/reboot and done. There are other ways to go about it, but after writing the initial convert() function, it takes all of 2 minutes to change the files.

Just remember to back-up in case you mess something up.

tbaMUD developer/programmer

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

Time to create page: 1.738 seconds