"Babylon II" - Civ3 Culture Flip Calc

Chieftess

Moderator
Retired Moderator

This is what happens when two great minds think alike.

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.

I have voluntered myself to Beta test this program . Thank goodness for that Algebra II class .

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.

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.

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?

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.

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?

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.

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?

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

Mine is now updated.

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!

Damn CT, you sure move fast!

Flip Calc 0.94 has been added.

There's a culture flip risk per turn that's been added, but still needs some tweaking.

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?

CT, I have PM'd you with my daytime (work) msm.

Here's version 1.00.

- 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.

Replies
3
Views
495
Replies
15
Views
1K
Replies
0
Views
2K
Replies
47
Views
15K
Replies
1
Views
2K