Follower data in save game file

Discussion in 'Arcanum Hints & Tips' started by Maratanos, Apr 17, 2010.

Remove all ads!
Support Terra-Arcanum:

GOG.com

PayPal - The safer, easier way to pay online!
  1. Maratanos

    Maratanos New Member

    Messages:
    4
    Likes Received:
    0
    Joined:
    Apr 17, 2010
    Would somebody here happen to know where in a saved game file the data describing which characters are occupying the follower slots is? For some reason Magnus has suddenly decided to take up two slots, and it's making things rather strange. The simplest way I can think of to fix this would be to open the save file and replace one of his references with an empty reference. If absolutely necessary, I'll reload an older save, but I'd like to avoid that if I can.

    EDIT: I suppose another thing that would work is if somebody knew a way to modify specific script variables. If I could tell Magnus to wait and then clear the script variable saying he's currently waiting, that would solve my problem equally well.
     
  2. DarkFool

    DarkFool Nemesis of the Ancients

    Messages:
    4,007
    Likes Received:
    5
    Joined:
    Jan 28, 2005
    I don't think anyone here (that's left, at least) has done that much delving into how the save games are structured. You could try hitting up the Ruskies' forums, if you speak Russian. This game still has a following there.

    The other option is: tell Magnus to wait, and hope that it doesn't break your game. :)
     
  3. Maratanos

    Maratanos New Member

    Messages:
    4
    Likes Received:
    0
    Joined:
    Apr 17, 2010
    Yes, the problem is that the game thinks that there are two followers in my party named Magnus, and yet both of their references point to the same NPC. So I could tell one Magnus to wait, but then Magnus is waiting. If I talk to him, I don't get the option to tell the other to wait (and it ignores such a command if sent via the follower context menu), and if I try to bring him back in the party we're back to double Magnuses.

    I mean, it's not really that huge of an issue because I have more follower slots than I want and other than the fact that I'm using one too many follower slots, it doesn't affect the game at all. But it's annoying.
     
  4. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
    Although I haven't heard of this problem before, a comment you just made about the second one not having a Wait command option has me wondering if you've tried telling one of them to disband - as in leave the party permanently.
    That might free up the remaining Magnus' menu. A small chance, but stranger things have happened.
     
  5. Maratanos

    Maratanos New Member

    Messages:
    4
    Likes Received:
    0
    Joined:
    Apr 17, 2010
    Okay, so, while it's impossible to tell a follower to disband while their dialog options are set to waiting, I did discover how to delete a follower from the list of followers currently in your party, how to delete a follower from the list of followers currently waiting outside your party, as well as how to toggle whether or not a follower's dialog script thinks they're currently in the party. These things are rather complicated to explain, so I don't really want to go over how I did it unless somebody wants to know, but I would like you to know that I did figure out how to do this and if anyone is interested in the details I will indeed let you know.
     
  6. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
    Glad to hear it, Maratanos.

    One of these days, someone is bound to run into the same problem as you, so if you ever get bored enough and feeling generous, do us a favor and post how you did that here.
     
  7. DarkFool

    DarkFool Nemesis of the Ancients

    Messages:
    4,007
    Likes Received:
    5
    Joined:
    Jan 28, 2005
    I second this. If you have the time, a write-up would be excellent.
     
  8. Maratanos

    Maratanos New Member

    Messages:
    4
    Likes Received:
    0
    Joined:
    Apr 17, 2010
    Okay, here goes.

    First of all, some disclaimers. I had some old save games from before my save got corrupted, and when I went to look at them using a hex editor I found that they had some features that my newer saves did not have. Thus, I should warn you, it's entirely possible that you could seriously screw up your game if you try doing this when it's not strictly necessary. Also, I have not yet completed the play-through where this happened, and it's entirely possible that my efforts to fix my problem have caused serious problems down the road. I am not responsible if you use my advice to fix a similar bug and something really screwy happens instead. If for some reason your save file does not behave the way I will describe mine as having behaved, I suggest you make sure you understand completely what's going on before you implement my changes. And of course, always make a backup. Never write over your backup. If you do this wrong the saves you modified will be unopenable.

    That said, over the course of the several days it took me to figure out how to do this, I did learn some things about how the TFAF format stores follower data, and I believe that if you end up having the same or a similar problem to my own, it is likely that you should be able to solve it using the techniques I am about to outline.

    ----------------------------------

    1. There are several steps that need to be completed before you can begin. First of all, you need to be able to get a hex editor that is capable of doing binary comparison on shifted offsets within a pair of files, as well as being capable of deleting bytes and thus decreasing the size of the file. I do not have a recommendation because the Hex Editors I used (I ended up having to use two in order to get both of those features) were not optimal, and I suggest you attempt to find something yourself. It shouldn't be too hard.

    2. Once you have your hex editors, you need to load the corrupt save in Arcanum and take a journey into the middle of nowhere on the world map. Once you arrive your followers should spread out around you. Speak to the problem follower (in my case it was Magnus), then exit the dialog. Do not scroll the map while you are doing this. Then, save your game. Then, right click on the problem follower's icon and tell them to wait. Then, as soon as possible afterwards, save your game again. If for some reason you need to recreate this pair of saves later, remember that you need to save both saves concurrently. If you load one of them, save over it before saving a second time.

    All of the above is designed to make there be as few differences between the two save files as possible, and to limit those differences to the ones which are relevant to our problem.

    3. Once this is done, exit Arcanum and load up your pair of tfaf files in your hex comparer. If all has gone according to plan, then your save files should look very similar to what mine did.

    Now when you scroll to the first difference between the two files, you should find that there are four differences in short succession surrounded by a block of data which is the same between the files. One of those four differences is the in-game date. Two others are data which I cannot tell the purpose of, and seem to vary randomly (although modifying them can lead your save game to do screwy things). The fourth and last should be a single byte, in which you should find that when you removed your problem follower from your party, that byte increased in value by 1 (remember how hex works, by the way). If you do not have this block of four differences, but instead have only three, none of which seem to vary by only 1, then in all likelihood the follower in question does not have data associated with them with regards to when they were told to wait by the player, and you will likely find that step 4 does not apply to you.

    If for some reason you cannot find the block of differences I am referring to, it may help to follow these steps: open the .gsi files in your hex comparer. There should be two differences. The first is the date, the second is the name of the save game file. From the first byte of difference in the date, write down that byte and the next three bytes. Then search for that hex string in your .tfaf file. This should bring you directly to this point in the code, where you should be able to proceed as above.

    4. This step details how to delete an entry from the list of followers currently being told to wait. It was necessary for me to do this because there was one too many such entries for Magnus.

    In order to do this, scroll down from the point in step 3. you should eventually come to a section where 48 bytes have been added when you told your follower to wait. These 48 bytes should end with "01 00 00 00" and be immediately followed by "00 00 00 00 FA EC EF BE" (or something similar-looking, I'm not sure if I'm remembering that quite right) followed by a sequence of zeros interspersed with the occasional nonzero value. You must delete these 48 bytes from the second file. Then you must go up to the site mentioned in step 3 and decrease the value of the fourth and final difference there by 1, so that that byte is the same between the two files.

    At this point in time, once you save your second tfaf file, your save game will not open. In order to complete the modification and make your save once again playable, you must open up the two .tfai files in your hex comparer. You should find that there are only two bytes of difference between the two files, the first of which immediately following the string "data.sav" (or possibly "data2.sav", I don't remember), the second following "mobile.mdy" or something similar. In your second save file, modify the first difference so that that byte is identical to what it is in the first file. Save it.

    At this point, you should be able to reopen your second file and find that with regards to the script variables which decide when a player has left a follower to wait too long (and they thus get mad at you), the character is not currently waiting. They will still have dialog options like they are waiting, they will still not be a member of your party. But if you talk to them and end waiting, then, assuming that your save game was corrupt insofar as it had that entry too many times, they will rejoin your party and the save will no longer be corrupt. If your game crashes at some point during this process, then you've either done something wrong or you tried to do this when you shouldn't have. Or else I just didn't know as much as I thought I did about how to do this.

    5. How to modify a player's dialog script to determine whether they are waiting.

    This is necessary if for some reason you have an NPC whose dialog thinks it is waiting when it is not, or vice versa.

    Once you have opened your pair of saves, produced as above, you should find somewhere in the file (it seems to vary where) three bytes of difference. On one file there should be 2 "30"s and a "02", on the other there should be 2 "38"s and an "0A". If you modify one file so that it agrees with the other, you will have modified whether or not that file has the problem follower marked as currently in your party for the purposes of dialog. Choose appropriately which file to modify in order to achieve the goal you want.

    6. How to modify the list of followers currently on the left sidebar.

    I did not actually have to do this, but I believe I know how, although I have not tested to make sure. Try this at your own risk.

    Once you have loaded the pair of saves, you should be able to find a place where 24 bytes have been removed from the second file. This should be shortly after a single byte which has decreased its value by 1 and shortly before a single byte which has changed its value X to (X+1)*2 -1.

    The first byte is the number of followers in your party. It must agree with the number of 24-byte segments following it or else your game will be treated as corrupt. The second byte is 2^(number of followers in your party) -1 in hex. Dunno why this is necessary, but make sure they match up. The 24-byte segment which has been removed represents the code associated with the particular follower occupying that slot in your list.

    In order to remove a follower from this list, decrease the first byte by 1, modify the second byte X to (X+1)/2 - 1. Then delete the 24 bytes associated with the follower you want to remove.

    At this point your save should still be corrupt. I believe that the way to fix this is to load the two .tfai's as before and modify the second difference (the one near mobile.mdy) so that it matches. I'm not sure though. If that doesn't work, you're on your own.

    Alright, that's more or less it. Are there any questions?
     
Our Host!