Defining a new economic system for future versions

Talk among developers, and propose and discuss general development planning/tackling/etc... feature in this forum.
Post Reply
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Defining a new economic system for future versions

Post by travists »

Here I go reopening a can of worms again. I have been thinking that something like this would be nice. First of all there is no reason to constantly simulate the universe, just update prices once per "day", you can also update quantity at the same time.


As to how: database seems the best implementation to me.

Each good has several input goods (labor, materials, general overhead, etc) likely as a percentage of the cost

Each base has a list of each good with: production rate, consumption rate, import rate, export rate, and stockpile.

Each base also has a storage limit, huge for planets, small for outposts, somewhere in-between for other bases.

Demand = (Pr + Ir) – (Cr + Er) If demand is positive, stockpile grows and price is low. If negative, stockpile shrinks and price is high.

Price = (manufacture cost + profit) modified by demand. It may be expedient, as well as adding to the interconnectedness, to take the mean price of the needed supplies from surrounding bases (perhaps six jumps). If six jumps is not enough to find a needed good, find the shortest rout to get it. Whether an extended rout is needed or not, an import markup would be added. Say two percent or so, per jump.

If the stockpile is not enough to get through say, two days, price goes way up. If the total stockpiles is near base storage limit price goes way down.

In multi-player import and export rates are the actual rates multiplied by a number to bring total traffic up to the desired number. But in single-player these must be hard-coded fudge factors.

I agree that all goods should follow this format, including: ships, parts, weapons, etc.

To up the dynamic nature of the setup: production, consumption, import, and export rates can be modified by in-game events. A blockade would be a decrease in import and export rates. Perhaps accompanied by a change in traffic at the affected base and a news item. A medical emergency would cause consumption to go up, with a news item. A mining base may find a new vein. A factory or industrial planet may develop a new technique. That would cause production to go up, with yet another news blurb. You want factions to be effected by economic changes? Fine, do a query on the bases under their control! I would limit this to perhaps once a “week”.

There also has been some talk of replenishing resources. Agreed, it also would be more realistic to not have a full larder again by saving and reloading the game. This, and the periodic price updates, requires the introduction of the concept and tracking of time. Add one line to the save game “GST=1125648.25” or some such. Time is already advanced during space flight, and may be tracked to keep the news time stamps current. Saving and loading would mark up the passage of some time. Every time 24 hours passes, update the price and quantity tables upon entering a buy/sell screen. Yes, crunching all those numbers will take some time. Throw up an “updating galactic price database…” placeholder while this happens.

That’s my thoughts on it anyway.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Defining a new economic system for future versions

Post by klauss »

travists wrote:As to how: database seems the best implementation to me.
That's the wrong thing to ask/answer at this point.

The first question you want answered is: what phenomena do we want to simulate? Which which level of detail?

Only then, you may start looking at implementation alternatives, and only when you analyze each alternative you'll be at a point where implementation details are not only knowable, quantifiable, but also qualifiable.

Ie: talking about implementation details without being certain of what the implementation should do is... misguided.

About the model you're proposing, I see where you're going. Coding suppy & demand as localized rules that interact with neighbours directly, the entire galaxy indirectly, to create a global effect.

There are important details left out, however. For instance, you use "storage limit" as a factor in cost formula to, I imagine, make the system stabilize when a suitable agreeable price is found. Ie: when others start buying your stock just enough to meet your production, the price is "right".

But there are other factors. Bases may not need to store their stuff, they may store it elsewhere, but make it available to you at your request. Say they transport it to your location if you ask for them. Or something like that. In essence, I don't believe storage is they key factor here, but production rate vs demand.

If I produce some amount, and I can only sell half of what I produce in any given period, my prices are too high. If I cannot meet demand prices profitably, I halt production, liquidate whatever accumulated stock I may have.

Also, there's transport cost, which you hinted at once in your text: well, they could be factored in more thoroughly. Price of import is price of buying in neighbouring locations + cost of transport. If the jump from said location takes you through hostile or blockaded regions, then transport cost is high. etc. etc.

In those last two paragraphs lays a simple phenomena I'd like modelled that is left out from your model: manufacturing dynamics. Production shifts as demand does, and demand does shift in response to other things, external to economic models.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Defining a new economic system for future versions

