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, 06:59 PM   #1
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
Chieftess' Civ3 Culture Flip Calc

Semi-spawned from this thread.

This is what happens when two great minds think alike.

Latest Version:
Civ3 Culture Flip Calc v1.03

Older Versions

Civ3 Culture Flip Calc v1.02
Civ3 Culture Flip Calc v1.01
Civ3 Culture Flip Calc v1.00b
Civ3 Culture Flip Calc v0.95b
Civ3 Culture Flip Calc v0.94b
Civ3 Culture Flip Calc v0.91b
Civ3 Culture Flip Calc v0.90b
Civ3 Culture Flip Calc v0.01b

v1.00 - This is the GUI version (Visual Basic) of the calculator.

Known problems/issues

- Cumulative value will occasionally jump around at a very low flip risk value, but corrects itself as the turns advance.



0.91b screenshot

(as you can see, something just doesn't look quite right).


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 ( n / d )
D = factor based on relative distance to capitals

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


I am calling for beta testers and for assistence on Visual C++ dialog programming, active memory access programming, and DirectX programming (like some of the utils that run with Civ3).

Right now, I want to see if the algorithm is 100% accurate.
__________________
"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 22, 2003 at 01:40 PM.
Chieftess is offline   Reply With Quote
Old May 12, 2003, 07:15 PM   #2
CivGeneral
Capitalist Slave
 
CivGeneral's Avatar
 
Join Date: Jun 2002
Location: The Pitt
Posts: 31,647
Images: 3
I have voluntered myself to Beta test this program . Thank goodness for that Algebra II class .
__________________
(伝統、 統一、名誉、知識)* | "Stranger in a Strange land" a Fallout 3 AAR
"Arrive at peaceful resolutions by using superior firepower." - Fallout 3 Energy Weapons Bobblehead
"Is that all?" - Samus Aran | "In Ravenholm, you do well, to be vigilant." - Father Gregori
"The slave is sold once and for all; the proletarian must sell himself daily and hourly." - Karl Marx
CivGeneral is online now   Reply With Quote
Old May 12, 2003, 09:52 PM   #3
Sirp
Emperor
 
Sirp's Avatar
 
Join Date: Nov 2001
Location: Texas
Posts: 1,742
So where's the source code Chieftess?

If you post it I'll look into sticking a gui onto it.

EDIT: Oh, and, what'd be cool is to be able to tell you the chance of it flipping over the next n turns. E.g. "what's the chance of it flipping sometime over the next 50 turns?"

-Sirp.
__________________
Try my strategy game

Last edited by Sirp; May 12, 2003 at 09:56 PM.
Sirp is offline   Reply With Quote
Old May 12, 2003, 09:59 PM   #4
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
Sirp - Just the Australian I was looking for! Come to the chat room.

This is a picture of what I hope it will look like (not messy, but you get the idea). I pasted stuff together quickly in Visual Basic.

__________________
"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 10:39 PM.
Chieftess is offline   Reply With Quote
Old May 13, 2003, 02:27 AM   #5
Steph
Multi Many Tasks man
 
Steph's Avatar
 
Join Date: Sep 2002
Location: Pont de l'Arn, FRANCE
Posts: 14,902
Re: Chieftess' Civ3 Culture Flip Calc

Quote:
Originally posted by Chieftess
I am calling for assistence on Visual C++ dialog programming, active memory access programming, and DirectX programming (like some of the utils that run with Civ3).
Why do you need all that? Like DirectX, memory access, etc? It sounds quite simple to do without that. Or do you have a grand plan in mind?
Steph is offline   Reply With Quote
Old May 13, 2003, 05:16 AM   #6
Sirp
Emperor
 
Sirp's Avatar
 
Join Date: Nov 2001
Location: Texas
Posts: 1,742
I assume Chieftess wants to be able to access the Civilization process and extract information about cities to be able to provide a list of cities. For that you'd need to be skilled in doing nasty things with the memory of another process. In fact I didn't/don't know that it's possible to do this at all in true 'protected mode' operating systems such as Windows XP and 2000, since one of the main ideas of protected mode is that you can't access the memory of another process. (But...maybe Microsoft exposes some evil API which lets you do it...)

I suspect Chieftess wants someone experienced in DirectX so she can do nasty things with popping the window up over the running civilization program.

Personally, I'd suggest that it's too much effort to do all that, and just stick with a simple dialog-based system that lets you key in all the variables. It's not like you want to calculate culture flip risk every turn or something...

-Sirp.
__________________
Try my strategy game
Sirp is offline   Reply With Quote
Old May 13, 2003, 08:43 AM   #7
Steph
Multi Many Tasks man
 
Steph's Avatar
 
Join Date: Sep 2002
Location: Pont de l'Arn, FRANCE
Posts: 14,902
I agree with you Sirp. Too much work for the objective.
Steph is offline   Reply With Quote
Old May 13, 2003, 08:44 AM   #8
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
Here's a diagram that factors the small 'd' (or the distance between capitals). (note - it might be reversed though, and after looking at it, I think it is).




If there's one question I have about the algorithm, it's what are considered foriegners and resistors. Say there's 10 citizens, and all of them are foreigners, but 3 are resisting. Does that mean 10 foriegners and 3 resistors? Or 7 foriegners and 3 resistors?
__________________
"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:57 AM   #9
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
Hi CT, I just posted version 1 of mine too

http://forums.civfanatics.com/showth...threadid=53157

__________________
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, 05:09 PM   #10
Sirp
Emperor
 
Sirp's Avatar
 
Join Date: Nov 2001
Location: Texas
Posts: 1,742
Chieftess: A resister counts as a doubly-bad foreigner. If you have 7 foreigners and 3 resisters, that counts as if you had 13 foreigners, since resisters count for double.

-Sirp.
__________________
Try my strategy game
Sirp is offline   Reply With Quote
Old May 13, 2003, 07:41 PM   #11
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
Quote:
Originally posted by Sirp

EDIT: Oh, and, what'd be cool is to be able to tell you the chance of it flipping over the next n turns. E.g. "what's the chance of it flipping sometime over the next 50 turns?"

-Sirp.
I believe I saw that in one of the culture flipping threads. It's a cumulative effect, right?
__________________
"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, 07:49 PM   #12
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
CT, once you have

P = Probability of flip

The chance of it not flipping in 'n' turns is:

(1 - P) <to the power of> n
__________________
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, 10:10 PM   #13
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
Mine is now updated.
__________________
"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 14, 2003, 04:58 AM   #14
sgrig
Comrade
 
sgrig's Avatar
 
Join Date: Nov 2001
Location: Isaac Newton's College
Posts: 1,060
Re: Chieftess' Civ3 Culture Flip Calc

Quote:
Originally posted by Chieftess


P=[(F+T)*Cc*H*(Cte/Cty) - G]/D
I'm not convinced that this is the correct formula, because a correct formula for probability is not allowed give an arbitrarily large result* - otherwise it is not possible to scale the probability to be between 0 and 1 (or 0 and 100). So it is simply not valid mathematically as a formula for probability.

(*Here for example if D=0.01, the result can be huge, which obviously does not give a probability)

Of course in the game D cannot be arbitrarily small (the largest distance between two capitals can be 362, and smallest distance between two cities can be 2, so D is at least 1/181). So maybe there should some scaling factor, although that still won't guarantee validity of this formula.



EDIT: Didn't read further on - there is in fact a scaling factor! Sorry for the rant! Next time I'll read the whole thread before replying!
__________________
War is Peace
Freedom is Slavery
Ignorance is strength

Last edited by sgrig; May 14, 2003 at 05:03 AM.
sgrig is offline   Reply With Quote
Old May 14, 2003, 05:07 AM   #15
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
Damn CT, you sure move fast!
__________________
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 14, 2003, 11:30 AM   #16
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
Flip Calc 0.94 has been added.

There's a culture flip risk per turn that's been added, but still needs some tweaking.
__________________
"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 15, 2003, 07:15 AM   #17
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
[b][color=red]I'd also like to get the civ culture values and X/Y locations from the Civ3 save. I have the source for file decompression/compression, but it's in C++, not Visual Basic. Anyone know how to make a COM file?
__________________
"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 15, 2003, 07:24 AM   #18
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
CT, I have PM'd you with my daytime (work) msm.
__________________
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 15, 2003, 04:02 PM   #19
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
Here's version 1.00.
__________________
"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 15, 2003, 06:59 PM   #20
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 22,360
Version 1.01 has been uploaded!

What's different/added?

- Added a distance calculator
- Fixed some typos in the distance help window
- Added a sample image so you can see how to measure the distance

What's next?

- Adding an option to automate the Culture Flip Calc from the save
- Making an ingame version to read from the memory (because I want to try. )

So, any comments from anyone besides Sirp and Anarres? Good? Bad? Ugly? buggy? Anarres' thread has 4x as many views as mine.
__________________
"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 15, 2003 at 07:03 PM.
Chieftess is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION III > Civ3 - Creation & Customization > Utility Programs > "Babylon II" - Civ3 Culture Flip Calc

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
Flip's "Help a Noob (i.e. Flip!)" playalong flipsix3 Civ4 - Strategy & Tips 95 Nov 29, 2008 02:07 AM
Why is "Flip-flopper" a bad word? Kraznaya Off-Topic 23 Jan 26, 2008 11:27 AM
Flip Calc - Calculates the probability of culture flips anarres Utility Programs 107 Dec 09, 2007 03:52 PM
HTML Culture Flip Calc DaveMcW Utility Programs 6 Jul 11, 2003 08:14 AM
re: Chingis Khan's "The Culture Flip" MSGT John Drew Site Feedback 4 Oct 17, 2002 11:41 AM



All times are GMT -6. The time now is 06:21 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