Announcement

Collapse
No announcement yet.

Turn Handling

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

  • Turn Handling

    Ok, I was thinking of something simple. Turn handling/resolution/processing is done on server machine, after all orders from all clients have been recieved, or timer exipred. Model is simultaneous Turn Based.

    0. orders recieved

    1. Builds orders first, all cities build stuff and update themselves
    2. City/province groups of people (classes) get updated and get to act if needed (revolts, etc)
    3. Tech is added and discoveres displayed, if any
    4. Other?

    5. Units move, combat.

    6. Send updates

    How does it sound? Units movement is most problematic oufcourse, so I guess it should be a subject of its own.

  • #2
    Re: Turn Handling

    Strictly speaking, this is not what the current Design Doc says, this simplified model ignores the grouping of turns (or cycles, ticks, iteration...) into one. So, I think the steps in turn resolution could be something like

    0. Orders received
    1. Process the orders of a cycle
    2. Store necessary information about the cycle
    3. Repeat step number one until all cycles in the turn are processed
    4. Send updates

    I'm sure this makes no sense so I'll try to explain. I'll deal with the actual resolution of orders later, here I lumped it all together in step number 1. I think that there are going to be a lot of things happening each turn, and it makes sense to think of the updating of the game world separately from the process of sending data back and forth between the game and the players.

    Secondly, the premise of my suggestion is that we are using "cycles" inside each turn. A cycle consists of a full update of the game world, so it is basically a turn in conventional sense. The only difference is that the players will not be able to give any input between cycles, and they will only receive the final outcome of the whole turn. So, for instance if a cycle length is one month, and the turn lenght is one year, within each turn the game status will be updated in twelve iterations. The advantages of this approach is that it becomes possible to have different lengths for turns, and thus accomodate a variety of paces of play. Is this a bad idea?

    However, there is one obvious problem with this approach: if the results of each cycle are transmitted to the player, the amount of data could be huge. If we are optimistic and think one update would be about half a megabyte, then in the case of 12 cycle turns the size of the update package would be [b]6 megabytes[/i]! And quite frankly, I doubt 500Kb for one cycle is hardly enough. So what can we do? My solution would be not to send the data from *all* of the turns, just the end result and selected tidbits from between (for example, the army movements might interest the player, but not population changes). In step 2 the "necessary information" is just that. I think that what exactly is stored should be highly configurable, allowing the server to set limits as well as players to decide for themselves what they want downloaded. It could even be possible to have the player get a standard package, and then retrieve more details later if he so chooses. (To those whom this sound unrealistic and convoluted, let's say that at first implementations there will not be such features, I think we'll just ignore step 2 altogether and store no extra information about individual cycles.)

    When the first cycle is processed, and another one is started, it basically rewrites the state of the game world, so there will be information loss (unless the "extra information" is defined to encompass the whole world). Only the results of the final cycle are preserved, and sent to the player. Players also receive the extra info from the intermediate cycles.

    Now to the actual order resolution. I suggest following steps:

    1.1. Environmental changes (climate, catastrophies, vegetation and animals)
    1.2. Population changes (the number of people, migration)
    1.3. Resources (assuming that there's a "pool" of resources that get drawn)
    1.4. Removals (if given resources cannot support something, it gets removed)
    1.5. Builds (armies, infrastructure,traded goods)
    1.6. Movement (yes, this is probably quite tricky...)
    1.7. Social and political environment (revolts, etc.)
    1.8. Technology (achived advances don't take effect until next turn)

    Now, I am not sure if this order is correct. I tried to put everything in order based on what should affect what... that's why the environment is first. Resource collection is done after population changes because people's work is an important resource itself. Removing units/infra that cannot be supported is calculated next, because it makes less sense to build stuff before you have checked that you can keep what you've already got. After the builds I inserted movement... basically my rationale is that you can move a newly built army immediately without having to wait until next cycle. But I am not sure if movement should be before socio-political stuff and technology... the politics on the other hand are coming late because I want them to be affected immediately by what the player does, and on the other hand it allows population to react to government's actions before the player actually does anything (so that people might migrate and leave your fields empty if you ban their religion, for instance). Technology is the last in my list because I feel that it's unrealistic to take the new technological advances immediately into use.

    There. Any objections? Please, let there be objections!

    Comment


    • #3
      Well, for cycles I would leave that for bit later. Also, amount of data is not simply multiplied, as we will send only changes and not everything will change.


      as for order of processing, I started the thread especially because it can be confusing at times.

      for example, should city in revolt be easier to conquer? should cities be allowed to build city walls for example, prior to being attacked? it would give an advantage to defender, as we should remember it is simultaneous turns we are talking about, so this order of processing is all we have to make it a fair playing ground.

      also, how about thing that just pop up? should we have a system for this? for example, a military victory causing the building of some structure or major defeat leading to revolts... I guess we should not have restrictions on changing game objects.

      example:

      city of London builds a stock exchange, in the same turn it is destroyed by military bombardment, a major defeat of the brits throws it in the revolt and little later a big victory throws it to ecstasy plus adds a 'statue of victory' building or something... all in the same turn.

      anyone thinks it should have some order to it or just like this?

      Comment


      • #4
        I see no reason to incorporate cycles into the mix right from the beginning. It has little effect on the actual resolution of orders, and since it's possible to just assume at first that 1 turn = 1 cycle, there is practically no extra work involved in designing the basic system with cycles. The danger of leaving the cycles for later is that during the design process we might forget all about them, and then suddenly realize that our designs can't support them.

        (It's another issue entirely whether they should be used at all or not... I think cycles provide realism as well as flexibility into the system, so I'm not compelled to leave them out.)

        Originally posted by VetLegion
        Also, amount of data is not simply multiplied, as we will send only changes and not everything will change.
        Yes it will, if you'll send the intermediate changes as well.

        for example, should city in revolt be easier to conquer? should cities be allowed to build city walls for example, prior to being attacked? it would give an advantage to defender, as we should remember it is simultaneous turns we are talking about, so this order of processing is all we have to make it a fair playing ground.
        That's right, but it gets very messy if we try to mix different models to work simultaneously. It's hard enough to keep the simultaneity working withing a model. However, I see this as a one reason why cycles should be used: the order in which each set of orders is resolved diminishes when you do it iteratively. In terms of your example it could go something like this:

        city of London builds a stock exchange, in the same turn it is destroyed by military bombardment, a major defeat of the brits throws it in the revolt and little later a big victory throws it to ecstasy plus adds a 'statue of victory' building or something... all in the same turn.
        Let's assume that the turn lasts a year, and consists of 12 cycles (months). Now, London could build a stock exchange in January, be bombarded in February, citizens could revolt in march. However, in April player's own armies in France take over Paris and the people are pacified. During the summer the French are utterly defeated, and in November the people build a statue to glorify their leader. In December a software bug causes the british isles to turn into an iceberg. And only then does the player get to know what happened.

        However, I do think there is some sort of chain of processing the orders, as opposed to entirely making each model isolated from the rest. I gave some rationales in my previous post, though they can quite probably be discussed alongside with the model designs. You're right about there being some things that conceivably affect each other... for example, an bombardment could reduce population outside the actual population algorithms.

        Comment


        • #5
          This is of course a most important subject! Thank you both!

          I agree almost completely with Lelands' first post. On the other hand, I think that VetLegion raised some interesting problems in his second post, which are essentially not solved by Lelands' reply.

          for example, should city in revolt be easier to conquer? should cities be allowed to build city walls for example, prior to being attacked? it would give an advantage to defender, as we should remember it is simultaneous turns we are talking about, so this order of processing is all we have to make it a fair playing ground.
          Sometimes some conflicting actions will occur during the smallest unit of a 'cycle', so we definitely need a fixed order within each century/decade/year/month/week/day (whatever happens to be the smallest unit of time used). Actually all games I know have some fixed order of consecutive phases.
          Some examples:
          Diplomacy
          1. Diplomacy period Spring
          2. Order writing Spring
          3. Movement Spring
          4. Retreats Spring
          5. Diplomacy period Fall
          6. Order writing Fall
          7. Movement Fall
          8. Retreats Fall
          9. Economic period: counting of supply centres
          10. Building and removing units

          Kingmaker
          1. Chance Phase (random events)
          2. Movement Phase
          3. Combat Phase (and sieges)
          4. Parliament Phase (summoned by King)
          5. Coronation Phase (royal heir crowned)
          6. Crown Deck Phase (player receives possibly new or reinforced Nobles)

          Republic of Rome
          1. Mortality Phase
          2. Revenue Phase (personal AND state revenue)
          3. Forum Phase (random events, persuasion attempts, attract economic elite, sponsor games)
          4. Population Phase (unrest)
          5. Senate Phase
          5a. elect two Consuls
          5b. elect Censor; prosecutions
          5c. elect governorships
          5d. other business
          6. Combat Phase
          7. Revolution Phase (trading/playing of reinforcing cards; possibly revolt of victorious commanders)

          Kremlin
          1. Cure Phase (aging, sanatorium)
          2. Purge Phase
          3. Spy investigation Phase
          4. Health Phase
          5. Funeral Commission Phase (new Party Chief is nominated)
          6. Replacement Phase (promotions/demotions)
          7. Rehabilitation Phase
          8. Parade Phase (Party Chief can gain victory point)

          Pax Britannica
          1. Random Events Phase
          2. Administrative Phase (revenue, maintenance)
          3. Minor Powers Phase
          4. Movement/Status Change Phase (purchase of new status markers and units, movement of units and merchant fleets)
          5. Colonial Combat Phase
          6. Marker adjustment Phase
          7. Negotiation Phase
          8. Congress of Europe Phase
          9. Chinese Resentment Phase
          10. War Phase
          10a. Chinese Rebellion
          10b. War with the Ottomans
          10c. All other Wars
          NB: Once war is declared the War Sequence is followed, which can be passed through many times -until the war has ended
          I Alliance Determination Phase
          II Initiative Determination Phase
          III First Alliance Maneuver Phase
          IV First Alliance Attack Phase
          V First Alliance Supply Determination Phase
          VI Second Alliance Maneuver Phase
          VII Second Alliance Attack Phase
          VIII Second Alliance Supply Determination Phase
          IX War End Determination
          When some settlement has been reached this cycle ends:
          X Resolution Phase
          11. Victory Point Record Phase
          12. Final Record Phase

          War and Peace
          1. Naval Phase
          2. Attrition Phase
          3. Alliance Phase
          4. Reinforcement Phase
          5. Movement Phase
          6. Combat Phase

          Down with the King
          1. First player Designation Phase
          2. Office Phase (filling of vacancies)
          3. Political problems Phase
          4. Crown events Phase (random events)
          5. Player turns Phase (each player may perform some activities like acquire a title, fill vacant office, expose a scandal, assassination attempt, seduce, wed, travel, recruit characters etc.)

          As you see, actually everything is possible!

          For the moment I would propose this turn order for GGS:
          1. Environmental changes (climate and weather, catastrophies, vegetation and animals)
          2. Resources: raw materials and food; Economics
          3. Population: births, deaths, diseases, migration
          4. Removals (attrition)
          5. Social and political environment (taxes, revolts, unrest, diplomacy, appointments, espionage)
          6a. Movement of goods, merchant marine, military units
          6b. Combat (and sieges)
          7. Builds (recruitment, production of final products, infrastructure)
          8. Technology

          In my view those events that are as a rule not or hardly at all controlled by the players should come first. And because food supply is most important to determine population changes I placed "Resources" before "Population".
          I prefer political events to occur before movement and combat. Though some great battles have been waged after a peace treaty had been signed or before war was declared, this should be rather exceptional, unless my delay of information spread would be applied.
          And recruitment and training, building of fortifications, all take considerable time. Even today, mobilising troops takes time. So I strongly recommend to place "Movement and Combat" before "Builds".

          How do I think Vets' example should be handled?
          city of London builds a stock exchange, in the same turn it is destroyed by military bombardment, a major defeat of the brits throws it in the revolt and little later a big victory throws it to ecstasy plus adds a 'statue of victory' building or something... all in the same turn.
          In August as a result of extreme weather conditions (hailstorms, icebergs) on the British Isles 90% of the harvest is destroyed(1). Food prices are soaring up(2) and the mortality rate rises considerably(3). Undernourished, the garrison of London deserts large-scale(4). As a result the military is unable to suppress the subsequent food riots: many labourers strike, shops and government buildings are attacked and some heavily damaged(5). In this Anarchy the British do not defend themselves effectively against a French bombardment(6): there are many casualties and a quarter of the city (houses and public buildings) is actually devastated. On the North Sea several ships of the line perish utterly, running aground some icebergs.
          Though the building of the London Stock Exchange was expected to be completed this month, this didn't occur because of the labour strike(7) -though the building was most lucky escaping the bombardment: it didn't suffer any noticeable damage!

          In September many people migrate to the countryside, where food shortage is less severe(3). Though the population of the city remains agitated, some order returns due to the psychological impact of the bombardment.(5). The government succeeds in bringing famine relief, shipped out of Ireland, Denmark and Germany by the merchant marine, while the British army finally captures Paris(6).

          In October the French sue for peace and a most favourable Peace Treaty is signed(5). The London populace rejoices and food riots end: work is resumed and the Stock Exchange is finally completed(7)!
          This boosts the Economy in November(2), so...

          I can go on, but I think I have made my point....
          Some events will happen in the same smallest unit of time. That's where the turn order comes in!
          Jews have the Torah, Zionists have a State

          Comment


          • #6
            I can find no fault in your analysis, especially the principle of moving from natural events to player-influenced events sounds reasonable. And I like the explanation of how the London stock exchange situation might unravel. But, how to distinguish between army movements and combat? A layman such as myself would just appoint a certain amount of "movement points" to each unit and make it just one phase (so that a puny resistance would not stop the movement of an army entirely, for example).

            In fact, I have nothing else to add. Except maybe throw a question in the air as to how long do you think that one cycle should last? I'm personally in favour of something between 1 to 3 months (because that would allow us to model seasonal changes, for instance armies getting stuck and starving in the winter), but I've not formed a fixed opinion yet. This is after all supposed to be a game that spans throughout human history, so in my opinion we shouldn't go deeper than monthly cycles under any circumstances.

            Comment

            Working...
            X