Economy design in a single player simulation game

Warning, wall of text
Hey guys, I’m making a village simulation game. I’m having a hard time setting up resources prices and designing the general economy.

A bit of background, the game plays somewhat like Banished where you place buildings and every villager is simulated. The main difference is that every villager has stats and character traits that can influence their decisions, ambitions and reactions. You play as the Lord of the manor, you must take care of your population but the first role of the manorial land is to provide you with money and men. Here’s a screenshot:

There are multiple social ranks in the game

  • Serfs are the lowest rank, these are your farmers. Serfs will work your fields for free but they can also work at your businesses in exchange for a salary.
  • Freemen are serfs who have emancipated themselves. Basically they made enough money to buy their freedom from you. Freemen can own businesses and have employees. If they work on your fields they’ll either keep part of the produce or you’ll need to pay them a salary.
  • Merchants are business owners that manage to make a lot of money. Merchants have higher luxuries demands than freemen and will be able to trade with other villages or cities.
  • Knights usually from noble families, these persons are trained from a young age to be fighters. They need to be entertained otherwise they tend to start fights.
  • Clergy (not implemented yet) are people that have an interest in learning and wisdom. They will usually work for the church and not you so you don’t directly manage them but they can be an important part of your lands
  • Nobles are families who’s name carry a lot of weight. These will be the main consumers of luxury resources and providers of knights. You’ll need to have the satisfaction of the nobles on your land in order to pass important decisions.

Okay, now here’s where I’m having an issue. I’m trying to simulate every transaction in the economy. For example a farmer that has managed to harvest a lot of grain could sell the excess at the market and keep that money. The blacksmith who doesn’t have time to sow and harvest would use his salary to buy that grain to feed his family and so on. This works but the issue I have is I don’t have enough money sinks, the money just goes around everyone’s pockets. People either get super rich or stay extremely poor I can’t seem to get it balanced.

I tried using a spreadsheet to balance my prices, here’s what I have so far:


These prices assume that the person is the owner of the business and the money received is based on sales, not on a given salary.

And here are prices for food which really is the only money sink I have so far:

People need 4 foods per meals. There are 3 meals per seasons. At 4 residents they need 48 units of food possibly balanced as shown above.

You can start to see where I’m having a problem… Some works don’t pay enough for people to feed their family. Farmers that work on freehold tenure fields will get to keep their harvest, keeping the food is always the better option. Let’s say for example a farmer harvest 200 peas, they pay 50 in taxes and keep 150. With that amount they can feed a family of 4 for 3 complete seasons. If they sell the peas they get around 45-60g depending on their bartering skills. That’s enough for maybe 2 seasons worth of (albeit more balanced) food.

I guess I’m just looking for ideas to make the economy more balanced and interesting. I want serfs to be barely able to put money aside. In general I want to make it super difficult for people to earn money. Right now in my prototype if a farmer works on a freehold field they can gather enough money to become freemen within a year or two…

So far aside from food, people must pay a tithe to the church (assuming you built one), pay a mason for repairs on their houses or businesses (that is really low because if I set it too high then the mason becomes super rich), clothes which must be bought every year and furniture (kitchenware is a part of that). The higher social ranks have more sinks like knights must buy and maintain their equipment, merchants must pay tolls and tariffs when trading, etc.

I have taxes of course but then again I don’t want the player to be able to make too much money from that at least not at the beginning when your village is all farmers. One way around that would be for the player himself to owe taxes to his liege lord.

Please let me know if you have any more questions, I’d love to get your feedback or just general Ideas on how I could improve this system and hopefully make it more balanced.

5 Likes

This is a fascinating subject and one that I think is often poorly handled in games. Get it right and the richness in the game will be ever engaging. I’ve thought about doing a game like this before and I am convinced it gets very complex fast. I don’t have experience of a game like this - but in my day job I work with macroeconomic simulations. Here they model things very differently - but I can offer one key piece of advice: Make your core model simpler. You model complexity scales very non-linearly with number of products and number of types of agent. Start with three - get the right behaviour there then add others having calibrated that.

