Fractal Softworks Forum

Starsector => General Discussion => Blog Posts => Topic started by: Alex on April 20, 2016, 03:36:25 PM

Title: Economy Revamp
Post by: Alex on April 20, 2016, 03:36:25 PM
Blog post here (http://fractalsoftworks.com/2016/04/20/economy-revamp/).
Title: Re: Economy Revamp
Post by: HELMUT on April 20, 2016, 04:30:55 PM
As someone that prefer space ships and explosions, i have to admit this blog post left me a bit apathetic. I guess all of this will become more relevant once we'll get the Industry system though.

Just one thing that confused me in those screenshots. Shouldn't "Imports" and "Production" be reversed? My eyes have to "cross" the screen to read and it feel surprisingly... Uncomfortable. It's hard to explain, so i just changed it a bit :

Spoiler
(http://i.imgur.com/24PHg1S.jpg)
[close]

Having "Production" facing "Exports" and "Imports" facing "Demand" feels less confusing. Or maybe it's just me, i just wanted to note it.
Title: Re: Economy Revamp
Post by: Alex on April 20, 2016, 05:11:00 PM
As someone that prefer space ships and explosions, i have to admit this blog post left me a bit apathetic.

Fair enough - it's mostly groundwork, though some aspects of it I think are interesting enough, if not specifically exciting. (And, I should note, this is another case of dev progress overtaking blog posts; the last of the work on the economy revamp was maybe a month ago.)

I guess all of this will become more relevant once we'll get the Industry system though.

Yes!

Just one thing that confused me in those screenshots. Shouldn't "Imports" and "Production" be reversed? My eyes have to "cross" the screen to read and it feel surprisingly... Uncomfortable. It's hard to explain, so i just changed it a bit :

Spoiler
(http://i.imgur.com/24PHg1S.jpg)
[close]

Having "Production" facing "Exports" and "Imports" facing "Demand" feels less confusing. Or maybe it's just me, i just wanted to note it.

I get what you're saying, yeah. I don't think there's any ideal way to lay it out, though. Exports may be related to imports and not production (if the trade is flowing through the world), and production and demand are often related as well.

I like keeping imports/exports and production/demand paired up because it separates "outside the market" and "inside the market", but there's a degree of personal preference there. (I have to say, the way you've got it laid out confuses me a lot - though, again, personal preference/being used to it being the other way...)

Still, I'll keep what you said in mind, and thank you for the suggestion.
Title: Re: Economy Revamp
Post by: xenoargh on April 20, 2016, 06:35:30 PM
Dumb CS question here:  isn't this a perfect task to use a second CPU on?
Title: Re: Economy Revamp
Post by: Alex on April 20, 2016, 06:58:09 PM
Dumb CS question here:  isn't this a perfect task to use a second CPU on?

Considered this pretty thoroughly during implementation, as, you're right, at first glance it really does look like one.

One problem is it's regularly updating the effects of market conditions, prices, connection weights, etc. It'd have to either make a deep copy of all of the markets (or make access synchronized, which could be troublesome performance-wise - or it might not, but it'd need to be investigated), and the implementation becomes significantly more complex (which isn't a problem by itself, but also makes it more error-prone).

The other problem is being able to save/load while still keeping this task's data around - you need to pause it when saving, collect the data, and then kick it off at the same point after loading. Again, doable, but painful enough and likely enough to introduce bugs that it's not really worth it. I seem to remember there was some non-obvious problem with doing that, but can't remember what it was - I mean, "pause, save data, resume on load" doesn't sound bad at all.

Also, pausing the game becomes iffy because the econ thread would have to get to a point where it can pause as well, right? Which means that pausing the game repeatedly actually speeds up how quickly each iteration of the simulation is computed. Not a problem if it's working with a deep copy (it'll just wait out its allotted time before copying changes over to the "real" data), but potentially weird if it's not.

On the flip side, making a deep copy seems likely to take a bit more time than you can spare in a single frame, mostly for the market connections, it being a fully connected graph. And if you do it over multiple frames, then what you're copying is changing and that's not good either. Might not turn out to be a valid concern, though - needs investigating.


None of this appears unsolvable, and it's definitely something I'll take a look at if performance becomes an issue. But as it stands? It's not using enough cycles to warrant the significant extra complexity it would introduce into the codebase. It's the best candidate out of everything so far for doing on another CPU, though.

Title: Re: Economy Revamp
Post by: Dri on April 20, 2016, 08:16:20 PM
Aye, currently the Trading game can't hold a candle to the Combat so a post dedicated to trading isn't going to rile up much - I do understand that you've got to start small to get to the big, juicy stuff though. :)

Imo, it is currently too time consuming and requires too many random events to make a profit from trading and despite all that has been added to the campaign thus far, it is still 90% about building your fleet and blowing stuff up. My hope for the Trade system is not so much about making credits but rather to shape the sector; I want to funnel supplies into Asharu so it can complete it's terraforming! I want to create my own faction or ally with another and provide resources for the production of allied fleets for both defense and invasion! Industry and Trade should allow you to indirectly win battles and claim territory by providing the credits and resources needed to do just that.

Or, ships should become many times harder to come by so that all the time, effort and money needed to build up a market to the point that it can produce the ships you want, would be worth it!
Title: Re: Economy Revamp
Post by: Auraknight on April 20, 2016, 10:06:16 PM
Honestly, the biggest thing I want from this is to actuially be able to 'starve out' a planet if I'm good enough to keep any trade fleets from reaching it. At the moment, my actions against non-millitary fleets feels... unimportant. Most of my trading is either selling loot from spacebattles, or desperately running 1C things from one place, and selling them for 3-5C somewhere else to buy more supplies.
Title: Re: Economy Revamp
Post by: xenoargh on April 20, 2016, 11:53:58 PM
Quote
None of this appears unsolvable, and it's definitely something I'll take a look at if performance becomes an issue. But as it stands? It's not using enough cycles to warrant the significant extra complexity it would introduce into the codebase. It's the best candidate out of everything so far for doing on another CPU, though.
Without getting into details, yeah, this just seems like it'd be amenable.  I'd like to hear more about the technical approach, though; it seems like this should all be pretty clean, fast spreadsheet shuffling and it's pretty weird to me that, when we start a game, it takes forever for those market "months" to execute. 

That probably points at update frequencies more than anything else; it's really just not that important, from a player POV, if markets only update in major ways (as opposed to dynamic events from local fleets arriving) once a week or so, I'd think.
Title: Re: Economy Revamp
Post by: TJJ on April 21, 2016, 02:28:26 AM
Re stock icons; if there are more than ~5 of them, I'd overlay a number too. (Like Colonisation did)
(http://www.mobygames.com/images/shots/l/53861-sid-meier-s-colonization-windows-screenshot-town-screen-strengthen.gif)


While the exact number might not be particularly relevant to the player, it does help quantify the relative scales of product.
Title: Re: Economy Revamp
Post by: Bastion.Systems on April 21, 2016, 04:35:49 AM
The economy fools!

I appreciate the fancy graphs, also the news that poorly balanced mod systems might not raise supply prices in the sector to 200-300 per unit would be nice.
Title: Re: Economy Revamp
Post by: Histidine on April 21, 2016, 05:08:45 AM
Oooh this is relevant to my interests.

Brief comments/questions:
Title: Re: Economy Revamp
Post by: Schwartz on April 21, 2016, 06:44:54 AM
tl;dr

Alex, in an attempt to write a transactional subroutine, has recreated the internet and eBay in one fell swoop. Next up: Tri-Tachyon's stranglehold on the search engine market.
Title: Re: Economy Revamp
Post by: Cycerin on April 21, 2016, 07:39:14 AM
The big planets in the background of the new detail overview is a nice touch. This is cool, but I'm mostly excited about what upcoming features it paves way for... ;)
Title: Re: Economy Revamp
Post by: ClosetGoth on April 21, 2016, 08:03:51 AM
Is there any indication of how this will affect/be affected by player or npc pirating? Will we see systems shift their purchasing faster, slower? Will it be easier/harder to keep farming the same area, or to see where the trade is happening?
Title: Re: Economy Revamp
Post by: CrashToDesktop on April 21, 2016, 08:11:06 AM
This is totally off-topic, but has anyone noticed the total lack of comments about this blog post?  Usually there's 3 pages of comments by this time.
Title: Re: Economy Revamp
Post by: Dri on April 21, 2016, 08:37:31 AM
Lack of comments is probably due to the fact that the Economy/Trading are currently no match for the awesomeness of the combat system. :)
Title: Re: Economy Revamp
Post by: Thaago on April 21, 2016, 09:08:54 AM
Looks interesting.

Playing as a smuggler currently is a lot of fun, but there really isn't anything to do with the profits. Nice job on the hints of other things :P.
Title: Re: Economy Revamp
Post by: sycspysycspy on April 21, 2016, 09:19:27 AM
Lack of comments is probably due to the fact that the Economy/Trading are currently no match for the awesomeness of the combat system. :)
+1 for this, but in order to build an effective fleet, trading is the best way to go.
Title: Re: Economy Revamp
Post by: HellBent on April 21, 2016, 09:23:10 AM
Dunno why this is getting such lack of interest.
For me economy and trade is one of the things I've been most looking forward to.