Post by travists »

Point taken. I happen to think that full on simulation in the discussion is part of the problem. Approximation allows for a dynamic economy without worrying about each ship in the universe. There are space simulators, city simulators, people simulators. Typically each is their own thing. An economic simulator is possible, but would take as much power as VS it's self!

The phenomena to simulate can be tiered. First tier is just to get prices to fluctuate in a quasi-realistic manner. Tier two, inter relationship. A report generated says that this path or that one is more profitable, so the import/export rates adapt, reflected by changes in traffic patterns (the probability of encountering factions in a system). Tear three priority of manufacturing can change. Perhaps other tears can be added. Start at the most basic, then work up.

My list:
Interrelationship of goods and services
Transport costs and scarcity
(Eventually) traffic patterns change
New trade route becomes popular --> pirate attacks increase --> military/law patrols pick up --> profits fall due too higher import/exports rate -->new route is discovered -->starts again
You like changes in production focus so let’s add that
(supply and demand is implied in an economy)

My thinking on a storage limit is that there is likely to be one. Even if off site, there is only so much space you can secure to stash the stuff. It's not so much a stabilizing factor as a practical one. If every cargo bay is full as well as what you can secure with un-manned turrets in off site storage, now you are starting to fill up empty quarters and closets... You might even pay someone to take it off your hands, production is likely to be shut down too.

You seem to catch most of my meaning. It’s kind of a web. Constructed simply and efficiently enough, each base can take about 1/100 of a second to calculate. 10,000 bases @ 100 bases/second = 100 seconds to do the whole galaxy, which is 1 minute 40 seconds. If this delay is only sporadic, there is little disruption to game play. Part of why I like a database approach. There is at present a master parts list, which is a table. Several linked tables is a database. You can run all kinds of reports on one in very little time. To add traffic patterns, cost per jump figures, production thresholds, it’s all just another table and report. Sadly, my ability to implement them is not sufficient to supply one, I just know what they can do.

To be honest, my eyes kinda glazed over about half way through the thread. Much of the discussion seemed to be implementation proposals and backbiting about how do you handle this or that. So, I tried to provide a baseline set of factors with a reasonable implementation, which happens to be expandable. An interesting byproduct of this kind of implementation is inflation. Something else that is worth simulating (or approximating) in it’s own right.

Shall we see if this idea can be resuscitated enough to get a reasonable list of features? Looks like it kinda fell off some time ago.
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: Defining a new economic system for future versions

Post by Deus Siddis »

travists wrote:I happen to think that full on simulation in the discussion is part of the problem. Approximation allows for a dynamic economy without worrying about each ship in the universe. There are space simulators, city simulators, people simulators. Typically each is their own thing. An economic simulator is possible, but would take as much power as VS it's self!
. . . .
Constructed simply and efficiently enough, each base can take about 1/100 of a second to calculate. 10,000 bases @ 100 bases/second = 100 seconds to do the whole galaxy, which is 1 minute 40 seconds. If this delay is only sporadic, there is little disruption to game play. Part of why I like a database approach.
. . . .
To be honest, my eyes kinda glazed over about half way through the thread. Much of the discussion seemed to be implementation proposals and backbiting about how do you handle this or that. So, I tried to provide a baseline set of factors with a reasonable implementation, which happens to be expandable.
But you are still missing the point that, as Klauss said, we are on the what phase of design, so let's stop talking about the how. That comes later.

We need further discussion on what features are desirable.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Defining a new economic system for future versions

Post by klauss »

Even though going into implementation details is premature in my opinion, travists does point to a rather viable design.

I'd like it if progress was made towards the clear and thorough specification of a system as travists described, putting implementation issues aside for the moment, concentrating on simulation rules: what affects what and how first, then defining a series of localized formulas that try to model the previously defined effects, then documenting which variables are tied to other AI levels (say, political simulations that do happen in VS, like faction relations and fleet deployments).
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Defining a new economic system for future versions

Post by travists »

Deus Siddis, I also sugested some features and interactions, as wel as closeing with a question of if intrest could be raised again to get this hammered out. So, lets get too it.