E.g. 3 types of agent, two products

  • Farmers - make food. Need tools.
  • Blackmiths make tools need food.
  • Landowners need food.

This is a three way simulation easier to get right, Then you can add complexity one product and agent at a time, making sure it does not unbalance. Be very interested to hear how it develops.

Ian

3 Likes

What you’re missing is, and I don’t say this lightly, supply and demand curves for every product.

Without going too far into my college years (which were a long time ago). Every product on the market has a supply and demand curve with varying levels of elasticity. Elasticity is how price sensitive someone is to a change.

IE: Study shows that despite the incredibly stupid risk, people will make left turns across traffic for gas that is .01 per gallon cheaper. Further, no matter how expensive gas gets, people will rarely cut back too far on how much they consume due to its neccessity in life. To put it another way, if your village had nothing but grain to eat and it was in short supply, no farmer would ever go hungry or be poor. The rest of the town would likely be in ruins though :wink:

Next up you have that whole supply/demand issue, which is the bigger crux.

Supply and Demand curves are rarely linear, but to start you may want to model a linear curve and then move to a more complex model. In short the greater the supply, the lower the price. The lower the price the more people will purchase of it.

So it sounds to me what you need is some additional fuzzy logic. First to add a supply demand curve for each item and a level of elasticity (how sharp the line is). Next add in some variation in what the person’s minimum needs are: IE: you have pre-packaged meals but what you need are “They need at minimum 1 grain item and 1 protein” and “10 total food value” and then let them pick what they want based on that supply/demand.

THEN add a fuzzy logic element that says “I don’t always do what is best for me.” - Which is to say they should try to behave like reasonable people, but reasonable people don’t always do what is economically best when buying food. We are not a perfect system, so add some randomness to their purchasing habits. Even if fish is expensive (to a limit) they’ll still sometimes buy it.

At the end of the day economics is about the movement of money, not the creation of money. You need to create an inflow of where currency comes from and an outflow of where it goes. Until you do, if you have 1000 coins in your kingdom you’ll always have 1,000 coins. If the economy fails, it is because at the end of the simulation one person ends up with all 1,000.

4 Likes

@SpaceMammoth Thanks for the input! I agree it might be a bit naive of me trying to balance everything in one go… I’ll keep your suggestion in mind!!

@ironbellystudios Thank you very much for the advice! I knew I couldn’t get away from this kind of economic system without having dynamic prices. As far as supply and demand goes, is that something that should be upgraded the very moment someone makes a trade? Or say update it every 100 seconds?

For example in the game Mount and Blade the prices change the second you sell an item. Like if you start selling a stack of Iron the price will very rapidly drop to the point where you must stop selling because you’re actually losing money.

I guess I should start implementing that , I read a couple of papers online on supply and demand and it all seems very complicated at least from my point of view. As far as money the main source of income is people selling their produces to traveling merchants at first but at their local market place once you build one.

As far as where the money goes the only way I can see money leaving is either by taxes or preventing the player from producing certain resources which would require some imports.

1 Like

This could possibly be fixed by forcing the people who earn a lot of money to start spending more and more.
Why? To show that they really have more money than others and to satisfy their ever growing needs.
For example if serfs earn a considerable amount of money they might go to the tavern and buy his less fortunate friends a drink, or he might think he deserves to eat better food.
Or you could use some other thing that people would want to do as they get richer.

It appears to me that you have money coming into the game by the means of traveling merchants and that additional moneys is getting consumed by some people who then get rich.
If you instead have a finite amount of money in the game then as some people that are getting rich will start to lose their customers as those customers will have to spend all their money on the essential stuff (I mean the food and such stuff) and thus the rich guy will start to lose money.
But this would only work if multiple people are selling the essentials, otherwise that’s just monopoly.