I have found making money from trading very obtuse, and if you start the game as a trader you need to get lucky with prices around you, and hope that somewhere close has a machinery shortage.
All in all I think this is very interesting, great to see this game come along in bounds with each blog post.
Title: Re: Economy Revamp
Post by: Alex on April 21, 2016, 10:02:55 AM
I'd like to hear more about the technical approach, though; it seems like this should all be pretty clean, fast spreadsheet shuffling and it's pretty weird to me that, when we start a game, it takes forever for those market "months" to execute. 

Most of the two months at the start have little to do with the economy - it's actually advancing the campaign engine, in large steps, to populate the sector with a reasonable spread of fleets, events, etc.

If it was *just* the economy, it would take under 10 seconds, depending on CPU of course. Which is still a fair length of time, but the core of it is O(n^2), and there really isn't a good way to get below that, whether you're doing bids/contracts or something else.

That probably points at update frequencies more than anything else; it's really just not that important, from a player POV, if markets only update in major ways (as opposed to dynamic events from local fleets arriving) once a week or so, I'd think.

It's not important right now, but it will be important later - the higher the frequency, the faster it reaches a stable point, both because there are more updates and because the updates are finer-grained and find the equilibrium faster. And, well, it *is* important now in terms of producing proper prices for supplies and fuel, though that'd be massive overkill if that's all that was required. The update frequency in the new version is once every 3 days, btw, though it'll take longer (and update stockpiles in larger increments) if need be.


Re stock icons; if there are more than ~5 of them, I'd overlay a number too. (Like Colonisation did)
...
While the exact number might not be particularly relevant to the player, it does help quantify the relative scales of product.

Honestly, not a fan. It's necessary in that screenshot, because the number of icons is huge compared to the space they dedicate to displaying them. I think they would do better just showing a single icon and a number, at that point - the stacking really isn't doing anything useful there.

In our case, the icons are spread out more. Given what the screen does, a difference between say, 8 or 10 icons isn't very important. Anything more, you'll pick up on visually, and if you need a detailed quantity, you can mouse over.

Adding a bunch of numbers over everything would look super cluttered and would, imo, reduce the readability a *lot*.



Oooh this is relevant to my interests.

(That totally made me laugh.)

  • Thank goodness markets can have realistic populations without causing massive supply/demand shocks. In fact I think 2^n is low enough to risk Fridge Logic thing from big markets not seeing much more traffic than small ones, could probably get away with 3^n or even 4^n.
I kind of like 2^p here - it produces results that "feel" right and are just in the player's grasp to influence on the high end. E.G. something like 8000 food/month needed by Chicomoztoc (size 8), vs 500 by a size 4 market. And it does help keep the number of icons in a manageable range on the low and high end, where I'm fairly positive a base of 3 or 4 would get away from that. As you can see, for Chicomoztoc it's juuust barely manageable already.


  • Is there now any built-in mechanism for correcting or at least compensating for Sector-wide over/undersupply (i.e. too many or not enough market conditions)? EDIT: okay, I see it does dynamically scale back
Right - for oversupply, production drops off to 0 when local stockpiles reach 2x base supply. For undersupply, nothing right now, but I'm thinking about some ways to handle this on a higher level - we'll see how that pans out :)

Hopefully, just being robust against oversupply will help out some in any case.


  • If the economy flow panel was scrollable the icons on that Chicomoztoc screenshot might not look so crowded. Though I think you really should do as TJJ suggests and use numbers instead of icon spam. Or use big icons that represent multiples of the small icons.
Don't want to make it scrollable, though, since it's supposed to be an "at a glance" thing.

(Yes, the commodity detail panel is scrollable too, but didn't see a way to avoid that. Might end up redoing its layout, though.)


  • A couple of mods (Interstellar Imperium and Nexerelin) have events that cause one-off destruction of stockpiles. Will the new economy reflect such events? Can it handle such events without making things go Horribly Wrong? Or should we target supply or something instead?
Should just work. In fact, should work better than before - it'll influence prices, show local demand as being not met, will show a nice huge dip in the "stockpiles" graph, etc.

Btw: all the "average" stuff is gone, nuked from orbit. I.E. getAverageStockpile()/getAverageDemandMet()/etc. It just works off the stockpile, which it can do because it's a fairly stable value now. Further, player trade directly influences the stockpile, instead of modifying averages etc. It's all much more straightforward. The one thing to watch out for is making more stuff available on all the submarkets, total, than there is in the stockpile - to make sure it doesn't happen, submarkets talk to each other to figure out how much each wants/gets.


The big planets in the background of the new detail overview is a nice touch. This is cool, but I'm mostly excited about what upcoming features it paves way for... ;)

Hey, someone noticed! Have to admit, I'm very partial to those myself. Really helps give each market a more unique feel.
Title: Re: Economy Revamp
Post by: ANGRYABOUTELVES on April 21, 2016, 12:13:30 PM
Backend updates aren't nearly as flashy as new ships, weapons, or balance changes, but they can be even more important. Changes to make the economy more reactive aren't going to be noticeable by most players as of right now unless it significantly impacts the prices of Supplies or Fuel, but are going to be very important in the future once Industry becomes a thing. So even though I don't care much about trading or economy stuff right now, I'm glad you're keeping us up to date on this kind of thing.
Title: Re: Economy Revamp
Post by: xenoargh on April 21, 2016, 01:16:32 PM
Looked at what you were talking about, in terms of bids / contracts, for a bit.

Thought:  why not simply allow for each Market to set its current-bid price, taking into account the global running average and global demand, then each Market purchases with credit that's based on the Faction, rather than the individual location?  

It's not sensible to let AI Markets blow out completely because they simply can't afford to buy enough to meet the basics; preventing that requires too much work and it's not realistic, either; the United States isn't going to let everybody in Utah starve to death because the crops didn't grow this year, for example, and neither is the Hegemony going to let one of its military bases starve; colonies don't exist in vacuums and nations aren't just loose collections of markets; there are Central Banks IRL for a reason.

That would hugely reduce the amount of n^2 involved and probably lead to more sensible events in general and much more stability.  I'd probably also simulate the futures market a bit, and have Factions put in for long-term deliveries over time, rather than just buying at spot prices; that would also greatly reduce the need for math-heavy event calculations and for the vast majority of commodities, it's much more sensible and realistic.  After all, the Hegemony isn't going to buy Food for a military base on today's spot market, for example, they're going to lock in their prices in exchange for orders over a long period; months, at least.

Then the Market providing said resource launches a delivery fleet with escorts, etc., and it's all in-game events, but is much less volatile and math-heavy.  Then recalculate the global running average, based on that stock being in-transit and possibly lost, and the next bid can be dealt with.  Fairly cheap math then.

The only stuff that would remain outside that box would be black-market goods, but even there, you can use a similar model; demand would create a need to be met, etc.  The difference is that black-market goods wouldn't be allowable via global credit; the local economy would have to have the cash-on-hand to make a purchase.

That leads to the other issue; I presume that Credits aren't being controlled for, as a resource.  They should be, including Factions expanding their buying power by "printing money", which would dilute the value of the Credit in general, vs. Credits constantly getting "destroyed" when fleets do battle and the local Commanders credit stocks are lost, etc.  

The Black Market sucking Credits out of the "legitimate" economy (although most of that would just go right back in, by buying the Pirates goods on the open markets) would also lead to some meaningful price volatility on things like weapons and ships, which a smart player could use to their advantage, and therefore find some trading opportunities.

Don't get me wrong, I'm OK with real dynamic motions in economies here, but I think that that should happen almost entirely because of major events (a successful blockade of a location, using weapons to damage a planet, inciting a revolution, etc.) rather than it being a bunch of relatively-finicky, complicated internal workings.  In short, if the behavior of Markets isn't contributing very directly to Drama that can be tied to Fun... why spend so much time coding it?

For the most part, day-to-day buying of major commodities shouldn't be a bunch of individual locations attempting to seek stability, but should largely rest on the strength / weakness of the nation-state that is a Faction; this keeps things simpler overall (think of MOO II's economy here, where it was complex-but-computationally-simple) without any real drawbacks, other than losing the "each planet is an island" feel, which isn't terrifically realistic anyhow and is just costing CPU cycles.
Title: Re: Economy Revamp
Post by: nomadic_leader on April 21, 2016, 04:26:44 PM
As one who thinks the overworld game is more interesting than combat (until the latter gets more integrated with the overworld anyway) I really liked this blog post.

