1
Programming / Re: Critique my "emergent economy" code
« on: May 20, 2012, 04:25:18 AM »
Thanks again for clarifying.
Here's the objectives: The game will be a procedurally-generated open world-type game containing cities + civilizations. Each city will have a local economy (basically, the above script) based on what resources are nearby. The local economy will be supplemented by trade routes/merchants, which connect cities to each other and resource types. The economy will be able to adapt to crises like forest fires or droughts and adjust prices of goods accordingly. Minimally, commodities will have different traits/prices depending on material used.
The economy code won't need to update often, maybe once or twice per in-game month or so. I'm guessing there will be around 100-150 cities on the map which will have economies attached. Cities will unlock "slots" for agents by building certain structures, but the # of agents does not have to be huge. Cities with populations in the thousands will probably only need ~50 agents or less.
What are your end objectives? If you describe the model and variables that you wish to implement, it would be easier to make more specific pseudo-code. The system is drastically different if each agent has skills and stats and other junk going on.
Here's the objectives: The game will be a procedurally-generated open world-type game containing cities + civilizations. Each city will have a local economy (basically, the above script) based on what resources are nearby. The local economy will be supplemented by trade routes/merchants, which connect cities to each other and resource types. The economy will be able to adapt to crises like forest fires or droughts and adjust prices of goods accordingly. Minimally, commodities will have different traits/prices depending on material used.
The economy code won't need to update often, maybe once or twice per in-game month or so. I'm guessing there will be around 100-150 cities on the map which will have economies attached. Cities will unlock "slots" for agents by building certain structures, but the # of agents does not have to be huge. Cities with populations in the thousands will probably only need ~50 agents or less.