With a smaller model, it’s probably easier to work things out purely with the costs of labor. How much work goes into a production cycle and how much do you get out of it. A sword may take months worth of man hours to produce and crops may take the same amount of work, but you would probably produce tons of crops, while only producing one sword.

Supply and demand is better used for trading between smaller economies, where how much labor actually went into it is no longer relevant.

Don’t forget the lord of the manor can tax based on income or any other measure. This will create the money sink so the lord can then help support the lower paid serfs, perhaps by supplying them with some of the grain, animals etc that they grew for him/her. This will let you have price elasticity in the market as well as a reserve that can be used to put cash back into the economy or take it out to help moderate prices. If the lord decides not to push cash out or to tax higher then the market will become unbalanced & people may leave/die or if things are really good extra people will come in & exacerbate the demand side (unless they are economic migrants that are cashed up in which case it lets you inject additional cash into the economy).

This stuff is just awesome! I love agent based simulations.

I don’t think that a supply/demand curve is actually appropriate for agent based simulations (since supply/demand is more of an abstraction for dealing with aggregates). If you’re going to model individual transactions, then you can sort of kill 2 birds with 1 stone by just modelling a market.

You have sellers place “asks” (asking price offers) and buyers place “bids” (buying price offers).

When a characters offers to buy or sell something, their initial price point should be sort of greedy (or could be based on how badly they need food, or how badly they need money). But the idea is that originally you place their bids further away from the mid point of the bid/ask, then if nobody agrees to their offer in some period, they change their price (either cheaper if selling or more money if buying).

So, if there are more people buying then selling - the ‘execution price’ (the price that both parties are willing to trade at) will go up, it will keep going up until some point where some people are not willing to buy it any more (assuming the rate of production stays the same).

If more people are selling than buying - the ‘execution price’ will go down and similarly, it will keep going down until some people are not willing to sell at that price (assuming the rate of consumption stays the same).

This would adjust naturally for stuff like ‘a travelling merchant’ or ‘burst of tourists’.

When you look at the ‘price’ of a thing - what you’re looking for is the last agreed on transaction.

Also, when choosing between things - what you do is look at a given product and calculate its ‘value per gold’ - so like different entertainment venues would have different ‘entertainment per gold’ values - you could model preference by just building out a preference matrix (maybe he gets bored if he goes to the same place too much) and multiplying out the entertainment per gold value.

1 Like

@ensiferum888 I think the answer to how price updates occur is largely code/design related. The reason a game does instant updates is to avoid “pump and dump” style abuse. If your design could lead to that kind of abuse, then you should find a way to avoid it. If not, updates in real time become less of an issue.

On the whole I disagree that a supply/demand system is to be avoided here. While all the suggestions given do, in fact, approximate something similar, they all seem rather resource intensive to me and prone to a lot of possible design errors. The key about agent based games is to limit the amount of data you have to crunch, which is where abstractions like a supply/demand curve work best. Calculating the individual needs of every citizen may add a lot of depth, but its depth the user won’t be able to keep track of. The prices of goods, however, can easily be displayed in a nice graph or table, allowing you to immediately see where there may be a problem.

The question - in the end - you have to ask yourself is “Where is the fun in this game.” Typically economic sims (Banished, Cities, Sim City) is in the balance of conflicting needs… but in the end most of those games get fairly boring once you’ve sorted it out. Most of the new games add a little spice and variety by unlocking new stuff as your grow. Cities does it explcitly (you get something new when you reach X population or Y achievement). Banished does it implicitly (You can’t start out by making the most advanced goods simply due to the limits of your population). The problem is both of these games, while successful, really fall apart in the end game. Balance becomes basically a non-issue.

Thanks everyone for the input I’m keeping all those suggestion under tight observation. Once I’m done my current task I’ll jump on it right away!!

