UGO
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION III > Civ3 - Creation & Customization > Utility Programs

Reply
 
Thread Tools
Old May 12, 2003, 02:14 PM   #1
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
Calculating the exact probability of a culture flip?

Edit: I will always have the latest version linked in to the first post so you don't have to go looking through the thread for it...

Please note that Version 1.5 contains a significant change to the distance formula, you should update to this version straight away.

Version 1.5




'Distance' dialog:


Change list:

- Changed distance formula from:

to: max(x,y) + 0.5*min(x,y)

1.4 (22nd June):
- Added a 'Minimum Garrison' field.
- Made the whole form dynamic. If all fields have valid values the calculations will be done automatically. If any fields are invalid 'n/a' is displayed, click 'Calculate' to see which one.
- Culture numbers now can be decimals instead of just whole numbers, this is so you can enter a ratio in like 2.5 : 1.
- Distance dialog box now keeps it's data when you close and re-open it.

1.3 (15th May)
- fixed some annoying bugs

1.2 (15th May)
- added new form to allow better entry of distance
- changed icon

1.1 (14th May)
- Added error checking
- Added cumalative probability of flip

1.0 (13th May)
- First version
--------------------------------------------------------------------------------

Taken from the FAQ:
Quote:
How many units do i need to suprpess a culture flip?[list][*]the full formula (this is from Sorenson, who is responsible for this programming):

P=[(F+T)*Cc*H*(Cte/Cty) - G]/D

where:
P = probability that it will flip this turn
F = # foreignors, with resistors counting double
T = # working tiles under foreign control (out of the max of 21, no matter what the cultural boundaries are atm)
Cc = 2 if foreign civ has more local culture than you, 1 otherwise
H = .5 for WLTKD, 2 for disorder, 1 otherwise
Cte = Total culture of the foreign civ
Cty = Total culture of your civ
G = # garrison units
D = factor based on relative distance to capitals

Now reorganizing this gives the required garrison as:
G = (F+T)*Cc*H*(Cte/Cty)

As you can see there is a nice set of extra factors there. Now when you take a city Cc is likely to be 2 for a long while. And then there is the culture ratio. And this is a true ratio so it could be 1.1:1, 2:1, 5:1 depending on how much culture each of you has.
According to this, the factor D is a crucial scaling variable that will enable us to work out the exact chance of a culture flip, since all other factors are known. 'D' should really be written 'n*d', where 'd' is the actual ratio of distance to capitals, and 'n' is the scaling factor.

P=[(F+T)*Cc*H*(Cte/Cty) - G]/n*d

My ultimate goal is to produce a 'Flip Calculator', an in-game tool that will allow you to select a city and give you the chance of it flipping to each civ.

The exact culture score of an opponent is a slight spoiler, as is the existing culture of a city you capture, so in honesty a 'Flip Calculator' would not be 'pure' (usable in GOTM and tourney) if it gained this information in game. You could still have a manual entry for these which would allow a non-spoiler version, and you could estimate the relative culture ratio fairly accurately.

Does anyone know what the value of 'n' is? If not I will run some scenarios to determine it, it shouldn't be difficult, just a little time consuming.
__________________
Civ3 Duel Zone | Come join the PBEM ladder today!
Calculate the probability of Culture Flips: Flip Calc
"Too many of us look upon Americans as dollar chasers. This is a cruel libel, even if it is reiterated thoughtlessly by the Americans themselves." - Einstein
"We are undergoing a period of history that will, in years to come, be compared with the anti-communist hysteria that dominated US headlines in the 1950's."

Last edited by Thunderfall; Jun 04, 2004 at 04:13 PM.
anarres is offline   Reply With Quote
Old May 12, 2003, 02:48 PM   #2
DaveMcW
Deity
 
DaveMcW's Avatar
 
Join Date: Oct 2002
Posts: 5,213
Images: 2
D=2000, in flip formula
DaveMcW is offline   Reply With Quote
Old May 12, 2003, 03:08 PM   #3
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
Yay! Thanks DaveMcW! [dance]

I *knew* I'd seen it somewhere.

Looking at the original Apolyton thread 'n' (as it is in my forumula) is definitely 2000, and 'd' (in my formula) is the ratio of distance to capitals, capped between 0.25 and 4.

hehe, calc ahoy!

