FlipCalc

Flip Calc - Calculates the probability of culture flips 1.5

TNO, the distance ratio is capped between 0.25 and 4 for calculations.

Even though it will let you enter a value of 5 it will still use 4 in the calculation. :)
Certainly, flips are LOTS less likely as of recent versions.
Sirp, is this observation or fact? I ask only because others have said it too, but AFAIK the last change to flip formula was in Civ2 1.17f...

Wow, I seem like a real 'naysayer' but all I want is something to back up the ideas the culture flips are not as stated by Soren over a year ago.
 
anarres: it's purely anecdotal, but seeing as how many people say it, it sounds like it's fact.

Of course I suppose it could just be that people have learnt to deal with flips better...

-Sirp.
 
aaglo and Hygro,

The reason there is no 'enemy city' flag to check to see if you can flip the enemy is because the calc is designed to be used for the city under chance of flip, by the occupying force.

In the calc replace all instances of the word "AI" with the word "the other civ", and you can see it will work for the AI city if you pretend to be an AI person using the calc.

If that didn't make sense I am sorry, but communication was never my strong point. :crazyeye:
 
Well I know what you're trying to say, even if I'm having trouble reading it (my reading not your writing is where the problem lies).
 
Excellent utility anarres :goodjob: I have never worried about flips too much in PTW, but it's very useful to have the actual numbers. I can see that I have often actually been running a real risk (esp. over 20 turns or so)... scary!

A question: am I right in thinking that the relative culture values have to be entered as integers? The reason I ask is that I initially entered values of 1.1 and 1, but this gives a different flip probability to entering 11 and 10... In fact a quick test shows it's rounding the values to the nearest integer (although .5 down), is it feasible to allow fractional entries here? np if not, but if I'm guesstimating the relative culture values they end up in my head as fractions not integers :)

Also a couple of (very minor) suggestions for the interface: I would suggest making the Calculate button the default button so that if you press enter it does a prob calculation regardless of which box has the focus. You could also make it so that when you Tab the focus it selects the current text in the next box (instead of just giving the focus) so you can enter a new value without having to delete the current text. And just from a perfectionist POV you could make the two probability textboxes labels as they don't need to take input :D this is nitpicking I know! So rest assured it is a dam good job ;)
 
Sorry if this is covered some where else in the thread.

What happens when the AI does not have a capitol (settler in galley)? How numbers do you enter for the distance ratio for that situation? I know that there is an allowance in the basic equation for this cause I did have a city flip under this condition once. :(
 
The distance calculation is capped between 0.25 and 4.

The scaling factor in the 'D' in the equation is 2000, so with no capital the flip equation comes out as:

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

Funnily enough I only recently found out about the distance capping myself. Until then I thought it impossible to get a flip without an enemy capital.
 
OK, so punch in 4. Believe me it was darn irritating when it happened, and I was scouring the face of the earth looking for that galley after that and it was a huge map.
 
Changes:

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

FlipCalc_1-4.jpg
 

Attachments

Look what I found:
Posted by alexman
Corruption calculations do not use Euclidean geometry, nor unit movement points, to get distance. Instead, the distance is based on the shortest path, where each orthogonal move costs 1.0 and each diagonal move costs 1.5. Another way of writing the distance formula is Distance = max(x,y) + 0.5*min(x,y), where x and y are the distance in the NW/SE and NE/SW directions, respectively. (Discovered by DaviddesJ)
This is from alexman's Do you think you understand corruption? strategy article.

At the moment the FlipCalc uses Euclidian distance, which we all used to believe Civ used as well. :crazyeye:

It looks like I will need to update it to use the 'Civ' definition of distance...
 
I guess this means mine will be needing an upgrade, too. ;) Looks like we're going to have to figure this out in MSN IM for both of our programs.
 
Changes:

- Changed distance formula from:

FC.distance.jpg


to:

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

Please note that this is a significant change, you should upgrade to Version 1.5 straight away.
 

Attachments

Chieftess, here is the function I wrote for distance, pretty trivial:

Code:
Private Function Distance(ByVal i As Integer, ByVal j As Integer) As Double

Dim min As Integer
Dim max As Integer

	If i < j Then
		min = i
		max = j
	Else
		min = j
		max = i
	End If
	Distance = CDbl(max) + 0.5 *CDbl(min)

End Function

Edit: No matter whether I use tabs or spaces, I can't get it to indent. :mad:

Edit2: So that's what the code tag is for....
 
All this technical detail goes over me. I just do not understand it.

However, a trick I have learnt on regular civ3, (I do not have PTW)
is that if you have done a save game before end of turn, and you get a culture flip of one of your cities. Re-load the game and move all your units (or leave 1) out of that city - if they have movement points. On replaying the end of turn it will not usually culture flip. Although a different city may do so, but not always.

So IMHO the AI must also take into account how many of your units it can destroy (an AI cheat!!) if it performs a culture flip.

So, if you need say 30 ground units to prevent a culture flip, but you have only between 2 to 29 it will occur.

However if you have 0 or 1 ground unit in the city it is unlikely to occur. But you now run the risk of being attacked by the AI, if the city is near AI units.
 
It's not an AI cheat. The movement of troops out of the city apparantly causes the AI to do things differently on its turn, thereby altering the RNG seed value. Thus, when the check is made for the flip, a different value is produced. (And the probability of a flip on any given turn is normally so low that it wouldn't take much of a change in the generated number. ;) )
 
Harrier - the reason I made the FlipCalc was so that people don't have to fully understand the calculations to be able to use it and see what the chances of flip are.

You can try putting in different values and see how things like garrison, distance, AI pop in the city and overall culture levels can affect the chance of flip - you may be suprised by som e of the numbers.

The main effect making this calc had on my play is that now I always starve to size 1 if I am keeping an AI city - it's just not worth the risk most of the time...
 
Anarres
Nice tool!
:goodjob:

However, i had this crash a couple of times (see attached)

It always occured when i enter a high AI culture, and mine is low.
The error message reads (t'is in french):

Execution Error '6':
Capacity overflow

This is the 1.5 version
Thx

Edit: can you PM me please when you get to see it?
Thx
 

Attachments

  • flipcalc_crash.jpg
    flipcalc_crash.jpg
    26.5 KB · Views: 430
On it Globetrotter - I know from the error it is an overflow problem. I must have assigned something to a 16-bit integer instead of a 32-bit one. Give me a day or so (PBEM's to play ;))
 
Originally posted by anarres
On it Globetrotter - I know from the error it is an overflow problem. I must have assigned something to a 16-bit integer instead of a 32-bit one. Give me a day or so (PBEM's to play ;))

Take your time
No worries... We're here for a looooooooong time... ;)
Thx again
 
anarres,

any idea how well/accruately the Mighty FlipClac will work in C3 Conquests?
 
Back
Top Bottom