# Economics engine

This topic is 1589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have a unique idea for how to simulate economics. I will eventually write a free RTS with a moddable economics engine, the first of its kind.

What would you like to see in an agent-based economics simulator?

##### Share on other sites

Can you go into more depth on what you mean by agent-based economics? Perhaps an overview of what you generally plan to do?

##### Share on other sites
Like the new SimCity, an agent-based approach simulates units instead of using statistics/formulas.

I plan to make resources moddable. You choose their name, icon, whether they're a capacity (like housing) that is uneconomical to store (like electricity) or whether they accumulate (like ore), whether they're physical and must be transported (like metal) or whether they require a conduit (like pipelines or powerlines).

Buildings too. Their models, inputs, outputs/economic process. And units.

Labourers would have demand elasticity curves and propensity for consumption for different commodities and differentiated products. Still figuring out how I'll handle differentiated products though.

Transportation would work on an auction model. Demanders bid on the lowest-cost transport of their resources (taking the path/fuel cost and the price of the resource to be transported from the available supplier) and trucks choose the most profitable use of their time (taking into account fuel, driver cost and expected earnings).

You can build private homes to sell to labourers. It's a trade-off for them, to pay rent each cycle (apartments owned by players) or pay a one-time fee to own a house.

You can build cars to sell too. It's an investment if the money spent on the car and fuel is made up for by the time saved and better job opportunities available. Interest of loan would also be factored in. The player can start bank branches to give loans to labourers and other players. He can do a background check on where the labourer lives, works, before giving the loan.

Having multiple currencies (perhaps user-created) and printing money is another possibility. And stock markets and owning shares in other players' corporations, and vice-versa.

Maybe you can own and sell land. And sell/buy buildings/businesses owned by other players.

The modding of buildings would include adding to aspects of the economy that I didn't think of yet, like different kinda of farming, ranching, entertainment industries. That might require making the game open source though. Or making it moddable through dll files, but I don't know how I'd expose enough and which parts for it to truly be able to grow.

##### Share on other sites

Could you explain a few things? What is the player doing in the game world, or whom does he incarnate, and what does he have control over exactly? It looks like he's some kind of central bank/half-god that does not control the agents' actions but still controls offer of certain goods like cars and buildings; but then will AI control the labourers' choices? In an auction, for example, the player obviously can't be the seller and the bidder, there has to be an AI involved.

##### Share on other sites

madshogo, he already explained what the players are - corporations competing with each other.

I'm interested in how extensive control the players would have over physical topology, land ownership, construction, etc. These come with high potential for degenerate strategies.

If the idea is for the game to show a physically growing city/region like Simcity or Transport Tycoon do, you might want some kind of government AI to automatically build basic road connectivity everywhere, perhaps regulate zoning and do other things.

##### Share on other sites

madshogo, he already explained what the players are - corporations competing with each other.

Well the only mention he makes of "corporations" (at least in this thread) is

owning shares in other players' corporations

and while I see that players can *have* corporations, I don't see that they are corporations. Also, since when do modern corporations build homes and cars for their workers? I think that instead, polyfrag meant his game as a kind of SimCity where you are some kind of powerful mayor who rules the economy of a city/region.

##### Share on other sites
The game takes place in an alternate universe where corporations have grown so large that they wield armies and hold responsibilities held by governments. These "corporation-states" are the next stage after city-stated and nation-states.

The player doesn't own labourers but merely offers them jobs where a chosen amount of currency (resource) is exchanged for a set amount of labour (resource). Labourers are AI controlled and choose the most profitable use of their time. They need housing to regenerate their labour power and consumer goods to survive.

##### Share on other sites

An economics engine would really be nothing more than a bunch of people with desires for different things and simulating supply and demand. All a real economy consists of is people with desires and different priorities who trade things for other things, creating supply and demand, which in turn creates prices. A lot of trappings of modern economies only serve to break them in reality (especially things like central banks).

Simulating this process as minutely as possible would be the main goal of an 'economics' engine IMO, because that is what a real economy is. Every actor in the economy would have to make decisions on an individual level based on their own individual values as well as their means and capabilities to actually act on their values.

##### Share on other sites

Farms complicate things. Is a farm one 'building' or is it made of grain silos, beehives, etc.?

What else is there?

- vineyard

- ranch

- cotton plantation

- tobacco plantation

- coffee plantation

- sugar cane plantation

And the associated businesses - cereal factory, etc.

