 |
|  |
 |
|
F_Smith
|
|
Austin, Tx 78728
May 1999 time: 05:13
|
|
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).]
|
|
|  |
 |
|
Mark_Everson
|
 |
Canton, MI
Jan 1970 time: 00:13
|
|
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 on 20-03-2002 at 03:42
|
|
|  |
 |
|
roquijad
|
|
Santiago
Nov 1999 time: 05:13
|
|
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.
|
|
|  |
 |
|  |
 |
|
roquijad
|
|
Santiago
Nov 1999 time: 05:13
|
|
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.
|
|
|  |
 |
|
F_Smith
|
|
Austin, Tx 78728
May 1999 time: 05:13
|
|
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).
|
|
|  |
 |
|  |
 |
|
Richard Bruns
|
|
NC, USA
Nov 1999 time: 06:13
|
|
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?
|
|
|  |
All times are GMT. The time now is 05:13. Apolyton Time is 00:13. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|