Co8 8.1.0 bugs

Discussion in 'The Temple of Elemental Evil' started by sirchet, Aug 15, 2014.

Remove all ads!
  1. messedup

    messedup Crazy Warrior Supporter

    Joined:
    Mar 28, 2014
    Messages:
    208
    Likes Received:
    0
    Just noticed something strange with my sorcerer. Are you supposed to be allowed to change a spell within a level? This happened when my sorcerer was at about level 8 and all the spells were open to be changed but I could only do one. I am saying that the blocks listing the spells when going up levels allowed for one spell to be changed and then when one spell was changed, the blocks for all the other spells that were there went away.

    This is in the New Content version.
     
  2. Endarire

    Endarire Ronald Rynnwrathi

    Joined:
    Jan 7, 2004
    Messages:
    953
    Likes Received:
    112
    It's standard 3.5 and ToEE for you to be able to swap 1 spell you know as a Sorcerer or Bard for another of the same level. This happens at Sor4, Sor6, Sor8... and Bard5, Bard8, Bard11...
     
  3. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    578
    Likes Received:
    60
    I just found a major problem in the Persistent Data system that could be upsetting to new games.

    Persistent data stays in memory until the program is fully shut down. So if you quit your current game (but don't shut the program itself down), then start a fresh new game, the existing persistent will still be in the system with the new game. The problem arises when you do your first save for the new game, because it will include all the persistent data from the old game.

    I can imagine this has mucked up quite a few fresh games, with dozens of flags and timed events set at the start of a fresh game.

    Recommend completely shutting down TOEE before starting a new game.
     
  4. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Iirc this is also the case for secret doors. And a bunch more caches. Basically ToEE has cleanup routines for save/load but often none for quit to menu / start new game.
     
  5. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    578
    Likes Received:
    60
    I don't know what percent of peoples games this has totally thrown out the window, but there could be a quick fix that checks for any persistent data lurking in memory and zeros it all out before play starts. Maybe in the shop map or somewhere early on.
     
    Last edited: Jan 11, 2018
  6. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    I think the shop map would be ideal.
     
  7. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    578
    Likes Received:
    60
    Here's the fix, it's very short:

    In /co8Util/PersistentData.py, add a new function called clearData() to the class Co8PersistentData.

    Code:
    def clearData():
        """Clear all data entries"""
        Co8PersistentData.__dataDict.clear()
    clearData = staticmethod(clearData)
    

    Then in py00334generic_spawner.py, where the first_heartbeat occurs in the Shop Map, the line marked by the comment is added.

    Code:
    elif (attachee.map == 5107):
    # shop map
        money_script()
        shopmap_movie_check()
        Co8PersistentData.clearData()   # clears persistent data
    return RUN_DEFAULT
    

    You alse need this at the top of py00334generic_spawner.py.

    Code:
    from co8Util.PersistentData import *
    from co8Util.ObjHandling import *
    

    It all seems to work just fine, and the only other thing that might be added as a safeguard is a global_flag to mark that the data has been cleared, just in case someone makes it back to the Shop Map and the first_heartbeat triggers again.

    Should I include the files?
     
  8. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Actually it would be better to give the player a warning that starting a new game after quitting to menu from a save is dangerous.
     
  9. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    578
    Likes Received:
    60
    I was going to suggest that actually, before I dug into the files.

    But I'm confused as to why warning a player about a bug would be better than actually fixing it?
     
  10. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Because as I mentioned there are other bugs that could happen for the same reason.
     
  11. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    578
    Likes Received:
    60
    I think doing both would be a good idea then. A warning will be ignored by a certain percentage of players, so you may as well fix as much as possible for those that plod on past the warning. Unless you completely prevent a player from starting a new game at the very beginning, which may be the ideal solution.

    BTW, is that what was responsible for the secret door bug? I'm not referring to the Co8 Persistent Data, but the other cache stuff from the original game.
     
  12. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    Is there a way to add cleanup routines to the quit to menu option?
     
  13. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    You can add an exit() python command, but that seems somehow harsh. I agree that it's better to do both though, and I guess players who ignore warnings do so at their own peril.

    I don't know if it's the ONLY means of triggering the bug, but it certainly does it.
    The "names seen" list is stored at memory location 0x109DD880. This is the list of scenery object names your party has already seen, which is used by the game to prevent searching for secret doors repeatedly. You can debug the values yourself using the Temple+ "Debug" menu option. In a fresh game, the list should be all zeros, but when you quit to main menu from an advanced save and then start a new game, it'll have that save's values there:

    upload_2018-1-13_8-27-22.png

    The SD bug is 100% caused by this list being non-empty and containing the values of SD names, and it is likely that the above mechanism is the one by which it happens.

    Another example of this type of bug is an exploit someone recently discovered where you can kill high level critters and quit to main menu before exiting combat. It will then hold the "CRs killed" array without wiping it clean, and when you start a new game you'll get a ton of XP on the first combat because of it.

    That sort of thing can be fixed in Temple+ on a case by case basis, but it's hard to anticipate everything. The best practice at any rate is to just quit the game before starting a new game.
     
  14. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
  15. messedup

    messedup Crazy Warrior Supporter

    Joined:
    Mar 28, 2014
    Messages:
    208
    Likes Received:
    0
    Just noticed something...I knew that if you sold the fireballs that you get from the Nulb weaver after you rescue him, the price is the same everywhere. I just looked at a darkwood shield and it is just above 99 gps everywhere. Is this supposed to be?
     
Our Host!