Big Problem: intra-system trade needs to be fixed!

Forum For Privateer Remake
Gavinfoxx
Merchant
Merchant
Posts: 48
Joined: Wed Dec 07, 2005 7:22 am

Post by Gavinfoxx »

So when can we have a version that makes trading decently profitable? Would-be traders want to know! :)
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

Regarding higher cargo densities combined with higher profits, we'd have a better balanced cargo system. Sounds good!

Concerning code, is this a python script or is it hardcoded?
Shissui
ISO Party Member
ISO Party Member
Posts: 433
Joined: Wed Feb 07, 2007 9:27 pm

Post by Shissui »

Melonhead wrote:I THINK you can add contraband for factions other than Confed, Militia, and Retros, but haven't verified that.
So catnip might not be contraband in human space !?
I want to live in Theory. Everything works in Theory.
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

Concerning code, is this a python script or is it hardcoded?
I'm not sure. I thought it was in the script "trading.py," but when I made changes there, it didn't work. I even tried commenting out the line that appears to calculate the price, but there was no difference when I ran the game. The script is definitely used for something, because it caused an error when I tried just hardcoding the price.

I searched in the Wiki and found a cargo class that includes Setprice and Getprice, but the syntax is a little different, so that might be from an older release.

Do any developers know where the cargo price is calculated?
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

So when can we have a version that makes trading decently profitable? Would-be traders want to know!
Regarding higher cargo densities combined with higher profits, we'd have a better balanced cargo system. Sounds good!
I'll take that as support for new prices, even if we can't get price variability working yet? :)
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

Maybe we can... I'll give you some tunes you might want to try, without any guarantee of course:
In trading.py

Code: Select all

self.price_instability=0.01
Try changing that value and see what happens.

For stock price changes, just change the prices in units.csv/untisRF.csv.

Uhm, not too much to start from, but if I find anything else, I'll let you know.
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

I did try changing price_instability, without effect. That variable was my first clue that something else is going on. The lines I thought needed to be changed are:

Code: Select all

price = prod[1]+vsrandom.uniform(-1,1)*prod[2]
cargo.SetPrice(cargo.GetPrice()*price)
vsrandom.uniform is actually in vsrandom.py, which is included in trading.py. Note that price_instability isn't used--so, what's it there for? :?

I actually commented out the "price" line, and the price that came up didn't change--it was clearly still using the base price in master_parts_list.csv, applying the multiplier in units.csv, and then subtracting the price variability multiplier in units.csv. But, it did vary slightly with each reload. I can't find the code for cargo.SetPrice and cargo.GetPrice, although they are mentioned in the Wiki.
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

I'd recommend to change price instability to a muck higher rate - let's say 1.00 for testing purposes.

I think the line indicates how prices on bases may fluctuate, so 0.01 means 1%. 1.00 would be 100%, you should see significant changes.

I'm sorry that I can't help more but guessing, but I'm not that deep in with those manners.
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

I tried changing price_instability to a higher number, without any observable effect.

Importantly, we need feedback on the master_parts_list.csv with the updated cargo densities (posted as master_parts_list_density.csv). Are they about right? Too heavy? Too light? I know there are a couple mods ready to go "final," so those authors need to know whether to incorporate that part of my trading update.
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

First of all, there is no hurry. If we don't use something now, we use it later. I haven't a schedule for the updates.

Second, I'm currently waiting for ZR and your update to create a new patch. For so long, I'm creating new campaigns (number 3 is complete btw!)

Third, I'll try your mod out this week and give a feedback. There are only one thing I'd like no know in advance:
- If you now fly an empty ship, does it have a better maneuverability like before?
- If you e.g. have a Paradigm full of iron, or let's say a Galaxy, are those ships still somewhat flyable?
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

If you now fly an empty ship, does it have a better maneuverability like before?
If I understand what you're asking, I didn't make any changes to the maneuverability of the ships themselves. The only changes are to the mass of the cargo and some of the volumes in master_parts_list.csv.

So, if you fly an empty ship, it should fly just the same as it did before. If you fly a load of plastics, you'll notice a little bit of a difference. If you fly a load of iron or uranium, you'll definitely notice some inertia. The ship will still rotate as it did before, but it will take longer to accelerate and decelerate, so it will also take longer to change your velocity vector--it will handle just like a real spaceship maneuvering. I don't have a Drayman, so I haven't play tested that, yet.

EDIT: I do like how a Galaxy, Tarsus, and Centurion handles with a full load of iron. Since I don't normally fly a lot of the other fighters, I'm not the right person to judge whether their handling is "okay."

Once I figure out how to make price variability work, this should be more interesting--if you haul a load of iron to a pirate base, and discover it isn't selling for very much, do you haul it back out through that asteroid field, or sell it at a loss (or low profit) and take out a low-mass load of Brilliance?

Just to clarify--did you make any changes to the ship specs?
Last edited by Melonhead on Tue Apr 24, 2007 4:04 am, edited 2 times in total.
Shissui
ISO Party Member
ISO Party Member
Posts: 433
Joined: Wed Feb 07, 2007 9:27 pm