This game is totally wasted on people who just like explosions.

I look forward to seeing what you give the player to do with this. I imagine being a manipulative Martin Shkreli of the sector.

Re: reducing the overall number of commodities-- what about all the campaign missions that require you to get 10,000 tonnes of heavy machinery? What about the giant freighters in the game? Will there be nothing to put in them? A pity if the ships became purely decorative.

Re: many icons in last screenshot -- Since every commodity icon is a very distinct, separate color (good design btw), can't you just represent them as bar graphs? ie pink bar for drugs, dark green for organics, etc.


Now a theoretical consideration:
I don't claim to be an economist or computer scientist familiar with all the algorithms you mention, but something to keep in mind: In real life trade is often irrational from a profit standpoint, so your simulation may not work as desired if you make markets behave entirely rationally. There's a metagame of trade that goes beyond simple profit.

In addition to immediate rational economic gain, trade happens for:
-Solidifying relationships between merchants, district leaders, or heads of state; part of diplomacy (gift giving,)
-Bailing out/stabilizing/developing other markets within one state (ie, buying a poor district's useless stuff to keep them from starving, or selling stuff to another district at a low price because they need it)
-Humanitarian aid to other states
-Useless displays of vanity and status (ie olympic villages)
-Internal political considerations (producing/selling at loss  something nobody much wants, because some powerful faction inside the state benefits from it)
-Because it happened before and people are just used to it and it has an inertia. Nomads use the same paths and trading oases in the desert because thats what their grandfathers did. You've already addressed this with accepted bids remaining accepted for a while. Inertia is perhaps even more influential than that however.

I don't say that all this stuff should be simulated in detail in the game. It just may be useful to think about stuff like that, and give yourself (and modders) some way to include provision for "irrational trade" in the simulation. Probably some factions would have a lot of centrally planned (for better or worse) economic activity, while others would be totally hands off and more 'rational.'
Title: Re: Economy Revamp
Post by: Bastion.Systems on April 21, 2016, 05:53:40 PM
In the old model the unit price of goods dropped inside a single transaction. Is this still the case? In reality there usually is a short period before the market figures out that the shortage has ended and the excess goods are unsellable and the price drops.
Title: Re: Economy Revamp
Post by: Alex on April 21, 2016, 07:43:54 PM
@xenoargh:
Hmm - I rather suspect that what you're proposing would end up with a huge amount of corner-case related complexity (see: black market stuff).

Thought:  why not simply allow for each Market to set its current-bid price, taking into account the global running average and global demand, then each Market purchases with credit that's based on the Faction, rather than the individual location?

That still seems like O(n^2) in the number of markets, except now they also have to share a common pool of credit, making things more complicated. Am I missing something?

I think you might mean that factions buy and sell as a unit - i.e. you'd be buying ore from the Hegemony, rather than from a specific market - but that really homogenizes all faction markets, with, I think, detrimental results in terms of there being opportunities to exploit. But since those are so abstract right now (and mostly exist in my head), it's not exactly something that can be discussed super productively... so many ways to do it, you know? :)


Quote
neither is the Hegemony going to let one of its military bases starve

That doesn't happen with this system, either. Military bases, in fact, get increased stability to reflect their political pull. Even if they didn't, it's rare for a market to get zero of something, since when stockpiles get very low, prices go up a lot, allowing it to temporarily outbid the better-stocked competition.

Credits being a resource... also something I'd given some thought. For me, that feels like an unnecessary complication. I mean, what's the benefit? It's going to be confusing to the player, and my feeling is it would make it much more difficult for the simulation to stabilize. Especially if factions are capable of making more credits on demand, one would have to be careful to ensure there's no runaway inflation, etc. And then you'd need to adjust bounty payouts etc - lots of repercussions for unclear gains.

Quote
rather than it being a bunch of relatively-finicky, complicated internal workings.

Making it not finicky and a lot less complicated is more or less the point of this revamp :)



Re: reducing the overall number of commodities-- what about all the campaign missions that require you to get 10,000 tonnes of heavy machinery? What about the giant freighters in the game? Will there be nothing to put in them? A pity if the ships became purely decorative.

I'll have to adjust those missions; have a todo item about it somewhere. The high-end quantities are such that the Atlas is still useful, in terms of the amount of stuff that's available to buy. Whether there's a point to shipping that much of it is another question; will depend on how things shake out.


Re: many icons in last screenshot -- Since every commodity icon is a very distinct, separate color (good design btw), can't you just represent them as bar graphs? ie pink bar for drugs, dark green for organics, etc.

That wouldn't look as good, wouldn't work for colorblind people, and wouldn't be mod-friendly. Plus, from a usability point of view, having that many graphs would be much harder to take in at a glance than seeing the icons. In one case, you just have the color - but in the case of icons, you have color and shape. That helps keep a large amount of information from becoming overwhelming.


Now a theoretical consideration:
I don't claim to be an economist or computer scientist familiar with all the algorithms you mention, but something to keep in mind: In real life trade is often irrational from a profit standpoint, so your simulation may not work as desired if you make markets behave entirely rationally. There's a metagame of trade that goes beyond simple profit.

