Project Jerkstop: The Final Solution

Discussion in 'General Modification' started by Gaear, Mar 14, 2012.

Remove all ads!
  1. sirchet

    sirchet Force for Goodness Moderator Supporter

    Joined:
    Dec 6, 2003
    Messages:
    3,721
    Likes Received:
    49
    MWAHAHAHAHAHAHAH I have been waiting nine years to point my finger at Gaear and say see ... He IS wrong .... once out of ..... a gazillion times .....

    Somehow it just does't feel like I imagined it, wait! If I'm patient maybe he'll mess up and I can say TWICE ... Out of a gazillion .....

    Gah! You just need to mess up more darn it, Gaear!
     
  2. Daryk

    Daryk Veteran Member

    Joined:
    Jan 14, 2012
    Messages:
    1,177
    Likes Received:
    34
    I really hate to rain on this parade, but in playing version 7.8, I just experienced some mild jerkstop in Verbobonc, where I've never had it before. I was crossing the West Bridge, moving from the Castle of the Lords to the Church of Pelor. Roughly half a dozen times, I gave move orders that terminated early for no apparent reason. I noticed two NPCs (a guard and a citizen) walk through one another just before the problem hit, but I have no idea if that had anything to do with it. When I finally got everybody away from the bridge on the Church side, it cleared up, and everything seems to be working now.
     
  3. sirchet

    sirchet Force for Goodness Moderator Supporter

    Joined:
    Dec 6, 2003
    Messages:
    3,721
    Likes Received:
    49
    Where you able to repeat this, or was it a one time thing?
     
  4. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Thanks, but I'm not too worried about isolated incidents in places where it's not known to occur. Going way back, there were a couple sporadic reports of JS in Hommlet even with the vanilla game or very early Co8, so whatever JS is, it's not something we invented. We did bring it to Hommlet fullscore though, so at this point I'm mainly interested in the notion that it seems to be gone from there. :)
     
  5. Daryk

    Daryk Veteran Member

    Joined:
    Jan 14, 2012
    Messages:
    1,177
    Likes Received:
    34
    No repeats yet. Hopefully it was just a one time thing. If it happens again, I'll let you know.
     
  6. GuardianAngel82

    GuardianAngel82 Senior Member

    Joined:
    Oct 3, 2007
    Messages:
    3,481
    Likes Received:
    5
    A similar phenomena can occur when a movement is supposed to be terminated by the initiation of combat, except the combat sequence doesn't start. I had that occur in 7.8 with the frogs at the Moathouse. I've also had it occur in vanilla. In this case, just move again until combat initiates.
     
  7. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    I'd like to bring some closure to this tragic modding mishap, and also a warning to all modders present and future:

    DO NOT MAKE MOBS WITH THE OF_DYNAMIC FLAG ON!!!

    That's all :p

    So basically that's what caused this bug. The invisible NPC with the first_heartbeat script that brings up the popup in Hommlet was flagged OF_DYNAMIC.
    Behind the scenes, this caused the engine to create a replica of him every time you entered Hommlet. After re-entering the map enough times, it would clog the animation system - the maximum number of animation slots is 512, and when that is exceeded animations begin to fail. (note that Hommlet had a ton of pre-existing animations - every tree, bush and cabbage takes a slot, so it was not far from the limit to begin with)
    Sure enough, once I removed the offending flag from the mob, the replicas stopped appearing.

    Also, in case you were wondering, it had nothing to do with the popup boxes in and of themselves - they're harmless.

    Didn't mean to open old wounds, but I wanted to figure out the root cause, in case it was creating other bugs elsewhere. Who knows, it may well have done so in other unexpected ways. Certainly something to look out for.
     
    Zoltec, FredSRichardson and anatoliy like this.
  8. FredSRichardson

    FredSRichardson Established Member

    Joined:
    Apr 13, 2004
    Messages:
    145
    Likes Received:
    3
    Wow, great find! This game still holds a pretty important place for me at least. The PnP implementation was really amazing for that time.
     
  9. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Welcome back Fred! (did that post ping you? :D)

    Following this, I added a check for duplicate GUIDs when loading a map. And sure enough...

    duplisheep.jpg

    Though this one isn't caused by OF_DYNAMIC - seems to be related to daynight xfers being out of sync, perhaps with initial state.
     
    Zoltec likes this.
  10. Zoltec

    Zoltec Pгōdigium

    Joined:
    Apr 22, 2012
    Messages:
    547
    Likes Received:
    16
    !... So this OF_DYNAMIC can you internally disable it so all scripts that has it will stop? I guess it has other uses and may break other scripts if you disable it but what is the purpose of that flag?
     
  11. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,745
    Likes Received:
    375
    Well, that's the problem - I suspect every NPC mob in the game has this flag set. Good pickup indeed on the pop-up critter, but what are you suggesting? Do we need to change every one? All those sheep have the flag set for instance - why is only one replicating?
     
  12. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Ah, no, you shouldn't turn it off with scripts on all creatures - I'm specifically referring to MOB objects created from MOB files.

    In fact, objects created by script will be flagged OF_DYNAMIC by the engine, as they should - this is what designates them as dynamic objects, and that's the meaning of the flag. These objects are then saved to the mobile.mdy file, whereas non-dynamic MOB objects only save differences from their original file.

    However it's certainly a good idea to add an engine level check for that flag right after loading the files, and probably switch it off.
     
    Zoltec likes this.
  13. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,745
    Likes Received:
    375
  14. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Actually all those sheep are duplicates - you can see that after attacking them, they do that "relocate to empty tile" teleport and there’s two of each. The one I highlighted just happened to do the "eat grass" animation.

    However in this case it's not due to the of_dynamic flag, or at least not for the ones in the hommlet exterior map - seems to be a daynight xfer related issue since I see they get transferred from another map. The cloned sheep issue isn't present in vanilla ToEE btw. Still looking into that.
     
  15. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Oh and as for your suspicion that every mob jas it - I doubt that most visible NPCs have that problem, since they'd generate duplicates, which should be quite jarring when testing things. I suppose the sheep flew under the radar since normally you don't interact with them.
     
    Last edited: Sep 18, 2021
Our Host!