Feature list:
Supply/demand (given)
Transportation costs(implied)
Travel risk changes price
Traffic patterns change refelecting changes in trade
Changes in traffic change profit levels
Changes in profit levels changes overall trade
Ships and equipment change in price like any other good?
Each base is simulated/aproximated independantly
Long term shifts in profitability of a good shifts production
Factions ability to field craft depends on net trade in their sphere of influance?
Costs of goods depends on costs of supplies to make said good

Additons or objections? Thoughts on order of priority?
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Defining a new economic system for future versions

Post by klauss »

travists wrote:Additons or objections? Thoughts on order of priority?
I don't think it can be given any order, it has to be monolithic.

But the bright side of it is that your approach (which is in fact called a cellular automaton) is rather easy to implement:
  • Make a function that reads the local neighborhood state...
  • ...computes costs...
  • ...does localized trade...
  • ...saves modified neighborhood state
In theory and in practice rather straightforward to implement in full.

Plus, most of what you mention is already in the game in some form or another, so it shouldn't be too hard to get the feedback going between the politics/events and the economy.

What I'd like to add, though, is provision for government-wide (and perhaps government-funded) economic endeavors. Say, the government applies incentives in a region, taxes imports across some frontiers, etc...

...mostly since we'll need those to:
  • Tweak the system
  • Create believable campaigns
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: Defining a new economic system for future versions

Post by Deus Siddis »

I think that list is missing some bottom level, rubber-meets-the-road, finer-grained simulation. Like simulating the flow of individual resource shipments aboard individual transport convoys moving between resource specialized colonies.

To put it another way, your list currently seems to suggest more of a money based economy (for example, where production costs only money, it does not require specific raw materials in specific proportions). This is simpler and an okay system to use for many games.

But we might consider if a resource simulation economy would be better for VS, because VS has these significant aspects:
  • War Economy
  • Resource Isolation
  • Character Level Perspective
A War Economy is a more demanding form of economy. Situations emerge where you need more of 'Munition A' or you will lose a battle you can't afford to lose. Money is not an issue then. The issue is how much of Munition A is on the nearest Colony or Convoy and when will it arrive here.

Resource Isolation is the fact that the game is full of such things as gas mines, ocean worlds and factory stations, separated by vast distances of vacuum. So an asteroid mine, must have X amount of food arrive before date Y or else everyone begins to starve/leave.

Character Level Perspective means the player experiences most of the game from a bottom level (an individual character), unlike say a 4x game (a massive space empire perspective). He notices inconsistencies like when fish and bottled water prices sky rocket on Atlantis (an ocean world) or there is an abundance of fertilizer on Serenity (an asteroid mine). And he would notice and keep track of many less obvious things too, like competing convoy traffic, if there was a reason to do so- if the economy simulated them.
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Defining a new economic system for future versions

Post by travists »

Sounds reasonable, how about include some of the larger corperations in that as well? That Brotea or whatever it is that you see a splash of on startup. Did they hust keep the colony going out of the goodness of their hearts (or whatever other pumping organ they use), where they payed by an overstreached government, or did the blockade make for lots of profit? Maybe one of the weapons manufacturers are so calous as to launch a strike just to sell more weapons?

edit: one sneaked in on me, just a moment
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Defining a new economic system for future versions

Post by klauss »

Deus Siddis wrote:I think that list is missing some bottom level, rubber-meets-the-road, finer-grained simulation. Like simulating the flow of individual resource shipments aboard individual transport convoys moving between resource specialized colonies.
Nono... going that route, simulating things in that much detail, is a sure path to overburdenning the system.

Rather, statistical-numerical, "money-like" analysis is both a lot faster at runtime and a lot simpler at design time...
Deus Siddis wrote:To put it another way, your list currently seems to suggest more of a money based economy (for example, where production costs only money, it does not require specific raw materials in specific proportions). This is simpler and an okay system to use for many games.
...which does not preclude the simulation of production prerequisites.

Part of the formula can say you can't build ships without plasteel. In fact, it should be a given, since traders will want to supply factories with what they need to produce more refined goods, which they can in turn trade at other places, and so like that build a profitable trade route.
Deus Siddis wrote:A War Economy is a more demanding form of economy. Situations emerge where you need more of 'Munition A' or you will lose a battle you can't afford to lose. Money is not an issue then. The issue is how much of Munition A is on the nearest Colony or Convoy and when will it arrive here.
Ya, that kind of stuff is what I was referring to when I mentioned government-wide endeavors.
Deus Siddis wrote:Resource Isolation is the fact that the game is full of such things as gas mines, ocean worlds and factory stations, separated by vast distances of vacuum. So an asteroid mine, must have X amount of food arrive before date Y or else everyone begins to starve/leave.
IOW, logistics.