In addition to immediate rational economic gain, trade happens for:
-Solidifying relationships between merchants, district leaders, or heads of state; part of diplomacy (gift giving,)
-Bailing out/stabilizing/developing other markets within one state (ie, buying a poor district's useless stuff to keep them from starving, or selling stuff to another district at a low price because they need it)
-Humanitarian aid to other states
-Useless displays of vanity and status (ie olympic villages)
-Internal political considerations (producing/selling at loss  something nobody much wants, because some powerful faction inside the state benefits from it)
-Because it happened before and people are just used to it and it has an inertia. Nomads use the same paths and trading oases in the desert because thats what their grandfathers did. You've already addressed this with accepted bids remaining accepted for a while. Inertia is perhaps even more influential than that however.

I don't say that all this stuff should be simulated in detail in the game. It just may be useful to think about stuff like that, and give yourself (and modders) some way to include provision for "irrational trade" in the simulation. Probably some factions would have a lot of centrally planned (for better or worse) economic activity, while others would be totally hands off and more 'rational.'

These kinds of things would be handled through events and/or missions. The goal for the economy simulation is to provide a solid base on which other, more complex mechanics can operate.


In the old model the unit price of goods dropped inside a single transaction. Is this still the case? In reality there usually is a short period before the market figures out that the shortage has ended and the excess goods are unsellable and the price drops.

Yes, that's still how it works. Kind of has to to prevent infinite/free money exploits. In the example you're giving, for example, you could sell at a high price, wait for it to drop, then buy everything back at a low price, then wait for prices to go up again, etc.
Title: Re: Economy Revamp
Post by: xenoargh on April 22, 2016, 10:36:31 AM
Quote
I think you might mean that factions buy and sell as a unit - i.e. you'd be buying ore from the Hegemony, rather than from a specific market
My thought here was that Markets would go to the global exchange and buy XYZ at whatever XYZ's bid prices were, hit their locally-available Credits, and then draw from the Faction if necessary.  Naturally, that would mean that some Factions would run at a deficit; but perhaps they could increase their tax rates and pay down their debt in exchange for slower economic growth in the short term, like the real world.

I agree about the black-market; that'd require some work to avoid various Bad Things.

Anyhow, I'll keep thinking about the n^2 issues; seems like there really ought to be ways to get it down to n passes without too much distortion, so that it's just not major weightlifting at all.  Probably the biggest issue is treating commodities as commodities, and not as local produce that needs to be re-bid every time a transaction occurs; a futures market would probably simplify things a lot.
Title: Re: Economy Revamp
Post by: Alex on April 22, 2016, 11:43:24 AM
Ah, I see - hmm. That sounds like introducing a few systems that work off of the feedback from trade, which would themselves take some time to stabilize, if that makes sense. I.E. credits/tax rates - not directly involved in trade, but stabilizing eventually (hopefully) as a result of what happens during trade.

My experience with this stuff has been that having several systems that feed back into each other trying to stabilize like this is potential trouble - it either takes longer, or it just doesn't stabilize at all.

Another alarm bell with having credits etc would be it being a hard cutoff at some point (if that's how it worked) - everything could be working perfectly, looking good, and then come to a crashing halt in the next step because it ran out of money somewhere.

Anyhow, I'll keep thinking about the n^2 issues; seems like there really ought to be ways to get it down to n passes without too much distortion, so that it's just not major weightlifting at all.  Probably the biggest issue is treating commodities as commodities, and not as local produce that needs to be re-bid every time a transaction occurs; a futures market would probably simplify things a lot.

Thanks!

The current sim is sort of doing a "futures" market, btw - assuming we mean the same thing by that, to some extent at least - by looking at production instead of stockpiles when deciding what gets moved where. This does indeed help reduce volatility a lot; probably the cornerstone of making the whole thing work out.

I don't think it can be reduced below n^2 without a major paradigm shift (did I really just say that? sigh). At some point, it's got to decide, "where does this batch of food go", and, well - it's not even as simple as saying "find the market that pays the best", because that market may be able to get a better deal elsewhere.

Thankfully, though, it performs well despite being n^2, as the actual algorithm is pretty lean.
Title: Re: Economy Revamp
Post by: Psigun on April 22, 2016, 12:00:25 PM
Looks great. A robust trading system and economy was something I really wanted out of this game.
Title: Re: Economy Revamp
Post by: Deshara on April 22, 2016, 03:17:01 PM
I'm very happy to hear that we're a step closer to commodity-starving markets into submission for fun and profit
Title: Re: Economy Revamp
Post by: PCCL on April 23, 2016, 09:41:17 PM
As someone studying economics and has interest in compsci, this is interesting.

As far as that readability issue on large markets goes, what if instead of stacking icons based on absolute amounts (100 Organics/icon, etc) you made the stack sizes relative to the different goods on the market (%1 in market output/icon)? As far as I can tell, there's very little point in showing the actual number of a given good on the market in the "at-a-glance" view, nor is that view used to compare a market's output to another market's, so having a relative figure that scales with market size shouldn't cause many problems
Title: Re: Economy Revamp
Post by: HGScout on April 24, 2016, 06:29:56 AM
will this help in making the game run faster?
Title: Re: Economy Revamp
Post by: Alex on April 24, 2016, 09:57:32 AM
As far as that readability issue on large markets goes, what if instead of stacking icons based on absolute amounts (100 Organics/icon, etc) you made the stack sizes relative to the different goods on the market (%1 in market output/icon)? As far as I can tell, there's very little point in showing the actual number of a given good on the market in the "at-a-glance" view, nor is that view used to compare a market's output to another market's, so having a relative figure that scales with market size shouldn't cause many problems

The thing is, while you're not using this view to compare markets side-by-side, it's still a big part of getting a feel for the size of a market's economy. For example, you go to Jangala, and that screen is full of stuff. You go to Asharu, and you get a very clear sense of how much smaller it is than Jangala, and how much worse off, even if you're not seeing the screens side-by-side. Further, imagine if you're in control of the market, and doing something to develop it further. It'd be good to see that growth reflected in this screen.

will this help in making the game run faster?

This shouldn't have much impact on performance one way or another.
Title: Re: Economy Revamp
Post by: HellBent on April 25, 2016, 06:16:47 AM
Had an idea for the issue of many icons being fit onto the screen.
How about having a larger good icon to represent 10 units that would also stack next to the smaller ones?
Title: Re: Economy Revamp
Post by: Gothars on April 25, 2016, 09:26:13 AM
Details:
Wouldn't it be nicer if the top icon of a stack was on the left? As it is now, if you don't recognize a symbol because of the overlay, you have to go all the way to the right to see it in full. That's counterintuitive for western reading habits.


And I'd maybe change "Incoming" and "Outgoing" to "Gain" and "Depletion" or something (Increase/Decrease, Adding/Subtracting). "Outgoing" strongly implies exports, which doesn't fit  with "Demands".
Title: Re: Economy Revamp
Post by: PCCL on April 25, 2016, 11:53:52 AM
"input" and "output"?
Title: Re: Economy Revamp
Post by: Dri on April 25, 2016, 02:40:44 PM
You're just so sensible, Gothars. A real voice of reason around here!
Title: Re: Economy Revamp
Post by: Alex on April 25, 2016, 03:30:16 PM
Had an idea for the issue of many icons being fit onto the screen.
How about having a larger good icon to represent 10 units that would also stack next to the smaller ones?

Tried that! It turns out it's not good for several reasons -
1) You lose a quick sense of scale - i.e. you see that Organics icons take up X amount of screen space, Volatiles take Y, and you can no longer instantly tell which there's more of. Obviously you can tell if you take a closer look at the icons involved, but it's no longer "at a glance" readable.
2) In the same vein, that makes it so there's two shapes for each commodity, which makes parsing this more difficult. Keeping the colors similar helps there, but the shape, it turns out, is a very powerful help there as well.


Wouldn't it be nicer if the top icon of a stack was on the left? As it is now, if you don't recognize a symbol because of the overlay, you have to go all the way to the right to see it in full. That's counterintuitive for western reading habits.

I'm not sure what you mean by "because of the overlay", and how that combines with reversing the ordering of the stack. I mean, if it's showing you that, say, the demand for food is not met, that's a quantity of food highlighted with a red border (if that's what you mean by overlay), but that's already to the right of the "food demand met" group. Shifting icon rendering within each group isn't going to affect the order of the groups in any case, though. Just not quite sure what you're saying - rather, it'd make sense w/o the "because of the overlay" part, but with that, I'm confused :)


And I'd maybe change "Incoming" and "Outgoing" to "Gain" and "Depletion" or something (Increase/Decrease, Adding/Subtracting). "Outgoing" strongly implies exports, which doesn't fit  with "Demands".

Hmm. Does it? I guess can see that, but it's still a fairly generic word. "Adding/Subtracting" is probably the most clear, but (unfortunately!) also feels off feel-wise.


"input" and "output"?

"Output" isn't right at all for demand, though. And is right for production/supply. So that'd just muddy the waters further :)
Title: Re: Economy Revamp
Post by: Gothars on April 26, 2016, 08:40:04 AM
Wouldn't it be nicer if the top icon of a stack was on the left? As it is now, if you don't recognize a symbol because of the overlay, you have to go all the way to the right to see it in full. That's counterintuitive for western reading habits.

