Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Google

Members: 0
Guests: 6
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » LoP Codebase » Reset issue
Forum Rules | Mark all | Recent Posts

Reset issue
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Apr 2, 2009, 6:49 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

In file reset.c
near the top
add
void set_room_reset_nums( ROOM_INDEX_DATA *room );

find
            mob->resetnum = resetnum;

change it to
            mob->resetnum = pReset->resetnum;

find the add_reset function and between the LINK and return make it look like this
   LINK( pReset, room->first_reset, room->last_reset, next, prev );
   set_room_reset_nums( room );
   return pReset;

next in function do_reset find and change three spots that look like this
            delete_reset( pReset );
            send_to_char( "Reset deleted.\r\n", ch );
            return;

to look like this
            delete_reset( pReset );
            send_to_char( "Reset deleted.\r\n", ch );
            set_room_reset_nums( ch->in_room );
            return;

at the bottom of reset.c add
void set_room_reset_nums( ROOM_INDEX_DATA *room )
{
   RESET_DATA *pReset, *tReset, *gReset;
   int nfind = 0;

   for( pReset = room->first_reset; pReset; pReset = pReset->next )
   {
      pReset->resetnum = ++nfind;

      for( tReset = pReset->first_reset; tReset; tReset = tReset->next_reset )
      {
         tReset->resetnum = ++nfind;

         for( gReset = tReset->first_reset; gReset; gReset = gReset->next_reset )
            gReset->resetnum = ++nfind;
      }
   }
}

in mud.h find the reset_data function and add
   int resetnum; /* Not saved but used to keep track of what resetnum it is */

It looks like the resetnum counter in the reset handling tends to count resets wrong for some reason so it looses the right number sometimes.

This affects anyone using the resetfix code. Think its stock in SMAUGFUSS now also.
       
Post is unread #2 Apr 3, 2009, 12:45 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

Now the above does fix the reset issues so that everything resets correctly.
It however doesn't make it work to well when deleting resets and lots of other crazy things.

For ones willing to do the work I suggest going through and add a RESET_DATA *reset to CHAR_DATA and OBJ_DATA and in RESET_DATA add in a CHAR_DATA *ch, OBJ_DATA *obj and then making it point to what it creates and back to itself. When freeing the reset free the stuff pointing to it and what it points to. When freeing the others free the reset pointing to it and then it's reset. (By freeing I mean just set them to NULL since your not adding new data just pointing to existing data). This seems to be the best way of dealing with all the possible reset issues. GL all :)
       
Post is unread #3 Apr 3, 2009, 12:50 pm
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

U lost me >.> Is this a fix that was already added to smaugfuss 1.9?
       
Post is unread #4 Apr 3, 2009, 1:22 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

The orginal reset fix was added as well as some changes to make it work a little better (always some problem here and there that gets found as time goes on) Best thing to do to test and see if you need to change it is go to a room that has like 3+ mobiles that reset there and kill the last one in the room, reset area, kill it again, reset room etc... Keep going and eventually you will run into it not reseting it and eventually all will quit respawning.
       
Post is unread #5 Apr 3, 2009, 2:13 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Well surely there must be a better answer than intertwining all those structs with each other like that. That kind of thing is why Smaug had so many problems to begin with, I'd rather not add to them just because a few mobs don't reset after things have been running for awhile.
       
Post is unread #6 Apr 3, 2009, 3:01 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

Lol dont blame you there it was alot of work getting it all set up and working right. (Works great now though I can even purge an item that a mob is wearing and reset the area and the object be put back on the mobile).

As for the fix post I do suggest doing it if you keep it like it is. It will make the mobiles reset correctly (as long as no resets are added/removed) so like after redoing the resets in a room need a hotboot so everything will run correctly). If you don't apply the fix lets see in my test I used 3 guards in a room, killed last guard and reset area, he spawned back, killed guard again and reset area and he didn't spawn back, so killed second guard and reset area (I think within 10 times he quit respawning also).
       
Post is unread #7 Apr 3, 2009, 5:20 pm
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008