Post by Shissui »

Melonhead wrote:If I understand what you're asking, I didn't make any changes to the maneuverability of the ships themselves. The only changes are to the mass of the cargo and some of the volumes in master_parts_list.csv.
This is a problem then. For example -- if we look at the current version of ZR, then the mass of a Demon is 15 + another 15 for upgrades. If I have 15 mass more of cargo, then with triple the mass, I can expect one third the accelleration to which I am accustomed.

*THIS* is the issue that Dilloh is pointing at.
I want to live in Theory. Everything works in Theory.
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

if we look at the current version of ZR, then the mass of a Demon is 15 + another 15 for upgrades. If I have 15 mass more of cargo, then with triple the mass, I can expect one third the accelleration to which I am accustomed.
Well, it could be a problem, but I'm not certain how the game engine actually uses upgrade volume. My units.csv shows a Demon massing 20 versus a Galaxy's 325--I'm assuming ZR's mod changes the Demon to 15? But, the Demon has a hold volume of 50 (verus a Galaxy 150 to start). For upgrade volume, it's 12 for the Demon, but 16 for the Galaxy--I assume this is where ZR's other mod to 15 occurs--I don't have his units.csv.

I think the upgrade volume is just a counter, rather than a real volume or mass measurement. A bigger deal is the hold volume, and this is where we should think about realism again--after all, a Demon light fighter certainly shouldn't be able to carry 50 m3 of cargo if a Galaxy only starts at 150. Most "fighters" don't carry any cargo, and carry their pilot's gear in "travel pods" that take the place of fuel tanks or weapons mounts. For PR purposes, we should probably have some small cargo space, but perhaps the Demon pilot should have to buy/rent a "cargo upgrade" to do certain campaign missions? :idea:

Ultimately, we'll just have to play test it, and see how it feels. The original master_parts_list.csv showed the mass as kg, but that was WAY too heavy. Dropping down by a factor of 10 seems much more playable, but tweaking it is easy, and there's nothing magic about round numbers. But, whether you're driving a container ship, 747 freighter, or F-35, you would certainly expect handling differences with a full load of tungsten ingots in the hold.

On a related note, this reminded me to look at the ship volumes in master_parts_list.csv, and I've been wondering--are the overall dimensions of the ships discussed anywhere?
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

I've made some progress in tracking down GetPrice and SetPrice in the SVN. In \trunk\vegastrike\src\python, I found unit_wrapper.cpp with the following:

Code: Select all

PYTHON_BASE_BEGIN_CLASS(VS,Cargo,"Cargo")
#if BOOST_VERSION != 102800
, boost::python::init<std::string,std::string,float,int,float,float>());
#else
Class.def(boost::python::constructor<std::string,std::string,float,int,float,float>());
#endif
PYTHON_DEFINE_METHOD(Class,&Cargo::SetPrice,"SetPrice");
PYTHON_DEFINE_METHOD(Class,&Cargo::GetPrice,"GetPrice");
It also defines quantity, mass, volume, content, category, whether it's mission cargo, etc. I'm still trying to figure out where the code is that actually does the price getting and setting.

Any developers happen to know exactly where this points? I'm not really much of a coder, although I can usually follow it, given enough time.
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

Ultimately, we'll just have to play test it, and see how it feels.
Jup. Give your changes to Zool, he will give both merged to me and I will put it in --
Zool
Bounty Hunter
Bounty Hunter
Posts: 230
Joined: Sun Dec 10, 2006 12:29 am
Location: Roaming the Gemini Sector looking for profit!!

Post by Zool »

I'm currrently messing around with the masses if the ships as there is a lot of imbalance there. The thing is, I don't know how much effect this is going to have on ingame performance. I have re-adjusted since I posted the read me below though. (Sorry, I keep having new ideas) :)

I have finished adjusting the cargo hold sizes for all of the ships. I posted the changes in a readme download.
Time is an Illusion..............Lunchtime doubly so!! -Ford Prefect-
Check out Privateer themed goodies!
http://www.cafepress.com/soulfulngifted/2889859
Shissui
ISO Party Member
ISO Party Member
Posts: 433
Joined: Wed Feb 07, 2007 9:27 pm

Post by Shissui »

Your link needs repair -- it comes right back here.
I want to live in Theory. Everything works in Theory.
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

Updated ship masses/volumes should be interesting to see! Still curious if anyone has thoughts on actual ship dimensions.

The new cargo masses have been sent to Zool; I've had some computer problems this week that have delayed exploration of price variability. But, I see there's a new coder in town, so I may ask for help! :D
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

I'm attaching the master_parts_list.csv with the updated cargo densities--could've sworn I uploaded it before, but I don't see it where I thought it was.