- pulp and paper mill

- textiles plant

- apparel plant

- plastic plant

- rubber plant

Also, how to handle wholesale/retail? Stores purchase produce, apparel, electronics, etc. wholesale and sell it to the end consumer.

And what about education? I was thinking of making 'engineering' a resource required in construction and maybe 'skilled labour' for operating a nuclear powerplant. Colleges are privately run, because corporations own everything in the game. How is the hiring of instructors handled. And primary/secondary schools, kindergardens. Labourers should be simulated getting married, having children, growing older, retiring. Maybe pension is a job benefit players could offer to employees.

Since this is an alternate universe, resources and buildings/economic processes can also be made up.

There's a scrolling ticker at the top showing resources.

Capacities show usage / total availability:

Cumulatives show stock and +/- projected change per cycle:

A cycle is the economic equivalent of a month:

Rent is paid cyclically.

Resources are localized and must be transported.

Potential 'buildings':

If I add ships to the game,

I could make mining really complicated and somehow tie into the heightmap/terrain:

Underground mining too. What would be the difference?

Prinz Eugn posted this in another topic: http://comtrade.un.org/db/mr/rfCommoditiesList.aspx

I started this years ago:

BTW,

Edited by polyfrag

##### Share on other sites

I'm interested in how extensive control the players would have over physical topology, land ownership, construction, etc. These come with high potential for degenerate strategies.

I can break construction down into

http://en.wikipedia.org/wiki/Construction_equipment#Types

http://en.wikipedia.org/wiki/Construction_materials

That would require making a special architectural editor/engine too.

If the idea is for the game to show a physically growing city/region like Simcity or Transport Tycoon do, you might want some kind of government AI to automatically build basic road connectivity everywhere, perhaps regulate zoning and do other things.

I'll be programming an AI for corporations that does that.

Also, mercenaries (to be soldiers, tank/mech operators) must be recruited from among labourers and they need to be fed, housed, and paid.

##### Share on other sites

What would you like to see in an agent-based economics simulator?
...
Farms complicate things. Is a farm one 'building' or is it made of grain silos, beehives, etc.?

I was going to say something about contracts, where an agent would gain access to a service but with some commitments. e.g. after buying a monthly bus ticket, the agent has a 'sunken cost' that it has to consider when evaluating other forms of transport. So if a better option pops up, they likely won't change at least until their monthly ticket expires.

You could use these kinds of contracts to build hierarchies to solve the farm issue too. E.g. a field can be worked to produce food, but it's owner has specified that that workers can only deliver the food to a specific silo (also belonging to the owner).
As with the bus ticket example, the farm owner might sign a distribution deal with a particular retailer for some time period, where breaking the contract means he has to pay a penalty fee. The retailer may sign a contract with a particular trucking group to move food from the silos to the retailer, etc, etc...

If you could build this reusable economics engine as a stand-alone library, which games could use to create their economies, then I can picture it being quite popular among indies that want to make these kinds of RTS/city-builder games, but don't have the time to build the simulation engine.

##### Share on other sites

I was going to say something about contracts, where an agent would gain access to a service but with some commitments. e.g. after buying a monthly bus ticket, the agent has a 'sunken cost' that it has to consider when evaluating other forms of transport. So if a better option pops up, they likely won't change at least until their monthly ticket expires.

The rational thing to do would be to choose the most cost-effective transport. The bus is free but takes longer (waiting/hopping buses/frequent stops).

profit = time spent working * wage rate - money spent on transport


For bus, money spent on transport is a fixed cost. For car,

money spent on transport = cost of fuel * fuel consumption rate * path length

If the cost of fuel, or consumption rate is low, or the path short, cars will be more cost-effective. If a bus pass is already purchased, it's cost = 0 (sunken cost as you said).

But if a bus takes significantly longer, it may be less profitable even if free. The choice must be made before the bus pass is purchased to gain the most benefit.

You could use these kinds of contracts to build hierarchies to solve the farm issue too. E.g. a field can be worked to produce food, but it's owner has specified that that workers can only deliver the food to a specific silo (also belonging to the owner).

I'll add an option to specify storage capacity of different buildings. If 0, they'll move it to a suitable owned building.

And rules for which buildings must be near each other (silo next to field).

As with the bus ticket example, the farm owner might sign a distribution deal with a particular retailer for some time period, where breaking the contract means he has to pay a penalty fee. The retailer may sign a contract with a particular trucking group to move food from the silos to the retailer, etc, etc..

