Apr 25th 2024, 16:53:49
Hmm would have been interesting to run my bots at that time see how they did, last time I ran was October 2019.
I changed the code so much that I think it would be difficult to remerge from qzjul's master
Although, having had a quick look over, it looks like he mostly added things in different places as I had refactored out a lot of my code for "bot strategy"
They all inherited from a core Strategy class that established wether it was possible to do something, whether they should do it, and then decided if they would do it, then did it!
Each Strat effectively became setting a land goal, build goals and tech goals then running a turn based on logic ie for Rainbow it was:
if ($this->willSendStockToMarket()) { return PublicMarket::sellFood($this->c,true); }
if ($this->willSellMilitary()) { return PublicMarket::sell_max_military($this->c); }
if ($this->willSellTech()) { return PublicMarket::sell_max_tech($this->c); }
if ($this->willSellFood()) { return PublicMarket::sellFood($this->c,$this->stockpiling()); }
if ($this->willSellOil()) { return PublicMarket::sell_oil($this->c,$this->stockpiling()); }
if ($this->willBuildCS()) { return Build::cs(); }
if ($this->willBuildFullBPT()) { return Build::buildings($this->buildings()); }
if ($this->willExplore()) { return explore($this->c); }
if ($this->willCash()) { return cash($this->c); }
if ($this->c->canExplore()) { return explore($this->c); }
Other strats did/didn't do some of those steps (e.g an indy wouldn't sell food, a techer would tech when it was right)
They all prioritiesed their goals, stocked/destocked when the time was right,& bought mil & tech sensibly according to their priorities.
I also had a FFO, so that their was an oil market and they would stock oil for destock too (without land dropping).