I bet that applies also to military campaigns, so we could also simulate battles being lost (ships made disfunctional, bases become degraded) because of underprovision.
Deus Siddis wrote:Character Level Perspective means the player experiences most of the game from a bottom level (an individual character), unlike say a 4x game (a massive space empire perspective). He notices inconsistencies like when fish and bottled water prices sky rocket on Atlantis (an ocean world) or there is an abundance of fertilizer on Serenity (an asteroid mine). And he would notice and keep track of many less obvious things too, like competing convoy traffic, if there was a reason to do so- if the economy simulated them.
At the same time, the player will not notice the overarching economic situation/goals without help. So news reports should be pushed into the news system to keep the player informed.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Defining a new economic system for future versions

Post by travists »

OK, Deus Siddis, my thinking is not that such transportation does not exist. Rather, those shipments are rendered down to traffic paterns and import/export rates.
Klauss posted while I was thinking of more, and I can't so I'll just post this for now.
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: Defining a new economic system for future versions

Post by Deus Siddis »

klauss wrote: Nono... going that route, simulating things in that much detail, is a sure path to overburdenning the system.

Rather, statistical-numerical, "money-like" analysis is both a lot faster at runtime and a lot simpler at design time...
I only said what kind of detail we should have, not how much.

It won't be overwhelming simulating finer details if you only track them within a 1-3 system radius around the player, only every hour of run time, only for a few major convoys and a few major destinations, etc. There are many ways to limit how much must be handled at this level of detail.

That's how the dynamic warfare simulation is already handled, right? Simulated in detail up close, but abstract at greater distances and for lesser flight groups. That's what makes it look and feel real from the player's perspective.
...which does not preclude the simulation of production prerequisites.
But then you do need to track the flow and stockpiles of those prerequisite resources. At least to some extent.
I bet that applies also to military campaigns, so we could also simulate battles being lost (ships made disfunctional, bases become degraded) because of underprovision.
Note that the player can destroy things without it being a part of an official campaign. So you need to look for recent infrastructure and logistics changes around the player as well.
At the same time, the player will not notice the overarching economic situation/goals without help. So news reports should be pushed into the news system to keep the player informed.
Definitely.
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Defining a new economic system for future versions

Post by travists »

Siddis, I understand what you are saying, I think. However, Simulating convoys through multiple systems (unless already included) adds a bit too much complication and data points. Whereas, simulating their net effect (base A has an export rate of X, base B has an import rate of Y, but X and Y are not always the same due to loss in transit) is very direct mathematically without overload. That is not to say that every so often the cross-linked traffic/exchange setup can't trigger a much-needed resupply. The outcome of which then changes stockpiles, costs, and every thing else it trickles down to. Rather than thinking of physical convoys, think of a more abstracted flow of material with a rate and chance of successfully reaching its end point. I would like to see your itemized list for what to simulate, then we can see what overlaps, what is in one or the other, etc. Get someone else onboard with a third list, and we can further refine it!
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Defining a new economic system for future versions

Post by travists »

Hey, I had a thought. One of the sticking points seemes to be do we:

A: Simulate the galactic economy in general?
B: Simulate the local economy in fine?
C: Balance the two, possibly bogging dow the sim?
D: Abandon a dynamic economy alltogether?

So, I think there is a way to set up a poll. Can one be set up in a less obscure place than this specific thread to get a wider view? That direction alone will help to define what details and how much is needed.
safemode
Developer
Developer
Posts: 2150
Joined: Mon Apr 23, 2007 1:17 am
Location: Pennsylvania
Contact:

Re: Defining a new economic system for future versions

Post by safemode »

With current gpu's being programmable for arithmetic and parallel general purpose computing and cpu's having multiple cores, simulating a decent economic model doesn't seem to be that big of a deal. It should be something that operates in it's own thread alongside the game and on a completely independent clock cycle. Buying and selling from the units in the game could occur in slots that get proper locks/unlocks to keep everything sane but the majority of the economic modelling would have to be done out-of-game as it involves things the game just can't simulate graphically.

