Announcement

Collapse
No announcement yet.

Need suggestion on my new Utility Project

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

  • Need suggestion on my new Utility Project

    First I'm sorry that I have never finished any announced projects in the past (I remember proposing 'Random Map Generator', 'Incremental Buying Automation', 'Oedo Year Alert', etc.) But this time I'm serious since I really see a good way for it to work!

    First, I'm going to write a unitility program to KEEP AI FROM CHANGING YOUR CITY PRODUCTION.
    Here's how it works: your city names can be as long as 15 characters, but you seldomly use all of them. Now, suppose you restrict your city name length to 10, then you have 4 positions to 'flag' your city information (the 11th place needs to be 00 so you only have 4 positions 12-15). The computer never bothers to clear the city names after a 00 so it is safe to do so. The program will copy the current production item of each city to the 15th position. Then, when your next turn comes, the production item recorded at the 15th position will be copied back to the city production byte. A flag will be set so this action will only take place once at the beginning of your turn.

    Next, I'm going to expand the program to EFFECTIVELY GROUP YOUR CITIES TO PERFORM FUNCTIONS IN BATCHES.
    Here's how it works: you go to the city screens and rename your cities to the 14th position, then rename them back if necessary (since some events depend on city names) so that the flags at positions 12-14 will be set. The Utility program then checks the flags to perform certain tasks for you. For example, suppose you want to hire all citizens as scientists in Moscow, Stalingrad, and 10 other cities. You go to each city and rename them so a flag 'a' is set at position 14. (Rename Moscow as Moscowaaaaaaaa, then rename it back to Moscow). Then run the utility program, and all the above cities will change all citizens to scientists (if city size >16 then the rest will be entertainers). Then you can do some adjustment of your own in each city. Similarly a flag 'b' at position 14 will hire all citizens as tax collectors; a flab '1' in position 13 will incremental buy a red guard for 100 golds automatically, and so on.

  • #2
    Here's my suggestion:

    look for the 00. if the letter before the 00 is _, do something. This will make it easier for the user, as names can just be changed permanently rather than have "Moscowaaaaaaa" it will just be "MoscowA" or something. and is only 1 or 2 more lines.

    check # of units in che city (I haven't looked at the hex-editing stiff in a while, is this possible?) if # of units < x, build a Red Guard (or something).

    have prog change name back after function is complete
    I refute it thus!
    "Destiny! Destiny! No escaping that for me!"

    Comment


    • #3
      Sounds useful. I have an other idea for a utility, though I don't know it it's doable. Is it possible to have an event (in ToT preferably) which automatically triggers a batch file in the scenario directory?
      Tecumseh's Village, Home of Fine Civilization Scenarios

      www.tecumseh.150m.com

      Comment


      • #4
        I need to know the starting byte for the city information block in memory. Angelo, Andrew Livings, anybody can help?

        If the above information is not available I can ask the user to provide the name of his civ's first city, then search will start from here.

        Goinonit: As I mentioned before some events depend on city names so changing Moscow to MoscowA may cause some events to fail. Checking number of units in a city involves more programming, but maybe doable.

        Techumseh: if 'event' is programmed by you then I think it's doable; however if you meant extracting information from events.txt then there may be some technical difficulties.

        Comment


        • #5
          The byte where city info starts is not fixed.
          I refute it thus!
          "Destiny! Destiny! No escaping that for me!"

          Comment


          • #6
            Originally posted by Goingonit
            The byte where city info starts is not fixed.
            That's true, but Angelo's CSPL for TOT could extract city info, so I think there is a way to get around. I found that right before the city info block there is a string of repetitive 'FF 00 00's. Maybe we can use this to identify the start of city info block.

            Comment


            • #7
              What I have in mind is an automatic changing of BAT files, triggered by a pre-programmed event. For example, could you use an event, added to Capt. Nemo's Red Front, which automatically triggers the BAT file which changes the events, terrain, rules and units files every 6 months without having to save the game, run the BAT file and reload?
              Tecumseh's Village, Home of Fine Civilization Scenarios

              www.tecumseh.150m.com

              Comment


              • #8
                LazyCiv Trial Version Released!

                This utility is solely for keeping AI from messing up with your production. Works under WinME, civ2 MPE version. Should work under other Windows platforms. Does not work for TOT or FW.

                Copy this file to your hard drive and make a shortcut for it on your desktop. Then, after MPE is running, click on the shortcut to run lazyciv.exe. You don't need to worry about AI changing your production in PBEM.

                Very Important: If it is your first turn, launch Lazyciv AFTER you take control of your civ; however if you have already played a turn, then launch Lazyciv AFTER MPE IS RUNNING BUT BEFORE YOU TAKE CONTROL OF YOUR CIV (i.e., launch Lazyciv when you select your civ).
                This is because the program saves your building queue in certain places, and before your first turn those places consist nothing but garbage. If you launch too early then your city productions will be replaced by those garbage. However if you launch too late in subsequent turns then the program will not have a chance to recover your building queue before you take control of your civ.

                Any of your cities with names longer than 12 characters will be truncated for storing building queue and shield progress information. To make sure the program works, change your first city and last city in your F1 or F4 screen to long names (>12), if the names immediately get truncated then the program does work; if not, then you need to restart MPE and Lazyciv -- the starting position for city info block sometimes change, however if you try a couple of times it will come back to its normal starting position then the program should work.
                Attached Files

                Comment


                • #9
                  Only one download so far. Come on guys, I need your help! Please download it and test it in your next PBEM game. Thanks!

                  Next step: I'm going to create a micro-manager, and the layout is like this:

                  CityName Size_ Improvements Food__ Trade__ Science_ Tax____ Production_ Rush
                  Location_ H/C/U Cost, Maintain Cur/Tot Net/Tot _______ _______ Progress__ Cost

                  [Kalinin]_ 10___ (church)_____ 70____ 20____ 10_____ 10_____ (Red Guard)
                  25,35___ 5/2/3_ 40,1 [Sell]___ 100___ 30____ [Xinning] [Xinning] 20/30____ [25]

                  () -- pull down list
                  [] -- button, click on it trigger action: Go to city, sell improvement, Xinning (means changing all citizens to scientists or tax men), and rush-buying incrementally.

                  Also, a color schema will be used to indicate different status of the city:

                  City name: red=riot, yellow=content, blue=celebrating
                  Size (indicating status of the next turn):red=riot, yellow=content, blue=celebrating
                  H/C/U (happy, content, unhappy citizens): different colors indicating wonders/improvements for happy/content effect, and units for unhappy effect. (Green color for H means one citizen made happy by wonders/improvements, etc.)
                  food: current: grey=none, blue=harbor, yellow=supermarket, red=both; total: grey=none, red=granary.
                  trade: net: Colossus and superhighways will be indicated; total: airport will be indicated.
                  science, tax: grey: none, blue: +50% (Library), yellow: +100%, red: +150%, Gold: +200% or up.
                  Production: grey: none=vet, red=vet (indicating the city has barracks, airport, etc. for corresponding types of units).
                  Progress: current: grey: none, blue: +50% (factory), yellow: +100%, red: +150%. Total: KRC, offshore platform will be indicated.

                  Comment


                  • #10
                    Today I have a major breakthrough in my programming. Now I have a workable version of my civmanager utility, although it can only rename cities. More functions will be added to the utility in the near future. Eventually I'll be able to change almost all aspects of my cities without the need of opening city windows. The only thing I may not be able to do is to assign workers to different squares, since this does not rely solely on city information.

                    Comment


                    • #11
                      Looks like promising project, Xin Yu.

                      Comment


                      • #12
                        Update: Now it is a fully functional utility and I have fixed some bugs so it is not likely to break down while running. I have also refined the interface:
                        Have made the utility window always on top, shrink after losing focus, and expand after gaining focus.
                        Have added hot keys for actions.

                        Now I can edit all aspects of my cities.

                        However, to make it work is one thing, to make it perfect is another.

                        I need to change some of the cells from editable fields to pull down menus so that the user cannot enter illegal entries. This will also require extracting information from rules.txt file, which I have no idea how to do it at this moment.

                        I also want to add a function to allow using keystrokes for scrolling up and down, but so far no success.

                        Comment


                        • #13
                          Update: successfully added pull-down combo boxes. Successfully activated scroll bar from keyboard.

                          To do:

                          Automatically retrieve rules.txt and extract information so that one combo box will only present units/improvements you can build, and (when playing scenarios) another combo box will use the custom names for improvements in your cities instead of the standard ones. Calculation for rush buying costs can also be carried out.

                          Add color schemas to the texts.

                          Comment


                          • #14
                            Do you plan to add the feature that player can sell certain improvement in all cities? It would save much playing time..

                            Comment


                            • #15
                              Here's what will be implimented: group numbers can be assigned to cities. When a cell is highlighted, the user can use hot keys to perform the same task (which has been performed for that cell, for example sell a barracks or rush buy a knight) to either the same group or all cities, whereever possible.
                              I also plan to add another feature: assign rally numbers to cities. Any unit sensored inside a rally city will automatically goto the city with the next rally number, with appropriate number of move points deducted (activated by a hot key as well). But this one is not easy.

                              Comment

                              Working...
                              X