I'm not sure what you mean by "because of the overlay", and how that combines with reversing the ordering of the stack. I mean, if it's showing you that, say, the demand for food is not met, that's a quantity of food highlighted with a red border (if that's what you mean by overlay), but that's already to the right of the "food demand met" group. Shifting icon rendering within each group isn't going to affect the order of the groups in any case, though. Just not quite sure what you're saying - rather, it'd make sense w/o the "because of the overlay" part, but with that, I'm confused :)

Sorry for being unclear, should have said "overlap" not "overlay".

What I meant is that this:

(http://i.imgur.com/nbpO8XH.jpg)

is easier to read than this:

(http://i.imgur.com/7T81DBy.jpg)

For western readers it feels natural to look to the left for the beginning of a semiotic construct ("icon sentence"). But here looking to the left doesn't clarify the icon, you have to look right to see in in full. It's a minor thing, but why not choose the better option?




"Outgoing" strongly implies exports, which doesn't fit  with "Demands".

Hmm. Does it?

Yes! It's almost a synonym in this context. Just google "outgoing commodities", you could replace most of the results with "exports".

In German the correct word instead of "Incoming" would clearly be "Zuwachs", which translates to "increment" (or "accretion"). Then the opposite would of course be "decrement" (or "diminution").


You're just so sensible, Gothars. A real voice of reason around here!

Uh, thanks!?  :)
Title: Re: Economy Revamp
Post by: Zarcon on April 26, 2016, 09:37:22 AM
I fear that I'm being overly dense to even ask this question...alas.  :P 

But all of these cool market supply/demand issues will be resolved by REAL fleets moving throughout the Sector right?

Fleets which will be carrying the desired supplies from the location with the surplus to the location with the demand?

Then if these fleets are assailed, the cargo recovered would naturally be the cargo which was being shipped due to this market system.

Anyways, sorry if that is old hat, but I didn't notice it being clearly laid out just now, maybe I overlooked it, or maybe I'm way off and this supply/demand chain will happen automagically.  :P
Title: Re: Economy Revamp
Post by: Auraknight on April 26, 2016, 09:53:18 AM
As someone studying economics and has interest in compsci, this is interesting.

As far as that readability issue on large markets goes, what if instead of stacking icons based on absolute amounts (100 Organics/icon, etc) you made the stack sizes relative to the different goods on the market (%1 in market output/icon)? As far as I can tell, there's very little point in showing the actual number of a given good on the market in the "at-a-glance" view, nor is that view used to compare a market's output to another market's, so having a relative figure that scales with market size shouldn't cause many problems
Wouldn't you then have the problem of a large market 'appearing' to have the same out-put and input as a small one?
Title: Re: Economy Revamp
Post by: Alex on April 26, 2016, 11:46:17 AM
Sorry for being unclear, should have said "overlap" not "overlay".

What I meant is that this:

(http://i.imgur.com/nbpO8XH.jpg)

is easier to read than this:

(http://i.imgur.com/7T81DBy.jpg)

For western readers it feels natural to look to the left for the beginning of a semiotic construct ("icon sentence"). But here looking to the left doesn't clarify the icon, you have to look right to see in in full. It's a minor thing, but why not choose the better option?

Ah, gotcha - thought that's what you meant, but the "overlay" bit threw me off.

Gave it a quick try - looking at an icon group, my eye naturally wants to move to the right. It does not want to stop and look at the left-most icon, there's almost a compulsion to keep the gaze moving to the right. The right side of a group feels like a much more comfortable stopping point. Further, overlapping icons like this, there's a "flow" to it, and it goes right-to-left if the first icon is on top. It feels quite uncomfortable moving my eye to the right over a group that's displayed like this.

I'm sure this is subjective even within western readers, to some degree, but having tried it... let's just say I've developed a lot more empathy for a right-to-left reader trying to adapt to left-to-write text and layouts. It actually felt nauseating and disorienting to look at the screen :) Really weird how strong of a sensation that was - not super apparent looking at one group, but when you start to look at many groups laid out like that, yikes.


"Outgoing" strongly implies exports, which doesn't fit  with "Demands".

Hmm. Does it?

Yes! It's almost a synonym in this context. Just google "outgoing commodities", you could replace most of the results with "exports".

In German the correct word instead of "Incoming" would clearly be "Zuwachs", which translates to "increment" (or "accretion"). Then the opposite would of course be "decrement" (or "diminution").

Thought about this for a while - funny how stuff like that can take up a bunch of time. Tried "Imports & Production" / "Exports & Consumption", but that feels awfully wordy and redundant, given that there are subtitles that say that anyway. I do see what you're saying though. It's more not liking any of the alternatives - they all have some downsides/undesirable connotations/etc. Going to keep this in mind in case something better comes along!


I fear that I'm being overly dense to even ask this question...alas.  :P 

But all of these cool market supply/demand issues will be resolved by REAL fleets moving throughout the Sector right?

Fleets which will be carrying the desired supplies from the location with the surplus to the location with the demand?

Then if these fleets are assailed, the cargo recovered would naturally be the cargo which was being shipped due to this market system.

Anyways, sorry if that is old hat, but I didn't notice it being clearly laid out just now, maybe I overlooked it, or maybe I'm way off and this supply/demand chain will happen automagically.  :P

It's a good question. The answer is both yes and no.

On the "no" side, the simulation doesn't require real fleets in order to work. If it did, it basically wouldn't work. Consider how fragile it would be if, say, something like a buff or nerf to Emergency Burn had the potential to wreck the economy, by making it so that pirates intercepted a lot more shipping.

It would also take an unreasonably high number of fleets to even send one fleet a month for every market pair that has some trades between them - and unless you have lots and lots of fleets for every such connection, the outcomes would be extremely volatile.

That's not necessarily bad by itself, but it'd be volatile in ways that are essentially random from the player's point of view. That one Tartessus-Sindria food fleet died halfway across the Sector? The food supply in Sindria takes a nosedive, but it's not something you could predict or even really figure out why it happened.


On the "yes" side, trade fleets that do spawn carry the right cargo, and their destruction may feed back into the simulation, just not to the point where the simulation requires them to do their thing.

Title: Re: Economy Revamp
Post by: Zarcon on April 26, 2016, 12:12:17 PM
Well that makes me a tad bit sad, lol. ;)  I love the concept of each bit of shipping/cargo/goods existing in a real sense and having to be moved around via fleets.  Would make blockades really cool imho, and pirates would be very disruptive just like they historically have been in real life. 

But I respect your reasoning Alex, thanks for the explanation, it makes sense.
Title: Re: Economy Revamp
Post by: shuul on April 27, 2016, 04:53:37 AM
Well that makes me a tad bit sad, lol. ;)  I love the concept of each bit of shipping/cargo/goods existing in a real sense and having to be moved around via fleets.  Would make blockades really cool imho, and pirates would be very disruptive just like they historically have been in real life. 

But I respect your reasoning Alex, thanks for the explanation, it makes sense.

I believe blockades will still have impact, but not so catastrophic as it would be with real fleets. This will still be a viable tactic for market disruption.
Title: Re: Economy Revamp
Post by: SierraTangoDelta on April 27, 2016, 09:45:53 AM
Not a super flashy blog post, but this does look far more readable and useful than the previous economy screen, plus it's definitely gonna be helpful when Industry is finally put into the game, as you can seriously begin messing with the markets then, right?
Title: Re: Economy Revamp
Post by: JT on April 29, 2016, 10:57:08 AM
Since "bigger icons" is out and "numeric overlays" is out, how about a special icon meant to represent "caselots" for a given commodity (like the board game Risk)?  It might not solve the problem entirely, but if there was a special "crate" or "barrel" icon that was readily distinguishable as being a multiple rather than another unit of the commodity (sounds like a challenge for David to distinguish supplies against ;-)), then you could replace the first few icons at the bottom (front) of the icon stack and it would help indicate very large quantities.  Say if the commodity load is greater than 50, then caselot icons would begin to appear, each representing 5 units, with 25 actual icons or some such always included in order to give a sense of scale.