Maybe after initialization the dynamic news can modify an economic value here and there but otherwise economic rules control the economic thread and the buying and selling of goods by units in-game can have a much larger influence in the economic thread than what goes on in it on it's own as we could assume that if a simulated ship is trading something then lots of ships we dont see will (we just make the in-game ship first).

The economic thread can't poll the game, so that removes any large scale delays and the economic thread gets a lower priority than the game. We only need to lock the economic thread when reading data from it when a ship is at a station trading. The price of goods could even change while in base on a fixed interval, kind of like real-time stock prices, although it would be driven only by economic rules (so only tiny fluctuations) as the game is pretty much paused when a player is in a base so dynamic news can't modify anything.

So basically, rather than a fixed stock of goods and such that get shuffled around, we have a rule for each type of good (produced, mined, etc) and allow the rule to dictate quantity of such good available and the game-play artificially magnifies the effect of any trading done in-game but the time period of this effect is temporary and once ended, the rules start from the new base and begin to function like normal again.

The absolute number doesn't matters, so maintaining the correct amount of goods shifted from A to B is not important. Just maintaining the correct amount removed from A is, as we can explain any discrepency with what's added to B as other ships not simulated trading as well.

Now on a system scale i think we can control how trade is done by in-game features already in place. Make unfriendly bases not trade with you at all, or trade at much higher prices. Price doesn't have to be something the economic thread even has to care about. All the economic thread needs to deal with is quantities of goods and the rules it has, price would never need to factor in. The game itself could generate a price given what it reads from the economic thread and other factors in-game.

On a galactic scale we once again have to simulate out of game how systems would interact. Maybe dynamic news can signal a change in ownership of a system and this causes a function in the economic thread to increase how often trading is updated amongst bases in that system (how often the functions that deplete and replenish goods on a base run) or decrease it. So say, there is a andolian system surrounded by other andolian systems on all jump points (4). Then the Rlaan take over 3 of the systems. Well since they are enemies, the dynamic news would indicate a decrease in trade updates for that system so that trade seems to occur slower in-game. Bases can be depleted of goods for a while before getting more. This mimics reality pretty decently i think and doesn't require deep scanning the game or anything.
Ed Sweetman endorses this message.
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Defining a new economic system for future versions

Post by travists »

Two things, safemode. One, we don't all have latest generation video cards and quad core processors with 4GB of memory. In about five years or so it may not be an issue, but now, while technically possible, is a bit demanding. Two, it is much simpler to structure it as a reoccurring price calculation than a constant simulation. Think more actual market and not so much a commodities and futures exchange. There are no absolute numbers as far as I am concerned. Goods are being produced and consumed all of the time.

You said that the news isn't important (big scale), I see it as more of an interrelationship. The rules stay the same, but some news items change the values. Also, some values trigger news items.

I see where you are going, but I think it is stretching. To do that level of simulation any justice it would be like running two iterations of VS concurrently.

It looks like 2 for in-depth simulation, and 2 for simple mathematical modeling. Need more votes!
safemode
Developer
Developer
Posts: 2150
Joined: Mon Apr 23, 2007 1:17 am
Location: Pennsylvania
Contact:

Re: Defining a new economic system for future versions

Post by safemode »

well, I dont think it would need quad cores and new gpu's but that having smp is pretty much expected when you are running a new game. VS has never been intended to work on low end hardware. It doesn't scale down nearly that well. So expecting something that can run two threads at full cpu is not a stretch. However, VS rarely uses 100% cpu single threaded, and the economics thread wouldn't be nearly that straining.

I really wouldn't see it so much as two vs's as vs and a sub-function that runs completely independent of VS. Inside it, you would have the objects relating to the economies of every base in each system loaded and simulated in-game and then objects relating to overall system economies of surrounding systems. Only so far as what VS simulates on any level. Then a database file that it writes and stores these economic objects when no longer needed and loads new data from when necessary.

I'm perceiving this model to be quite lightweight. There would be no need to poll the VS game and the VS game sets prices on-demand and the economic functions dont need to know anything about the game's politics or etc. Dynamic news can hit it up with a couple of methods that can modify trade-rate and/or cause a momentary surplus/shortage of a good and units will interact by adding and removing goods. That's it.

