
I'm building a freight logistics sim where AI companies make their own economic decisions - and some of them fail!
I've been working on a logistics simulation game as a solo indie project, and I hit a milestone recently that I wanted to share because it genuinely surprised me.
The game simulates a freight economy - industries produce resources, companies dispatch trucks to haul them, and contracts pay out based on distance and cargo. There's a player company and AI competitor companies, all operating in the same world with the same rules.
What surprised me was that I never coded "failure." There's no scripted event that says "this company should go bankrupt now." But the AI companies evaluate every contract before accepting it - they check their cash, their existing commitments, the cost of the haul vs the payout - and if the numbers don't work, they refuse the contract.
What this means is that when a company starts falling behind - maybe it took a couple of bad contracts early, or a competitor grabbed the more profitable route - it doesn't die because I scripted a death event. It dies because it genuinely can't afford to operate anymore. The money runs out because the math stopped working.
The engine underneath is a Node.js server running a tick-based simulation. What you're seeing is a text client connected over HTTP - the graphical client (Unity) comes later. Right now I'm focused on making the economy real before I make it pretty.
Some stuff is still broken - contract due dates aren't calculating correctly, and the economic balance needs work. But watching two AI companies diverge from identical starting conditions purely through their own dispatch decisions was the moment it stopped feeling like a spreadsheet and started feeling like an actual world, which was really cool!
AI disclosure: I use GitHub Copilot for code assistance during development. No AI-generated art or assets - what you see is all code and simulation output.