N
N
Nikolai Trifonov2020-06-20 17:14:27
Game development
Nikolai Trifonov, 2020-06-20 17:14:27

How to make random price fluctuations for an economic strategy?

The game has a market where you can sell goods in the form of primary resources, processed resources and goods.

At the moment, price fluctuations are done like this:

  • I recorded the price history for the dollar, euro, silver, gold and pork futures in a table.
  • I choose a random line from which prices will start
  • Over time, prices change by start_line_number + elapsed time
  • Some resources are subject to a seasonal factor base_potato_price * winter_price increase


I do not like the predictability of price fluctuations and some limitedness in the long game.
How to make random fluctuations that will look natural?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Eugene Kuznetsov, 2020-06-21
@fridriekh

How to make random fluctuations that will look natural?

Many random fluctuations are actually not completely random. If you don't want to bother with the math, you can use real data, as you did. For example, take historical data for a year at the price of a USD/GPB or USD/AUD pair (these pairs will not have "strange" jumps), normalize them (this is easy to do even in Excel) and take the result as the base value of the main game currency. If you want to add seasonality, then you can take the real value of grain (instead of pork) - a price drop before harvest and a maximum price after 2/3 years. High frequency vibrations will be very small, you can use it as is. Or smooth it out a bit. On this graph, "impose" your base cost. Everything else is derived values ​​with a certain exchange rate of 1:XX.

D
Dmitry Pavlov, 2020-06-20
@Stalker31

Maybe add a random number

S
SagePtr, 2020-06-20
@SagePtr

You can also remember how often the player buys what, and depending on demand, change prices, forcing the player not to buy the same thing often.

G
Griboks, 2020-06-20
@Griboks

Natural fluctuations are not random. Either develop the laws of the market, or make random unnatural fluctuations.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question