Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Anubis-class Cruiser (12/20/24)

Author Topic: effect of stability on economy  (Read 4604 times)

PCCL

  • Admiral
  • *****
  • Posts: 2016
  • still gunnyfreak
    • View Profile
effect of stability on economy
« on: May 03, 2017, 02:59:36 PM »

I feel like there exists room for improvement on the current implementation of market stability, the whole "prices increase/decrease" thing isn't (imo) very exciting nor, unless I'm looking for a place to sell survey data, very useful.

I propose stability be present as a simple multiplier to supply/demand. This multiplier applies differently to different goods based on the following axioms:

  • In times of low stability, people hoard essentials, forgo luxuries, and seek to leave the planet.
  • In times of low stability, production of luxury goods shut down first, followed by industrial goods and finally essential/agricultural goods.
  • In times of high stability, production and consumption of all goods increase, with luxury goods increasing above the rest in proportion to total consumption (people want good stuff) and industrial goods increasing below the rest in proportion (only so much infrastructure)

Therefore, I propose existing goods be roughly divided into 3 categories: essentials, industrials, and luxuries (commodities.csv already has tags to a similar effect).

Essentials: food, domestic goods, organs (need those to survive, ya know), hand weapons (gotta stay safe somehow)
industrials: ore, metals, volatile, etc. etc.
luxuries: luxury goods, "chemical arts", lobsters

with only some back-of-the-napkin math, I tentatively propose the following functions for multipliers:

supply:
essentials: s = 1+ 0.075(x - 5)
industrials: s = 1+ 0.4(ln(x+1) - ln6)
luxuries: s = 1+ 0.6 (arctan (x-4) - arctan1)

demand:
essentials: d = 1+ 0.025(x-5)^2
industrials: d = 1+ 0.1(x-5)
luxuries: d = 1+ 0.02(x-6)^3

(graphs below provided generously by orost)

where a planet's final production is its initial production times s as a function of x (stability from 0 to 10) and final demand is its initial demand times d as a function of x

this means that at stability 10, for example, a planet will demand 128% more luxuries, 62.5% more essential goods, and 50% more industrial goods. It will also supply 37.5% more industrial goods, 31% more luxuries, and 24.2% more industrial goods. commodity prices can then shift based on those numbers.

heading out right now but I will go deeper into the advantages of this system when I get home

EDIT: right... ahem... thanks orost for the graphs. Basically from there, you can see that all markets produce at their baseline capacity at stability 5 (multiplier = 1) and will, for example, stop producing luxury items almost completely at stability 3. Below I briefly discuss the main properties of this system:

  • A natural, stable economy. Since (generally speaking) higher stability => higher demand and vice versa, and since demands being met and stockpiles being built up naturally increases stability (I believe this is the current state of affairs), markets will trend towards an equilibrium without outside influence. This gives markets a good baseline stability which we can then edit with various properties (region capital, military base, etc.) The only case where this system is unstable is...
  • Food shortages! Or in this case, essential goods shortages. This is by design as it, in addition to certain events (interception of essential good trading fleets, etc) allows disasters to organically occur. As essential goods supply decreases, the market demands more essential goods and simultaneously produces less, compounding the issue. This creates what is essentially the 0.7.2 version of the food shortage without artificially influencing the price and will not return to stability until an outside force is brought together to relieve it.
  • Not a current concern, but I believe this is something alex intends to work on at some point in the future: insurgency, revolution, and decivilization. As hand weapons and organs are essential goods, demand for them will naturally increase in a time of crisis. While in most cases demand of goods being met increases stability, these two goods are different as they're contrabands for the most part. This allows the player (or other nefarious parties) to fuel the crisis and make a neat profit (from local warlords) by smuggling those in instead of organizing relief like a good samaritan . Now THAT is what I call "meaningful choices" in the economic model (something alex strives for, according to the game's faq).

In conclusion. This seems to be a really simple change code-wise (take whatever function that generates commodities, multiply it by whatever function that commodity uses, give output) for a huge gain. I hope alex at least deigns to play around with it a little bit.
« Last Edit: May 03, 2017, 09:46:16 PM by PCCL »
Logged
mmm.... tartiflette

orost

  • Captain
  • ****
  • Posts: 436
    • View Profile
Re: effect of stability on economy
« Reply #1 on: May 03, 2017, 07:22:07 PM »

I don't think anybody can parse those functions in text form like that. This might help.



« Last Edit: May 03, 2017, 08:36:50 PM by orost »
Logged

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3875
  • Quartermaster
    • View Profile
Re: effect of stability on economy
« Reply #2 on: May 03, 2017, 07:52:34 PM »

