Simulating a simple economy

Started by
3 comments, last by Mr Grinch 20 years, 5 months ago
I''m looking for help about how to simulate a simple economy for a game which allows the player to trade a few (like 4) commodities. I would like to do more than assign random prices to good when the player enters a town, like some supply/demand stuff but I really don''t know where to start, all the searches I''ve done have come up with really serious economics simulation stuff. It doesn''t seem like I need something that complicated, but I don''t know, maybe it''ll be more complicated than I expect. Does anyone know how I should approach this? Where can I find information on game related (ie simple) economic simulation, rather than scientific simulation? Sorry for my ignorance, but thanks for help.
Advertisement
I''m not sure about sources for this kind of thing, but because you have a very specific need, you might want to think about outlining the needs you have, and writing a simple program (or use excel for that matter) that lets you step forward in time given the parameters you define in the economic simulation. Exporting data into excel and drawing graphs showing trends and price projections would give you some sense about where you need to tweak your algorithm. I''ve done this with simulations before and it is hugely valuable in letting me define a simple simulation that is somewhat stable without having artificial limiting factors.
Try playing Gazillionaire by Lavamind (www.lavamind.com) - it''s a space trading game that I think does exactly what you want.
It''s a basic sim with supply and demand, and various occurances that modify the economy on specific planets, like earthquakes and productivity booms, etc.
Brewdles, thanks for the link. The economy in Gazillionaire seems fairly similar to how I would like mine to work. I had fun playing it, too. However, I am really looking for discussion (or pointers to discussion) about how to implement this sort of economy. I''d prefer not to just get source code (I''d rather get the theory and then work out my own implementation), but even reading source is better than nothing. Any ideas?
start with the basics of all economics. supply and demand.

lets build a small scenario.


you have your 4 commodities.

for simplicity lets save you have 4 towns.

in each town you will have X amount of demand for each commodity, and Y supply of each commodity. price will be determined by the difference in supply and demand.

(this would be alot easier if i could draw a graph)


so we have city 1-4;
demand of commodity D1-D4;//demand of commodity 1 thru 4
supply of commodity S1-S4;//supply off commodity 1 thru 4
price of commodity P1-P4;//retail price of commodity 1-4

city 1 has a constant demand of D1-D4 of 70.(on a scale of 1 to 100)

its supply of each commod goes as follows. S1 = 40, S2 = 60, S3 = 70, S4 = 80)

so we will calculate prices as follows.

Demand - Supply = MarketFlux;

MarketFlux * BasePrice = Price;

(here you must decide if you are going for accuracy or realism, econ is a very misunderstood science, let me give you the hack version first, as it will ring true for a majority of people.

lets focus on commodity 1 first.

D1 - S1 = MFlux;
MFlux * BPrice = Price;

so

70 - 40 = 30;
30 * BPrice = Price;

now, what is BPrice? This is where the hack comes in.

you would expect a brick of gold to be worth more than a glass of water, in fact, if that were not the case you would think it was wrong. but imagine a man dying of thirst in a desert palace made of gold. the supply of gold is huge, the demand is virtually non-existent. but because the supply of water is 0, and the demand is life threatening, water is worth many times its weight in gold.


You can use a base price to ensure that your commodities reflect a "real world" representation of an imagined value.

lets say our first commodity(S1/D1) is gold, and our second commodity(S2/D2) is coal. You assign a BasePrice of 5 to gold and 1 to coal.(to reflect an imagined difference in their value often held by the player)

finally we can actual finish our equation.

Supply - Demand = MarketFlux;
MarketFlux * BasePrice = Price

so for our gold.

70 - 40 = 30; //(a +30% multiplier)
1.3 * 5 = 6.50

so each unit price of gold is worth 6.5 whatevers(dollars, gold pieces, you pick)

now our coal

70 - 60 = 10 //(a +10% multiplier)
1.1 * 1 = 1.10

so each unit price of coal is worth 1.10 whatevers

finally lets make our last commodity straw or hay, well give it a BasePrice of .50

D4 = 70
S4 = 80

so

70 - 80 = (-10) //(a negative 10% multiplier) here we take 100% - the 10% multiplier which equals .90%

.90 * .50 = .45

so each unit price of hay is worth .45 whatevers.


there are tons of ways to expand this, and we can complicate it as you wish, but that is the basis of exchange, which is a logical place to start.

Best of Luck

Dredd
________________________________________

"To die with your sword still in its sheath is most regrettable" -- Miyomoto Musashi



[edited by - Dreddnafious Maelstrom on November 18, 2003 1:35:59 PM]
"Let Us Now Try Liberty"-- Frederick Bastiat

This topic is closed to new replies.

Advertisement