Whip-Assist Modlet Idea

Say you can whip now for 3 population and 0 overflow, and the three population you'll be whipping away are working grassland hill mines (1 :food: 3 :hammers:). If you whip now, you'll be losing 9 :hammers: per turn until you store enough food for the city to grow.

For simplicity, say the city tile is the only other production tile, so you have 10 :hammers: per turn right now. If you wait 4 turns to whip (Epic speed), you'll now be able to whip those same 3 population with 40 overflow applied to your next build. Had you instead whipped before, you would only have produced 4 :hammers: toward the build in the same 4 turns you waited.

Now, it's true that this means that each population grows back 4 turns later, but the situation can change along the way. Perhaps I'm micromanaging too much?
 
After putting my amateurish suggestions in the BUG-requests thread I found that there is this whole thread about the whip threshold issue. Cool, so I put some more thoughts into it and came up with this:

WhipTH1.jpg


What you see here is a half transparent second production bar displayed on top of the original production bar. This second bar exploits the maximum number (4) of different colors with
1. the STORED hammers (default color, 0 in screenshot)
2. the hammer RATE set to fill the gap till the next whip threshold ("transparent", 0...9 in screenshot)
3. the EXTRA RATE set to the hammers surpassing this threshold (yellowish, 9...18 in screenshot)
4. the "EMPTY" section set to the hammers between the first threshold (or end of yellow) and the second whip threshold (cyanish, 18...39 in screenshot)

The additional text follows the rule ""TH"NP "("NT")" NH :hammers:" with
NP - number of population that will be whipped at next threshold
NT - number of turns to go until this next threshold is reached/surpassed
NH - number of hammers left until this next threshold is reached

In the screenshot I have 0 hammers stored for a Settler and my current production amounts to 2:hammers: + 16 :food:. I want to maximize overflow to go into the Moai Statues. The whip thresholds for the Settler are at 9/39/69 hammers so my current 18 hammers per turn surpass the 9-hammers threshold and the next available threshold is the one at 39 hammers for a 3-pop-whip. So the original production bar shows 0 stored hammers, a hammer rate of 2:hammers:, and the extra rate from 16:food:. The second production bar shows 0 stored hammers, a transparent hammer rate of 9 till the 9-hammers threshold, the yellow extra rate of 9 hammers that surpass the 9-hammers threshold and the cyanish 21 hammers left until the 39-hammers threshold is reached. The text "TH3 (2) 39:hammers:" shows that I have 2 turns of production until I cross the 39-hammers threshold for the 3-pop-whip.

Rearranging my citizens allows me to maximize overflow with a 4-pop-whip:

WhipTH2.jpg


1:hammers: + 8:food: make me reach the threshold on the next turn, so no yellow hammers and the text shows "TH4 (1) 9:hammers:".

More details:

Spoiler :
Next turn - I have 9 hammers stored and am ready to whip 4 pop for 30 hammers whip-overflow (info given in the BUG whip assist text).

WhipTH3.jpg


Next turn - I have 44 hammers overflow which push me above the 29-hammers threshold if I put a Courthouse into the queue, so the next available threshold comes at 59 hammers. The text "TH3 (15) 59:hammers:" is colored as a warning that the current size of my city does not allow a 3-pop-whip. The whole threshold info will not be displayed if my city is to small to allow whipping the pop of the second threshold.

WhipTH4.jpg


The 30 hammers feature production from a Math-chop push me above the 59-hammers threshold so now the info is for the 89-hammers threshold (with a white text "TH2 (15) 89:hammers:" because I can whip 2 pop).

WhipTH5.jpg