I have initial feedback that the results are too heavy. Please let me know your thoughts!
You do not have the required permissions to view the files attached to this post.
Zool
Bounty Hunter
Bounty Hunter
Posts: 230
Joined: Sun Dec 10, 2006 12:29 am
Location: Roaming the Gemini Sector looking for profit!!

Post by Zool »

@ Melonhead

Firstly, one question, Is your calculated mass for each commodity simply based on what you think 1m^3 of that commodity would be ?

Oh and you missed plutonium in the copy you sent me :) It's still at 0.01.

Be a few days before I can give you any feedback as I'm sorting out some ZR issues as well as testing your implementations at the same time. But the overall concept is good. :D
Time is an Illusion..............Lunchtime doubly so!! -Ford Prefect-
Check out Privateer themed goodies!
http://www.cafepress.com/soulfulngifted/2889859
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

The masses are what I researched for the various commodities, with a dose of TLAR. They are based on how many hectograms (NOT kilograms) one cubic meter of that commodity would mass. The original title for the entry, kilograms, turned out to be way too much for play balance.

For elements like iron, tungsten, etc., the values are the actual values I looked up, either in my engineering texts or online. For grain, I used wheat, compared with corn, and rounded.

For commodities like plastics, holographics, mining equipment, etc., I used a common sense factor: item is mostly steel, but isn't solid, so should mass about X. For example, for home appliances I looked up the mass of a washing machine and then calculated based on its dimensions. For plastics, I looked up the value of raw plastic sheeting.

For people, I applied a mass for the passenger and baggage (more baggage for first class, less for frozen colonist), and then applied a larger volume based on first class, business class, etc.

Looks like Plutonium ought to be about 198.4. We could reduce it, if desired, and just say that in 2669, there's an additional volume required to prevent Plutonium in this kind of spent fuel rods from achieving critical mass. (Plutonium pits in storage, for example, have specific spacing requirements.) But, until we have more playtesting results, it seems simpler to just use the raw figures.
Zool
Bounty Hunter
Bounty Hunter
Posts: 230
Joined: Sun Dec 10, 2006 12:29 am
Location: Roaming the Gemini Sector looking for profit!!

Post by Zool »

@ Melonhead,

Now that's some GOOD commitment to your research, I'm impressed, and I cannot fault your work.

Now for what I have found out so far. I've hacked a new save game (I now have 4 installations of PR on my machine :lol:) bought a Tarsus Mk2, kitted it out and took it for a fly.


*0 - 329 kps in less than 10 sec no AB (after burner)
* bought 66 units of iron and did the above test
*0 - 329 kps 1 min 37 sec no AB (6.5 times as long)
*0 - 329 kps (full AB from zero) 66 Iron cargo, 36 sec
*0 - 729 kps (full AB from zero) no cargo, approx 10 sec
*0 - 729 kps (full AB from zero) 66 Iron cargo, 1min 20 sec
*Inflight, at top speed, do a 180 deg flip and time to decelerate and re-accelerate to top speed , about 30 sec no AB, no cargo no AB
*The same mauoeuvre with the 66 iron cargo (and no AB)took well over 3 minutes. For half that time I was flying backwards whilst the ship decelerated.


This is definitely going to be a big problem with larger cargo ships AND with Dilloh's Troy campaign when you can't buy AB's.
Time is an Illusion..............Lunchtime doubly so!! -Ford Prefect-
Check out Privateer themed goodies!
http://www.cafepress.com/soulfulngifted/2889859
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

Wow, those are really different times. I will double-check that I didn't send/use the wrong file. Your results sound very much like the ones I was getting when I used kilograms in the master_parts_list.csv entry, which were definitely unplayable (unless you're a fan of Microsoft Container Ship Simulator).

I did realize today that I mispoke about the dimension. The mass value in master_parts_list.csv isn't hectograms instead of kilograms. Rather, it's 10's of kilograms. I moved the decimal correctly in the file, but wrong in my head.
Shissui
ISO Party Member
ISO Party Member
Posts: 433
Joined: Wed Feb 07, 2007 9:27 pm

Post by Shissui »

Those are reasonable times for the relatively small cargo that Zool was carrying.

Contemporary transport typically has cargo that weighs much more than the vehicle. By comparison, when I drove a water truck, my vehicle (including the empty tank) weighed 3500kg & the water that it held was another 10,000kg. (Actually, the entertaining part of driving a water truck is when it is HALF full!) A train could have up to an order of magnitude larger ratio between vehicle weight and cargo; and, a boat would have an even larger ratio than that.

Ships in WCU & Privateer actually have a very low ratio of cargo space to ship size. Thus, as more effort is put into making things realistic, then this performance difference will only get worse.

SO, how realistic do people *really* want these ships to be ??
I want to live in Theory. Everything works in Theory.
Gavinfoxx
Merchant
Merchant
Posts: 48
Joined: Wed Dec 07, 2005 7:22 am

Post by Gavinfoxx »

I dont want this game to be realistic at all! Its Wing Commander, for crying out loud! The only time you should really have to worry about inertia a lot is afterburning!
Post Reply