Announcement

Collapse
No announcement yet.

DESIGN/DEBUG: reconstructing file type 66

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DESIGN/DEBUG: reconstructing file type 66

    If we want to be able to load scenarios - like the LOTR scenario - that have been generated with the Activision 1.1 patch, we have to support the changed file format. From the change list of the Activision patch we get
    * Incremented save file version to force string reload for old games.
    So, open GameFile.cpp, add a new file type 66, and try to open the LOTR scenario. Instead of directly returning to the selection screen, it really starts to load now.
    Getting some Assert popups, applying some modifications, getting lots of Assert popups , thinking I should have started with something simpler than LOTR , more debugging , getting even more popups , more debugging, more popups , [ ... ] , but finally getting something recognisable on the display with only about 20 popups left to Ignore.

    In the end, the difference between the file formats appears to be an inserted byte in the city data. Reading and writing it (up to now I only encountered 0 as value) is no problem, but I don't have a clue what it is supposed to do. For now, I have added a new member variable and christened it m_unknown_from_patch, but I do not consider this ripe for inclusion in the altered source file thread yet. If you want to check it out, see for the code changes, and LOTRdata.zip for some LOTR data file changes.

    Any suggestions on a name and possible meaning of the new data will be appreciated!

    [Edit: moved the code to the altered source code thread after testing.]
    Last edited by Fromafar; February 26, 2004, 18:14.

  • #2
    Originally posted by Fromafar
    In the end, the difference between the file formats appears to be an inserted byte in the city data. Reading and writing it (up to now I only encountered 0 as value) is no problem, but I don't have a clue what it is supposed to do.
    We know that savegames of CTP2.1 are incompartible with CTP2.0, obviously this is indeneded, inserting such a dummy byte could do the trick.

    -Martin
    Civ2 military advisor: "No complaints, Sir!"

    Comment


    • #3
      If I start a new game and try to settle, the city name isn't properly displayed and I get a debug assertion at civarchive line 338. If I try to ignore it, the game crashes.
      Last edited by Peter Triggs; January 17, 2004, 09:12.

      Comment


      • #4
        I commented out the lines you added to CityData::Serialize. This avoids the crash.

        City names still aren't being displayed properly: I either get no name at all or something like " 2 Warsaw".

        To test scenarios, I'm using the World Map scenario so that there's less to go wrong. I've just put in a units.txt with Settlers having 10 tiles of movement so that I'll know that it's loaded the right data.

        So, now for the good news. Fromafar, you're a genius. It looks like you've just fixed one of the most annoying bugs in the game.

        The reason why nobody made scenarios was because they didn't work properly. IIRC, MedMod and Cradle started out as scenarios. The problem was that you could start playing a scenario game but if you saved it and later restarted, you wouldn't get the right data files. That's why people used ModSwapper; it made sure that the right files were loaded. Now I've saved and loaded several times and my settler still has the 10 movement points. So it looks like you've fixed it by copying the scenario name into the save info. This means that we don't need ModSwapper anymore and we can use the scenario system as it was intended.

        Comment


        • #5



          My hat is off to you Fromafar. Great work on yet another fix.
          Solver, WePlayCiv Co-Administrator
          Contact: solver-at-weplayciv-dot-com
          I can kill you whenever I please... but not today. - The Cigarette Smoking Man

          Comment


          • #6
            [Cot spares a few thoughts for those poor souls who made modswapper into such a friendly to use program..........i never knew that was why we used Modswapper!]

            Fromafar - Thank you and i hope you're having fun!
            'The very basis of the liberal idea – the belief of individual freedom is what causes the chaos' - William Kristol, son of the founder of neo-conservitivism, talking about neo-con ideology and its agenda for you.info here. prove me wrong.

            Bush's Republican=Neo-con for all intent and purpose. be afraid.

            Comment


            • #7
              He definitely is . Almost every of his posts is either a bug fix or some valuable debug information, clearly a member of the community to be respected and remembered.
              Solver, WePlayCiv Co-Administrator
              Contact: solver-at-weplayciv-dot-com
              I can kill you whenever I please... but not today. - The Cigarette Smoking Man

              Comment


              • #8
                Originally posted by Peter Triggs
                I commented out the lines you added to CityData::Serialize. This avoids the crash.

                City names still aren't being displayed properly: I either get no name at all or something like " 2 Warsaw".

                To test scenarios, I'm using the World Map scenario so that there's less to go wrong.
                Strange. I don't get this behaviour. Actually, I can not use the world map at all, because it has more than 32 tribes, which causes a crash when trying to access tribe 33. But that is another problem. From what I could investigate, the world map has file type 63, which is pre-patch, so the new code should not be triggered at all during loading. Did you change the world map scenario yourself and save it? This could give it a new type number.

                The displacement of the name is a clear indication that some interpretation is still missing - this is how I found out about the missing byte in the city data. But it could also mean that the file is corrupt (or doesn't match the file type indicated in the file).

                And, to not get unearned credit: I am not aware of having fixed any scenario paths. Maybe you have fixed this yourself, Peter.

                Comment


                • #9
                  I thought that the problem with scenarios was that when you saved and reloaded you got all of your movement points back, plus a new turns worth of production, science, etc.

                  Comment


                  • #10
                    Originally posted by J Bytheway
                    I thought that the problem with scenarios was that when you saved and reloaded you got all of your movement points back, plus a new turns worth of production, science, etc.
                    The extra turn bug was another problem, well actual I don't know if it was a problem or it is still a problem.

                    There were also another problem but I saw it just in one game, I played with the city styles and put into a subfolder of the pictures folder some other sprites and at one time the game started to use these sprites in the subfolders instead of the original ones and finally the game crashed at loading. So you cannot be sure that the game loads the right data, well before playing mods I played on selfmade maps, obviously in that respect there is no problem as the map is also saved in the save file and no additional rhules where used.

                    In mind the bug also appeared not at once and I wasn't able to find a pattern behind it.

                    -Martin

                    -Martin
                    Civ2 military advisor: "No complaints, Sir!"

                    Comment

                    Working...
                    X