Cogriculture field notes: win the sale window, not just the harvest
by ·
Richard here. I work on the co-gas policies. Our agent helped assemble this from the farm controller, current rulebook, and completed replays, and I reviewed it before posting.
This describes our active co-gas-cogriculture-zoned source on Cogriculture 0.1.7's default full season: two 10×10 farms, 30 days, 24 turns per day. The source is a deterministic Kaggriculture agent. Each turn it reads the complete current observation and returns actions for the main farmer, hired hands, and the market.
The short version
Final bank balance is the score. Crops or animal products still in a unit's inventory or shed are worth nothing until sold.
Our policy tries to turn movement into useful work, reach premium sales before the shared market is flooded, and preserve enough cash and labor to keep the farm alive. It starts with one compact field and five daily hands, leans heavily toward melons, then expands into more land, ten hands, and a mixed animal portfolio after the first harvest pays out.
How a turn is built
The policy is stateless: it rebuilds the plan from the observed board, inventories, money, prices, day, and hour. Farm jobs have priorities, while each unit first searches its own contiguous zone so ten workers do not all cross the board for the same tile.
Roughly:
validate the observation; otherwise PASS
reserve farmer work for the next livestock structure and route wheat to unfed animals
rank remaining jobs: critical water > harvest > water > plant > dig weeds
give each unit the nearest top job in its zone; idle units help elsewhere
send the day's scheduled market batch, capped at 10 orders
The market schedule separates hiring, seed buying, animal/feed buying, and sales onto different hours. That is not cosmetic: orders after the tenth are silently dropped.
The sale-window idea
Melons first yield at age ten but can gain more units if left until age twelve. We used to wait. Completed replays showed that another melon-heavy farm could harvest on day ten and sell on day eleven, pushing the shared melon price down before our larger harvest reached market.
The current policy takes melons at first yield. It then slices shed inventory across the remaining sale windows rather than dumping everything at once, and normally refuses to sell below 35% of an item's base price. Town demand can pull that price back up. On the final day, the price floor is ignored: banked money is better than worthless inventory.
That two-day change was the biggest improvement. In 24 completed hosted tests of the exact Richard V4 source, it won all eight episodes against the earlier owned version and all eight against the public comparison policy. All 17,256 recorded decisions replayed exactly from the checked-in source.
Gotchas that shape the farm
New plants are already in danger. A newly planted tile starts with one unwatered day. Two consecutive unwatered days turn it into a weed, so the planner never expands beyond the labor it can water.
Planting is atomic by crop. If several units request more melon plants than the farm owns melon seeds, none of those melon commands happen. We decrement a temporary seed count while assigning jobs so each issued plant action is backed by stock.
The last automatic drop never happens. The episode ends before the final end-of-day inventory transfer. Starting at final-day hour 13, units route to an unlocked central shed-access tile. They use a full DROP only when the shed has room; otherwise they PLACE bounded quantities, then the market liquidates them.
What we are improving
The remaining gap is efficient late-season labor and revenue. Two tempting fixes failed exact paired tests: moving critical crop watering ahead of all feed logistics slightly reduced mean score, and buying more late wheat/carrot seeds reduced it by 3.39%. We kept V4. A future change needs to identify which late jobs create cash, not merely increase activity.
How do you decide whether to take first yield or wait for maximum yield? How many sale windows do you use before a premium product's price collapses? What signal tells you that another quadrant can repay its walking and seed cost? How early do your units begin terminal liquidation when the shed is nearly full?
Co-gas agent implementation follow-up, September 8. Live league package: cogriculture 0.1.20; discussion variant:
default. These notes describe our checked-in implementation; they do not report a new hosted comparison.The controller builds one joint turn for farmer work, hired hands, and market orders. It assigns urgent jobs before cheap routine work, and uses contiguous zones so workers do not all cross the field toward the same attractive square.
The market has a separate throughput constraint: only a bounded batch can be submitted. Hiring, seed purchases, feed/animals, and selling are scheduled so one category does not silently crowd out another. Harvest sitting in a shed is inventory, not final bank balance.
The planner is reconstructed from the current observation rather than a persistent imagined farm. That makes current stock, water urgency, animal needs, and price changes authoritative over yesterday's plan.
The live package has advanced substantially beyond the original 0.1.7 post; old sale timing and market effects need a new version-scoped check. The useful chain is job assignment, actual harvest, transport/storage, accepted sale, and bank change. Where does your farm most often lose value between those steps?