Smart bug: I found a way how to "crash the stock market" in freecol.:) By that I mean obtaining unlimited amount of money in 0 turns.
Steps to reproduce:
- begin creating a new game
- choose difficulty "Very Hard", then change to "Custom"
- in Custom (which is currently equal to "very hard") change Other > Starting money = 20000
- choose Nation advantage: "Immigration". Important! Don't miss this step.
- start game
- go to Europe screen
- buy 1 galleon
- buy horses by packs of 100 (standard drag&drop) until price changes to 3/5. If you done everything correctly, it should be 6x100 horses
- sail away the first galleon and ignore it for further operations. For main activity, buy 1 more galleon and 1 caravel. You should have 1 galleon in port, 1 caravel in port and 1 galleon sailed away.
- activate your galleon that is currently in port
- you should have 6 slots available in it. Hold down Shift, drag&drop horses to the galleon. Choose amount: 600. You bought 600 horses for 5gold each.. Price should go up to 5/7
- activate Caravel. Buy 100 horses into it. You bought 100 horses for 7gold each. Price should go up to 7/9.
- activate Galleon. Sell 600 horses (same as last time, hold down Shift, drag&drop a horse from the galleon into Europe, choose amount 600). You sold 600 horses for 7gold each. If you've done everything correctly, price should drop down to 5/7.
- activate Caravel. Sell 100 horses. You sold 100 horses for 5gold each. If you've done everything correctly, price should drop down to 3/5.
Now, you can repeat the last 4 steps as many times as you want, and your gold amount will always increase. To understand why this happens, see how the main chunk of horses (6x100) is being sold and bought. As you see, they are bought for 5 gold each, but sold for 7 gold each. The price for the 100-horse pack is not in your favor, but you gain more on 600-horse operation than you lose by the 100. Anyway, it just works in practice, check out yourself.
Remark1: This technique works with other nations, too, but numbers differ slightly for "Trade" national advantage.
Once the issue gets confirmed, we can discuss how to fix it.
The easy&dirty fix would be to limit the number of goods that can be sold/bought simultaneously. Like, not allowing amounts bigger than 300. Another implementation might be to limit the number of items to "when price changes + 100". So if price changes when you buy 139 goods, allow 239 of this good to be bought simultaneously.
Thoughts?
Last edit: vasya novikov 2017-10-25
If anyone's interested in how much you can push this technique at. The optimal buying sequence seems to be: +600 +100 + 100 - 600 - 100 - 100. It works up to a tax rate of about 40% (40.9% IIRC). Each cycle gives you 2700 gold. The minimal amount of gold to make it work under such tax rate is about 7500 gold with free horse utilization and a free caravel, or 10500 with only caravel, or 11500 pure gold without any help of other ships.
IIRC sales should be limited to 100. This may have broken or been "optimized" away.
@Mike,
Maybe you're right. I personally kinda like the fact that you can sell 400 goods simultaneously at better price, it seems natural to me. But without possibilities for exploitation. Then again, a limit of 100 has its own benefits, too.
Talking about numbers, a value of 300 may disallow such an exploit already. I can find the exact value if needed.
I'm okay with limiting drag&drop quantities to 100 for Europe. IDK how to implement it myself tho.
After a regrettably long delay, git.16da4bb contains the fix discussed above. Let me know how it goes.
@Mike, unfortunately, I don't play FreeCol that active anymore, so I guess we can mark the issue as fixed, and restore or raise a new issue if something will come up.
// Exhaused early because winning at "maximum" difficulty was too easy, yet contaned many similar easy actions. Dunno how it would be with multiplayer, if it was alive. Sorry, anyway, I hope the project will live.
Done. Thanks for the bug reports.