Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Alternative Civs > Clash of Civilizations > *Attn* -- Turn Handler dev discussion
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
04.Sep: `FC` 2.0.5 COMPLETED AND RELEASED
27.Jul: `FC` 2.0.4 COMPLETED AND RELEASED
16.Jul: `FC` 2.0.3 COMPLETED AND RELEASED

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
F_Smith is offline F_Smith
Prince
Austin, Tx 78728
May 1999
time: 05:13
Question  Old Post 22-12-2000 02:37
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
*Attn* -- Turn Handler dev discussion Support Apolyton, buy Civilization 2

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 is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 22-12-2000 06:07 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Full PM-box? Change here!

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

axi is offline axi
Prince
Athens Greece
Sep 1999
time: 07:13
Lightbulb  Old Post 22-12-2000 06:39
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

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 is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 23-12-2000 03:30 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Inflate your Upload Space

I have made extensive changes to my post of 12/21 above.

Twinge is offline Twinge
Chieftain

Dec 2000
time: 22:13
Arrow  Old Post 23-12-2000 06:26
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

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 is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 23-12-2000 23:38 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Help yourself to an AD-FREE life

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.

alms66 is offline alms66
Prince
Louisiana
Oct 1999
time: 23:13
Post  Old Post 24-12-2000 12:22
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

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 is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 24-12-2000 18:12 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton buy from Amazon

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 is offline roquijad
Prince
Santiago
Nov 1999
time: 05:13
Post  Old Post 25-12-2000 02:33
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Put an end to popups!

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 is offline Lord God Jinnai
Prince
St. Louis
Sep 1999
time: 23:13
Post  Old Post 25-12-2000 05:50 Visit Lord God Jinnai's homepage!
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Browse Apolyton AD-FREE

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 is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 26-12-2000 17:27 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Remove this text

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 is offline Lord God Jinnai
Prince
St. Louis
Sep 1999
time: 23:13
Post  Old Post 27-12-2000 02:50 Visit Lord God Jinnai's homepage!
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

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 is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 27-12-2000 03:39 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton, buy Call to Power 2

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 is offline roquijad
Prince
Santiago
Nov 1999
time: 05:13
Post  Old Post 27-12-2000 09:16
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

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 is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 28-12-2000 07:34 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Put an end to popups!

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 is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 28-12-2000 20:18 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Increase the size of your Attachments

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 is offline F_Smith
Prince
Austin, Tx 78728
May 1999
time: 05:13
Post  Old Post 28-12-2000 20:41
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Support Apolyton, buy Call to Power 2

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 is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 31-12-2000 10:30 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

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 is offline Twinge
Chieftain

Dec 2000
time: 22:13
Lightbulb  Old Post 31-12-2000 07:17
Edit/Delete Message Reply w/Quote
#19 Report this post to a moderator
Full PM-box? Change here!

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 is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 03-01-2001 08:41 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#20 Report this post to a moderator
Support Apolyton buy from Amazon

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 is offline Richard Bruns
King
NC, USA
Nov 1999
time: 06:13
Lightbulb  Old Post 10-01-2001 05:03 Visit Richard Bruns's homepage!
Edit/Delete Message Reply w/Quote
#21 Report this post to a moderator
Inflate your Upload Space

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 is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 10-01-2001 07:33 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#22 Report this post to a moderator
Suffering from ads?

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.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:13.
Apolyton Time is 00:13.
    top of page
Rate This Thread:
Forum Jump:
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
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0520 seconds (91.43% PHP - 8.57% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net