This would create a disparity where ~49 commodities would appear bigger (49 icons) than 50 commodities (5 caselots + 25 icons), but that could be tuned to taste -- lowering the allowed number of "actual" icons, setting the required number of "actual" icons to equal the same threshold where caselots appear, etc.
Title: Re: Economy Revamp
Post by: David on April 29, 2016, 11:31:52 AM
Since "bigger icons" is out and "numeric overlays" is out, how about a special icon meant to represent "caselots" for a given commodity (like the board game Risk)?  It might not solve the problem entirely, but if there was a special "crate" or "barrel" icon that was readily distinguishable as being a multiple rather than another unit of the commodity (sounds like a challenge for David to distinguish supplies against ;-)), then you could replace the first few icons at the bottom (front) of the icon stack and it would help indicate very large quantities.  Say if the commodity load is greater than 50, then caselot icons would begin to appear, each representing 5 units, with 25 actual icons or some such always included in order to give a sense of scale.

This would create a disparity where ~49 commodities would appear bigger (49 icons) than 50 commodities (5 caselots + 25 icons), but that could be tuned to taste -- lowering the allowed number of "actual" icons, setting the required number of "actual" icons to equal the same threshold where caselots appear, etc.

We actually tried that, using MoO2 as inspiration - remember how science/food/production/pollution stacked and had 10x icons? Didn't work very well in Starsector due to the sheer number of different icons and their more representational nature. MoO2's icons were very abstract and there were only 4 categories, for 8 total icons, contained in three very clearly designated rows on the screen. Meanwhile Starsector has .. uh, what, 16 or something base for 32 total? (somewhat) arbitrarily placed on the screen. The market screen is already visually noisy and this just made it worse because suddenly the number of different icons doubled.
Title: Re: Economy Revamp
Post by: Morrokain on April 29, 2016, 11:40:02 PM
**in regards to icon discussion** Have you ruled out a tab-based or sorting UI  for commodities to categorize them by logical relevance? This would allow the "caselot" format to be less noisy because you have less icons to deal with per logical grouping.

You lose a tad of "at a glance" readability that way, for sure, since you cannot view every commodity on one screen, but the payoff is more general readability in larger markets and less overall dead space in smaller ones since most markets are smaller markets.

Just a ~2min thought-out solution so there is probably issues there that have already been considered, but figured I'd throw in my two cents.  :)
Title: Re: Economy Revamp
Post by: Alex on April 30, 2016, 10:25:14 AM
That's rather vague, so I'm not sure I can really respond in detail :) As you note, though, it would reduce at-a-glance readability, which is the main point of the main info screen, and there's already a commodity detail screen for more specialized information.
Title: Re: Economy Revamp
Post by: JMPicard on April 30, 2016, 10:36:22 AM
Alex, would you care to give a more specific problem statement for the goods distribution? You mentioned in your blog post you had written a technical description of your second (current) solution as well -- perhaps you still have this somewhere? I'm asking because I have a fair bit of experience with such problem solving, and I'd be interested to see if I could help out -- I'd love it if I could :)