Thanks for the graphs, orost!  Being red-green colorblind though, 2/3 of the graph is useless to me, heh.  Figured it out despite that with a little logic and deduction anyway. :)

Now this is actually improving the economy system.  So, I'm no economist, but these feel relatively logical and they're easy to understand at a glance - "we're starving here, we don't care about fancy suitcases!" or "hey, I'm swimming in cash, let's get high while we're at it!".  The numbers themselves could always use tweaking, but the concept and basic shape(?) of them feels solid.

However, if this is going through, there needs to be more economic conditions added to the game, because currently, most markets are going to stay within +-1 of their usual "default" standing.  Janagla is going to stay at 5 and Sindria is going to stay at 9 unless you smuggle, so more conditions are going to have to be added to make this work.  Conditions related directly to the graph, like "Demand Met" or "Demands Unmet" as two simple examples might be there to boost or shrink the stability, while other random conditions thrown in like "Drug War" or "Relative Peace" might be there to affect the stability as well, because currently it's either Smuggling or their relief fleet just got pulverized.
« Last Edit: May 03, 2017, 07:54:49 PM by The Soldier »
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

orost

  • Captain
  • ****
  • Posts: 436
    • View Profile
Re: effect of stability on economy
« Reply #3 on: May 03, 2017, 08:00:38 PM »

Sorry about the colors, those are just the gnuplot defaults. I'll edit it if you tell me which colors would work. Yellow instead of green? IDK how that works.
Logged

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3875
  • Quartermaster
    • View Profile
Re: effect of stability on economy
« Reply #4 on: May 03, 2017, 08:04:51 PM »

Sorry about the colors, those are just the gnuplot defaults. I'll edit it if you tell me which colors would work. Yellow instead of green? IDK how that works.
Heh, I could go into into a long post about how to make graphs easier to read, but suffice to say generally a dark(er) background and lighter colors works best.  In this case if you don't want to fiddle with much, replacing either the red or the green line with a black or grey one would work, though.  Thanks!

Back on topic, hopefully the OP develops the idea bit more, looks like it could go somewhere.
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7573
  • Harpoon Affectionado
    • View Profile
Re: effect of stability on economy
« Reply #5 on: May 03, 2017, 08:44:59 PM »

I like the idea of stability effecting different commodities in different ways, though the exact functions are going to be tricky. The perfect balance would be for a change in the supply/demand to create market opportunities for the player to exploit (including once they are knowledgeable enough deliberately crashing stability to do so), without having the knock on effect of quickly ruining the entire sector's economy.

@The Soldier
I've always thought that for graphs I should include different line styles (dashed, dot dash, etc) in addition to colors - would that help?
Logged

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3875
  • Quartermaster
    • View Profile
Re: effect of stability on economy
« Reply #6 on: May 03, 2017, 09:46:41 PM »