My first attempt will be a windows app with manual fields to enter the variables in. The second will hopefully integrate with civ and allow you to dynamically select a city to evaluate.
__________________
Civ3 Duel Zone | Come join the PBEM ladder today!
Calculate the probability of Culture Flips: Flip Calc
"Too many of us look upon Americans as dollar chasers. This is a cruel libel, even if it is reiterated thoughtlessly by the Americans themselves." - Einstein
"We are undergoing a period of history that will, in years to come, be compared with the anti-communist hysteria that dominated US headlines in the 1950's."
anarres is offline   Reply With Quote
Old May 12, 2003, 03:20 PM   #4
wilbill
That Old Time Religion
 
wilbill's Avatar
 
Join Date: Nov 2002
Location: North Carolina
Posts: 2,516
Images: 2
Good luck with the project, Anarres. I've developed a pretty good "feel" for when there's a danger of flipping and am not wrong often, but it still happens.
wilbill is offline   Reply With Quote
Old May 12, 2003, 03:55 PM   #5
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
Drat, there goes another attempt for me to create a civ related program. (atleast Visual Basic is the quick way...)

Thread moved and title changed.
__________________
"Never trust an Aztec with nukes!" (Civ1 - unknown) | 2nd user of the Ancient Style.
South America (based on El Mencey's Map) | N & S America (based on El Mencey's Map) | C3C Scenario: 7,000 Turns Civ2 Earth for C3C | Old Style Civ3 for C3C | "Future is Wild" map
How to upload multiple files to a post | File Upload | Paint Shop Pro 3.11 shareware (screenshot util - doesn't expire) | Chieftess' Culture Flip Calc | Don't wind up like this AI! | resource icons file To download a patch: Select "Advanced" from the main menu, and go to "Check for Updates". || My Web Journal (yes, it's a "blog")
Chieftess is offline   Reply With Quote
Old May 12, 2003, 04:37 PM   #6
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
Thanks CT!

I probably will do the first version in VB, just to get it done quickly.

For the second version that ties in with civ I am fairly sure that I will need to use C++ to properly access the memory stack.
__________________
Civ3 Duel Zone | Come join the PBEM ladder today!
Calculate the probability of Culture Flips: Flip Calc
"Too many of us look upon Americans as dollar chasers. This is a cruel libel, even if it is reiterated thoughtlessly by the Americans themselves." - Einstein
"We are undergoing a period of history that will, in years to come, be compared with the anti-communist hysteria that dominated US headlines in the 1950's."
anarres is offline   Reply With Quote
Old May 12, 2003, 04:42 PM   #7
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
I've been trying to write a dialog-based app in C++ for ages, with no success (very little tutorials. Never learned it in college... Ask Sirp. ). I can do it in C++ too. (besides, I'm sure someone's going to find out how to access the cities in the save before I do...)

Well, neither Borland nor Visual C++ want to link correctly...
__________________
"Never trust an Aztec with nukes!" (Civ1 - unknown) | 2nd user of the Ancient Style.
South America (based on El Mencey's Map) | N & S America (based on El Mencey's Map) | C3C Scenario: 7,000 Turns Civ2 Earth for C3C | Old Style Civ3 for C3C | "Future is Wild" map
How to upload multiple files to a post | File Upload | Paint Shop Pro 3.11 shareware (screenshot util - doesn't expire) | Chieftess' Culture Flip Calc | Don't wind up like this AI! | resource icons file To download a patch: Select "Advanced" from the main menu, and go to "Check for Updates". || My Web Journal (yes, it's a "blog")

Last edited by Chieftess; May 12, 2003 at 05:29 PM.
Chieftess is offline   Reply With Quote
Old May 12, 2003, 05:40 PM   #8
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
I can do C++, I just use VB for utils with graphical interfaces.

To give meaningful data the latest version will have to work on the active memory itself, reading the values as the game is playing. Having to save a file and check it will be far to cumbersome. I know this is possible, SpiderZord is writing a GOTM logging utility that does it.
__________________
Civ3 Duel Zone | Come join the PBEM ladder today!
Calculate the probability of Culture Flips: Flip Calc
"Too many of us look upon Americans as dollar chasers. This is a cruel libel, even if it is reiterated thoughtlessly by the Americans themselves." - Einstein
"We are undergoing a period of history that will, in years to come, be compared with the anti-communist hysteria that dominated US headlines in the 1950's."
anarres is offline   Reply With Quote
Old May 12, 2003, 06:35 PM   #9
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
And here it is. I'll be moving this to the Utilities forum next.

Chieftess' Civ3 Culture Calc

Note: It's **VERY** crude (and thus, **VERY** beta), since I'm still trying to figure out how to work MS Visual C++. (anyone have any sites for dialog programming?)