@ironbellystudios You’re right, most citi-builders fall apart late game because there is no challenge anymore. I’m really trying to come up with a way of curbing that aspect meaning that the entire game doesn’t revolve about trading or necessarily managing your town. I’m working really hard on the agent simulation to create a believable and interactive society that feels somewhat different every game.

I think that simulating the supply/demand curves would help with the economy I actually found a pretty simple formula for it which I might be able to use in my context.

@tedthebug Yes good idea! Actually right now the Lord is sort of responsible for feeding the serfs who can’t provide their own food. Regardless of if they have money or not, it’s your duty to see to their “well being”. Other people will need to purchase food either through your own stocks or through the producers themselves. It’s this part I haven’t quite worked out yet. It’s a weird blend between free market and everyone owns everything I’m still prototyping to make sure this makes sense (or is fun).

@frosted This is actually something I thought about implementing but it’s hard to have this kind of market when people need stuff right now. I’m not sure how I could approach this model in real time considering that people need food every 200 seconds, they try to make provisions so that you have more people in need of food at the beginning of a season compared to mid season.

Micro economic, self balancing systems are very hard to build. I’ve tried in several attempts. If you actually succeed without some massive fakery, I’m keen to read a post mortem and see how you did it.

Economics is basically the study of decisions that individuals make. Individuals make these decisions based on very complex factors, including a ton of historical data, personal prejudices, goals and needs.

Macro economics does an okay job at predicting the aggregate results of these choices. But dropping this down to agent level is tricky.

2 Likes

I’m a little confused- what is the goal? Is it to grow your manor forever, or to compete against other manors or what?

I think somebody may have already said it, but your game will get ten times more accessible if you simplify what is going on at least to the point where your average guy can hold the info in his head.

The settlers model is a good example- farmer produces 1 wheat crop given 2 water units and 3 minutes. Miller produces 1 flour bag given 1 wheat crop and 1 minute.

I can hold in my head that a particular worker requires these supplies to produce his thing, and it’s going to take an amount of time for him to make it. What might be intimidating if I was working with 500 units of this needs 900 units of that gets really accessible when it’s just 1 of this needs 2 of those.

Second, you might be able to learn something from fallout shelter- since the fun is in expanding, balancing the economy is rather easy. But every so often your economy is disrupted by a raider attack or a fire or some kind of external pressure on your otherwise internal economy. I’d say having that external pressure is important to this kind of game, as it provides a degree of uncertainty, and a risk to your actions. Getting disrupted mid-expansion could be very costly.

Third, it’s important to determine what the consequences are for failing in some way. In settlers, running out of something slowed or stopped your economy, but it didn’t shrink it. As that game features competing economies, slowing down meant getting out-produced by your enemies, who could then leverage that advantage to ultimately shrink your available resources, in turn shrinking your economy. But just running out didn’t actually hurt.

1 Like

Simulator or game? For games, consider learning from other successes! I thought of games like Civilization, SimCity, and other detailed simulation/resource games. And whether real time, turn based, or a simulation exercise, these kinds of games solve these problems with one simple answer - they CHEAT.

Unless you are doing academic research, try to simplify your systems, so that you can focus on the FUN! Players’ like the illusion of a complex simulation system, where they have goals, mechanics, and feedback, that allow them to test out various strategies within the system.

TL;DR - Simplify, use slide-scales - vice highly detailed interactions, and cheat. Focus on the fun.

Gigi

4 Likes

@LMan_1 Thanks for the input I really appreciate the challenge. I always wanted some sort of combat aspect on this game but I can’t find something I’m satisfied with, external pressures such as keeping your trade routes safe or the occasional bandit raid could be the answer to that.

For now no you’re not necessarily competing against other manors, simply because I can’t possibly simulate other towns there is just too much that is happening. I could fake it but I’m really scared of going that route as it might feel too “static”. It’s really just a case of I don’t know how to fake it. Right now the role is really just providing your population with opportunities so you can in turn grow your power. You’re just a petty lord with a land trying to make the most out of it while keeping your population under control.

