Page 6 of 8

Re: Midway step in refactoring trade

Posted: Tue Mar 06, 2012 2:18 am
by loki1950
Maybe they are like camp followers in the middle ages :D And just tag along in plowshares and such :wink:
Most command types might hope for a friendly fire incident involving the the petty coat brigade.

Enjoy the Choice :)

Re: Midway step in refactoring trade

Posted: Tue Mar 06, 2012 2:47 am
by travists
Now there is a new upgrade class! Recreation facilities. What would the Luddites do if they found you with some of them? :twisted: Still good way to make a few credits if you can avoid being shot. No rec centers is fine with me. We'll do planets later.

Re: Midway step in refactoring trade

Posted: Tue Mar 06, 2012 2:55 am
by travists
OK, Some sectors have repeats but here is my production list

Code: Select all

Basic Goods Types
I: Primary Producers
	A: Mining
		1: Small Asteroids
		2: Ore
		3:Mixed Gasses
		4: Space Ice
	B: Agricultural
		1: Raw Foodstuff
		2: Plants
		3:Animals
II: Secondary Producers
	A:  Refining
		1: Metals
		2: Alloys
		3: Chemicals
		4: Separated Gasses and Gas Blends
		5: Drinkable Water
	B: Food Processing
		1: Processed Foods
		2: Animal Feed
		3: Food Byproduct (industrial additives)
III: Manufacturing:
	A: Shipyard
		1: Ships
		2: Recycled Materials
	B: Factory (Consumer)
		1: Consumer Goods
		2: Recycled materials
		3: Food Packs/ Highly processed or synthesized food
	C: Factory (Industrial)
		1: Mining Equipment
		2: Ag Equipment
		3: Refining Equipment
		4: Food processing Equipment
		5: Recycled Materials
	D: Factory (Ships)
		1: ship upgrades
		2: ship Subassemblies
		3: very small ships
		4: recycled materials
	E: Factory (munitions)
		1: Guns
		2: Missiles
		3: Other weapons
		4: recycled materials
	C: Pharmaceutical 
		1: Drugs
		2: Medical Items
IV: End consumer
	A: fighter base
		1: Surplus/outdated milspec upgrades
		2: Decommissioned ships
		3: Recycled materials
	B: Star fortress
		1: Recycled Materials
		2: Bio waste
	C: Outpost
		1: Recycled Materials
	D: Residential
		1: recycled materials
		2: Bio-waste
V: Special
	A: Medical
		1: Recycled Materials
		2: Bio waste
		3: Passengers
B: Research
	1: researched material

Re: Midway step in refactoring trade

Posted: Tue Mar 06, 2012 5:20 am
by klauss
travists wrote: Shaper Bio-Adaptation: Just what are these anyway? Without a known function (or canonical necessity) I'm inclined to use the model for Shaper bases and drop this one.
From what I've heard of shaper, maybe something in-between medical and factory?

Anyway, there doesn't have to be a model per station type. The model for a medical would work for many applications, within reason.

So, a shipyard would most likely be always a shipyard, because it's quite specialized. But medical could stray a bit into other tasks, as well as commerce and many other types.

Re: Midway step in refactoring trade

Posted: Thu Mar 08, 2012 10:46 pm
by travists
Now what is the best direction for implementation?
Ideally we will have several factions, each having several base types, and each type with multiple iterations, and every individual iteration has production, consumption, import, export values for every purchasable item and every item references other items for price.