Another chop enables the display of the threshold info for the Moai Statues (threshold at 219 hammers). Note that the relative width of the cyan section (=whip hammers of 1 pop) is unchanged here since the increased hurry cost for the Moai National Wonder (+100%) is negated by the access to stone (-100%). Side note: I always thought that all wonders would have a +100% hurry cost but this is not the case, some National Wonders only have +50% and the AP has +300%!
Spoiler :
Code:
[SIZE="3"]Type	iHurryCostModifier
BUILDING_GLOBE_THEATRE	50
BUILDING_GREAT_PALACE	50
BUILDING_HERMITAGE	50
BUILDING_HEROIC_EPIC	50
BUILDING_NATIONAL_EPIC	50
BUILDING_NATIONAL_PARK	50
BUILDING_OXFORD_UNIVERSITY	50
BUILDING_PALACE	50
BUILDING_ANGKOR_WAT	100
BUILDING_ARTEMIS	100
BUILDING_CHICHEN_ITZA	100
BUILDING_COLOSSUS	100
BUILDING_CRISTO_REDENTOR	100
BUILDING_GREAT_LIBRARY	100
BUILDING_GREAT_LIGHTHOUSE	100
BUILDING_GREAT_WALL	100
BUILDING_HAGIA_SOPHIA	100
BUILDING_HANGING_GARDEN	100
BUILDING_IRON_WORKS	100
BUILDING_MAUSOLEUM_OF_MAUSSOLLOS	100
BUILDING_MOAI_STATUES	100
BUILDING_MT_RUSHMORE	100
BUILDING_NOTRE_DAME	100
BUILDING_ORACLE	100
BUILDING_PARTHENON	100
BUILDING_PYRAMID	100
BUILDING_RED_CROSS	100
BUILDING_SANKORE	100
BUILDING_SHWEDAGON_PAYA	100
BUILDING_SISTINE_CHAPEL	100
BUILDING_SPIRAL_MINARET	100
BUILDING_STATUE_OF_ZEUS	100
BUILDING_STONEHENGE	100
BUILDING_TAJ_MAHAL	100
BUILDING_VERSAILLES	100
BUILDING_WALL_STREET	100
BUILDING_WEST_POINT	100
BUILDING_BROADWAY	200
BUILDING_EIFFEL_TOWER	200
BUILDING_GREAT_DAM	200
BUILDING_HOLLYWOOD	200
BUILDING_KREMLIN	200
BUILDING_PENTAGON	200
BUILDING_ROCKNROLL	200
BUILDING_STATUE_OF_LIBERTY	200
BUILDING_APOSTOLIC_PALACE	300
BUILDING_SPACE_ELEVATOR	300
BUILDING_UNITED_NATIONS	300[/SIZE]

WhipTH6.jpg


I have introduced a new method "showUpdatedBar" in CvMainInterface.py to allow for an easy and flexible use of those bars with all 4 sections.
Spoiler :
Code:
[SIZE="3"]# DanF new function to display bars
	def showUpdatedBar(self, screen, szBarName, iTotal, iFirst, iSecond = 0, iThird = 0, iFourth = 0):
		fFirst = float(iFirst) / float(max(1, iTotal))			
		if (iFirst < iTotal):						
			fSecond = float(iSecond) / float(iTotal - iFirst)
		else:
			fSecond = 0.0
		if ( iFirst + iSecond < iTotal ):					
			fThird  = float(iThird) / float(iTotal - iFirst - iSecond)					
		else:
			fThird  = 0.0
		if ( iFirst + iSecond + iThird < iTotal ):					
			fFourth = float(iFourth) / float(iTotal - iFirst - iSecond - iThird)					
		else:
			fFourth = 0.0
			
		screen.setBarPercentage( szBarName, InfoBarTypes.INFOBAR_STORED, fFirst )
		screen.setBarPercentage( szBarName, InfoBarTypes.INFOBAR_RATE, fSecond )
		screen.setBarPercentage( szBarName, InfoBarTypes.INFOBAR_RATE_EXTRA, fThird )
		screen.setBarPercentage( szBarName, InfoBarTypes.INFOBAR_EMPTY, fFourth )
		screen.show( szBarName )[/SIZE]

I also changed the original production bar to use this method to fix the bug which displays too many :food: when producing Settlers/Workers:

WhipTH7.jpg


You can see that the second production bar makes the sections of the original bar a little darker inspite of using "COLOR_CLEAR" - I don't know whether/how this could be avoided. My work around idea was to have the second bar display the STORED hammers too and use the same color without Alpha for the hammer RATE of the original bar, so that it gets darkened by the second bar's "transparent" RATE.

There is also a small issue with the Kremlin - the current mechanics in 3.17 allow a (iHurryPop+1)-whip in certain situations where a iHurryPop-whip would already give the necessary hammers.

WhipTH8.jpg