But if I could have everything I wanted yes, ideally I’d love for you to compete against other manors to get the king to buy your lumber instead of the other guy’s etc. It’s one thing I want to experiment with but I just don’t see how to simulate it without it appearing fake.

The only interactions you get with the outside are passing merchants and the occasional king’s steward collecting his taxes.

The inputs/outputs of a work place are always the same, it takes 1 wood and 3 irons to make 3 tools that won’t change. But a blacksmith with 20 Craftsmanship will make the tools in 15 seconds whereas someone with 0 craftsmanship will take 60 seconds to create them (a month is 200 seconds). So while you can have the basic economy chain in your head, depending on who’s working what you’ll get different results.

As a tenant to a more powerful lord you’ll need to provide them with grain, money and/or fighting men. Failing would of course lower your production, probably making you unable to fulfill your obligations to your lord. What that entices hasn’t been decided yet unfortunately. I’ll definitely check out Fallout Shelter thank you for the recommendation.

@Gigiwoo Thank you for the feedback. You’re right, I’m probably going way too deep with this.

Yesterday I implemented just a demand curve, what I did was every time you order the construction of a building, every time a work place needs resources in order to continue production, increase demand for said item. Just that feels like the economy is more “real” even though it doesn’t change anything on the game play yet. Eventually I want the lord to sell or give out businesses so that production will be handled by villagers themselves.

My main inspirations are Banished and Crusader Kings 2, I loved the depth and complexity of CK2 to be honest. I spent so many hours on that game because there was so much stuff to learn. I’m definitely making a game but yes it’s a village simulation game. I keep throwing the term City Builder around but I realize it might not be true, it’s more a base building game because the goal won’t be to cover the entire map, or to over expand.

Managing a village of 100-150 people should and will be extremely hard. Not only do you have to make sure they have everything they need, but their personality might clash with yours, they might revolt, they might fight with each other etc.

In regard to faking it I’ll give you the best piece of advice I ever recieved on AI- it’s goal isn’t to simulate another player, it’s goal is to be fun to beat. The computer is never meant to win.

Focusing on that, the only thing that matters is the effect an ai decision will have on the player. Everything else can proceed along very generalized paths. Since the player will spend 99% of his time looking at his own economy, he won’t care that the ai’s early game is almost exactly the same. The only parts he will care about are decisions that directly influence his own decisions.

Think about the design implications of each resource in the game. Divide them into early game, mid-game, late game and look at them as levers you can use to influence the challenges the player must overcome. If the player had very little lumber to begin with, it would slow his early game. If the ai hit his wheat production mid-game, it would mean xyz.

You can use this, plus maybe general ai personalities to create unique challenges every time.

2 Likes

Yeah, unless the entire point of your game is a market-based economy, just cheat it. For each item, have maybe 5 breakpoints and if the inventory is above a breakpoint, reduce the price. So if the farmer is trying to sell 150 units of peas, each one sells for 1 gold. If he is selling 10 units of peas, each one sells for 1.5 gold. It doesn´t have to be fair or realistic to fix the problems.

One way to keep poor people poor is to add a disease type mechanism. Each class of citizen has a chance of becoming sick and reducing productivity, and the poorer the class, the more likely to be diseased.

Another way to keep the poor poor is to add production boosts that do not scale.

For instance Ox and plow costs 5 gold per day to maintain and increases the production of farms up to 100 acres by 50%.
A serf with 3 acres could never afford it
A farmer with 50 acres would benefit from it
A landowner with 100 acres would get full benefit.

So it’s just like real life. :slight_smile:

ensiferum - I didn’t read the entire thread, only your first post and a couple of the following replies.
I’d like to suggest, if you have the time, to play or research Nobunaga’s Ambition. Originally on the Nintendo, then re-released on the SNES, then another take on either the first or second playstation.
Anyway - they have a pretty logical economic system set in place that is easy to learn as a player and comprehend as a designer, and it works, and is fun which is important.