As for the active memory, I have NO idea how to even use that, or even have a DirectX program within a DirectX program. I can't even program DirectX well...
__________________
"Never trust an Aztec with nukes!" (Civ1 - unknown) | 2nd user of the Ancient Style.
South America (based on El Mencey's Map) | N & S America (based on El Mencey's Map) | C3C Scenario: 7,000 Turns Civ2 Earth for C3C | Old Style Civ3 for C3C | "Future is Wild" map
How to upload multiple files to a post | File Upload | Paint Shop Pro 3.11 shareware (screenshot util - doesn't expire) | Chieftess' Culture Flip Calc | Don't wind up like this AI! | resource icons file To download a patch: Select "Advanced" from the main menu, and go to "Check for Updates". || My Web Journal (yes, it's a "blog")

Last edited by Chieftess; May 12, 2003 at 06:44 PM.
Chieftess is offline   Reply With Quote
Old May 12, 2003, 06:51 PM   #10
zulu9812
The Newbie Nightmare
 
zulu9812's Avatar
 
Join Date: Jan 2002
Location: Athens of the North
Posts: 5,967
nice hijack Chieftess
zulu9812 is offline   Reply With Quote
Old May 12, 2003, 07:04 PM   #11
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
Quote:
Originally posted by zulu9812
nice hijack Chieftess
I figured you were coming with your wrong forum animation.


anyway, the thread with my version of it is here.
__________________
"Never trust an Aztec with nukes!" (Civ1 - unknown) | 2nd user of the Ancient Style.
South America (based on El Mencey's Map) | N & S America (based on El Mencey's Map) | C3C Scenario: 7,000 Turns Civ2 Earth for C3C | Old Style Civ3 for C3C | "Future is Wild" map
How to upload multiple files to a post | File Upload | Paint Shop Pro 3.11 shareware (screenshot util - doesn't expire) | Chieftess' Culture Flip Calc | Don't wind up like this AI! | resource icons file To download a patch: Select "Advanced" from the main menu, and go to "Check for Updates". || My Web Journal (yes, it's a "blog")
Chieftess is offline   Reply With Quote
Old May 13, 2003, 01:20 AM   #12
Plexus
Division-owning squid.
 
Plexus's Avatar
 
Join Date: Dec 2001
Location: Ventura County, Southern California
Posts: 6,777
I know yer name!

Nice program, ct.
__________________
“It's rally time!”
Plexus is offline   Reply With Quote
Old May 13, 2003, 07:36 AM   #13
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
Quote:
Originally posted by Plexus
I know yer name!

Nice program, ct.
Now all I need is Spycatcher's name and then... (running gamecatcher between anarchywrksbest and spycatcher34).

Well, let's get this thing back on topic.
__________________
"Never trust an Aztec with nukes!" (Civ1 - unknown) | 2nd user of the Ancient Style.
South America (based on El Mencey's Map) | N & S America (based on El Mencey's Map) | C3C Scenario: 7,000 Turns Civ2 Earth for C3C | Old Style Civ3 for C3C | "Future is Wild" map
How to upload multiple files to a post | File Upload | Paint Shop Pro 3.11 shareware (screenshot util - doesn't expire) | Chieftess' Culture Flip Calc | Don't wind up like this AI! | resource icons file To download a patch: Select "Advanced" from the main menu, and go to "Check for Updates". || My Web Journal (yes, it's a "blog")
Chieftess is offline   Reply With Quote
Old May 13, 2003, 08:54 AM   #14
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070


So can I pick this up or have you claimed it for yourself CT??
__________________
Civ3 Duel Zone | Come join the PBEM ladder today!
Calculate the probability of Culture Flips: Flip Calc
"Too many of us look upon Americans as dollar chasers. This is a cruel libel, even if it is reiterated thoughtlessly by the Americans themselves." - Einstein
"We are undergoing a period of history that will, in years to come, be compared with the anti-communist hysteria that dominated US headlines in the 1950's."
anarres is offline   Reply With Quote
Old May 13, 2003, 09:01 AM   #15
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
You can pick it up. There can always be 2 versions.

Medium or supersized?
__________________
"Never trust an Aztec with nukes!" (Civ1 - unknown) | 2nd user of the Ancient Style.
South America (based on El Mencey's Map) | N & S America (based on El Mencey's Map) | C3C Scenario: 7,000 Turns Civ2 Earth for C3C | Old Style Civ3 for C3C | "Future is Wild" map
How to upload multiple files to a post | File Upload | Paint Shop Pro 3.11 shareware (screenshot util - doesn't expire) | Chieftess' Culture Flip Calc | Don't wind up like this AI! | resource icons file To download a patch: Select "Advanced" from the main menu, and go to "Check for Updates". || My Web Journal (yes, it's a "blog")
Chieftess is offline   Reply With Quote
Old May 13, 2003, 09:48 AM   #16
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
Well, here is my version 1.