So I would add an option to specify which outputs and which inputs require a distribution deal. Rather, which inputs/outputs are wholesale and which retail (end consumer).

I don't know why a deal with one retailer should prevent them from having a deal with another. PlayStation ships at Futureshop and Best Buy after all.

Edited by polyfrag

##### Share on other sites

I'm working on the game for iphone, ipad and android. Check my journal.

http://www.gamedev.net/blog/1512/entry-2256323-next-project/

It's a limited version of the full economic engine I will eventually make.

##### Share on other sites

Polyfrag, here's my question: what is the core appeal of this game?

What aspect of micromanaging an economy do you feel is going to be fun? I'm asking honestly, because I think it's always worth taking into consideration.

For me personally, all the number crunching and statistics in Roller Coaster Tycoon were just the background glue that held together the game's core appeal: pretending to be a miniature Walt Disney, thrilling the hearts and minds of thousands of guests with your creative ideas.

So would your economics game, perhaps, engulf the player into the fantasy of no longer having to wait for politicians to fix problems and taking matters into their own hands? If so, sign me up!!!

##### Share on other sites

Polyfrag, here's my question: what is the core appeal of this game?

What aspect of micromanaging an economy do you feel is going to be fun?

Trying to figure out how to win. How to gain the most profits -- what price to set, what to set the production quota to, where to build. I designed this game without knowing what the winning strategy is.

When you lower or increase a price, I'll try to make it react in an intriguing way instead of there being one dumb strategy.

Increasing the price alienates some clients while earning more from others, depending on their proximity relative to other suppliers. The one who's closest to the clients can set the highest price. Your profits also depend on the price of your inputs. Its most profitable to own your inputs. You won't have the resources in the beginning to build all the necessary buildings, so you depend on others.

##### Share on other sites

When you lower or increase a price, I'll try to make it react in an intriguing way instead of there being one dumb strategy.

Hm, you know for me, a great way to make the effects of your decisions in the game interesting would be the human element.

What if your other main goal was to keep happy the citizens under your jurisdiction? That if they were made unsatisfied, they would stop working, or not work as efficiently. And not just with obvious things like keeping down on crime or fires or pollution, but also for more surprising things that people could have a problem with.

I highly, highly recommend you check out the writings of Thomas Sowell. Two of his books on economics, "Basic Economics" and "Applied Economics: Thinking Beyond Stage One" are very informative, and very engaging. Particularly the first third of Basic Economics. They put a lot of focus on the cause-and-effect relationship politician's decisions have with the economy.

##### Share on other sites

When you lower or increase a price, I'll try to make it react in an intriguing way instead of there being one dumb strategy.

Hm, you know for me, a great way to make the effects of your decisions in the game interesting would be the human element.

What if your other main goal was to keep happy the citizens under your jurisdiction? That if they were made unsatisfied, they would stop working, or not work as efficiently. And not just with obvious things like keeping down on crime or fires or pollution, but also for more surprising things that people could have a problem with.

I was thinking of "utility".

Maybe I have to make a full-fledged simulation with governments and taxes etc. Then crime/fire-fighting/pollution would make sense.

I highly, highly recommend you check out the writings of Thomas Sowell. Two of his books on economics, "Basic Economics" and "Applied Economics: Thinking Beyond Stage One" are very informative, and very engaging. Particularly the first third of Basic Economics. They put a lot of focus on the cause-and-effect relationship politician's decisions have with the economy.

Found the books at a local library. Thanks. I'll post my thoughts as I read.

Edited by polyfrag

##### Share on other sites

Found the books at a local library. Thanks. I'll post my thoughts as I read.

Um, wow, you're actually going to read them a little bit? Thanks!

I was thinking of "utility".
Maybe I have to make a full-fledged simulation with governments and taxes etc. Then crime/fire-fighting/pollution would make sense.

Now I've hardly played simulation games myself--other than Roller Coaster Tycoon, which I have practically memorized--so I don't know if any of the concepts I could touch on here have already been done in earlier games, but here I go:

>The density of the population effects the way people react to various situations and the politics they support. The population in big cities will tend to think more collectively.
>The people also have an acute sense of whether or not they feel they're being taken advantage of. They will be hesitant if they feel they are losing their freedom. The player might have to find the right balance between ordering her citizens around to maximize productivity, and leaving the simulated people to their own devices to maximize morale.
>I know sim games have disasters that can have natural disasters that wipe out coastlines, and monsters that knock down buildings, but has there ever been a game where revolutions can pop up under the right circumstances? Occupy Wall Street comes down the streets and breaks stuff, or full-on rebels try to tear the city apart altogether.

