ECON: Planetary classification

Talk among developers, and propose and discuss general development planning/tackling/etc... feature in this forum.
Post Reply
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

ECON: Planetary classification

Post by pheonixstorm »

While the automate thread is getting a bit off topic I came across this idea.

Currently you have planets that are labeled by type but given no other information on what it is or does.

So, what exactly does an aquatic planet do? Is it research, mining, manufacturing, agriculture??

Orbital installations seem pretty much self explanitory. Mining, refinery, relay, fighter, etc. But the line still gets a little fuzzy. Relay and fighters should only be a net importer with little useful cargo to export.. but should be a better mission hub especially for fixers. A mining base shouldn't be a good source for refined products either. Everything they sell is raw material. Everything they import should be entertainment, mining equipment, food, and water. I noticed that Atlantis has a higher water price than serinity!.

To truely understand how this works currently we need to find how it is handled in the code... something that seems more difficult that it should be.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
Boaal
Hunter
Hunter
Posts: 93
Joined: Sun May 06, 2007 6:43 pm

Re: ECON: Planetary classification

Post by Boaal »

Well, planets are vast things, so it'd be hard to restrict them to just a single economy - they'd never run!

The only solution I can really think of is to somehow make traders and vessels actually trade cargo and goods with stations who sell their stock to the ai and round and round it goes. But that's incredibly complex to set up a running dynamic economy.

Maybe some of the stations won't deal in certain goods which then eliminates the semi-randomness of what you'll find in these places, a commerce centre or a trade hub, I'd assume you'll find all sorts of goods there, that would be a good place to have a pretty randomised stock.
The Twitching Pattern - http://www.last.fm/music/The+Twitching+Pattern
Have a listen.
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: ECON: Planetary classification

Post by Deus Siddis »

pheonixstorm wrote: Currently you have planets that are labeled by type but given no other information on what it is or does.

So, what exactly does an aquatic planet do? Is it research, mining, manufacturing, agriculture??

Orbital installations seem pretty much self explanitory. Mining, refinery, relay, fighter, etc. But the line still gets a little fuzzy. Relay and fighters should only be a net importer with little useful cargo to export.. but should be a better mission hub especially for fixers. A mining base shouldn't be a good source for refined products either. Everything they sell is raw material. Everything they import should be entertainment, mining equipment, food, and water.
Totally agree.
I noticed that Atlantis has a higher water price than serinity!.

To truely understand how this works currently we need to find how it is handled in the code... something that seems more difficult that it should be.
This kind of example makes me wonder if there even is any code for handling commodity prices at locations, besides a random number generator? That is, the current engine might treat every location's market equally, without knowing any difference.
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: ECON: Planetary classification

Post by pheonixstorm »

Just in the data files there are several locations which have import data. The first being inside units.csv

Code: Select all

Cargo_Import
{Cat(string);price(percentage);pricestddev(percentage);quant(percentage);quantstddev(percentage)}

{Consumer_and_Commercial_Goods/Domestic;1;.1;2;2}
Cat: Category
Price: % of base price?
pricestddev: Price standard deviation is my guess.
quant: % of base quantity? what is the base quantity anyway??
quantstddev: Another Deviation. I can see what the two deviation lines do.

and

Code: Select all

Cargo
{filename(string);Category(string);price(credits);quant(int);mass(metric Tons);volume(meters*meters*meters);functionality(percentage);maxfunctionality(percentage);description(string);missionCargo(bool)}

{Iron_Ore;Raw_Materials/Ores;0;4;1;2;1;1;;0}{Tungsten_Ore;Raw_Materials/Ores;0;1;1;2;1;1;;0}
This second bit was found on line 198 listed as asteroid.cargo That makes it sound like you can tractor in small asteroids for mineral cargo. Asteroid mining anyone??

Now, the next file to show any import/export can be found under /units/factions/planets the file has no extention. The same goes for bases, though those are more scattered about. The example below is under ocean.

Code: Select all

<!--Last Edited by: Daniel-->
<!--23MAY01-->
<Unit>
	<Hold volume="100000000000">
		<Category file="Natural_Products/Food">
			<import price=".75" pricestddev=".15" quantity="25" quantitystddev="25"/>
		</Category>
		<Category file="Natural_Products/Liquor">
			<import price="1.17" pricestddev=".1" quantity="0" quantitystddev="0"/>
		</Category>
		<Category file="Natural_Products/Plants">
			<import price=".77" pricestddev=".22" quantity="20" quantitystddev="12"/>
		</Category>
		<Category file="Natural_Products/Natural_Resources">
			<import price=".82" pricestddev=".1" quantity="15" quantitystddev="25"/>
		</Category>
		<Category file="Raw_Materials/Metals/Crude">
			<import price=".8" pricestddev=".1" quantity="12" quantitystddev="5"/>
		</Category>
		<Category file="Raw_Materials/Metals/Precious">
			<import price=".4" pricestddev=".1" quantity="0" quantitystddev="0"/>
		</Category>
		<Category file="Raw_Materials/Metals/Alloys">
			<import price=".8" pricestddev=".1" quantity="2" quantitystddev=".2"/>
		</Category>.....
I just wonder if these are still being used or not since units.csv has a cargo_import section that holds pretty much the same data.

Found some additional trading data under /modules/trading.py

So, the trading data is fairly random in nature but not very dynamic. Next up is to find where in the c++ code the python file gets called. Either we have to redesign the python file or design a new trading module to stick in the code. As an added complexity we may need to have a means to allow a switch for mods such as Priv GG (or does anyone care?)
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: ECON: Planetary classification

Post by Deus Siddis »

pheonixstorm wrote: So, the trading data is fairly random in nature but not very dynamic. Next up is to find where in the c++ code the python file gets called. Either we have to redesign the python file or design a new trading module to stick in the code.
Since an overhaul is needed, there could be some good ideas to be found in this big thread:

Defining a New Economic System for Future Versions
breese
Bounty Hunter
Bounty Hunter
Posts: 152
Joined: Thu Sep 02, 2010 8:00 pm

Re: ECON: Planetary classification

Post by breese »

pheonixstorm wrote:

Code: Select all

Cargo_Import
{Cat(string);price(percentage);pricestddev(percentage);quant(percentage);quantstddev(percentage)}

{Consumer_and_Commercial_Goods/Domestic;1;.1;2;2}
Cat: Category
Price: % of base price?
pricestddev: Price standard deviation is my guess.
quant: % of base quantity? what is the base quantity anyway??
quantstddev: Another Deviation. I can see what the two deviation lines do.
Here is my understanding of how these values work.

Each cargo type has a baseline price defined in master_part_list.csv. This baseline price can be adjusted up or down for each type of planet or station with the "price" setting, and the "pricestddev" setting specifies how much the actual price may vary. The actual price on a given instance of planet or station is chosen within the price range. So, the actual price is calculated by choosing a random number in the range of "baseline * [price - pricestddev; price + pricestddev]". The random number is uniformly distributed, so it is not really a standard deviation as we know it from statistics.

The quantity is simpler, because there is no baseline quanity. The actual quanity is selected randomly from the range "[quant - quantstddev; quant + quantstddev]". A negative quantity is the same as no quanity, so if quant = 10 and quantstddev = 20, which gives us the range [-10; 30], then the station will only carry the cargo with a probability of 75%, and when it does it may have between 1 and 30 items.

If you want to see the full horror-show (it gets more complicated by config variables that I have omitted above) of how the actual prices and quantities are calculated, look at Unit::ImportPartList() in src/cmd/unit_generic.cpp.
Post Reply