|
Author
|
|
Topic: *Attn* -- Turn Handler dev discussion |  |
|
F_Smith Prince Austin, Tx 78728 May 99
|
 |
posted December 21, 2000 16:37
|
 |
 |  |
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
- ecology turn handler:
- growth of plants
- change in water levels
- govt turn handler:
- policy changes
- taxation
- special orders
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).] |
Mark_Everson Clash of Civilizations Project Lead Canton, MI, USA b.02-15-99
|
 |
posted December 21, 2000 20:07
  |
 |
 |  |
Version 3, edited 12/26/00 -- most recent corrections in bold 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.) 3. 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. 2. Government/social/riots turn handler (similar to military in that it can affect many other models) A. Government
- policy changes applied
- special orders applied
- 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)
- update Knowledge Levels and Representation Values
B. Riots
- compute PAFs and probabilities for events
- 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
- calculate religion spreading
- compute Tendency Values for cultures (only done every N years)
- check for new Great Religion of the World appearing
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?
[This message has been edited by Mark_Everson (edited December 26, 2000).] |
axi Prince Athens Greece Sep 1999
|
 |
posted December 21, 2000 20:39
  |
 |
 |  |
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 |
Mark_Everson Clash of Civilizations Project Lead Canton, MI, USA b.02-15-99
|
 |
posted December 22, 2000 17:30
  |
 |
 |  |
I have made extensive changes to my post of 12/21 above. |
Twinge Chieftain
Dec 2000
|
 |
posted December 22, 2000 20:26
  |
 |
 |  |
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) |
Mark_Everson Clash of Civilizations Project Lead Canton, MI, USA b.02-15-99
|
 |
posted December 23, 2000 13:38
  |
 |
 |  |
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. |
Toubabo_Koomi Clash of Civilizations Disease & Natural Disasters Models
Oct 1999
|
 |
posted December 24, 2000 02:22
 |
 |
 |  |
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...  |
Mark_Everson Clash of Civilizations Project Lead Canton, MI, USA b.02-15-99
|
 |
posted December 24, 2000 08:12
  |
 |
 |  |
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. |
roquijad Clash of Civilizations Government Model Santiago Nov 1999
|
 |
posted December 24, 2000 16:33
 |
 |
 |  |
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.
|
Lord God Jinnai Prince Arnold, Mo 63010 Sep 1999
|
 |
posted December 24, 2000 19:50
  |
 |
 |  |
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. |
Mark_Everson Clash of Civilizations Project Lead Canton, MI, USA b.02-15-99
|
 |
posted December 26, 2000 07:27
  |
 |
 |  |
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... |
Lord God Jinnai Prince Arnold, Mo 63010 Sep 1999
|
 |
posted December 26, 2000 16:50
  |
 |
 |  |
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. |
Mark_Everson Clash of Civilizations Project Lead Canton, MI, USA b.02-15-99
|
 |
posted December 26, 2000 17:39
  |
 |
 |  |
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. |
roquijad Clash of Civilizations Government Model Santiago Nov 1999
|
 |
posted December 26, 2000 23:16
 |
 |
 |  |
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. |
Mark_Everson Clash of Civilizations Project Lead Canton, MI, USA b.02-15-99
|
 |
posted December 27, 2000 21:34
  |
 |
 |  |
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 |
Mark_Everson Clash of Civilizations Project Lead Canton, MI, USA b.02-15-99
|
 |
posted December 28, 2000 10:18
  |
 |
 |  |
I also need to add character aging and other character/dynasty development in the doc.Anyone notice anything else big I'm missing? |
F_Smith Prince Austin, Tx 78728 May 99
|
 |
posted December 28, 2000 10:41
|
 |
 |  |
This looks outstanding!As Mark said, the next step is to come up with 'test cases' for programmers to work by. The points below each 'turn handler' above are a good example of the test cases. For example, when coding the Government turn handler, the test cases should be -- 1) Apply policy changes 2) Apply special orders 3) Change current govt profile 4) Update Knowledge Levels and Representation Values Each of these is a 'test case', or 'programmer's task'. The programmer picks one, then codes, tests, codes, tests, until that 'test case' works the way it should. The programmer then gets as many others as possible to bang around on the program to help iron out any issues. We have an early working 'govt turn handler' from the Beast's code that can be used as an example, for anyone that wants to see the code. Once I get off my duff and email Mark the latest 'GameData' code this afternoon, he's going to begin fleshing out turn handlers one at a time, and having periodic 'releases'. He will need our complete cooperation in testing each release according to the stated test case ("Apply policy changes", etc). |
Mark_Everson Clash of Civilizations Project Lead Canton, MI, USA b.02-15-99
|
 |
posted December 30, 2000 12:30
  |
 |
 |  |
I've finished most of the turnhandling stuff I can do at this point.I have moved on to implementing the Demo 5 version of the economy. I've mostly finished the first stab at section A. (Calculate production). For the moment I'm just going to use as a test case that I can reproduce the results in the econ spreadsheet I did this summer. After that I'll do a crude interface for it, unless there is something more urgent to work on. Once there's an interface, other people can run it through its paces! |
Twinge Chieftain
Dec 2000
|
 |
posted December 30, 2000 21:17
  |
 |
 |  |
quote:
 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.
 |
Yeah, I know. I just meant enough time to come to nearly the best option. Anyway, I think there should be a "panic" button to interrupt streaming, just in case something happens you didnt set a cancelation for. |
Mark_Everson Clash of Civilizations Project Lead Canton, MI, USA b.02-15-99
|
 |
posted January 02, 2001 22:41
  |
 |
 |  |
quote:
 Originally posted by Twinge on 12-30-2000 09:17 PMAnyway, I think there should be a "panic" button to interrupt streaming, just in case something happens you didnt set a cancelation for.
 |
Its already there in demo 4. Its called 'Halt'  |
Richard Bruns Prince NC, USA Nov 1999
|
 |
posted January 09, 2001 19:03
 |
 |
 |  |
I have an idea to use the processor time more efficiently. Instead of having a single "End Turn" button and calculating everything at once, could we have seperate buttons that iterate each model? The player could make all military decisions, and then click "Submit Military Orders." The CPU then calculates all the military stuff while the player is making decisions about other areas. Instead of sitting idle and then taking a lot of time at the end of the turn, the computer is calculating more stuff in the background. This could be a big help for people with slow machines.It would of course be optional, and we would have to explain why the order submitting is final. But I think it would make the game run more smoothly. Would it be a practical addition? |
Mark_Everson Clash of Civilizations Project Lead Canton, MI, USA b.02-15-99
|
 |
posted January 09, 2001 21:33
  |
 |
 |  |
Hiya Richard.I don't like the idea aesthetically, but there's a bigger objection. The comp Won't be just sitting there when you're doing your turn. That's when the AI will think. So its not 'fallow' time that can be most productively used for other things IMO. | |