##### Share on other sites

Yes I'm going to read them. Why not.

Edited by polyfrag

##### Share on other sites

Underground Mine

Can be

- horizontal tunnel carved into hillside with portal outlined by frame of rough-hewn timbers

- more commonly shaft mines where entry is vertical requiring a hoist

- next stage of mining operation - the mill, or ore-processing plant
- at small, isolated mines, might be hauled by trucks or rail cars
- most modern conveyor systems are like supermarket checkout counter or airport luggage carousel
- can extend for miles, underground and surface
- certain ores (lightweight or soft or soluble, such as phosphate) transported more efficiently by slurry pipeline
- dumped on outdoor storage heap

Surface Mining

- open-pit for mineral veins or ore bodies that dive deep into earth through hard rock; most iron and copper mines this way
- open-cast for "bedded" sedimentary deposits that extend horizontally over large areas, lie not far under surface
- coal seams usually fit this, and so do deposits of certain other soft minerals such as phosphates

Open-Pit Mining

- terrace or bench
- others switchbacks/zigzags, built mainly along one wall
- this usually chosen when one wall of mine is at the edge of ore body and will not be excavated further
- gigantic power shovels and fleets of front-end loaders scoop up debris

Strip Mining

- largest open-pit mines cover only few square miles, but ambitious strip mine could roll over 10 or even 100 times as much territory in same period
- in many cases no blasting done; overburden is soft enough to be chewed up by earthmoving machinery

Machinery

"stripping shovel"
"dragline"

Solution Mining

- in US 30% of copper, 35% of gold, 75% of uranium

##### Share on other sites

Listening to the audiobook of "Basic Economics".

So much of a city is not refineries and mines but apartments, houses, office buildings and skyscrapers. To make it visually realistic, most of the city has to consist of these buildings. This is the SimCity approach.

If I lean more towards RTS though, it's more about resource extraction and manufacturing. It's a caricature.

If I make it like SimCity, I have to do a lot of pathfinding optimizing to make it able to run in real-time. This is probably impossible.

What I want is fun gameplay, so it will be a caricature of a whole country. Maybe even planets.

I was thinking of calling it "States and Corporations". And "in Space" maybe?

Now I've hardly played simulation games myself--other than Roller Coaster Tycoon, which I have practically memorized--so I don't know if any of the concepts I could touch on here have already been done in earlier games, but here I go:

>The density of the population effects the way people react to various situations and the politics they support. The population in big cities will tend to think more collectively.
>The people also have an acute sense of whether or not they feel they're being taken advantage of. They will be hesitant if they feel they are losing their freedom. The player might have to find the right balance between ordering her citizens around to maximize productivity, and leaving the simulated people to their own devices to maximize morale.
>I know sim games have disasters that can have natural disasters that wipe out coastlines, and monsters that knock down buildings, but has there ever been a game where revolutions can pop up under the right circumstances? Occupy Wall Street comes down the streets and breaks stuff, or full-on rebels try to tear the city apart altogether.

That seems too marginal to simulate.

##### Share on other sites

Yes I'm going to read them. Why not.

This guy has the spirit.

##### Share on other sites

Don't know how much this helps, but I played a game called Capitalism II,

it features a pretty extensive economy system with corporations that compete for certain goals (highest market share in electronics, etc.). You can mine resources, build factories to craft the resources into goods, build retails to sell the goods (you can also sell your competitions goods if they allow it). You can set prices on pretty much everything, buy shares of company, take over companies, etc.

This is just if you need some more inspiration ;), cheers

Edited by Arhim

##### Share on other sites

Thanks.

I'm interested in how extensive control the players would have over physical topology, land ownership, construction, etc. These come with high potential for degenerate strategies.

Don't know what kind of degenerate strategies there could be.

Listening to Basic Economics over again to make sure I get all of it.

I had some ideas for how to do quick pathfinding on a street level. The hard part is the rules for how roads are formed. You should be able to place them in any orientation and be curved, like in SimCity 5.

##### Share on other sites

I'm tempted to add the ability to go inside buildings and up/down stairs.

The paths between the different rooms could be precomputed in a building editor.

It could be a small city block. I can't create all the content so I'd leave it up to other people to use my tools.