[WIP] New Deal Economies (for Oolite 1.81)

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [WIP] New Deal Economies (for Oolite 1.81)

Post by Cholmondely »

Milo wrote: Mon Jul 12, 2021 1:13 am
I realize I'm bumping an older thread here, but Cholmondely, your assumption is incorrect. See for example, this script reference which shows one of the ways in which secondary markets can be modified by OXPs independently from the main planet of the system.

Also, it may be of interest in the context of this discussion to review the SW_Economy OXP. It is another recent take on economic tweaking. I stumbled across it while hunting for the above script reference link, having not seen it before.
SW Economy is superb - I highly recommend it (and it's been a permanent inmate of my ManagedAddOns folder since Stranger published it)! And please note that Phkb has just now come out with a test version of his Risky business.oxz mixing his effects with those of Cim's Risk-based Economy: His OXZ is tweakable via library config to give the effects of either or both.

I tried to summarise all of the various possibilities here: http://wiki.alioth.net/index.php/Economics - & here: http://wiki.alioth.net/index.php/Oolite_Trading - please critique!

I don't quite understand all of your Market Scripts page - am I correct in presuming that the possible secondary markets are merely modifications of the primary orbital market (ie - based on them but one can modify the primary prices and quantities?). If that is so, how easy is it to simulate a mining planetary economy on the secondary planet of a Highly Agricultural System (high prices for food, alcohol & textiles with barely any for sale, but oodles of minerals, gold, etc selling at rock-bottom prices)?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 462
Joined: Mon Sep 17, 2018 5:01 pm

Re: [WIP] New Deal Economies (for Oolite 1.81)

Post by Milo »

Cholmondely wrote: Mon Jul 12, 2021 4:36 pm
I don't quite understand all of your Market Scripts page - am I correct in presuming that the possible secondary markets are merely modifications of the primary orbital market (ie - based on them but one can modify the primary prices and quantities?).
Essentially correct, but see below.
Cholmondely wrote: Mon Jul 12, 2021 4:36 pm
If that is so, how easy is it to simulate a mining planetary economy on the secondary planet of a Highly Agricultural System (high prices for food, alcohol & textiles with barely any for sale, but oodles of minerals, gold, etc selling at rock-bottom prices)?
Following links from that Market Scripts page, you can find this for example:

http://wiki.alioth.net/index.php/Shipda ... definition

From this you can see that the secondary markets have Shipdata.plist entries with market definitions, which are pre-defined modifiers supplied by the OXP maker, putting capacity limits or adjustments on the goods available in the secondary market, relative to the main station market in any system where the secondary market appears. So, that gives a baseline divergence for secondary markets compared to the main station.

At the top of the Market Scripts page it shows how some other OXP can make further adjustments. Each individual commodity in each market in the system passes through a series of script callbacks in any OXP that listens for those callbacks, and those script callbacks can modify any aspect of that commodity in that market -- changing price, quantity, etc.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [WIP] New Deal Economies (for Oolite 1.81)

Post by Cholmondely »

Milo wrote: Mon Jul 12, 2021 8:11 pm
Cholmondely wrote: Mon Jul 12, 2021 4:36 pm
I don't quite understand all of your Market Scripts page - am I correct in presuming that the possible secondary markets are merely modifications of the primary orbital market (ie - based on them but one can modify the primary prices and quantities?).
Essentially correct, but see below.
Cholmondely wrote: Mon Jul 12, 2021 4:36 pm
If that is so, how easy is it to simulate a mining planetary economy on the secondary planet of a Highly Agricultural System (high prices for food, alcohol & textiles with barely any for sale, but oodles of minerals, gold, etc selling at rock-bottom prices)?
Following links from that Market Scripts page, you can find this for example:

http://wiki.alioth.net/index.php/Shipda ... definition

From this you can see that the secondary markets have Shipdata.plist entries with market definitions, which are pre-defined modifiers supplied by the OXP maker, putting capacity limits or adjustments on the goods available in the secondary market, relative to the main station market in any system where the secondary market appears. So, that gives a baseline divergence for secondary markets compared to the main station.

At the top of the Market Scripts page it shows how some other OXP can make further adjustments. Each individual commodity in each market in the system passes through a series of script callbacks in any OXP that listens for those callbacks, and those script callbacks can modify any aspect of that commodity in that market -- changing price, quantity, etc.
Umm... so does it work like this:

The market is composed of just the two elements: a random factor and a modifier (eg.: extreme agricultural/extreme industrial/etc.).

If I replace the orbital station modifier with another, then I can easily transmogrify the market from (say) an e.a. to an e.i. ?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 462
Joined: Mon Sep 17, 2018 5:01 pm

Re: [WIP] New Deal Economies (for Oolite 1.81)

Post by Milo »

Cholmondely wrote: Mon Jul 12, 2021 9:40 pm
Umm... so does it work like this:

The market is composed of just the two elements: a random factor and a modifier (eg.: extreme agricultural/extreme industrial/etc.).

If I replace the orbital station modifier with another, then I can easily transmogrify the market from (say) an e.a. to an e.i. ?
Just two elements? No, no... Have a look at this:

http://wiki.alioth.net/index.php/Trade-goods.plist
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [WIP] New Deal Economies (for Oolite 1.81)

Post by Cholmondely »

Milo wrote: Mon Jul 12, 2021 9:47 pm
Cholmondely wrote: Mon Jul 12, 2021 9:40 pm
Umm... so does it work like this:

The market is composed of just the two elements: a random factor and a modifier (eg.: extreme agricultural/extreme industrial/etc.).

If I replace the orbital station modifier with another, then I can easily transmogrify the market from (say) an e.a. to an e.i. ?
Just two elements? No, no... Have a look at this:

http://wiki.alioth.net/index.php/Trade-goods.plist
Alas... meaningless to me... not being a programmer, I don't have the context to understand what the page is saying - never mind having the ability to sort out the wheat from the chaff. It does look impressively complex, though!
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 462
Joined: Mon Sep 17, 2018 5:01 pm

Re: [WIP] New Deal Economies (for Oolite 1.81)

Post by Milo »

Cholmondely wrote: Mon Jul 12, 2021 9:51 pm
Alas... meaningless to me... not being a programmer, I don't have the context to understand what the page is saying - never mind having the ability to sort out the wheat from the chaff. It does look impressively complex, though!
Indeed. In short there are many factors involved, some dependent on the system economy level, some not. Tweaking the economy is an object lesson in the https://en.wikipedia.org/wiki/Butterfly_effect
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [WIP] New Deal Economies (for Oolite 1.81)

Post by Cholmondely »

Milo wrote: Mon Jul 12, 2021 9:58 pm
Cholmondely wrote: Mon Jul 12, 2021 9:51 pm
Alas... meaningless to me... not being a programmer, I don't have the context to understand what the page is saying - never mind having the ability to sort out the wheat from the chaff. It does look impressively complex, though!
Indeed. In short there are many factors involved, some dependent on the system economy level, some not. Tweaking the economy is an object lesson in the https://en.wikipedia.org/wiki/Butterfly_effect
Righty-ho! Having read through Phkb's magnum opus a couple of times, let me give it another go!

The property keys are used to create a template for each of the 8 basic economies (poor agri'l <-> rich ind'l). The interaction between these templates and the random factors creates the changing market I find at the orbital station.

The secondary market's template can be tweaked with these property keys - and also with the secondary market definitions (as can the primary orbital if eg. Lave.oxp or Tianve.oxp so defined it). This could be done in such a way as to create another identical template to one of the 8 basic economies. Or to create a much less variable market such as that on an unmodified Deep Space Dredger with exactly 36TC of alloys on sale for exactly 0.4₢/TC. Or something more butterfly-ish.
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 462
Joined: Mon Sep 17, 2018 5:01 pm

Re: [WIP] New Deal Economies (for Oolite 1.81)

Post by Milo »

Cholmondely wrote: Tue Jul 13, 2021 1:22 am
The property keys are used to create a template for each of the 8 basic economies (poor agri'l <-> rich ind'l). The interaction between these templates and the random factors creates the changing market I find at the orbital station.

The secondary market's template can be tweaked with these property keys - and also with the secondary market definitions (as can the primary orbital if eg. Lave.oxp or Tianve.oxp so defined it). This could be done in such a way as to create another identical template to one of the 8 basic economies. Or to create a much less variable market such as that on an unmodified Deep Space Dredger with exactly 36TC of alloys on sale for exactly 0.4₢/TC. Or something more butterfly-ish.
Second paragraph is correct, but note that market definitions can be either in the shipdata.plist under the market_definition property, or they can be scripted in a .js file (in this case, the market_script property in the shipdata.plist for the station containing that market would point to the desired .js file, and the market_definition property for that station would be ignored).

First paragraph is almost correct. Each trade good has a single template definition, not eight separate definitions. The economy value (0 - 7) applies modifiers, so the single template does represent eight separate templates, but you don't edit them separately. Look at the descriptions of the properties peak_export, peak_import, price_economic and quantity_economic on the trade_goods.plist wiki page.

For reference, http://wiki.alioth.net/index.php/Planet ... st#Economy lists the correspondence between the economy number and what you see in-game (poor agri'l <-> rich ind'l).

On top of all of this, market scripts come into the picture. There can be a market_script (pointer to a .js file) for the station itself; that works as I described above, allowing you to override the market_definition. There can also be a separate market_script for each trade good. Such commodity-specific scripts will run for every station and secondary station, as described at the top of the market scripts market scripts wiki page, first running for the main station, then for each secondary station that appears in the system, so the script can make decisions based on the main station market, the current system, etc.

Since the commodity-specific scripts are defined in the trade goods plist, which is a globally shared list, if multiple OXPs want to make tweaks by adding their own market scripts for each commodity, they will run into a conflict because there can only be one script attached to each trade good. There are ways around that, of course, but in general this means that only one OXP can do global tweaks of this type.

Each OXP that adds a secondary market can use the shipdata.plist properties market_definition and market_script without interfering with other OXPs (unless another OXP is intentionally overriding the same shipdata.plist entry).
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [WIP] New Deal Economies (for Oolite 1.81)

Post by Cholmondely »

New wiki page now up: http://wiki.alioth.net/index.php/New_Deal

Desperate attempt to try and get somebody to take this further...
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [WIP] New Deal Economies (for Oolite 1.81)

Post by Cholmondely »

This does not seem to work on my AppleMac (no icon replacement on the F6 screen, no obvious changes in commodity prices) - and there are no obvious error messages either (latest.log).

Does it work on Windows or Linux?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Post Reply