Announcement

Collapse
No announcement yet.

*Attn* -- Turn Handler dev discussion

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

  • *Attn* -- Turn Handler dev discussion

    Hi, ya'll:

    We need to begin the development discussion for the 'alpha' code of 'turn handlers'. So we start with the questions ---

    What 'ends' a turn?

    and

    When a turn is 'over', what happens?




    What 'ends' a turn?

    I assume clicking on a 'end turn' button, for one thing. But we should allow many options for people to explore.

    Should a turn also end automatically if/when all units have moved, ala SMAC? Time limits? A limit on the number of orders you can issue? Other ideas?




    When a turn is 'over', what happens?

    We need to make a list of all things that must be cycled/processed after a turn. Then we need to order/organize those things.

    Preliminary thoughts, off the top of my head:
      [*]population turn handler:
        [*]births[*]deaths[*]consumption[*]movement[/list][*]ecology turn handler:
          [*]growth of plants[*]change in water levels[/list][*]govt turn handler:
            [*]policy changes[*]taxation[*]special orders[/list][/list]

            This is mainly intended to be a starting point/example. We need to list and organize all turn logic in this manner, then decide what order they will be 'fired' in.

            The floor is now open!
            [This message has been edited by F_Smith (edited December 21, 2000).]

  • #2
    Version 3, edited 12/26/00 -- most recent corrections in bold

    [edit 3/19/02, put numbers in right order, fix indents, etc]

    This is by no means complete! I'm just putting it up here as a central repository for information that will be frequently updated to further the discussion. At the bottom are a few things I'm still not sure how we should handle. And of course I haven't fleshed out most of what happens in the various turn handlers yet. I start with step 1, which is stuff the player does before ending the turn.

    note: the order of these phases is not fixed. I will try and note which models need to go before others, at least as I think it should be. Obviously there is feedback going both ways between each of a pair of models fairly frequently. In these cases I have put the model where the feedback to the other is strongest IMO first. We can see if my proposed sequence is adequate, or needs to be rearranged. Sometimes I will skip numbers, or have them in the wrong order, since there is no point in rearranging all the numbers each time a change is made.

    Also, in keeping with our new extreme programming (XP) philosophy we should attempt to come up with "stories" or test cases to go along with these. F. Smith is the one who really knows about this, so he can tell us when it's time to start...

    My current take on the overall turn sequence is that each phase should be executed for all civs before moving onto the next phase. This is especially critical for the governmental and military areas, but I expect it may also be important in the economic area if we have merchants making real-time decisions about trade across civs boundaries

    1. During the turn the player orders actions like: military movements, changes in economic or government areas, diplomacy, etc.
    Also the AI thinks about its moves to whatever extent it can while the player is moving.

    Or, alternatively, the turns can be run in "streaming" mode. In this case, the AI will execute turns itself for the player based on the player's general orders. In this case, the "end turn" button is pushed automatically until either a player-set interrupt condition is met, and streaming mode stops, or the number of turns the player wanted to stream has elapsed.

    When the turn ends:

    (I think the military stuff should generally go first, because it can change the results of most other models. For instance, if a given area was actively fought over during the turn, economic production there will of course be suppressed. However, I have tentatively put the government stuff first, since in principle revolts can be started in response to player actions, and since revolts and riots should be able to surprise the player and cause combats, it needs to go before the military stuff.)

    2. AI final decisions for military movements etc. are made. If the AI had a lot of chance to think during the player turn, then the best decisions are used. If the AI hasn't yet had time to think about something it will use the quick-and-dirty action that seems best. After this point the turn handling for the player civ and AI civs is the same.

    3. Government/social/riots turn handler (similar to military in that it can affect many other models)
    A. Government
    i policy changes applied
    ii special orders applied
    iii Change current govt profile a step forward to the already computed equilibrium point. (the eq point is computed after a ruler's intervention in the govt interface or automatically after some years w/o ruler's intervention)
    iv update Knowledge Levels and Representation Values

    B. Riots
    i compute PAFs and probabilities for events
    ii check for revolts/riots/disturbances (can create/change allegiance of military units, these units can't move on the turn created, but can fight, at least that's my take on it )

    C. Social
    i calculate religion spreading
    ii compute Tendency Values for cultures (only done every N years)
    iii check for new Great Religion of the World appearing[/list=a]


    4. Execute military actions one tick at a time. TFs for all civs act simultaneously. AI allocates supporting forces according to previously determined directives. Fight battles as they occur each tick. (I'm not sure if TF supplies status should be checked each tick, or just at the beginning of each turn.) If we can it would be good to update map showing locations of battles with some cool graphic at this point.

    5. Once the military stuff is done determine who holds which territory securely, and which territory is contested. I'm not sure about this, but it seems we may need to know this information so I put it in.

    6. Econ turn handler
    A. Calculate production
    B. Calculate initial prices
    C. Figure Taxes and implement government purchases
    D. Trading phase (merchants trade with local economy, taxes on trade can be used next turn)
    E. Calculate final prices and wages
    F. Consumption and Investment (& people's purchases)

    7. Population turn handler
    A. consumption (before rest since nutrition is important contribution to others)
    B. handle disease model
    C. births and deaths
    D. migration

    8. Ecology turn handler
    A. disaster model + pollution effects & climate effects
    B. intentional terrain modification
    C. plant growth
    D. water level changes

    9. Tech turn handler (after economy)

    10. Advance turn number/year

    11. Activate first TF for player to move (if appropriate), update maps and other GUI elements as appropriate

    Return to step 1


    Some further questions (I'm sure there are a lot more )

    When do we do diplomacy between two AIs?

    Should we break up the Econ turn? When do merchants search for new trade routes?. Should we do production at beginning of turn, but people don't consume until end? I think for now it will work okay just leaving all the Econ stuff together. Merchants can search for new trade routes during the player move.

    Where do we evaluate happiness of the people for various purposes? Before it is needed, or once per turn?
    Last edited by Mark_Everson; March 19, 2002, 18:42.
    Project Lead for The Clash of Civilizations
    A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
    Check it out at the Clash Web Site and Forum right here at Apolyton!

    Comment


    • #3
      To see a nice implementation of simultaneous mouvement and also a very nice free TBS game, download this:
      Arrggh! The Pirate Game
      You'll love it!

      ------------------
      "In a time of universal deceit, telling the truth is a revolutionary act."
      George Orwell
      "In a time of universal deceit, telling the truth is a revolutionary act."
      George Orwell

      Comment


      • #4
        I have made extensive changes to my post of 12/21 above.
        Project Lead for The Clash of Civilizations
        A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
        Check it out at the Clash Web Site and Forum right here at Apolyton!

        Comment


        • #5
          Small Note:
          quote:

          1. AI final decisions for military movements etc. are made. If the AI had a lot of chance to think during the player turn, then the best decisions are used. If the AI hasn't yet had time to think about something it will use the quick-and-dirty action that seems best. After this point the turn handling for the player civ and AI civs is the same.

          This should be at the discretion of the player; If they want the computer to always think all the way through, they should have the option. (I assume you've already talked about such, but I thought I'd make sure)

          Comment


          • #6
            Twinge:

            Yeah, that's something I left out. BTW with our AI there is no such thing as "all the way through". It can think for an arbitrarily long amount of time. And of course results will improve the longer you give it to think.
            Project Lead for The Clash of Civilizations
            A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
            Check it out at the Clash Web Site and Forum right here at Apolyton!

            Comment


            • #7
              Well, if we're discussing all models, not just those that are ready for coding, the disaster and disease models should fall in there somewhere...

              I'm guessing disaster model will go with ecology model, since they are so closely linked... in most places anyway...

              and disease model will fall in with population model, again since they are so closely linked (death and all), etc...

              Correct me if I'm wrong...

              Comment


              • #8
                TK:

                Yep, forgot them . I will put them where you suggest on the next revision.

                F_Smith:

                On the question of when the turn ends, I think this should mostly be selectable by the player from a range of alternatives. All your suggestions should be options IMO, and perhaps also some others that will come up from time to time.
                Project Lead for The Clash of Civilizations
                A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
                Check it out at the Clash Web Site and Forum right here at Apolyton!

                Comment


                • #9
                  Mark's proposal looks good to me. I too think disease should be within the "population phase" and disasters in the "ecology phase".

                  I'd like to specify a bit further what's needed in the govt/social/riots part:

                  Govt
                  1. Change current govt profile a step forward to the already computed equilibrium point. (the eq point is computed after a ruler's intervention in the govt interface or automatically after some years w/o ruler's intervention)
                  2. Update Knowledge Levels and Representation Values

                  Riots
                  1. Compute PAF's
                  2. Compute probabilities for Events and roll dices for them. Apply events according to dices results.

                  Social
                  1. Do religion spreading.
                  2. Compute Tendecy Values for cultures. This task shouldn't be made each turn, but every N years.
                  3. Move culture values a bit forward to the tendency values.
                  4. Check for new great religion of the world appearing in the game.

                  Comment


                  • #10
                    I just have one thing to say...we should take of streaming of turns unless all turns are going to be 1 month. That's why I thought we had longer year turns in the beginning so that they would act as the 'streaming' during dull times.
                    Which Love Hina Girl Are You?
                    Mitsumi Otohime
                    Oh dear! Are you even sure you answered the questions correctly?) Underneath your confused exterior, you hold fast to your certainties and seek to find the truth about the things you don't know. While you may not be brimming with confidence and energy, you are content with who you are and accepting of both your faults and the faults of others. But while those around you love you deep down, they may find your nonchalance somewhat infuriating. Try to put a bit more thought into what you are doing, and be more aware of your surroundings.

                    Comment


                    • #11
                      I've updated the outline up top again to include the info posted by TK and Rodrigo.

                      LGJ: I don't agree that we should limit the streaming turns in any way. Remember, even at 5y/turn from 4000BC to 1AD there would be 800 turns. Approx Twice as many as in Civ2! If you want to play every one by hand, go ahead, but don't make Me do it . Anyway, this is a far-future decision...
                      Project Lead for The Clash of Civilizations
                      A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
                      Check it out at the Clash Web Site and Forum right here at Apolyton!

                      Comment


                      • #12
                        Problems arise with turn streaming because say you set it to go for 10 turns...well say in the second turn a civil war breaks out, you'll have no control over it for eight more turns and must leave it up to your AI which maynot handle it they way you wanted it to.
                        Which Love Hina Girl Are You?
                        Mitsumi Otohime
                        Oh dear! Are you even sure you answered the questions correctly?) Underneath your confused exterior, you hold fast to your certainties and seek to find the truth about the things you don't know. While you may not be brimming with confidence and energy, you are content with who you are and accepting of both your faults and the faults of others. But while those around you love you deep down, they may find your nonchalance somewhat infuriating. Try to put a bit more thought into what you are doing, and be more aware of your surroundings.

                        Comment


                        • #13
                          LGJ:

                          I quote from my piece above:

                          quote:

                          In this case, the "end turn" button is pushed automatically until either a player-set interrupt condition is met, and streaming mode stops, or the number of turns the player wanted to stream has elapsed.


                          Civil War breaking out is one such interrupt condition, invasion or declaration of war is another. I imagine there will be many such conditions that the player can set if they want to play a streamlined game.
                          Project Lead for The Clash of Civilizations
                          A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
                          Check it out at the Clash Web Site and Forum right here at Apolyton!

                          Comment


                          • #14
                            Mark,

                            just one tiny detail: In your update, you listed as the first step in govt: "policy changes applied". I'm not sure what you meant there. I assume you were thinking of changes in the civ that take place because of changes in govt. If so, I'd suggest to take that out. That's because each model that takes inputs from the govt model is supposed to be in charge of considering changes in govt status. So, FE, if PrivateProperty changed, it's the economic model in the economic phase that should reflect this change. There's nothing to do in the govt model once a change occurs. The govt model is meant only to do the change.

                            Comment


                            • #15
                              Hi Rodrigo:

                              Yeah, that was just supposed to be essentially "enter the previously chosen selections into the model guts". I know many things will be passed to other models. I'll try and rephrase it better sometime, but for now I've got some programming to do, so another update of this will probably have to wait a bit.

                              Cya,

                              Mark
                              Project Lead for The Clash of Civilizations
                              A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
                              Check it out at the Clash Web Site and Forum right here at Apolyton!

                              Comment

                              Working...
                              X