Announcement

Collapse
No announcement yet.

Hexediting stuff - net trade

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

  • Hexediting stuff - net trade

    The document Hexedit.rtf says that in "cities section" bytes 31-32 stand for "net trade (not including those from trade routes)" ("base trade arrows" in samson's terminology), in other words trade that is used for computation of revenue of a caravan delivery.

    My question is: will it be a problem if this value is set incorrectly? Is the value used by Civ2 directly, or does Civ2 recalculate it when a caravan is being delivered?

    (I want to write a tool for PBEM games that will reset workers that were relocated after some player opened Demographics window by mistake. But I will hardly be able to count "net trade" correctly)
    Civ2 "Great Library Index": direct download, Apolyton attachment

  • #2
    As usual ST, I find myself as SlowerThinker in a discussion with you.

    Sadly, I don't know the answer to your question. The ones most likely to know, Catfish and Mercator, visit CivFan more often than here. I suspect that this is an unexplored region for us.

    Since you have a well-earned rep for testing, testing, and testing, I'm curious about the context here. Have you checked this yourself? If so, what have you found? If not, is a limiting hex-editing capability hindering you? In that case, some of us can help you set up a test.
    El Aurens v2 Beta!

    Comment


    • #3
      I didn't test it, as I am busy and primarily I want to write that tool (we need it in our SoG PBEM now).
      Last edited by SlowThinker; March 31, 2007, 19:06.
      Civ2 "Great Library Index": direct download, Apolyton attachment

      Comment


      • #4
        Well, I'm not sure about all the formulas behind it I'm afraid... I just did some hex-editing and checked samson's thread... My calculations didn't quite match what I actually got, but nevermind that.

        From my tests it seems that the net trade is not recalculated for a caravan delivery. I hex-edited one of my existing savegames and then cheat-created a caravan with the same properties in both the original and the one with an edited net trade value. The trade revenues were different.

        The net trade is recalculated when opening the city screen, I noticed, but I'm not sure if that's any use to you.


        Oh, and I updated the hex-editing document in that thread. It's nothing related to this though.
        Last edited by Mercator; March 31, 2007, 19:32.
        Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

        Comment


        • #5
          Thank you for the testing.

          The net trade is recalculated when opening the city screen
          It looks most (probably all) values are recalculated only after you click on the city (+ after some other actions, like a delivery of a caravan).
          (For example you are never sure if the F4 window is correct, unless you opened all cities before. The programmers forgot that a founding of a new city may affect happiness in all other cities)

          In my tool I could recalculate the "net arrows", but it would be very laborious and I would have to avoid a mistake. Better to add a warning "open all city screens after usage".
          Last edited by SlowThinker; April 1, 2007, 06:42.
          Civ2 "Great Library Index": direct download, Apolyton attachment

          Comment


          • #6
            Opening the Demographics window recalculates them too... But I suppose that's not something you'd want.
            (Though I'm not familiar with the bug with that in PBEMs.)
            Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

            Comment


            • #7
              BTW the programming style of Civ2 is terrible.

              Civ2 needs "net arrows" of cities only for calculating caravan deliveries. Therefore a natural idea would be not to store the value but to calculate it just after a caravan is delivered.
              But no. They decided to store the value in the memory (= a vaste of memory) and to recalculate it when it changes. But it changes much more frequently than it is used (= a vaste of computer time).

              Of course they forgot to recalculate the value in some situations: for example after roads are built but a city window is not opened (I just tested it).
              Civ2 "Great Library Index": direct download, Apolyton attachment

              Comment

              Working...
              X