Page 1 of 2

Oolite 1.70 Re-sell values

Posted: Sat Feb 09, 2008 9:15 pm
by Timm74
Hi,

I get the feeling that the re-sell values at 1.70 are a lot lower than at 1.65.
When I bought the military shields today (for 47500) my ship was worth only 25000 or so more afterwards.

Anyone noticed similar behavior?
Is this a bug or intended?

Cheers!
Tim

Posted: Sat Feb 09, 2008 9:18 pm
by JensAyton
It is intended. In previous versions, resale values could be higher than original prices.

Posted: Mon Feb 11, 2008 10:11 pm
by Timm74
Hi,

ok, I understand that the resell should not be at a higher price. But in 1.70 you loose LOTS of money when reselling.


And some of the buy prices also seem quite strange.

A ship just equipped with lets say an extra energy unit more at a price of 45000 credits more?

Cheers!
Timm

Posted: Mon Feb 11, 2008 10:48 pm
by Cmdr James
I did start looking at this. I added some changes to make the equipment on the ship you are selling discounted by 10%, so it is consistent with the 10% discount on fitted equipment on a new ship. I guess once these changes make it in, we could reduce the overall discount (25% I think) to the whole price.

Posted: Mon Feb 11, 2008 10:52 pm
by LittleBear
A Robin Reliant with a SatNav fitted is still a Robin Reliant though. :wink

Posted: Tue Feb 12, 2008 5:13 am
by Commander McLane
Cmdr James wrote:
I did start looking at this. I added some changes to make the equipment on the ship you are selling discounted by 10%, so it is consistent with the 10% discount on fitted equipment on a new ship. I guess once these changes make it in, we could reduce the overall discount (25% I think) to the whole price.
Please have a conversation with Ahruman before you make any changes. Or at least make a search for the thread in which these changes were discussed, and read the arguments that lead him to do what he did. The way it works now is intentional. So it would not be a good idea to re-introduce the very bug he was squashing!

IIRC the problem was with the different locations you can buy and sell ships on. E.g. sell your CobraIII on a scripted station or carrier with an equipment_price_factor of 2 or 3, and you will get lots and lots of money for your installed equipment. Buy just a simple Adder there, fly to the main station and buy another CobraIII with the same equipment you had before. You will have made a profit, because the price you have to pay for your new equipment is now below the money you got for the old equipment. This was considered cheating by the comOonity, and so Ahruman fiddled with the prices to prevent it from happening. So make sure that something like this can not happen, whatever the player does. And I'm afraid you haven't paid attention to this when you changed the formula.

This is why we are discussing things here before we implement changes in the code!

Posted: Tue Feb 12, 2008 9:18 am
by Cmdr James
Relax guy, I dont put anything into the source tree directly. :)

In any case, all I have done, in my version, is to reduce the value of of the ship you are selling.

It seems to me that resale values should be capped at "standard prices", I mean, an outpost who charges you double are hardly going to pay you double. In fact, I think this change was already made (I think I even suggested it?)

Edit: In fact currently it is only lasers which have price capped when upgrading, but it would seem natural to apply the same to all equip when selling a ship.

Posted: Tue Feb 12, 2008 10:21 am
by JensAyton
As far as I recall, this is separate from the equipment_price_factor issue. Reducing resale values by 25% across the board is an unsatisfactory hack, and working out the trade-in value in the same way as the sale price would be better. In fact, there’s a comment in the relevant code about it:

Code: Select all

/*  FIXME: the trade-in value can be more than the sale value, and
    ship_trade_in_factor starts at 100%, so it can be profitable to sit
    and buy the same ship over and over again. This bug predates Oolite
    1.65.
    Partial fix: make effective trade-in value 75% * ship_trade_in_factor%
    of the "raw" trade-in value. This still allows profitability! A better
    solution would be to unify the price calculation for trade-in and
    for-sale ships.
    -- Ahruman 20070707, fix applied 20070708
*/
(Programmificator reference: -[Player(Contracts) tradeInValue], currently PlayerEntityContracts.m line 1337.)

Also, elsewhere we have:

Code: Select all

/*  BUG: equipment_price_factor does not affect trade-ins. This means
    that an equipment_price_factor less than one can be exploited.
    Analysis: price factor simply not being applied here.
    Fix: trivial.
    Acknowledgment: bug and fix both reported by Cmdr James on forum.
    -- Ahruman 20070724
*/
(-[PlayerEntity tryBuyingItem:], PlayerEntity.m:5261)

I guess Cmdr James did know about that one after all. ;-)

Posted: Tue Feb 12, 2008 12:38 pm
by Commander McLane
Okay, okay; I retreat from warning people to trespass the borders they have set themselves. :)

Anyway: I do think it is worthwhile to come up with a sane and sensible way of calculating resell values. So, Cmdr James, if you're up to it, please go ahead.