I think all the fun aspects of a dynamic economy dont occur in the economy part, but in what the game does with the economy. VS can then be coded to utilize the economy to decide ship quantities / aggressive strategies etc. So the game makes the economy seem way more realistic than it needs to be by basing decisions on it more. The real magic bullet is the rate-change method available to dynamic universe to affect how often trade is done on a planet.

You can effectively destroy trade in a system (blockade) by realistic means of owning all access to it. And it would function realistically. likewise you can boost trade by removing hinderances to your system. The economy doesn't care if you do this by owning systems around you yourself or placing friendly systems there. Dynamic news already knows when a system ownership is changed and calls the appropriate method (increase/decrease trade rate).
Ed Sweetman endorses this message.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Defining a new economic system for future versions

Post by klauss »

safemode wrote:well, I dont think it would need quad cores and new gpu's but that having smp is pretty much expected when you are running a new game. VS has never been intended to work on low end hardware. It doesn't scale down nearly that well. So expecting something that can run two threads at full cpu is not a stretch. However, VS rarely uses 100% cpu single threaded, and the economics thread wouldn't be nearly that straining.
The big problem I see: VS is thoroughly thread-unsafe.

Creating a thread from anywhere that accesses any kind of game data (even read-only) would imply an enormous amount of work to make sure it is thread-safe.

I can see however how we could move some economics calculations to secondary threads, but those threads must not access any kind of VS API that accesses any kind of game data. Ie: it's tricky. And in your proposed simulation method, impossible. Because you propose using game data and actually loading systems and simulating them, which can't be done thread-safe without a lot of work atm.

I know, it would be great to make VS thread-safe, but adding it as a prerequisite to economic improvements would delay the improvements too much IMO.

Numerical simulation, on the other hand, amounts to merely massaging numbers. A pile of numbers can be amassed in the main thread, sent to the "processing" thread for simulation, and then fetched back at synchronization points without ever touching shared game data (and thus risking thread-unsafe operations).

Furthermore, I challenge your assumption that economic modelling doesn't need to know about prices. I doubt any kind of economic simulation can get away with that.
safemode wrote:Dynamic news can hit it up with a couple of methods that can modify trade-rate and/or cause a momentary surplus/shortage of a good and units will interact by adding and removing goods. That's it.
Furthermore, we're aiming for a model where politics and outside events (news) have permanent, believable effects. Rather than a stable base state that fluctuates with "momentary surplus/shortage", we want a really dynamic system that can win or loose battles.

I don't see how treating news/events as "momentary modifiers" can achieve those goals. News communicate a change in the state of things, state that must be an integral factor in any economic model - just MHO.
safemode wrote:I think all the fun aspects of a dynamic economy dont occur in the economy part, but in what the game does with the economy. VS can then be coded to utilize the economy to decide ship quantities / aggressive strategies etc.
Exactly.
safemode wrote:You can effectively destroy trade in a system (blockade) by realistic means of owning all access to it. And it would function realistically. likewise you can boost trade by removing hinderances to your system. The economy doesn't care if you do this by owning systems around you yourself or placing friendly systems there. Dynamic news already knows when a system ownership is changed and calls the appropriate method (increase/decrease trade rate).
All of which can be modelled by the numerical approach.

And, IMO, more straightforwardly than the "detailled" approach.

For the power of mathematics is the power of abstraction, the removal of details that don't matter from a problem to get a lean & mean equation that does what is needed and nothing else.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Defining a new economic system for future versions

Post by travists »

@safemode
I've got a dual core 3 or 4 ghz (I'm at work now), w/ a 256MB graphics card. Very solid computer when I got it in '06. Handles most things quite well, even handles VS 5.0 without a hitch. The present SVN causes problems (dumping me, low frame rates, can't use shaders) If these are truly code problems, then fine. On the other hand, if it is that my computer isn't up to snuff, and you want to add more high end simulation, the potential audience is reduced to serious gamers.

It is critical that the game responds to the generalities in the economy.
functions don’t need to know anything about the game's politics or etc. Dynamic news can hit it up with a couple of methods that can modify trade-rate and/or cause a momentary surplus/shortage of a good and units will interact by adding and removing goods. That's it.
Trade rate change, yes. Surplus/shortage, yes. I'd add production rate change. The functions need to know about politics, but only is it easier or harder to move goods.

