Announcement

Collapse
No announcement yet.

Supply and Demand Calculator v2 beta

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

  • Supply and Demand Calculator v2 beta

    Merry Christmas to all and to all a new Supply and Demand Calculator!

    My elves, and by that I mean I, have been working hard to bring you all a (slightly early) Christmas gift this year. As some may be aware, I have been trying to get the calculator to load data from a Civ 2 .sav file. I have got this new functionality to a relatively stable state and now I need some help testing out the calculator to ensure that it works properly.

    I have tested the calculator for version 2.42 .sav files, but in theory it should work on MGE, FW, and TOT files as well. I have not done any tests on this, however.

    Here is where you come in. I need people to download and use the calculator to see if it will accurately predict the Supply and Demand Commodities for all player known cities. I also need help ensuring that I do not reveal any information that the player could not find out on their own already, and also ensure that the calculator accurately captures the information that it should know. Note I used Visual Basic, so you may have issues if you do not have the visual basic runtime environment (available at Microsoft.com)

    If you are willing and able to help, or just want to try out the calculator please feel free to download it and give it a try. Please post any problems, comments, or suggestions back in this thread.

    Disclaimer: This program is provided as-is and is to be used at your own risk. Though this program was not made with malicious intent, I accept no responsibility for any damages real, implied, or imagined that this software may cause to anyone or anything. USE AT YOUR OWN RISK.

    /Disclaimer

    sorry for the disclaimer, but I must have something out there to protect myself.

    Thanks,
    StuporMan

    (version 2.0.0 beta was downloaded 2 times)
    Attached Files
    Last edited by StuporMan; December 22, 2005, 13:50.
    Man had always assumed that he was more intelligent than dolphins because he had achieved so much - the wheel, New York, wars and so on - whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man - for precisely the same reasons.

    StuporMan's Supply and Demand Calculator
    Supply and Demand Calculator 2.0.1 Beta Now loading savegames!

  • #2
    Well, a quick test worked for me on my own city taken from an 2.42 save of an OCC game, but failed on any of the AI cities I tested. For them, information such as city size, or techs were often missing and the demand lists were wrong. So, is it supposed to work for them, too?

    By the way, this is so much more easier to use that I love what you've done so far. No more laborious counting or searching for input info! Great!!!

    Attached is the file I ran my quick test on. Cardiff, my own city worked. None of the AI ones tested did.
    Attached Files

    Comment


    • #3
      I have briefly looked over the problem at my end over my lunch break and figured out the problem. It seems I got the source from one version prior to my last version and had included a bug in setting city values. I have corrected this bug and now things should work better. I also included code to make MPE work properly, I had forgotten to include it in my list of Wonders to be concerned with (more on this below).

      There may be more than meets the eye on why the foriegn cities do not produce accurate results. Since I do not want the calculator to have any semblance of being able to cheat by knowing information the player does not know, the foreign civ's tech list and count will be empty. This is to prevent the player from gaining information about that foreign civ they do not have privy to. So you must have an embassy or an ACTIVE MPE to get tech info for free.

      The new version should be up now!

      StuporMan
      Last edited by StuporMan; December 22, 2005, 14:04.
      Man had always assumed that he was more intelligent than dolphins because he had achieved so much - the wheel, New York, wars and so on - whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man - for precisely the same reasons.

      StuporMan's Supply and Demand Calculator
      Supply and Demand Calculator 2.0.1 Beta Now loading savegames!

      Comment


      • #4
        Got it - it claims to be v1.012?

        Must admit to being uncertain just what this is doing?

        Stu
        "Our words are backed by empty wine bottles! - SG(2)
        "One of our Scouse Gits is missing." - -Jrabbit

        Comment


        • #5
          Well it certainly works on the v2.42 files of saved games played from a fresh start - including the various and sundry ones downloaded from Apolyton.

          Not that it matters, since it rarely becomes an issue, the scenario save files I tried as well, cause it to error.

          Nice work Stuporman, you have far more patience than I ever had in sorting it out.

          Comment


          • #6
            Sorry I went AWOL there for a while. I left town for Christmas Holiday and have been unable to get back to Poly until right now.

            Stu,
            As to the version number, I simply failed to change that. This is still a beta version, there still will likely be some bugs!

            As to your other question, what this program endeavors to do is to calculate the supply and demand products that a city will produce under certain circumstances. The latest version, more specifically, attempts to load the city information from a Civ 2 save game file to avoid the arduous process of entering all of the cities information by hand.
            At the same time, the calculator does not allow the player to learn information that he/she should not know at the moment. For instance, if you do not have an embassy with a civilization, you will not know the number of technologies that they have. Likewise, if you have not found a particular city, it will not appear in the cities list (with the exception of the first city founded in the game, as this shows up as discovered by all civilizations in the save game file). You also will not get a complete list of terrain for cities that you have not explored all the city squares. (I also did not have the calculator do any "black clicking" so continent sizes will not be accurate unless the whole island has been explored.
            After the information is loaded, you can edit the information to be more in line with what you already have discovered. Likewise, you can do some looking ahead to see what the city will supply and demand as the game progresses. This can help you make good technology choices and can allow you to discover some beneficial terrain changes you can make to get commodities that you want. (IE, trade a grass for a forest and get to keep hides as a supplied commodity for 10 more techs).
            Oh, one more thing to keep in mind. The calculator does not factor in the Copper/Dye bug as of yet. So this assumes that the bug has been taken care of. Hopefully, the bug will come to be better understood so I can handle that in the future.
            I hope this adequately answers your question.

            civic,
            I am glad that this works from a fresh start. I am curious if this implies that it does not work from a later saved game or if the error is specific to scenarios?

            Could you please post the scenario file that you had an error on (if it is not included in 2.42 by default). Also, were these scenarios created in 2.42 or some other version of the game? Note, I have not yet been able to test FW, MGE, or TOT saved game files, so I do not know if they work properly or not. I intend to work on these as I have time and plan on each of these being included in the "official" 2.0 release of the calculator. (along with some other features like city prospecting). So any Civ 2 save game files that you find that error would be good to post here along with any useful comments you might have. (I know my error messages are less than descriptive )

            Thank you all for your help and your kind words. Hopefully, with your help, I can help us all understand a little more of Civ 2's trade system, and make those delivery payments all the more lucrative!

            StuporMan
            Man had always assumed that he was more intelligent than dolphins because he had achieved so much - the wheel, New York, wars and so on - whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man - for precisely the same reasons.

            StuporMan's Supply and Demand Calculator
            Supply and Demand Calculator 2.0.1 Beta Now loading savegames!

            Comment


            • #7
              I tried the newest version out, using the same save file posted earlier. Now Cardiff's supply was incorrect, not having Oil as the middle commodity. I tried Bremen, a small AI city and its demand list did not match at all, and I do not think the dye/copper bug was the reason.

              So something is probably still not quite right.

              One thing that would be nice to add, if you are looking for even more to do, is to also list how many more turns it will be until a city's next cycle date.
              Last edited by solo; December 31, 2005, 11:34.

              Comment


              • #8
                Thanks for the help solo!

                The cities solo cycle was one of the things that I had planned on adding in one of the later beta versions. I just wanted to get all the bugs out of loading a file (at least 2.42) before I went and added more features.

                As to the errors in the supply and demand calculations in the sav file you were loading, were these values correct in the previous verison or were they incorrect?

                Also any help in narrowing down which calculation was incorrect would be useful if you have the time. I have also noticed that there are a few errors in the supply and demand calculations on other cities and have not been able to figure out why (the calculations appear to me to be correct based on what samson wrote in his supply and demand opus).

                I have also narrowed down the Scenario errors that were happening earlier. This is due to cities being on the map borders. I should have a fix for that problem out this week sometime.

                StuporMan
                Man had always assumed that he was more intelligent than dolphins because he had achieved so much - the wheel, New York, wars and so on - whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man - for precisely the same reasons.

                StuporMan's Supply and Demand Calculator
                Supply and Demand Calculator 2.0.1 Beta Now loading savegames!

                Comment


                • #9
                  The file I used was the one attached in a previous post, cu_a1561 AD.


                  When testing my city Cardiff, your program’s results were:

                  Final: Dye, Gold, Beads
                  Uranium, Coal, Silk

                  Top 3: Dye, Gold, Beads
                  Uranium, Oil, Silk

                  The supply and demand wildcards are both Coal.

                  Actual Civ 2.42 values were:

                  Dye, Oil, Beads
                  Uranium, Coal, Silk

                  Coal acts as the demand wildcard, replacing Oil on the demand list. This frees up Oil to act as the secondary wildcard on the supply list, where it replaces Gold.

                  (Oil substitutes for the primary wildcard when the original wildcard (coal in this case) is eliminated as a duplicate.


                  I will use Bremen as an AI city example:

                  If I go into the cheat menu and become the Germans, I can see Bremen’s lists are:

                  Dye, Oil, Salt
                  Beads, Spice, Wool

                  The answers given by your program are:

                  Dye, Salt, Wool
                  Hides, Copper, Cloth

                  Wildcards are: Hides for supply and Copper for demand.

                  Top 3 listed in your program were:

                  Dye, Salt, Wool
                  Hides, Beads, Cloth

                  I will check the calculations for hides:

                  Supply: forest(6) x 4 = 24
                  # techs = 41, no changes
                  city size 1, so 24 x 2 for a final value of 48

                  (Your program gives a value of 192! Perhaps it mistakenly assumes the Germans have no techs)

                  Demand: forest = 6
                  Location: 40 – 18 = 22 x 3 = 66/2 = 33 + 6 = 39
                  Techs: Industrialization 39/3 = 13
                  # techs = 41, no changes
                  city size 1, so 13 x 2 = 26

                  (Your program gives a value of 312, perhaps again not taking into account the number and types of techs)

                  It looks to me that when you “hide” some values from your program’s user, they are not retained correctly for commodity calculations. Techs are one of the items that you have hidden.

                  Comment


                  • #10
                    Wow, this is amazing! Great Job!

                    This is definately a 100 on Ell_man's cool factor list

                    Comment


                    • #11
                      Ell_man,
                      Thank you so much for your kind words!

                      solo,
                      Thanks for the quick help on the calculations. I will have to look into how my program handles secondary wildcards.

                      As to the AI cities, you are correct in that the calculator assumes that the AI does not have any techs for AI Civs you do not have an embassy with. I do not actually hide these values, I do not retrieve them from the .SAV file. I did this to avoid any semblance of cheating via the calculator. As I have thought on this further, there really would be no way to cheat with the values in the calculator being hidden for AI cities (where the information was not known by the player).

                      I will attempt to add that in the next calculator version. In the mean time I will go ahead and check your cu_a1561.sav file again to see if I add an embassy if the AI cities produce the correct results.

                      Thanks,
                      StuporMan
                      Man had always assumed that he was more intelligent than dolphins because he had achieved so much - the wheel, New York, wars and so on - whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man - for precisely the same reasons.

                      StuporMan's Supply and Demand Calculator
                      Supply and Demand Calculator 2.0.1 Beta Now loading savegames!

                      Comment


                      • #12
                        In answer to your other question about the accuracy of Samson's formulas, I should note that they have been tested a lot, but not exhaustively. I believe you and I uncovered a slight error a while back in one formula, where an extra set of parentheses seemed to be needed to make a formula match the actual results seen in the game.

                        Most of the formulas are fairly complex, so I'm sure there are still many minor bugs that remain. It's too bad Samson has not been around to see your great program (something he requested, by the way) or to assist in testing it out. His method for deriving the formulas is still a mystery to the rest of his. Something about "simple algebra", is about all he mentioned!

                        Comment


                        • #13
                          I'm getting that error re not having a dll file . i've tried installing the VB6 runtime file mentioned in the other thread, with no success. Is there any other trick to it?

                          Thanks - would love to try this out!

                          Comment


                          • #14
                            Hmm, last time I tried it I had no problem. What OS are you using? I am guessing that you are using WinXP so I will go ahead and try on my XP machine tonight (I have only been using my 98 and Win2K machine so far for development). The only other thing I use is Microsoft Scripting Runtime which can be downloaded HERE or you can search for Windows Script 5.6.

                            Let me know if this helps.

                            StuporMan
                            Man had always assumed that he was more intelligent than dolphins because he had achieved so much - the wheel, New York, wars and so on - whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man - for precisely the same reasons.

                            StuporMan's Supply and Demand Calculator
                            Supply and Demand Calculator 2.0.1 Beta Now loading savegames!

                            Comment


                            • #15
                              I am indeed in XP. The missing dll is MSSTDFMT.DLL, if thats of any help (isn't to me!).

                              I installed the scripting with no impact.

                              Comment

                              Working...
                              X