The supply and demand aspect of that game was seasonal, rice is cheaper during certain seasons than it is in others, and when typhoons blow through the price of rice goes up because some crops are destroyed and it wrecks havoc on other areas that need repaired.
It is a lot more in-depth than I can explain intelligently, and involves a lot more than just rice and storms but I’d strongly suggest it as a quality reference for an economic model - that is fun, easy for the players to understand, and logical for a designer to breakdown and gather ideas from.

Thanks for the ideas I love this! So far right now all the prices are static, which doesn’t make any sense because I can just make a hunter and sell the game meat (it’s sold to a “global market” which never runs out of money) for a ridiculous amount of money, I would need to tweak down the meat amount given by deers.

There is already a disease and injuries system, people with a low craftsmanship and constitution have a higher chance of getting injured when they work. An injury will make them go rest at their home for 45 seconds, if there’s a physician in your village they’ll go there instead and get healed within 15 seconds. Be careful though serfs are under your watch so you have to pay for their healing. Of course this does mean that they can work less if they get injured, the downside is that it also directly affects you. Especially if it’s an important business like the Oven which produces bread.

Food will need to be balanced right now it’s really hard to fine tune the production vs consumption, some produce wayyy too much like the hunter compared to the fields. I like the Ox idea and it’s something I wanted to implement eventually. Right now the biggest field will need 4 farmers to harvest all the crops. Also right now food stocks are hard to keep track of because it’s so volatile.

Here is 4 years of Fish production(green) - consumption(red) - stock in storage barns(blue) the stock does not take into account the fish that people already brought in their homes.

And this is in a village that had a lot of peas production as well I had 3 big fields running, if I recall correctly this village had about 35-40 residents. Actually it’s the exact same village as the screenshot in the OP. Each “point” on the graph represents a season, I’ve actually updated this screen so that samples are taken every months rather than every season. I wish I still had a screenshot of the peas production graph to compare.

I agree that seasons should and will play a role in the demand of certain goods. Not only in your fief but in the entire world. I’ve tried to get some information on the economic system in that game but all I could find is a few let’s plays and none of them really get into the actual workings of the economy, I might have to download and try it. The latest one seems kind of nice. Thank you for the ideas I really appreciate!

Thank you for the input everyone!

2 Likes

The last one I played was the first one in 3D and it was a lot more involved and I didn’t get into it very much. (so can’t confirm it is a good reference)
The first two I played the devil out of - they were 2D and both of them were the exact same game. A little disappointing after I bought the second one on SNES and it turned out to be the exact same game. :eyes: (but can confirm either of these would be a good reference)

I’ll be contrary here on the subject of cheating.

The common design wisdom is to cheat as much as you can get away with, and I understand the reasons for this. But I don’t always agree. A savvy player will eventually figure out how the system is cheating, and for me at least, that drastically reduces the fun.

If we’re talking about a sim game, I want the interactions in that sim to be as realistic as possible. It doesn’t matter if it’s too complex for me to model in my head – if it’s realistic, then I will apply my intuition from real life, and things will react pretty much as I expect. If you fake it, I will find the edge cases, see the man behind the curtain, and lose my suspension of disbelief. Ho hum.

If we’re talking about an enemy AI, I absolutely hate it when I catch the computer cheating. I feel, well, cheated. I don’t want to beat an AI that cheats because I’m so awesome, and I certainly don’t want to lose to a cheater. I want an AI that plays by the same rules I do, and if I lose, it’s because I wasn’t smart enough. And it’s not just me – would a chess program where the AI occasionally gets to move an extra space or some such sell well? I really don’t think so.

So, there. You have conflicting advice now; you decide what seems the most fun to you, and go with that. :slight_smile:

5 Likes