If it's subtle enough, it can definitely help.  But when the actual dashes are too large with a lot of open space, it starts to hamper the readability of the graph.  Also, as a student currently working on an engineering major, I dislike it when graphs don't show the exact line (even if it's totally unrelated to engineering, just kinda ingrained in me).
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

PCCL

  • Admiral
  • *****
  • Posts: 2016
  • still gunnyfreak
    • View Profile
Re: effect of stability on economy
« Reply #7 on: May 03, 2017, 09:58:45 PM »

yeah, expanded the idea a little bit. thanks for the support (and the graph)

@thaago: yeah, tuning is definitely necessary. Again, back-of-the-napkin math.


However, if this is going through, there needs to be more economic conditions added to the game, because currently, most markets are going to stay within +-1 of their usual "default" standing.  Janagla is going to stay at 5 and Sindria is going to stay at 9 unless you smuggle, so more conditions are going to have to be added to make this work.  Conditions related directly to the graph, like "Demand Met" or "Demands Unmet" as two simple examples might be there to boost or shrink the stability, while other random conditions thrown in like "Drug War" or "Relative Peace" might be there to affect the stability as well, because currently it's either Smuggling or their relief fleet just got pulverized.

demands met and demands unmet, iirc, are already conditions that affect stability. The beauty of the system is that, given proper set up, stability naturally decreases during war time and increases otherwise through these conditions alone. If we pepper some other interesting stuff like "drug war" or "political tension" or "war preparation" or "production mandate" etc. etc. things can get pretty exciting, I think
« Last Edit: May 03, 2017, 10:20:05 PM by PCCL »
Logged
mmm.... tartiflette

borgrel

  • Captain
  • ****
  • Posts: 351
    • View Profile
Re: effect of stability on economy
« Reply #8 on: May 03, 2017, 10:26:34 PM »

PCCL, i like the idea, only convert the functions into polynomials instead

This does not need to be precise enough to use those functions and a O(5) polynomial is a lot faster for a poor CPU than an inverse function like ln
The 1-2% error in result wont change the functioning
And polynomials will we a lot easier for others to play with.
Logged

PCCL

  • Admiral
  • *****
  • Posts: 2016
  • still gunnyfreak
    • View Profile
Re: effect of stability on economy
« Reply #9 on: May 03, 2017, 10:39:20 PM »

Dammit Borgrel! I'm an economist, not a mathematician!

idk... just like take the 4th degree taylor series of these things at x=5 or something or other....

the graphs are there, it's the shapes that's important
Logged
mmm.... tartiflette

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3875
  • Quartermaster
    • View Profile
Re: effect of stability on economy
« Reply #10 on: May 03, 2017, 10:48:24 PM »

demands met and demands unmet, iirc, are already conditions that affect stability. The beauty of the system is that, given proper set up, stability naturally decreases during war time and increases otherwise through these conditions alone. If we pepper some other interesting stuff like "drug war" or "political tension" or "war preparation" or "production mandate" etc. etc. things can get pretty exciting, I think
Definitely!  Some of these might just be temporary market condition that go away after a while, like the "Production Mandate" which might increase demand for industrial materials like Metals and Heavy Machinery, and after the mandate is completed the condition ends, while others could be interacted with to an exciting level.  Sell Hand Weapons on the Open Market (hell, such a market condition could temporarily remove a faction restriction) or to the Military and help the security forces remove the "Drug War" negative condition, and maybe increase your standing with the station leaders?  Or sell them on the Black Market to both destabilize the economy and make the "Drug War" condition more severe, and if you make it bad enough, maybe even turn into a more difficult to remove "Organized Crime" market condition?  This also increases the depth and choice required where the player might want to sell their items, perhaps avoiding selling their crates of hand weapons on the Black Market at that location because it might worsen the situation there.  Not to mention the basic and easily-read market system that makes that decision both clearer and more meaningful due to how it would affect the stability.

Now that's the epic level of player interaction that I'm looking for - that's the kind of stuff to die for.  Help determine the fate of the sector!
« Last Edit: May 03, 2017, 11:29:07 PM by The Soldier »
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

Histidine

  • Admiral
  • *****
  • Posts: 4913
    • View Profile
    • GitHub profile
Re: effect of stability on economy
« Reply #11 on: May 04, 2017, 05:16:12 AM »

FYI stability affecting demand already exists to some extent in the game.

Spoiler
Code: java
public static float getLowStabilityBonusMult(MarketAPI market) {
float s = market.getStabilityValue();
//if (true) return 1f + (10f - s) * 0.2f;
if (true) return 1f + (10f - s) * 0.1f;
//[...]
}

public static float getLowStabilityPenaltyMult(MarketAPI market) {
float s = market.getStabilityValue();
//if (true) return 0.1f + s * 0.09f;
if (true) return 0.5f + s * 0.05f;
//[...]
}

public static float getHighStabilityBonusMult(MarketAPI market) {
float s = market.getStabilityValue();
//if (true) return 1f + s * 0.2f;
if (true) return 1f + s * 0.1f;
//[...]
}

public static float getHighStabilityPenaltyMult(MarketAPI market) {
float s = market.getStabilityValue();
//if (true) return 0.1f + (10f - s) * 0.09f;
if (true) return 0.5f + (10f - s) * 0.05f;
//[...]
}
lowBonus * highPenalty is used to multiply demand from Population condition for drugs, guns and goods illegal on the market, and the supply/demand effects of Organized Crime.
highBonus * lowPenalty multiplies demand for luxury goods.
[close]
« Last Edit: May 04, 2017, 05:51:47 AM by Histidine »
Logged

nomadic_leader

  • Admiral
  • *****
  • Posts: 725
    • View Profile
Re: effect of stability on economy
« Reply #12 on: May 04, 2017, 07:31:37 AM »

I'm not sure your breakdown of commodities makes sense. What you show here is the demand for guns going UP as stability increases beyond 6-7, which doesn't make sense. Also why is organs there? I think the 'essentials' category is a bit dubious.

Would this result in all the essentials' price going up in addition to demand, as the stability increased? I'm not sure this makes sense either.

For various other purposes comoddities should also be broken down into raw materials (volatiles, ore, organics) and refined or value added materials (domestics, metals, machinery, etc).

edit: Are these R plots? Font looks familiar or something.
« Last Edit: May 04, 2017, 08:13:02 AM by nomadic_leader »
Logged