Remcon said:

For ones willing to do the work I suggest going through and add a RESET_DATA *reset to CHAR_DATA and OBJ_DATA and in RESET_DATA add in a CHAR_DATA *ch, OBJ_DATA *obj and then making it point to what it creates and back to itself. When freeing the reset free the stuff pointing to it and what it points to. When freeing the others free the reset pointing to it and then it's reset. (By freeing I mean just set them to NULL since your not adding new data just pointing to existing data).


..... I am still learning, and I am trying my hardest to, But I have no clue how to do this, at all
       
Post is unread #8 Apr 4, 2009, 7:16 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

It is a long process. I've done it on two muds so far (my codebase and on Vladaar's mud).

There is one bad thing that might make you all not to want to use it and that is the fact that doing it the way I suggested and didn't post means that you have to come up with something for hotboot/copyover and storing the info and relinking it afterwords. (No doubt a long process by itself). Mine doesn't do the save world stuff of hotboot to keep objects and mobiles where they were at.

So in the end just apply the fixes I posted and it will make it so your resets work correctly enough. (Just remember when adding/deleting resets they may not work correctly till you get in a hotboot/copyover).
       
Post is unread #9 Apr 4, 2009, 4:52 pm
Go to the top of the page
Go to the bottom of the page

6Dragons
Fledgling
GroupMembers
Posts48
JoinedNov 23, 2008


Remcon said:

It is a long process. I've done it on two muds so far (my codebase and on Vladaar's mud).



Of which I am very happy, thanks Remcon. It is awesome to have resets work as they are supposed too.
No more having to copyover sometimes to work out why some mobs disappeared and kick start them back.
       
Post is unread #10 Apr 4, 2009, 7:19 pm   Last edited Apr 4, 2009, 7:23 pm by dbna2
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

Wanna Share the fix he added for you? I really would appericate it, I don't want resets to mess up when I open my game.
       
Post is unread #11 Apr 5, 2009, 12:58 am
Go to the top of the page
Go to the bottom of the page

6Dragons
Fledgling
GroupMembers
Posts48
JoinedNov 23, 2008

well my game is not smaugfuss, but from what I gather of listening to Remcon,
it isn't a simple fix in reset.c but code changes in multiple files. He even
redid my copyover code because the way my old one saved the state of
every mob and object caused problems with his fix. I believe he gave the
general idea of how to do what is involved with the fix though. I think Samson
and smaugfuss guys are interested in a different way of resolving reset issues.
       
Post is unread #12 Apr 5, 2009, 1:48 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

My game is not smaugfuss it's smaug 1.4a
       
Post is unread #13 Apr 5, 2009, 9:41 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

Dbna2, I think what Vladaar (6Dragons) was saying was that his game, like many of our games, has been so heavily modified at this point that the code would be able to be just posted to here as a snippet or even diff file format and be truly meaningful to you but that the "SmaugFUSS Team" is probably working on something to essentially address this already that will be. Personally, my code also started as Smaug 1.4a (after my mud's hiatus - another story for another place/time) but has since evolved to SmaugFUSS 1.4, then SmaugFUSS 1.6, then something kinda different unto itself.. or something along that sort of path anyway.
       
Post is unread #14 Apr 5, 2009, 10:25 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

The general idea here is something that interests me. What doesn't interest me, is making resets any harder on new coders to understand, by intertwining them with other things. This is one of the biggest issues with Affects currently. They're intertwined into so many different things, and there's so much done using them, that it becomes harder and harder to truly understand how they work. I'm almost positive that they're needlessly complex, and could be simplified greatly. I fear intertwining RESET_DATA into CHAR_DATA and OBJ_DATA will do little else but be a repeat of Affects.

I want to see resets fixed. But I don't want to see them needlessly complicated by intertwining them into everything like Affects. We need an easier to understand solution. However, I'm at a loss for what it is.
       
Post is unread #15 Apr 5, 2009, 11:26 pm
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

Ah, I understand now thanks.
       
Pages:<< prev 1 next >>