[WIP] Real-life economics OXP
Moderators: winston, another_commander
[WIP] Real-life economics OXP
A quick-and-dirty OXP that takes a stab at adding a touch of reality to trade in the Ooniverse. Link to latest version...
FRIENDLY WARNING:
Real-life economics modifies system.info.market, which makes permanent changes to the save file... so you might want to start a new game. That way there won't be any unsightly mess to clean up if you decide that you don't like the OXP.
FRIENDLY WARNING:
Real-life economics modifies system.info.market, which makes permanent changes to the save file... so you might want to start a new game. That way there won't be any unsightly mess to clean up if you decide that you don't like the OXP.
Last edited by Phasted on Wed Jan 22, 2014 4:52 am, edited 4 times in total.
Re: Real-life economics
Interesting idea! Certainly shakes things up for traders.Phasted wrote:A quick-and-dirty OXP that takes a stab at adding a touch of reality to trade in the Ooniverse. Give it a whirl...
There seem to be a few bugs in the commodities lists - Diso appears to be so Agricultural it gets an overflow error of some sort - there were 37TC of Computers on the market at 0.0Cr. each. (Prices can't be more than 102.0Cr, or they wrap, and the quantity is surprising for an Agri surrounded by Agris too) The rest of the prices there looked fairly plausible, though. Lave's prices were plausible for an Agri in an Agricultural region, but the quantities looked more like they were Industrial (no Liquor, no Fur, plenty of expensive Computers). Leesti, Zaonce, Qutiri and Aronar looked okay, though - maybe there's something not quite right in the Agricultural plists?
A few minor scripting bugs - in script.js,
system.infoForSystem
should be System.infoForSystem
and system.systemNameForID
should be System.systemNameForID
, to get the static methods rather than the instance methods.Also a couple of minor packaging issues - Oolite on Linux is case sensitive, so the CONFIG directory needs to be renamed to Config, and the Script.js file needs to be renamed to script.js, or it doesn't work at all.
Re: Real-life economics
Hi,
Just downloaded and unpacked the zip. Noticed that the Config Directory name is actually all in CAPITALS I think this may cause problems for Mac and Linux users. I currently have my WIN XP disks in and can't check until tomorrow.
Ironfist
Just downloaded and unpacked the zip. Noticed that the Config Directory name is actually all in CAPITALS I think this may cause problems for Mac and Linux users. I currently have my WIN XP disks in and can't check until tomorrow.
Ironfist
64bit Mint 10 and Win 8 64bit on E8400 at 3.6GHz - ATI HD5750 graphics.
Concentration is the ability to think of absolutely nothing when it is absolutely necessary.
Concentration is the ability to think of absolutely nothing when it is absolutely necessary.
Re: Real-life economics
Thanks to cim, Ironfist, and Svengali for helpful hints... I didn't know case-sensitivity was an issue (I've never used a Mac or Linux machine ).
Currently at work on next test version, which will include:
- code to modify a system's economy (migrating toward Mainly AG/IND) if the player visits too often.
- an updated commodities.plist (though I dread the thought of wrestling with that bear again ).
- occasional interaction with the quietly homicial trader/pirates of Fast Eddie's Faster-Than-Light Transport Company.
Coming soon to an internet connection near you!
Currently at work on next test version, which will include:
- code to modify a system's economy (migrating toward Mainly AG/IND) if the player visits too often.
- an updated commodities.plist (though I dread the thought of wrestling with that bear again ).
- occasional interaction with the quietly homicial trader/pirates of Fast Eddie's Faster-Than-Light Transport Company.
Coming soon to an internet connection near you!
-
- Above Average
- Posts: 19
- Joined: Fri Feb 17, 2012 5:11 pm
Re: Real-life economics
Just saw this and haven't had a chance to download and look at it yet but wanted to comment that I'd had the same idea of tweaking the economics and I wondered how you'd done it. I see you altered the system.info.market but I didn't realise that could be set from within javascript functions.
My intent was to add a ships_override.plist that provided a list of roles for all known stations that used the default commodities list. These roles defined the available commodities lists and I have created a base commodities market for each economy type. Upon creation of the station the primary role of the station would change to be the appropriate commodity list depending on the economy of the system. This doesn't affect it's role as a station as that does not need to be defined as a primary role, but it does change the commodity list used as that is chosen based on primary role if system.local.market is not provided. This doesn't then require alterations to the save file.
I'll also be interested in how you reconfigured the commodities for the various economies. If you're interested let me know and we'll compare ideas.
My intent was to add a ships_override.plist that provided a list of roles for all known stations that used the default commodities list. These roles defined the available commodities lists and I have created a base commodities market for each economy type. Upon creation of the station the primary role of the station would change to be the appropriate commodity list depending on the economy of the system. This doesn't affect it's role as a station as that does not need to be defined as a primary role, but it does change the commodity list used as that is chosen based on primary role if system.local.market is not provided. This doesn't then require alterations to the save file.
I'll also be interested in how you reconfigured the commodities for the various economies. If you're interested let me know and we'll compare ideas.
Re: Real-life economics
The central idea is the Economic Balance [this.econBalance].realbrit70 wrote:Just saw this and haven't had a chance to download and look at it yet but wanted to comment that I'd had the same idea of tweaking the economics and I wondered how you'd done it.
Every system is at the center of its own cluster of stars. A cluster consists of every system within 7 LY. Clusters are either Industrial (this.econBalance < 0), Agricultural (this.econBalance > 0), or at equilibrium (this.econBalance == 0).
Every system in the cluster is assigned a value from -4 to +4, depending on its economy (RichInd is -4; PoorAg is +4) and its distance from the player's present system (the greater the distance, the lower the influence of that system on this.econBalance).
There are other factors. The distance to the nearest agricultural system is subtracted from the distance to the nearest industrial system, and that number is added to this.econBalance. Then the total number of industrial systems is subtracted from the total number of agricultural systems. This result is also added to this.econBalance.
I've done a few systems "by hand" to ensure that the code is actually doing what I intended it to do. The results for Malama and Qudira (in galaxy 0) are:
-------------------------------------------------------------
Malama [RI -4] econBalance: -12.1 Market: "IND_over_AG_4"
NearestAgSystem 1.2 LY / NearestIndSystem 3.6 LY [+2.4]
AgEconomies 4 / IndEconomies 7 [-3]
-------------------------------------------------------------
Malama is 6.4 light-years from Zaatxe [RI -1.5]
Malama is 4 light-years from Esbiza [RI -2]
Malama is 6.8 light-years from Alaza [AA +0.5]
Malama is 4.8 light-years from Soinuste [PI -2]
Malama is 5.6 light-years from Celabile [MA +0]
Malama is 1.2 light-years from Qudira [PA +3]
Malama is 3.6 light-years from Inines [RI -2]
Malama is 6.4 light-years from Bierle [RI -1.5]
Malama is 6 light-years from Edreor [MA +0]
Malama is 6.8 light-years from Anle [RI -1]
Malama is 6.8 light-years from Tianve [RI -1]
-------------------------------------------------------------
Qudira [PA +4] econBalance: -15.8 Market: "AG_under_IND_4"
NearestAgSystem n/a / NearestIndSystem 1.2 LY [-5.8]
AgEconomies 2 / IndEconomies 6 [-4]
-------------------------------------------------------------
Qudira is 3.2 light-years from Esbiza [RI -2]
Qudira is 1.2 light-years from Malama [RI -3]
Qudira is 6.8 light-years from Aate [MI -0]
Qudira is 3.2 light-years from Soinuste [PI -1]
Qudira is 6.8 light-years from Celabile [MA +0]
Qudira is 4.4 light-years from Inines [RI -2]
Qudira is 4.8 light-years from Bierle [RI -2]
Qudira is 6.8 light-years from Edreor [MA +0]
-------------------------------------------------------------
I hope this answers your question.
- Dr.Tripsa
- Dangerous
- Posts: 84
- Joined: Mon Apr 30, 2012 9:33 pm
- Location: In your cargo bay, eating your chips.
Re: Real-life economics
should different Governments have different economies?
for instance Communist:
takes all 'profits' from sales
while providing 'free' fuel and maintenance
this is semi tongue in cheek BUT would be realistic
for instance Communist:
takes all 'profits' from sales
while providing 'free' fuel and maintenance
this is semi tongue in cheek BUT would be realistic
Re: Real-life economics
Love the idea, going to grab it...
Re: Real-life economics
Test version 0.03 is now available for your downloading pleasure...
• Case-sensitivity issues are now resolved...
• NEW and IMPROVED commodities.plist...
Again, I offer heart-felt apologies to those who downloaded test version 1 and found it lacking...
I shouldn't have been in such a hurry to turn it loose.
• Case-sensitivity issues are now resolved...
• NEW and IMPROVED commodities.plist...
Again, I offer heart-felt apologies to those who downloaded test version 1 and found it lacking...
I shouldn't have been in such a hurry to turn it loose.
Last edited by Phasted on Fri May 18, 2012 1:57 pm, edited 1 time in total.
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Real-life economics
It was a test version - nobody would expect it to be perfect, and I can understand your keen-ness to release. I'm sure there is not an author out there who isn't keen to show off what they've made.Phasted wrote:Again, I offer heart-felt apologies to those who downloaded test version 1 and found it lacking...
I shouldn't have been in such a hurry to turn it loose.
Commander Smivs, the friendliest Gourd this side of Riedquat.
Re: Real-life economics
This is getting to be a bad habit...
While I was testing the OXP, I modified
Then, in a lightning stroke of genius, I forgot to change it back...
If you've downloaded test version 0.02, you'll find that the economy of a system changes (migrating toward Mainly Agricultural/Mainly Industrial) if you visit more than 3 times in 500 hours... not at all what I intended.
I'm gonna get the hang of this eventually.
While I was testing the OXP, I modified
this.checkForEconomyChange()
, to make sure it really did what it was supposed to do.Then, in a lightning stroke of genius, I forgot to change it back...
If you've downloaded test version 0.02, you'll find that the economy of a system changes (migrating toward Mainly Agricultural/Mainly Industrial) if you visit more than 3 times in 500 hours... not at all what I intended.
I'm gonna get the hang of this eventually.
Last edited by Phasted on Fri May 18, 2012 1:59 pm, edited 3 times in total.
- Cody
- Sharp Shooter Spam Assassin
- Posts: 16081
- Joined: Sat Jul 04, 2009 9:31 pm
- Location: The Lizard's Claw
- Contact:
Re: Real-life economics
Don't fret about that, Phasted. I'd only add that you should remind people to restart the game with shift held down until the spinning Cobra appears if anything internal has been changed (such as replacing a script).Phasted wrote:This is getting to be a bad habit.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
And any survivors, their debts I will certainly pay. There's always a way!
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Real-life economics
That's a bit radical isn't it? I would think restarting Oolite with Shift held down should be enough.Phasted wrote:• Restart your computer (if necessary)
Re: Real-life economics
El Viejo wrote:...you should remind people to restart the game with shift held down until the spinning Cobra appears if anything internal has been changed (such as replacing a script).
Honestly, I had no idea... I've been going through hell every time I make changes to my OXP's.another_commander wrote:I would think restarting Oolite with Shift held down should be enough.
Re: Real-life economics
Oolite will reload the OXPs rather than using its cache if any of the following are true:Phasted wrote:Honestly, I had no idea... I've been going through hell every time I make changes to my OXP's.
1) The contents of the AddOns folder have changed
2) The timestamp of any of the OXP folders with the AddOns folder is later than the cache date. It does not, however, check the dates within the OXP folders.
3) The version of Oolite is different to the version used to generate the cache (rare!)
4) Shift is held when starting Oolite
...I may have forgotten some others, too.
I tend to use '2' when building OXPs. I develop the OXP outside of the AddOns folder, and then have a short script which deletes the copy of the OXP in AddOns, and copies my development version in, which I run whenever I want to test changes. That makes certain that the timestamp is fresh and so Oolite will reload the OXPs. Much easier than holding down Shift and hoping it works...