Specifically: What is the optimisation problem you want to solve? Are the accepted deals carried out by transport fleets, which can be disturbed? (And what happens in such a case? Who's responsible for the goods during transport?) Can you be a bit more specific on the allotted CPU resources as well? Implementation in Java, I suppose?

I also wonder if you considered an economy where the markets are more passive, and only set their prices based on current stockpiles, and where merchants -- independent or faction-owned -- drive the market through "buy low, sell high"? This has been rather successfully implemented in e.g. the X3 series.
Title: Re: Economy Revamp
Post by: Alex on April 30, 2016, 11:21:44 AM
Alex, would you care to give a more specific problem statement for the goods distribution? You mentioned in your blog post you had written a technical description of your second (current) solution as well -- perhaps you still have this somewhere? I'm asking because I have a fair bit of experience with such problem solving, and I'd be interested to see if I could help out -- I'd love it if I could :)

I don't have that anymore - it was part of the blogpost but was edited out.


Specifically: What is the optimisation problem you want to solve? Are the accepted deals carried out by transport fleets, which can be disturbed? (And what happens in such a case? Who's responsible for the goods during transport?) Can you be a bit more specific on the allotted CPU resources as well? Implementation in Java, I suppose?

Basically - the markets are in a (mostly) fully-connected, bidirected graph. Edge weights represent the overhead for a trade between the two markets - hostile factions, distance, etc. Specifically, the weight is a multiplier for the price. E.G. if one market is buying food that another is selling 20 credits per unit, and the edge weight is 1.5, the actual cost to the first market is 30 credits per unit.

Prices are based on stockpile compared to max(local demand, local supply), roughly.

The deals are carried out directly by the algorithm; there are transport fleets that spawn based on the deals, and them being destroyed feeds back into connection weights.

The main desired property is that there are no profitable trades remaining to be made, the prices of things being balanced across all connections. E.G. the price market A is willing to pay for food is less than the price at which all connected markets are selling food at, times the relevant edge weight. Not meeting this 100% is fine, just something the sim aims for.

There are complications, though - for example, a "stability" rating for each market, with more stable markets being able to pay more, and charging more. Stability is in turn raised by being able to meet demand, and exports, but lowered by imports. Another is being able to support transitive trade - i.e. market A sells to B sells to C, when the edges A-B and B-C combined are cheaper than A-C directly, or A-C directly just doesn't exist.

CPU-wise, it's... well, that's hard to quantify. As a ballpark, the new version takes maybe 5-6 seconds (fully dedicated to running the economy) to more or less stabilize, on my dev pc. It should also be able to run incrementally, though; if an iteration takes more than half a second it's quite a bit too much. Obviously CPU-dependent, hence "hard to quantify".


I also wonder if you considered an economy where the markets are more passive, and only set their prices based on current stockpiles, and where merchants -- independent or faction-owned -- drive the market through "buy low, sell high"? This has been rather successfully implemented in e.g. the X3 series.

I think that boils down to much the same thing as this new version is doing, as both favor making trades across higher price gaps first.


(I appreciate your curiosity/desire to help, but I'd hate for you to spend a lot of time on it. From my perspective, the new approach pretty much solves the problem!)
Title: Re: Economy Revamp
Post by: JMPicard on April 30, 2016, 02:56:46 PM

(I appreciate your curiosity/desire to help, but I'd hate for you to spend a lot of time on it. From my perspective, the new approach pretty much solves the problem!)


Allright! I got the impression you were only partially satisfied :> I'll let you know if I have any revelations about it in my dreams, then ;> (I simply enjoy problems like this, so I might look into it just for fun!)
Title: Re: Economy Revamp
Post by: Alex on April 30, 2016, 10:44:26 PM
Allright! I got the impression you were only partially satisfied :>

Well, I'd be more satisfied if it didn't run in O(n^2), but I suppose one can't have everything - and the actual performance is quite alright, since the constant factors are super low.

Might run into problems with the simulation when working in industry/outposts etc, but it *seems* in a good place to fit into that right now - certainly a good enough place that I don't want to mess with it until adding those things and seeing how it works out, to guide any potential changes.

I'll let you know if I have any revelations about it in my dreams, then ;> (I simply enjoy problems like this, so I might look into it just for fun!)

Much appreciated, and yeah, I hear you. It's fun stuff to dig into!
Title: Re: Economy Revamp
Post by: JT on May 04, 2016, 12:55:41 AM
Since "bigger icons" is out and "numeric overlays" is out, how about a special icon meant to represent "caselots" for a given commodity (like the board game Risk)?  It might not solve the problem entirely, but if there was a special "crate" or "barrel" icon that was readily distinguishable as being a multiple rather than another unit of the commodity (sounds like a challenge for David to distinguish supplies against ;-)), then you could replace the first few icons at the bottom (front) of the icon stack and it would help indicate very large quantities.  Say if the commodity load is greater than 50, then caselot icons would begin to appear, each representing 5 units, with 25 actual icons or some such always included in order to give a sense of scale.

This would create a disparity where ~49 commodities would appear bigger (49 icons) than 50 commodities (5 caselots + 25 icons), but that could be tuned to taste -- lowering the allowed number of "actual" icons, setting the required number of "actual" icons to equal the same threshold where caselots appear, etc.

We actually tried that, using MoO2 as inspiration - remember how science/food/production/pollution stacked and had 10x icons? Didn't work very well in Starsector due to the sheer number of different icons and their more representational nature. MoO2's icons were very abstract and there were only 4 categories, for 8 total icons, contained in three very clearly designated rows on the screen. Meanwhile Starsector has .. uh, what, 16 or something base for 32 total? (somewhat) arbitrarily placed on the screen. The market screen is already visually noisy and this just made it worse because suddenly the number of different icons doubled.

Were there unique "caselot" and "individual" icons for each commodity, or a re-used "caselot" graphic for every commodity?  I was actually suggesting the latter -- the same "caselot" graphic would be used for every commodity, and then the individual units of commodities themselves would distinguish that stack from the others.  Envisioning it in my brain, the only problem would be that it would start to "same-ify" the commodities rather than make it busier, since very large markets would just show a crapton of crates.  If the crates were hue-shifted to be similar to the commodities they represent, it might even accomplish the effect of "square" shapes representing lots and "dynamic" shapes representing individual loads, which might also work for better cognitive flow.

I'm probably just laying down track on a spur that's already miles behind your thought trains, though. ;-)
Title: Re: Economy Revamp
Post by: miljan on May 05, 2016, 04:12:45 AM
How big of negative impact will this have on people that dont have that good PC? I read that on dev computer it was ok, but I am more worried about my *** comp.
Title: Re: Economy Revamp
Post by: Alex on May 05, 2016, 09:40:17 AM
@JT: Yeah, I think you're pointing out some good problems with that approach :) Hue-shifting is... well, for one, it's adding an assumption that all commodity icons have unique hues, which, while true in vanilla at this point, is not a good assumption to make, especially when you consider mods.

@miljan: Shouldn't have an impact either way.
Title: Re: Economy Revamp
Post by: Deshara on May 06, 2016, 01:11:28 AM
I feel that chicomotzoc's market screen being an unmanageable cluster *** is a problem that doesn't necessarily need to be solved. It kind of fits, thematically
Title: Re: Economy Revamp
Post by: Linnis on May 08, 2016, 01:39:59 PM
This is good groundwork and all. But I am wondering what direction you are planning to take the economy in the game to? I got some questions and concerns...

From what I understand is that: Most trading is done behind the scenes with simple number swapping between markets. While if actual transport fleets is destroyed, there will be an "status effect" applied on the affected markets. Also, the trading automatically accounts and adjusts for smaller and large market interaction so small markets will not be "ignored"


Will this mean that players will not actually need to manage their own markets? Maybe we just need to prevent shipping from being destroyed?

Will we then get a tax on the profit of our markets that goes into the player credit count? And or access to market shipyard productions?

Will there be an option to decide who our markets trade with? Or ability to set up our own trading and production network?

From the current view of the game it seems fleet production also needs a rework... Because once its in player's hands, I don't think many people will be happy with the set value but random ships that come out of markets.

Then this also will prob lead to a market "shipyard" where perhaps somehow value is gathered so players and AI will create their ships from?
Title: Re: Economy Revamp
Post by: Alex on May 08, 2016, 02:53:46 PM
I feel that chicomotzoc's market screen being an unmanageable cluster *** is a problem that doesn't necessarily need to be solved. It kind of fits, thematically

I like the way you think :)

Will this mean that players will not actually need to manage their own markets? Maybe we just need to prevent shipping from being destroyed?

Will we then get a tax on the profit of our markets that goes into the player credit count? And or access to market shipyard productions?

Will there be an option to decide who our markets trade with? Or ability to set up our own trading and production network?

From the current view of the game it seems fleet production also needs a rework... Because once its in player's hands, I don't think many people will be happy with the set value but random ships that come out of markets.

Then this also will prob lead to a market "shipyard" where perhaps somehow value is gathered so players and AI will create their ships from?

Good questions, all. I'll just say that the new economy sim is meant to be flexible enough and/or adaptable enough to handle a range of answers to these questions, all of which are ones I've been thinking about. I don't want to get into any details, though, due to the answers not being quite settled yet.
Title: Re: Economy Revamp
Post by: kazi on May 08, 2016, 07:05:55 PM
<rant>

I have to admit, the displays for commodities feels absolutely uninterpretable to me. I have absolutely no idea what's going on in the economy either in the current build or this blog post (without studying each screen for a solid 10 minutes). There's all these icons, some of which it's impossible to tell how many of them there are when stacked (looking at you, organics), and some have red outlines, some have green, some don't have any, and I don't know what's going on.

Would it be possible to redo the graphics to more intuitively reflect what's going on? Because I have no idea what's happening except for those beautiful line graphs you've got going on. Like the line graphs are seriously the most exciting part of this update for me. That and the planet underlays.

</rant>

(I'll see if I can sketch up a better prototype.)
Title: Re: Economy Revamp
Post by: Alex on May 08, 2016, 08:07:30 PM
One thing to keep in mind is that there's mouseover information which provides detail/explains what's what. Some things are not going to be possible to glean just from the color coding (green is "good", ok, but what does it mean in a particular context?), but they can be learned from the mouseover info.

some of which it's impossible to tell how many of them there are when stacked (looking at you, organics),

Well, that's very much not a thing the UI is trying for. "5 icons of organics" is not particularly useful information. If you want a specific number - which isn't "5 icons", but rather "X units" - then that's available from the mouseover. The only thing that the group of icons is required to convey is relative size. I.E. can you tell that this group of organics is smaller/bigger/of similar size to another one? If so, the job's done.


Because I have no idea what's happening except for those beautiful line graphs you've got going on. Like the line graphs are seriously the most exciting part of this update for me. That and the planet underlays.

Honestly, I'm pretty excited both about the graphs and the planet underlays, myself :)

But I'm also excited about the UI. Seriously, I hope you give it a chance when you get your hands on it - I freely admit that the previous (i.e. currently out) version was not, uh, very elucidating. But this one "works", by which I mean it's given me a lot of insight into the economy of specific markets that I haven't had before, and it's done so in an at-a-glance fashion.
Title: Re: Economy Revamp
Post by: kazi on May 08, 2016, 08:24:09 PM
To me, something like this feels much more informative than a mass of icons- it's very easy to see how much the supply/demand is and how much of a shortfall/surplus there is for a given resource. The lazy person in me doesn't want to have to mouseover anything.

(http://i.imgur.com/ZWy84Sb.png)

Solid bar = demand met through imports or supply exported.
Black bar = demand unmet or supply that couldn't be sold (and was stockpiled). Values of unmet demand/stockpiled goods are in the -red/+green text respectively.

Negative values (left side) are a net demand, positive values are net supply. Perfectly met supply/demand through local production/consumption is a bar length of zero. We don't really care where the import or exports are from.

--------------------------------------------------------------------------------

Too many icons/bars to fit on the screen? Have the graph scroll down. Perhaps put higher volume icons at the top- so the player immediately knows what the top produced/demanded items are, the less important stuff is out of sight.

Still have space for more information? Maybe add a number that represents how much each commodity's market price is above or below sector average. In this example, drugs might be +78CR and metals are -15CR. The player can then determine that they actually might be able to make a profit by selling metal from a -15CR to a +7CR market.

*edit - added some labels that I shouldn't have left out
Title: Re: Economy Revamp
Post by: Alex on May 08, 2016, 08:35:46 PM
What's the black bar on the inside of some of the bars? Would I need to mouseover to find that out? :)

This seems like it'd work nicely if you were only concerned with stockpiles, and how far the stockpile is from... well, it's not exactly clear what - I'd say "demand level", but that's not entirely applicable to markets that produce the commodity but don't have demand for it. Still, "neutral price point" or whatever.

It doesn't show what the market is doing, though. Is it importing or exporting organics? Is it producing or consuming them? That's going to be of primary importance.
Title: Re: Economy Revamp
Post by: kazi on May 08, 2016, 08:47:18 PM
Solid bar = demand met through imports or supply exported.
Black bar = demand unmet or supply that couldn't be sold (and was stockpiled). Values of unmet demand/stockpiled goods are in the -red/+green text respectively.

Negative values (left side) are a net demand, positive values are net supply. Perfectly met supply/demand through local production/consumption is a bar length of zero. We don't really care where the import or exports are from.

I think.  ;)

*added some labels that I shouldn't have left out on the graph above
Title: Re: Economy Revamp
Post by: Alex on May 08, 2016, 10:50:13 PM
Hmm. I see what you're saying, but I think I have the same reaction to it that you have to the screenshots in the blog posts :)

Cases not handled, as far as I can see: market having both supply and demand of the same commodity (just showing the net isn't enough); market having both imports and exports of a commodity, but no local production or demand, because everything is shown in terms of supply and demand, which doesn't necessarily apply; higher-than-demand stockpiles of a commodity that's in demand.

Also doesn't differentiate between imports/production, and exports/consumption. E.G. are the organics that are being consumed produced locally, or imported?

It also feels, at least to me, considerably more difficult to parse at a glance. Say I look down the left side to see what the demand of the market is. That's already more eye movement than looking at a smaller area dedicated to demand.

Then, all I see are colored bars. If I want to figure out what all the commodities the market needs, I've got to, for each bar that points to the left, either read text or look at an icon to the right. Or remember what color is associated with the commodity, which is another requirement (each commodity having a unique color), which would be rather mod-unfriendly. Plus this isn't going to be good if one is color-blind.

So just to figure out what a market needs, it's not a glance, it's a bunch of looking at it closely and trying to remember what's what, because the info is spread out.

The point I'm trying to make is even if it looks cleaner, it feels a lot harder to actually use to answer some of questions the player might have when looking at this screen. They are "what does this market consume/produce/export/import", and "what demand is met/exceeded/etc" and the UI is built for those.

There may be other questions that turn out to be important, and if they turn out to be hard to answer with the UI, then it'll need to be adjusted accordingly. This actually brings up another point: which set of questions did you have in mind when designing that one? It doesn't seem to be the same ones - rather, it seems to be about answering the "demand met/stockpiles built up" questions, but not the other ones. It might then be useful for a pure "do I buy/sell this here or not" use case.

Which, fair enough, is just about what matters right now, but not in a (not too distant) future where markets are something the player has a direct hand in.

Edit: I do also want to say that I appreciate the feedback and the suggestions, and the time you've taken to mock this up. It's interesting to think about these things!
Title: Re: Economy Revamp
Post by: kazi on May 09, 2016, 06:51:38 PM
All valid points- after all, it only took me about an hour to whip that up, can't expect it to be a perfect job the first time around.  ;)

Anyhow, you're not forced to use my little graph idea- I just think that the way you display economic information could use a significant rework. Displaying masses of icons is really "busy" on the eyes and it's near impossible to tell what's going on.

Personally, I think you should focus on net supply or net demand more than production/consumption. Over supply (exports/stockpiling) or market shortfalls (imports/demand not met) are much more important to the player. We don't really care if a market is making tons of something and consuming it locally. Nothing is being bought and sold so it doesn't affect the greater Sector economy. This works the same way as GDP: if a farmer grows their own food and then eats it all, nothing gets contributed to GDP (no transaction occurred). In the same way, if Sindria makes tons of fuel and then consumes it all without it ever entering the market, no one cares. If Sindria makes tons of fuel and then exports it all at a dirt cheap price, that's some really important information with implications for trading and markets elsewhere.

TL;DR: Don't focus on production/consumption/demand/supply/import/export all in one screen (it's too much!). In my mind you should concentrate on displaying the amount of import/export relative to the actual supply/demand. Shortfalls and excesses are the cases where there's the potential for profit or indicate if a market needs player intervention in some way.

(Raw production/consumption should be relegated to mouseover text or a screen for each commodity.)
Title: Re: Economy Revamp
Post by: Megas on May 10, 2016, 02:08:23 PM
Production/consumption is kind of important if we can do things that impact that like scorching markets or killing the population... or build our own outposts and a new trade hub, and we need to siphon some of our production to build a war machine.
Title: Re: Economy Revamp
Post by: Clockwork Owl on May 10, 2016, 05:15:59 PM
War machines, you mean.  ;D
Title: Re: Economy Revamp
Post by: pigreko on May 12, 2016, 06:25:06 AM
OK, this is cool stuff.

I was waiting for something like this to develop. Honestly, I was a bit thrown away from the economic side of things in SS. Now I could finally understand where things go and why, which is awesome to understand the how the sector works... yet I felt sad when you said that those exchanges were not simulated by fleets. I WOULD HAVE LOVED to see those fleets build actual commercial routes, with maybe patrols going along those ways. Frankly I would have loved for the game to have any kind of "route" system somewhere...
Damn the more I see talks about economy and relations between different markets, the more I want to see it represented in in game events. For instance, should I keep raiding a safe trade route, maybe more patrols are spawned from the parent markets to defend it or less and better armed trade fleets are spawned. On the other side, if I disrupt the pirates raiding along a trade route, it could boost the economy of the involved markets.

Damn, the point is that all those relations between markets look interesting as hell, I cannot imagine what is brewing for the future... I just want to have the chance to go hands deep into those features.
Title: Re: Economy Revamp
Post by: Goumindong on May 23, 2016, 10:47:57 AM
Credits being a resource... also something I'd given some thought. For me, that feels like an unnecessary complication. I mean, what's the benefit? It's going to be confusing to the player, and my feeling is it would make it much more difficult for the simulation to stabilize. Especially if factions are capable of making more credits on demand, one would have to be careful to ensure there's no runaway inflation, etc. And then you'd need to adjust bounty payouts etc - lots of repercussions for unclear gains.
@Alex

As an economist it definitely is an unnecessary complication. At the end of the day, money must be neutral. So if you're looking for stable prices then simply not using actual money stocks solves that problem easily. The only person who has credits is the player, everyone else is buying on an inverse demand function.

From a certain point of view money debt anyway* so its much easier to just abstract the financial system and suggest that places have enough credits and more over not care when places go into debt/print money.

*Well, more than a certain point of view. But if you actually call money debt nutbars go nubar and i don't want to deal with it. Essentially anything that is zero maturity is debt and so money is functionally debt.

Quote
I think you might mean that factions buy and sell as a unit - i.e. you'd be buying ore from the Hegemony, rather than from a specific market
My thought here was that Markets would go to the global exchange and buy XYZ at whatever XYZ's bid prices were, hit their locally-available Credits, and then draw from the Faction if necessary.  Naturally, that would mean that some Factions would run at a deficit; but perhaps they could increase their tax rates and pay down their debt in exchange for slower economic growth in the short term, like the real world.

I agree about the black-market; that'd require some work to avoid various Bad Things.

Anyhow, I'll keep thinking about the n^2 issues; seems like there really ought to be ways to get it down to n passes without too much distortion, so that it's just not major weightlifting at all.  Probably the biggest issue is treating commodities as commodities, and not as local produce that needs to be re-bid every time a transaction occurs; a futures market would probably simplify things a lot.

n^2 is pretty low all things considered. Graphs (multiplication, solutions, etc) tend to be O(n^3) for a simple algorithm and have a currently limit at O(n^2.373). Economies, even simple ones, are pretty complicated.

It may be possible to get lower, but i would be skeptical. I.E. suppose each planet as an inverse production function and an inverse demand function. This takes in prices and outputs production and consumption. The difference between these is import or export quantity. And this can be done at O(n) where n is the number of markets. But now i have to assign exports to imports, get them to agree on a price, and then (maybe*) set another price. Which means that, almost assuredly, i need to do one calculation set for each planet and each other planet, which puts me at O(n^2)

*Unless you solve the entire system which would generate stable prices and stable trade routes and should be O(n^2.373) to O(n^3)