My code is trying to kill me

Economix - Lessons learned

22.04.2019In Projects

Although I learned a lot from my first two attempts at economy simulator, they failed as projects.

In the first iteration, the world had no dimensions, no concept of place, no distances. It simplified things a lot but it was hard to visualize anything.

A world had resources like forest, hunting ground or berry field which could be extracted wood, food or animal skin. Each human had daily need for food, wood, cloth and he had to have this in inventory to be able to live. There were predefined processes like hunting, woodcutting, spear making which required different resources and items to produce some other item. Each human could take one action per day. He could gather resources, craft something, rest or reproduce. So once the basic needs were covered he could rest to increase happiness, reproduce to increase the number of people or craft something. Crafted tools would increase productivity of any process and using a process would increase the skill of using that process.

But the simulation immediately hit the Malthusian trap, everybody competed to survive on the most basic level. The only viable tactic was to use the resources as much as you can. If you try to invest in skills or tools, you'll most likely die of hunger.

If all critical resources are shared but scarce, there is no economy, just basic survival. What I needed was some kind of private property over the resources but current engine was not able to do it so I wanted to base it on better foundation.

The second attempt abstracted too much and economy was falling. I want describe the internals but I got one important insight. Basic of the economy is sustenance without trade. You need to be able to produce your own food and then decide if you want to trade or not. If you are forced to trade to survive, the prices fluctuate too much.

I still didn't figure how to do money.