I'm a merchant, my self, got a plowshare (well loaded) half of what I need to get a mule in the bank. So, obviously I like the economy. However I see bases as simple data points.
The more I think of it, what you and I are proposing are not that far apart. Both use a database. Both appear to be more concerned with shipment rates than the shipments themselves. The one big difference is how frequently the numbers are crunched. Did you see my list? Did you see, and understand, my possible implementation? Do you have a list?

@klauss
As you said, implementation is premature. Yet, here we are talking about just that. Told you guys I was reopening a can of worms! We need more voices!
safemode
Developer
Developer
Posts: 2150
Joined: Mon Apr 23, 2007 1:17 am
Location: Pennsylvania
Contact:

Re: Defining a new economic system for future versions

Post by safemode »

An economic model that doesn't care about detail because there are an untold number of hidden influences doesn't need to care about price. A momentum model based on various functions that can control rate of production/use of material and goods would do the same without having any of the complexity of having to poll VS for any data.

Dynamic News then would modify this momentum as the game needed but in a very generic way that had no real fine-grained control over how the economic thread handled it. Most of the realistic effects of trade would be handled by modifying the rate of these functions running for a given base. The lower the rate, the more effect the in-game trading has and the more substantial those action are and last. Price doesn't even factor in to the functions, as the functions dont care about other bases in any linked way. They dont poll eachother, they dont communicate. They operate on various generic functions that alter their item levels unless acted upon by in-game units or dynamic news. This is perfectly believable from a player perspective since you can't possibly render and simulate the BILLIONS of units that would have to exist that would be responsible for trading cargo amongst bases and worlds.

Cost would be generated by VS on-demand. Looking at the relationship with the base and the player and supply/demand, a price can be generated. Perfectly reasonable factors that would dictate price. The underlying economic functions that deal with it all dont have to care about price because none of the polling and grepping around is being done. And this is realistic because we aren't simulating everything. If we were, then we would need to maintain constant polling on all bases that are simulated. This is not the case however.

So i would suggest the opposite of what would be intuitive. For a dynamic and inter-connected economy, the best way to simulate it is by not being inter-connected at all. Do not try to simulate what you know you cannot, and unless you plan on simulating every means of trade in-game, then you dont need to integrate everything into some inter-communication api to do things right.


The economy doesn't need to know about jack all about VS. It really doesn't. VS needs to know about VS and VS needs to respond to the economy when appropriate. Politics and all that jazz, all it does to the economy is modify certain aspects. So VS calls a function to reduce trade rate, or increase trade rate or decimate the levels of a certain good or slow the rate or increase the rate of a good's production. That's it. Everything else needed from the economy can go on in VS proper and every aspect of an economy can be gleamed from what VS reads from the economic state of a given base and any others it wants to grep. The economy itself doesn't care.

I guess what i'm saying is that the economy is two level here. The backend, which does all the grunt work is basically like an independent library that VS calls functions to in order to modify. The frontend to the economy is generated on the fly for the player and to a much lesser extent, the mission scripts. The frontend of the economy gives you prices, and combined with dynamic news, allows the player to see the reasons behind trade fluctuations and price changes. All of which the backend reflects because dynamic news modifies the backend as events occur (though only in the very limited ways it can).

I'm sure this isn't coming across the right way because all previous discussions have been about connecting everything together and maintaining a list of inter-connected inventories and such, but I'm throwing all that out with this suggestion. No interconnectivity. no polling for lists every cycle. And in the end, you get the same reactive economy at a fraction of the cost .
Ed Sweetman endorses this message.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Defining a new economic system for future versions

Post by klauss »

travists wrote:@klauss
As you said, implementation is premature. Yet, here we are talking about just that. Told you guys I was reopening a can of worms! We need more voices!
I was thinking the exact same thing while responding to safemode's post :P

But... well... he brought it up :P

Joking.

But truly, I think, feature-wise, we're all quite on the same wavelength.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Defining a new economic system for future versions

Post by klauss »

