Announcement

Collapse
No announcement yet.

Maximum # of Events in FW?

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

  • #16
    I just had a little look at the savegame, and it's a bit more complicated than I thought it was.
    The events part seems to be split in two parts, a large portion of "rubbish" (events compiled into at first sight incomprehensible code) and at the very end a string table (all the text from the events squashed together)...
    And the very start of the events section there's a number that says: 32768 (I have FW), which is presumably an indicator of the max size of events.
    I immediately tried changing it to the maximum possible value (around 2 billion)... Of course, that doesn't seem to make any difference, since the events are already there. But Civ2 has a habit of resetting values... Not this one. After playing a little more and after a few events had taken place, that value was still 2 billion.
    If that value really is "THE indicator" that might be some good news. Once we figure out that events code, we might be able to compile the events ourselves, add it to a savegame and set whatever maximum we damn well please ourselves!
    Another possibility is to find where in the executable this value of 32768 is set, and change that, which should also allow bigger events.
    In other words, there's plenty of reason for us to start up our hex editors!
    ( Interesting how such a seemingly simple question seems to have revealed a possible major Civ2 breakthrough)
    Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

    Comment


    • #17
      Wow.
      Tecumseh's Village, Home of Fine Civilization Scenarios

      www.tecumseh.150m.com

      Comment


      • #18
        Very, very interesting...
        No Fighting here, this is the war room!

        Comment


        • #19
          Take that!

          Techumseh!

          ToT my eye!

          2 billion!!!!!!

          Damn! This is just what I'd like to see. I need an events file that's about 10-20 times as large as the one I'm using in Imperialism 1870. That would really enhance the "uprisings/revolts" part of the thing.

          Mercator, please keep me posted.
          Lost in America.
          "a freaking mastermind." --Stefu
          "or a very good liar." --Stefu
          "Jesus" avatars created by Mercator and Laszlo.

          Comment


          • #20
            Re: Take that!

            Originally posted by Exile
            Techumseh!

            ToT my eye!

            2 billion!!!!!!

            Damn! This is just what I'd like to see. I need an events file that's about 10-20 times as large as the one I'm using in Imperialism 1870. That would really enhance the "uprisings/revolts" part of the thing.

            Mercator, please keep me posted.
            Well Exile, 100kb in the hand is worth 2 billion kb in the bush, as they say. And ToT events language has many other advantages, (more triggers, more actions, multiple events, etc., not to mention multi-layerd maps. etc. etc. etc.)

            Still this is very interesting. If a scn. file could be edited to increase the events capacity, the question then is: Will the extra events which are loaded into the scn file then be retained in the sav. file when you save the game?

            I would also like to be kept posted.
            Tecumseh's Village, Home of Fine Civilization Scenarios

            www.tecumseh.150m.com

            Comment


            • #21
              OK, that means I have to go and do something then.
              Julius Brenzaida, Allard Höfelt, Gothmog etc... Help!
              Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

              Comment


              • #22
                Merc, I kind of hate to say this but why would an apparent events file size tag in the savegame have any effect?
                If its a part of the savegame after events have been embedded but not before then it came from the exe right? Or am I missing something?
                The key question as to whether or not that number makes a difference should be able to be solved by trying to embed events files with drastically different sizes. Taking into account your previous note about different events files having different (not necessarily comparable) sizes you should still see some difference between a 1kb event and a 25kb event. If both of the savegames came up with the same number then its a red herring I'd think.

                [Edit: Actually, scratch that. Now that I think about it that logic doesn't necessarily follow although any effect would still have to rely on the exe getting it from the savegame which sounds a little unlikely to me]

                Finding the part of the exe OTOH sounds like a plan indeed ...
                Last edited by ravagon; May 29, 2002, 22:28.

                Comment


                • #23
                  Well, that number in the savegame is only there when there are events, and is always 32768 (I think)... I think that this would be a maximum size indicator of some sorts, so when changed would allow for more events. But of course, since that number is only in when the events are already in the savegame, changing that number is really pointless unless we would be able to compile events ourselves.
                  So I will be looking into the executable... probably first the CiC executable because there are far less occurrences of 16K in the CiC executable, than there are occurrences of 32K in the FW executable... That would make it easier to test, and might give a clue to which one to pick in the FW executable.
                  Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                  Comment


                  • #24
                    OK... So my try with CiC didn't work out quite the way I hoped. I changed all occurrences of 16K to 24K and there was no difference. That probably means the event size limit is not a long integer (range up to over 2 billion), but a short integer (up to 32K). So the maximum CiC event size would be smaller than the current FW maximum. Moreover, there are more occurrences of short integers with a value of 16K in the CiC executable than there are occurrences of long integers with the value 32K in the FW executable. In other words, the advantage I hoped I would have in first examining the CiC executable isn't there.
                    Now, let's only hope the FW event heap size is a long integer, not a short integer. If the latter is the case, 32K will be as big as we can ever get.

                    Apart from that, it doesn't seem to be a very smart thing to do to open CiC scenarios with the FW scenario editors. It showed more actions than there really were to a trigger. If I'd click on one of those non-existant actions, Civ2 would freeze.
                    That brought me to another "discovery", while in FW the events data is stored in the savegame, in CiC it's not! I verified it using this event:

                    @IF
                    CITYTAKEN
                    city=Rome
                    attacker=ANYBODY
                    defender=ANYBODY
                    @THEN
                    JUSTONCE
                    TEXT
                    Boo!
                    ENDTEXT
                    @ENDIF

                    AFAIK, JustOnce is the only event structure that should require some memory, to remember it if you save and reload a scenario. If no record is kept whether this "once" has already occurred, the action can occur once each time you load a savegame from the scenario.
                    And indeed, if you save and reload, the "Boo!" message will appear again when it shouldn't.
                    I don't know if this is a very interesting, or perhaps already well-known fact... But anyway, now you know.


                    I've now also tested the FW executable. I changed all long integer occurrences of 32768 to 65536, and the debugger refused the events (just over 32K). This doesn't look very good.
                    Ahem... And that 32768 I found in the events section of a savegame was just chance I guess. I haven't found it in any other savegame yet, so it probably isn't the size indicator. By the looks of it, I was a little early screaming about infinite events.

                    On the other hand, I might be able to decipher the events code, but that'll take time, and I really can't do that on my own... And even then, assuming that this code in the savegame is loaded into the events heap in memory, we'll probably still have to deal with a preset maximum, which is probably at it's maximum of 32K already.

                    *sigh* It was fun while it lasted.

                    Any suggestions?
                    Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                    Comment


                    • #25
                      ToT.
                      Tecumseh's Village, Home of Fine Civilization Scenarios

                      www.tecumseh.150m.com

                      Comment


                      • #26
                        ah so hard to live with the 100k and multiple events of ToT.

                        Comment


                        • #27
                          Originally posted by techumseh
                          ToT.
                          Naturally! But the FW'ers deserve a little more too.
                          Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                          Comment


                          • #28
                            It may be possible to rig CSPL to run with FW. You'd need access to the library file that Angelo's locked away though.

                            Comment

                            Working...
                            X