Saving can add a CSV file with entries like
Base Name, Base type, Location, Good1(P,C,I,E),Good2((P,C,I,E),etc.
And I suppose a basic
Base type, Good1(P,C,I,E,variance),Good2(P,C,I,E,variance), will work for initial values
But do we count a Machinist mining base and a Purist mining base as two different base types or have a faction modification table? What happens when a base changes hands?

How about production and cost tables? Does someone have a better way then

good1 | %good1 | %good2 | %good3 | etc
good2 | %good1 | %good2 | %good3 | etc
good3 | %good1 | %good2 | %good3 | etc
etc.

Do we want to include a faction specific contraband list with this? Such a list would include each faction along with items that that group deems illegal. A related list could include systems and banned goods in that system. For example In system "A" "Guns" are perfectly legal and quite cheep. They are legal in system "C" as well, but rather expensive. However to get from "A" to "C" you must travel through system "B" where "Guns" are utterly banned except for those mounted on passing ships.

Lastly, how much of the data am I making on my own? Without help, this may take a while...

Re: Midway step in refactoring trade

Posted: Thu Mar 08, 2012 11:16 pm
by klauss
travists wrote:Now what is the best direction for implementation?
Ideally we will have several factions, each having several base types, and each type with multiple iterations, and every individual iteration has production, consumption, import, export values for every purchasable item and every item references other items for price.
First, I think, would be deciding on the data format for the economic database. I mean, base classification, which base produces which out of what, production formulas (what needs to be consumed to produce what), etc.

The format should be the easiest for modding, base scripts (python) can read whatever you throw at it.
travists wrote: Saving can add a CSV file with entries like
Base Name, Base type, Location, Good1(P,C,I,E),Good2((P,C,I,E),etc.
And I suppose a basic
Base type, Good1(P,C,I,E,variance),Good2(P,C,I,E,variance), will work for initial values
But do we count a Machinist mining base and a Purist mining base as two different base types or have a faction modification table? What happens when a base changes hands?
The savegame should simply contained a serialized version of the economic structures. There's already a lot of code for space-efficient serialization, and even better ways can be developed if needed. Savegame data does not need to be moddable, and storing a serialized representation of in-memory structures will help preserve all the subtleties of the economic system.
travists wrote: How about production and cost tables? Does someone have a better way then

good1 | %good1 | %good2 | %good3 | etc
good2 | %good1 | %good2 | %good3 | etc
good3 | %good1 | %good2 | %good3 | etc
etc.
Production formulas should be a representation of:

Product = Q1 x Consumable 1 + Q2 x Consumable 2 + ... + Qn x Consumable n

However, it should be easily moddable. Maybe a structureless CSV, maybe just a text file with some easy to read/mod format.
travists wrote: Do we want to include a faction specific contraband list with this? Such a list would include each faction along with items that that group deems illegal. A related list could include systems and banned goods in that system. For example In system "A" "Guns" are perfectly legal and quite cheep. They are legal in system "C" as well, but rather expensive. However to get from "A" to "C" you must travel through system "B" where "Guns" are utterly banned except for those mounted on passing ships.
I don't think so. Contraband needs tighter integration with the engine, so that police AI can spot contraband. ATM, I think, contraband is detected by belonging to the "Contraband/" category, but that's not faction-dependant AFAIK. So Rlaan AI would be sensitive to all kinds of contraband, not just Rlaan contraband. We would have to check/expand on this though.
travists wrote:Lastly, how much of the data am I making on my own? Without help, this may take a while...
Right now, the priority is getting the release out. I'm working on finishing gas giant shaders (which are almost ready but I haven't committed yet because of lack of testing), because I'd like to be able to release with them.

After the release, I can certainly help implementing all the necessary code for that. Data production, however, is not my strong side.

Re: Midway step in refactoring trade

Posted: Fri Mar 09, 2012 12:06 am
by travists
So far I have Bases categorized into economic sector and general type. I've also got several generalized goods types. One of my questions remains though, is a base type from one faction fundamentally different from the analogous type from another faction (especially the different human groups) and thus requiring lengthy development of each base-faction combination, or are faction preferences and base type general production values separate?
klauss wrote:Production formulas should be a representation of:

Product = Q1 x Consumable 1 + Q2 x Consumable 2 + ... + Qn x Consumable n
Simple text file with one line per good listing on that line component goods and qty?
klauss wrote:I don't think so. Contraband needs tighter integration with the engine, so that police AI can spot contraband. ATM, I think, contraband is detected by belonging to the "Contraband/" category, but that's not faction-dependant AFAIK. So Rlaan AI would be sensitive to all kinds of contraband, not just Rlaan contraband. We would have to check/expand on this though.
Understandable for this issue, but the present implementation is less than ideal and should be addressed at some point.
klauss wrote:(D)eciding on the data format for the economic database.
I suspect a base type listing with each good and data would easy, but some input from modders would be great. I keep coming back to starting with two lists, a starting point and a faction modifier.

Re: Midway step in refactoring trade

Posted: Fri Mar 09, 2012 6:20 pm
by klauss
travists wrote:So far I have Bases categorized into economic sector and general type. I've also got several generalized goods types. One of my questions remains though, is a base type from one faction fundamentally different from the analogous type from another faction (especially the different human groups) and thus requiring lengthy development of each base-faction combination, or are faction preferences and base type general production values separate?
It may be, but perhaps we'd be better off handling those differences as different entries in units.csv that just happen to share a mesh and most stats.

Re: Midway step in refactoring trade

Posted: Fri Mar 09, 2012 6:49 pm
by travists
My thinking is what happens when a base changes ownership? If it can be seamlessly be swapped to the corresponding base type of another faction great, otherwise it is possible to have a Luddite Pharmaceutical station producing Machinist type full body augmentation!

Re: Midway step in refactoring trade

Posted: Fri Mar 09, 2012 6:53 pm
by klauss
It can, bases are recreated from what is saved on savegames, so the information should be rather easily mutable.

However, I don't think a base's function can change so easily. Function is a function (pun is merely accidental) of internal layout and equipment. If a base is adapted to work as medical or factory, that fact can't change as easily as the people who control it.

Re: Midway step in refactoring trade

Posted: Fri Mar 09, 2012 7:08 pm
by travists
No, but a production facility can change it's output. In the above pharmaceutical plant, the implant manufacturing equipment can be dismantled and the drug portion expanded and converted to more naturalistic remedies. A Consumer Goods Factory Run by High-Born and a less opulent group like unadorned both have the same equipment, but vary in output greatly.

Re: Midway step in refactoring trade

Posted: Fri Mar 09, 2012 7:24 pm
by klauss
Then I guess faction and a couple more factors should influence production.

I'd say, this should be dynamic, and the data files should only contain production capabilities.

Say, the file says the base can produce N man-hours worth of goods per week, and lists the cost (in man-hours and consumables) to produce each item. Then, available man-hours are spread as faction preferences, and local political and economic factors dictate.

Re: Midway step in refactoring trade

Posted: Fri Mar 09, 2012 7:47 pm
by travists
That's my thinking anyway. There's time to sort out the details, I think I can just about finalize bases now, goods categories are fairly fleshed out, so then we (I) can cross check against current entries in the data and figure out what we need, what gets eliminated, etc.

Re: Midway step in refactoring trade

Posted: Thu Mar 15, 2012 10:31 pm
by travists
OK, I've compiled a faction list from the wiki and tried to assign them to the propper grouping and posted it here, on the factions page. Anyone that sees a group that does not need to be considered for inclusion in base type/owner listings for distinct goods production mark it with a strike-through, preferably in red.

Re: Midway step in refactoring trade

Posted: Fri Mar 16, 2012 2:55 am
by loki1950
Like your spreadsheet just because a faction does produce distinct products/goods does not mean that they don't need and produce common stuff for local consumption ie. beer,foods and furniture.They may not be profitable for interstellar trade but very useful in-system trade(remember the runs between Serenity Mining base and Atlantis :wink: )or some enterprising privateer grabbing some cheap stuff and selling it in next jump over where there happens to be a shortage and a high asking price.And I wonder if some of the goods might deteriorate/spoil from rough handling or storage system failures.

Enjoy the Choice :)