safemode wrote:Cost would be generated by VS on-demand. Looking at the relationship with the base and the player and supply/demand, a price can be generated. Perfectly reasonable factors that would dictate price. The underlying economic functions that deal with it all dont have to care about price because none of the polling and grepping around is being done. And this is realistic because we aren't simulating everything. If we were, then we would need to maintain constant polling on all bases that are simulated. This is not the case however.
Leaving aside the fact that I'm having trouble following you (ie: how this all relates to an... executable model... formulas and algorithms), leaving that aside, you're putting yourself in a position where you have no control over a very critical aspect of game balance: prices, trading profitability, potential for economic growth.

As much as we'd like to simulate a quasi-realistic model, we'll be even more interested in keeping the model in check, the game balanced, so the player can't neither become billionaire without effort nor is forced into poverty because of lack of opportunities.

And all that requires direct access to prices and trade routes for modders.

I'm saying, we're forgetting (and I sense your model, safemode, is far more vulnerable to this problem) the fact that modders will want to tweak the system (nerf it). Just to keep the gameplay balanced.

We must provide the means for that.
safemode wrote:The economy doesn't need to know about jack all about VS. It really doesn't. VS needs to know about VS and VS needs to respond to the economy when appropriate. Politics and all that jazz, all it does to the economy is modify certain aspects. So VS calls a function to reduce trade rate, or increase trade rate or decimate the levels of a certain good or slow the rate or increase the rate of a good's production. That's it. Everything else needed from the economy can go on in VS proper and every aspect of an economy can be gleamed from what VS reads from the economic state of a given base and any others it wants to grep. The economy itself doesn't care.
But then everything happening on the economy is explicitly scripted.
You have no emergent behavior.

I don't know... it's a way, but I favor simple mechanics that interact to give rise to emergent behavior - behavior far more complex than specifically stated in code or in the rules. It feels more... alive.
safemode wrote:I'm sure this isn't coming across the right way because all previous discussions have been about connecting everything together and maintaining a list of inter-connected inventories and such, but I'm throwing all that out with this suggestion. No interconnectivity. no polling for lists every cycle. And in the end, you get the same reactive economy at a fraction of the cost .
With a fraction of the complexity*.

Or did I miss something?

* as in, the system will behave simply - as scripted
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Defining a new economic system for future versions

Post by travists »

safemode wrote:An economic model that doesn't care about detail because there are an untold number of hidden influences doesn't need to care about price. A momentum model based on various functions that can control rate of production/use of material and goods would do the same without having any of the complexity of having to poll VS for any data.
...

This is perfectly believable from a player perspective since you can't possibly render and simulate the BILLIONS of units that would have to exist that would be responsible for trading cargo amongst bases and worlds.

Cost would be generated by VS on-demand. Looking at the relationship with the base and the player and supply/demand, a price can be generated. Perfectly reasonable factors that would dictate price. The underlying economic functions that deal with it all dont have to care about price because none of the polling and grepping around is being done. And this is realistic because we aren't simulating everything. If we were, then we would need to maintain constant polling on all bases that are simulated. This is not the case however.
...
I do not see how the price of iron ore has now effect on the price of a car, which is what you are saying. Cars need steel, steel needs iron, and iron needs ore.

Nor do I care what has been previously discussed about simulating the ships. Both the what and the how of the present discussion (at least what I propose and klauss seems to largely agree with) is based on numerically represented flow. The traffic is just an in-game manifestation of that flow, not necessarily anywhere near the actual number of ships needed to match that flow.

Cost is generated when polled, though polling is not needed ever second. Cost is determined by what it takes to produce it and the supply/demand modifies that price.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Defining a new economic system for future versions

Post by klauss »

travists wrote:The traffic is just an in-game manifestation of that flow, not necessarily anywhere near the actual number of ships needed to match that flow.
Let me remind everyone present in this discussion that VS already maintains a similar "numerically represented flow" across the entire galaxy.

VS simulates (in full, with units and such) only a handful of systems. The rest is simulated numerically, with "virtual battles" modifying the "reserves" of ships in a system, and merchants flowing (numerically) from one place to the other.

So VS is no stranger to the technique of statistical simulation.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Defining a new economic system for future versions

Post by travists »

If I understand this correctly, from a purely practical standpoint, a dynamic economy would best be served by another layer of flow?
Post Reply