EmperorFool
Deity
I've been thinking of a small modlet idea for a while now. Basically, it's a whip assistant on the city screen to help you decide when to whip. I'm still unsure of exactly what it should show (only info you can figure out yourself doing math).
Since I'm busy with BUG right now, I'm posting the idea here in case anyone wants to try their hand at a small Python project. When I got started modding, ideas were harder for me to come by than time to code. That's reversed for me right now, but hopefully someone else is still in that boat.
I started by asking What is the player's goal?
Goal: Maximize hammer overflow
Next, what questions would the player need answered to achieve their goal?
Question: When is the best time to whip?
Question: How much overflow will I get now versus if I wait?
Does the player care how much overflow they'll get now if waiting 1 or 2 turns will get more? What about if they have to wait 5 turns? Does it matter; is there a cutoff?
Sometimes I'll MM to the extreme and back off
production in a very production poor city with lots of food to maximize overflow, even if that means having to adjust the citizens while waiting for the best time or delaying a turn. Do others do this, or is it going overboard?
Here are the pieces of information I came up with to answer the questions:
into a 180
Courthouse at 10
/turn (no bonuses) on epic speed (45
/pop). If you whip right now, your overflow will be 18 + X (however many
you generate this turn working plots)
45 * 3 - (180 - 63) + X
= 135 - 117 + X
= 18 + X
[ Since you lose population, X might not be 10 anymore depending on how the citizens are rearranged. From now on, ignore that value in this example. ]
Clearly, 18 is a suboptimal overflow. 44 is the ideal amount. If you wait 2 turns, you'll get 20 more overflow -- 38. This is usually better than whipping immediately because X will likely go down after whipping. So the modlet should show
/turn changes along the way (growth!) they might miss the best time. I'm leary of having the game actually watch it each turn to tell you -- seems like too much.
Since I'm busy with BUG right now, I'm posting the idea here in case anyone wants to try their hand at a small Python project. When I got started modding, ideas were harder for me to come by than time to code. That's reversed for me right now, but hopefully someone else is still in that boat.

I started by asking What is the player's goal?
Goal: Maximize hammer overflow
Next, what questions would the player need answered to achieve their goal?
Question: When is the best time to whip?
Question: How much overflow will I get now versus if I wait?
Does the player care how much overflow they'll get now if waiting 1 or 2 turns will get more? What about if they have to wait 5 turns? Does it matter; is there a cutoff?
Sometimes I'll MM to the extreme and back off

Here are the pieces of information I came up with to answer the questions:
- Current threshold
- Current production (already there)
- Current overflow if you whip now
- Next whip threshold
- Production you'll have on that turn (or how close to threshold)
- Overflow at next threshold
- How many turns before the next threshold (without passing it)





45 * 3 - (180 - 63) + X
= 135 - 117 + X
= 18 + X
[ Since you lose population, X might not be 10 anymore depending on how the citizens are rearranged. From now on, ignore that value in this example. ]
Clearly, 18 is a suboptimal overflow. 44 is the ideal amount. If you wait 2 turns, you'll get 20 more overflow -- 38. This is usually better than whipping immediately because X will likely go down after whipping. So the modlet should show
- Current threshold = 45
- Current production = 63
- Current overflow = 18
- Next threshold = 90
- Production then = 83
- Overflow then = 38
- Turns before = 2 (without going over)
- 27
until next threshold
- 2 turns