Posted: Tue Feb 12, 2008 8:34 pm
by Cmdr James
This was all caused by my clunky message, and lack of clarity. Followed up by a nice bit of drunken self defence :(

Anyway, to be clear, for anyone who is interested, I started looking at reimplementing the whole resale thing, and found that its a bit if a nightmare as it isnt a set of Objects that we can iterate through, but an NSDictionary that is different for a player and a new ship. I did start trying to sort it all out, but I got a bit nervous about it, as I dont know how much of this stuff is accessable from oxps. I think probably the best thing to do, would be to make more of the NSDictionary stuff into arrays of objects that you can use, but I dont want to do that for the moment.

Some of the other stuff I have done I sent to another_commander who generously said he would take a look.

I am also looking into a few things that seem kind of odd to me, like the pilot ejecting and leaving the ship in an odd state (if its got cargo, for example). I have been experimenting with setting it to isHulk == true. None of this will make it into the source tree any time soon, and quite likely never, but if there is anything anyone really wants done and thinks I am the man for the job, let me know :D

Posted: Tue Feb 12, 2008 8:49 pm
by JensAyton
Cmdr James wrote:
Anyway, to be clear, for anyone who is interested, I started looking at reimplementing the whole resale thing, and found that its a bit if a nightmare as it isnt a set of Objects that we can iterate through, but an NSDictionary that is different for a player and a new ship. I did start trying to sort it all out, but I got a bit nervous about it, as I dont know how much of this stuff is accessable from oxps. I think probably the best thing to do, would be to make more of the NSDictionary stuff into arrays of objects that you can use, but I dont want to do that for the moment.
I know the feeling. ;-)

Posted: Tue Feb 12, 2008 9:35 pm
by Cmdr James
Im currently thinking about creating a mapping method that converts a player dictionary to a "standard" ship one, and passes it to the same method for the calculation.

Not convinced yet.

And anyway, there is so much action in the source tree, I dont want to make any changes, or it will be too hard to merge (look, Ive got an excuse :) )

Posted: Thu Feb 14, 2008 12:26 am
by Timm74
Hi,

although I have not understood why the capping method will not solve the problem, would it be possible to ask if you want to keep your equipment when you buy a new ship?

That way you won't punish players with well equipped ships too hard , but still not allow making a bargain on the equipment.

Cheers!
Timm

Posted: Thu Feb 14, 2008 8:47 am
by Commander McLane
Hmmm. Imagine you buy a new car, let's say a Toyota instead of your old Chrysler. How much of the Chrysler's equipment would you expect to be transferred to the Toyota?

Most of it simply wouldn't work in a different car. So why should it be different with space ships by different manufacturers?

Besides, don't forget that not each ship can fit each equipment item. So a one-to-one transfer is impossible.

Posted: Thu Feb 14, 2008 9:14 am
by Cmdr James
There are a number of problems.

Firstly there is a different mechanism for calculating price for ships on and the ship you have. One difference is that for new ships, equipment is discounted 10%, the players equipment is not (adding the same discount to player equipment was the change I mentioned above).

It is possible, but not a complete solution to simply cap trade in prices. This makes profit much harder, but does not fix the underlying problems.

Other issues related to the calculations include things like equipment from oxps -- I dont think (need to check the code) that some stuff like rock hermit detectors are included in the price calc. Im also not too clear about if you get your money back for missiles and mines and so on.

It also make sense for shipyards to charge a premium of some kind, like auto traders, they buy a car for $100, and sell it for $150. At the moment this is set to 25%, which makes it hard to profit from ship trading, but it remains possible. Or, if you want to look at it another way, there is 25% sales tax on ships.

Allowing a commander to keep items might be ok, but there are issues related to which items can be fitted to which ships -- not all combinations are allowed. There is also a tech level question of sorts, if the tech level isnt high enough for a bit of kit, then its not clear that they would be able to remove and refit the gear to your new ship. Maybe they will refuse to pay you for high tech gear, or maybe they pay a premium?

Edit: good point from Commander McLane, who can clearly write more succinctly than me :) just because many ships can fit the same thing for the same price, does not mean they are interchangeable. A cobra docking computer costs the same as a python one, but they are different things. Like cell phone chargers, they are all about $25 dollars, but good luck fitting a nokia charger to an ericsonn.

Some gear is always kept already though, if its awarded through a mission I think. This is even more confusing, because it should not be reflected in the price you get when you sell the ship. Perhaps for equip that must be removed and refitted to the new ship, there should be a shipyard fee?
And one of the interesting problems with buying a new ship, is that you sometimes find the ship of your dreams, but because of the tech level, you have to take it somewhere to be fitted out, this adds risk (I have to fly through 3 anarchies before I can fit a beam laser? maybe Ill pass), and makes buying ships more interesting.


An alternative view is that allowing a player to buy cheap ships at high tech worlds, fit them up with top quality gear, and sell them for a profit at a low tech world is in fact an entirely reasonable business to allow players to be in. Its just like buying and selling used cars. I dont think I really like it, but its not so bad.

So, its not simple, we do need to have more thoughts on it. A good starting point would be to get the code easier to work with, which is what I was hoping to do, but for the moment have given up, because I dont know what oxps might get broken.