Note: There is no error checking on any of the fields yet. The calculations seem to be fine, and it even remembers to cap the distance ratio for you if you enter in a value outside the 0.25 to 4 range.

Negative values for the flip chance should read 0.00%, stupid formatting on my part...

If you use it please post any bugs here.

The next version will have full error checking in, and it will allow a decent input system for the distance ratio (should have NW-SE distances for both human and AI).

Please also note that it was written in VB6 for development speed.
Attached Files
File Type: zip flipcalc.zip (4.7 KB, 324 views)
__________________
Civ3 Duel Zone | Come join the PBEM ladder today!
Calculate the probability of Culture Flips: Flip Calc
"Too many of us look upon Americans as dollar chasers. This is a cruel libel, even if it is reiterated thoughtlessly by the Americans themselves." - Einstein
"We are undergoing a period of history that will, in years to come, be compared with the anti-communist hysteria that dominated US headlines in the 1950's."
anarres is offline   Reply With Quote
Old May 13, 2003, 09:55 AM   #17
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
Here is a screenie:

__________________
Civ3 Duel Zone | Come join the PBEM ladder today!
Calculate the probability of Culture Flips: Flip Calc
"Too many of us look upon Americans as dollar chasers. This is a cruel libel, even if it is reiterated thoughtlessly by the Americans themselves." - Einstein
"We are undergoing a period of history that will, in years to come, be compared with the anti-communist hysteria that dominated US headlines in the 1950's."
anarres is offline   Reply With Quote
Old May 13, 2003, 11:29 AM   #18
Moulton
Monarch
 
Moulton's Avatar
 
Join Date: Nov 2001
Location: Kentucky
Posts: 810
Anarres -- could not find yours to download....

I still believe that the final datum is the Jokers-Wild random chance of flipping, no matter what else is happening. I have taken to leaving only one unit in a city once the resistance is quelled.
__________________
Njondac

"Peace through Strength"
-- R. Reagan
In virtute sunt multi ascensus
Moulton is offline   Reply With Quote
Old May 13, 2003, 11:37 AM   #19
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
Moulton, the file is *attached* to post 16. (3 up from here).

Please post comment/feedback. I guess CT will get the popular vote, but it would be nice if *someone* found a use for mine.


Edit: I also linked the attachment in to the first post, that can act as a pointer to the latest version...
__________________
Civ3 Duel Zone | Come join the PBEM ladder today!
Calculate the probability of Culture Flips: Flip Calc
"Too many of us look upon Americans as dollar chasers. This is a cruel libel, even if it is reiterated thoughtlessly by the Americans themselves." - Einstein
"We are undergoing a period of history that will, in years to come, be compared with the anti-communist hysteria that dominated US headlines in the 1950's."

Last edited by anarres; May 13, 2003 at 11:40 AM.
anarres is offline   Reply With Quote
Old May 13, 2003, 12:16 PM   #20
Moulton
Monarch
 
Moulton's Avatar
 
Join Date: Nov 2001
Location: Kentucky
Posts: 810
Thanks, I will try both. Wish I had thought of it
__________________
Njondac

"Peace through Strength"
-- R. Reagan
In virtute sunt multi ascensus
Moulton is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION III > Civ3 - Creation & Customization > Utility Programs > Flip Calc - Calculates the probability of culture flips

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
culture flips dbarandiaran Civ3 - General Discussions 14 Feb 15, 2007 05:22 PM
Culture flips Knickers Civ3 - General Discussions 2 Mar 21, 2006 01:53 PM
HTML Culture Flip Calc DaveMcW Utility Programs 6 Jul 11, 2003 08:14 AM
"Babylon II" - Civ3 Culture Flip Calc Chieftess Utility Programs 35 Jun 02, 2003 11:22 PM
Culture Flips Greg Loader Civ3 - General Discussions 20 Aug 27, 2002 05:14 AM



All times are GMT -6. The time now is 05:25 AM.


Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
This site is copyright © 2000 - 2009, Civilization Fanatics' Center.
Support CFC: Amazon.com | EB Games | Amazon UK | Amazon DE | Amazon CA | Amazon FR