I have 41 hammers stored and produce 13 hammers which will put me to 54 hammers stored next turn. With the Kremlin and +50% Bureau bonus 1 pop gives me 30*150/67 = 67 hammers, so the whip threshold for a Courthouse would be at 120-67-1 = 52 hammers (-> 2 yellow hammers). But on the next turn with 54 hammers stored I can still whip 2 pop:

WhipTH9.jpg


The change to a 1-pop-whip comes at 55 hammers

WhipTH10.jpg


and it WILL give me the above calculated 67 hammers :crazyeye:.

WhipTH11.jpg


The ""TH"NP "("NT")" NH :hammers:" text uses a new entry in BUG_CIV4GameText.xml:
Spoiler :
Code:
[SIZE="3"]	<TEXT>
		<Tag>INTERFACE_CITY_WHIP_THRESHOLD</Tag>
		<English>- TH%d1 (%d2) %d3[ICON_PRODUCTION]</English>
		<French>- TH%d1 (%d2) %d3[ICON_PRODUCTION]</French>
		<German>- TH%d1 (%d2) %d3[ICON_PRODUCTION]</German>
		<Italian>- TH%d1 (%d2) %d3[ICON_PRODUCTION]</Italian>
		<Spanish>- TH%d1 (%d2) %d3[ICON_PRODUCTION]</Spanish>
	</TEXT>[/SIZE]

It is a lot of info that might confuse the normal civ player but I think it is quite handy for the true µ-manager. What do you think about it?
 

Attachments

initial reaction is that this looks a little confusing. I've had some more thoughts on my initial idea of drawing lines on the production bar and thought that we could also add future production points (ie where the hammers will be after 2, 3, 4, 5... turns) ...

whipassist00201ac7.jpg


Note the little blue lines that show that amount. As you change your hammer production, they will move around with the aim of getting one of them very close to a yellow line (whip threshold).
 
I think I understood most of what you wrote, though like Ruff I do believe overloading the bar with that much info may be confusing. I still feel that adding a new bar below the production bar might better serve our purposes. It all depends on how we show the info.

For Ruff's idea, certainly putting it into the same bar makes sense--just some more lines extending from the current production. For your more involved concept and what I originally envisioned, I see the second bar allowing more detail and the ability to focus on whipping thresholds and overflow in the future leaving the original bar focused on current production and whip overflow.

Keep in mind, too, that all that info you pack into your bar won't fit at 1024x768.

One thing I learned is that the Kremlin applies to whipping. I thought it was just for rush-buying. Oops. I have no idea if the current BUG calculation takes that into consideration. Perhaps that is what you were talking about in your final example, but you lost me entirely there.

30 - 150 / 67​

What are those numbers? :confused:

This is all good progress, so please don't be discouraged by my confusion (in case you were though you likely weren't ;)). Also understand that I play at 1024x768, and I will have no qualms insisting that it be legible at that resolution before I include it in BUG.
 
Thanks for giving it a look -- yeah it might be confusing at the first sight especially with my opening example with the settler and the 4 different colors in the production bar, but it actually only comes down to
1. close the gap to the cyan bar section (1st threshold)
2. avoid yellow or maximize yellow (2nd threshold)
Hadn't thought about 1028x768 :(. Maybe a toggle option to switch between the current whip assist text and the threshold info would help ... or transfer everything to a separat production bar as you suggest.

The Kremlin numbers: It's 30*150/67
30 hammers per pop (normal game speed) * 150 (production modifier 100 + 50% for Bureau) / 67 (hurry cost modifier 100 - 33 (Kremlin) = 67)
So with the Kremlin 1 pop gives me 67 whip-hammers in my Bureau capital. Sorry for this rather short reply, I really need to get some sleep now...
 
The mods focuses on whipping for maximum overflow. But there is another situation where it is nice to whip in imo... basically when your granary is almost full and you can whip for 1 population. It is virtually a free whip since the city will grow immediately on the next turn. This is especially true if the town is going to grow into unhappiness soon.
 
True, and if you can quantify how to display that I'd have something to work with. Keep in mind that if the city is going to become unhappy on the next turn, whipping away one population that will immediately regrow will cause unhappiness as soon as it regrows.
 
Sorry for the necro but this was a revolutionary thread for me, was this continued or finished in any mod? In bullai I see the basic whip assistant implementation.

Thank you
 
Back
Top Bottom