Re: Midway step in refactoring trade

Posted: Fri Mar 16, 2012 4:12 am
by travists
My reasoning is that all (or most) Human, Rlaan, and Area factions will, within their group, have many of the same production/consumption needs. Yet many will differ in particulars. Question is how many of the forty or so deserve to be separately handled and how many can just be lumped in with their group?
loki1950 wrote:And I wonder if some of the goods might deteriorate/spoil from rough handling or storage system failures.
Interesting thought. Many drugs have very short half-lives. Some products don't take well to high Gs, others are ruined by freezing, radiation exposure, thawing. I am quite open to this idea, but I wonder about the practicalities in the code. Tracking so many statistics for every cargo item... Though I suppose if we hull passengers we will need to track life support and quarters functionality, so a refrigeration unit or other "special handling" upgrade could be used, that failure of it "kills" the cargo.

Re: Midway step in refactoring trade

Posted: Fri Mar 16, 2012 4:21 am
by pheonixstorm
If you look at X3 Terran Conflict, they have you buy passenger quarters before you can haul people around. From the most basic up to the presidential suite (don't remember the ingame designations). Vega Strike is setup for this as far as the commodities exchange, but I don't know if the code is setup to handle this or not. Either the feature was never added/worked on or it was just never turned on. I would say we need to look into adding some functionality as far as passenger quarters, refrigeration, etc. Just remember we can't go overboard with it or the players won't care for it one bit.

Maybe use something like...

Passengers/Livestock = Crew quarters/pens just lump the basic set into one common name then have higher classes for the more discerning passengers (who don't want to smell like a pig upon arrival).
Perishable foods = Refer units
?

Re: Midway step in refactoring trade

Posted: Fri Mar 16, 2012 3:49 pm
by klauss
From what I could see in code, the presence of passenger quarters affects mission availability only.

Re: Midway step in refactoring trade

Posted: Fri Mar 16, 2012 5:32 pm
by travists
If true, this should be addressed. Along with handling for "if destroyed in-route". The most straight forward approach would be, as we need to add some extra descriptors for cargo anyway, is have a list of cargo requiring special equipment and a handler that cross checks that list at purchase time and again after damage events. Such an approach should give UtCS the ability to use it while limiting the scope while allowing modders to expand it infinitely if desired.

say:
Cargo name 1, required upgrade
Cargo name 2, required upgrade

I question buying non-slave people as cargo, but as long as people are a cargo item (paying passengers or what have you) you should need the right equipment.

(A tangent to this is should the "enslave/free slaves" option be included? Get a load of passengers that think they are heading to a resort then sell them as slaves! Or, buy slaves then grant them their freedom.)

Re: Midway step in refactoring trade

Posted: Fri Mar 16, 2012 6:32 pm
by klauss
That modus operandi raises another possible problem, with prices.

Profit in carrying passangers would be the result of "selling them" at higher prices than they were bought. Buying price should be 0, and selling price should be a function of distance. Certainly something the engine can't do now in the commodities trade screen.

Re: Midway step in refactoring trade

Posted: Fri Mar 16, 2012 6:48 pm
by travists
I think we can safely ignore passengers as commodities, that always has struck me as odd. They needs must be treated as cargo with special needs, but unless enslaved and thus in effect becoming property, passengers should only be handled through missions.
Possible new fixers:
  • Tour group leader
  • Immigration advocate
  • Political prisoner contact
  • Random person needing a ride

Re: Midway step in refactoring trade

Posted: Fri Mar 16, 2012 7:05 pm
by klauss
Taxi guild?

Re: Midway step in refactoring trade

Posted: Fri Mar 16, 2012 7:25 pm
by travists
A good thought, though I'd be careful with "guild" unless, Privateer style guilds are in the works. (Hunters would work well for this from how the description reads in the wiki.) The term guild seems to indicate something similar to a trade union that you gain entry to, rather than being hired by, for a job.

Re: Midway step in refactoring trade

Posted: Fri Mar 16, 2012 7:29 pm
by travists
Pan-Galactic Passenger Transport Brokers.

Re: Midway step in refactoring trade

Posted: Fri Mar 16, 2012 8:01 pm
by klauss
travists wrote:Pan-Galactic Passenger Transport Brokers.
Nice one