modify Price Spread for Selling and Buying

Started by Kori, September 10, 2017, 01:46:01 PM

Previous topic - Next topic

Kori

Hello,

I would like to edit/ remove the flat price spread of 0.5 for selling and 1.5 for buying (because it completely ruins the fun of trading for me), but I couldn't find a single entry for it in the XMLs.

What I found is
tradePriceFactorLoss for different difficulties (0.05 on easy, 0.1 on medium, 0.15 on hard..) and
SellPriceFactor that kicks in for certain types of goods (1.1 for art, 0.7 for apparel, 0.2 for weapons..)

...but not a single clue on that 0.5/ 1.5 modifier for selling/ buying.


I'd like to change it back to 0.75/ 1.25 (pre-A17) or remove it completely and only have the difficulty modifiers (adjusted so that they are slightly higher) instead.

Can someone please tell me how this can be done? Any help would be very much appreciated! :)

CannibarRechter

Note:


namespace RimWorld
{
public class Tradeable : Transferable
{
...

public const float PriceFactorBuy_Global = 1.5f;
public const float PriceFactorSell_Global = 0.5f;
...


You might want to look around for a mod that fixed this problem. I'd swear there is one.

Note that even if I were to code a patch for you, the values shown above are defaults. Any def that implements <statBases></statBases> is going to override them.

If you can't find a mod you like, I'd suggest that you develop a series of Patches that simply override every base/abstract class that concerns you. If they do not apply a sell/buy factor, then use PatchOperationAdd. If they do, then use PatchOperationReplace.


CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

Kori

Quote from: CannibarRechter on September 11, 2017, 07:24:34 AM

You might want to look around for a mod that fixed this problem. I'd swear there is one.

Note that even if I were to code a patch for you, the values shown above are defaults. Any def that implements <statBases></statBases> is going to override them.

If you can't find a mod you like, I'd suggest that you develop a series of Patches that simply override every base/abstract class that concerns you. If they do not apply a sell/buy factor, then use PatchOperationAdd. If they do, then use PatchOperationReplace.

Thank you very much for your reply! :)

I already searched for hours trying to find a mod, but couldn't find any.
The only one I found that comes close to it is Economic Stability, but it only triples the sell-value after the 0.5 multiplier (so you get market price * 0.5 * 3).
https://ludeon.com/forums/index.php?topic=33098.0

Well, I should have mentioned that I have zero knowledge about more sophisticated modding that includes coding  ;) , so what you are saying is that I need patches that correspond to all other mods I'm using which include defs that implement <statBases></statBases>?
Or did I get that wrong?
Sorry for asking stupid questions.  ;D

CannibarRechter

>  so what you are saying is that I need patches that correspond to all other mods I'm using which include defs that implement <statBases></statBases>?

For every mod that you are using where you want to alter the buy sell price, yes, you need to do that.  Alternatively, you can do it in code with a Harmony injections, but this would be difficult for a non-programmer.

CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

AngleWyrm

#4
Quote from: CannibarRechter on September 11, 2017, 07:24:34 AM
You might want to look around for a mod that fixed this problem. I'd swear there is one.

Economic Stability mod. The source code on github

It's an xml patch mod that adjusts the sell factors to match the buy factor, so that the value of an item is a measure of what it compares/trades against.
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

Kori

#5
Quote from: CannibarRechter on September 12, 2017, 09:35:04 AM
>  so what you are saying is that I need patches that correspond to all other mods I'm using which include defs that implement <statBases></statBases>?

For every mod that you are using where you want to alter the buy sell price, yes, you need to do that.  Alternatively, you can do it in code with a Harmony injections, but this would be difficult for a non-programmer.

Oh, I see!  :-\
Well, you said something before about "if I were to code a patch for you"... does that mean you are a programmer and are there any chances you could create such a Harmony patch/ mod, if it wouldn't be too difficult or time consuming? If you don't want too I'd completely understand that, I'm asking just in case! :D

Also I'm sure there are a lot of other players out there who'd also welcome such a mod so they can alter the price spread to their liking, especially those who think that trading on the Rimworld should be more like
"I give you this (potatoes) and in return you give me that (rice)"
instead of
"I give you this (potatoes) and in return you give me that (rice), this (your fellow pack muffalo), these (those spare parts you wanted to keep for bad times) and your girlfriend."

And right now Rimworld feels more like the latter.


@AngleWyrm: Thank you, I already mentioned your mod in the other post. :) It is very helpful, just not exactly what I had in mind, because I'd like to alter both values for selling and buying independently so that you don't run into occasions where your pawns with a high social skill would receive less for selling certain goods because the selling price can never be higher than the buying price (which also goes down with high social), so the selling price gets capped and is therefore lower than for those pawns with zero skill.

AngleWyrm

#6
Quote from: Kori on September 12, 2017, 05:53:04 PM
...I'd like to alter both values for selling and buying independently so that you don't run into occasions where your pawns with a high social skill would receive less for selling certain goods because the selling price can never be higher than the buying price (which also goes down with high social), so the selling price gets capped and is therefore lower than for those pawns with zero skill.
There is an odd entanglement of Player-vs-Environment (PvE) in the game mechanics of trade that doesn't have to do with economics or character skills & abilities.

The game engine presents a variable called SellPriceFactor (which defaults to 1/2 item market value) and can be altered through xpath patching. But I haven't yet found a corresponding adjustable BuyPriceFactor (which defaults to 3/2 item market value).

And as you've pointed out, there's an additional rule SellPriceFactor <= BuyPriceFactor, which makes buying low and selling high something the Environment tradesman can do but the Player tradesman cannot do.

My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

Kori

Quote from: AngleWyrm on September 13, 2017, 02:36:02 PM
There is an odd entanglement of Player-vs-Environment (PvE) in the game mechanics of trade that doesn't have to do with economics or character skills & abilities.

The game engine presents a variable called SellPriceFactor (which defaults to 1/2 item market value) and can be altered through xpath patching. But I haven't yet found a corresponding adjustable BuyPriceFactor (which defaults to 3/2 item market value).

And as you've pointed out, there's an additional rule SellPriceFactor <= BuyPriceFactor, which makes buying low and selling high something the Environment tradesman can do but the Player tradesman cannot do.

That's why the approach CannibarRechter proposed by editing


      public const float PriceFactorBuy_Global = 1.5f;
      public const float PriceFactorSell_Global = 0.5f;


sounds really promising!

This rule SellPrice <= BuyPrice makes sense so that the player can't abuse the system (sell high, buy back cheaper, sell high again and so on until the NPC runs out of money/ stuff), but as you pointed out it ultimately prevents players from playing as a trader (who says the caravans are the traders and not your customers? and what if you are the caravan-merchant?) and it would be really great if there would be a way to sell at a higher price when the criteria are met (very good social skills and maybe additional trader traits = your own trader who can make a profit by buying cheap at place A and selling for a better price at place B).

To prevent abuse of this system, stuff that you've sold can only be bought back at the same price you've sold it at.
Same goes for things you bought from the trader: Selling it back (to this specific trader) is only possible at the price you bought it for.

Since we already have several entries in the trading screen for the very same goods (because slightly different values due to deterioration) this wouldn't even look strange in the trade window and would perfectly meld into already existing game mechanics!

Oh what an awesome addition that would be, having pawns who are good traders and can make profit by running trade caravans between different NPC-locations!

AngleWyrm

#8
Quote from: Kori on September 13, 2017, 05:12:50 PM
This rule SellPrice <= BuyPrice makes sense so that the player can't abuse the system (sell high, buy back cheaper, sell high again and so on until the NPC runs out of money/ stuff)
Does the characterization of sell high and buy back cheaper as an abuse of the system also apply to the environment traders?
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

Kori

Quote from: AngleWyrm on September 13, 2017, 07:19:18 PM
Does the characterization of sell high and buy back cheaper as an abuse of the system also apply to the environment traders?

What do you mean? I'm fairly new to the game, so maybe this is something I don't know yet.
I was talking about:

-sell amount x of goods to trader for 1000 silver
-buy the same amount from the very same trader back for 800 immediately
-repeat until you got all the NPCs silver and goods

To prevent this, all goods that are an item of re-buy or re-sell (to the very same trader) should keep their original price.

AngleWyrm

#10
Quote from: Kori on September 13, 2017, 09:48:35 PM
I was talking about [sell high, buy low, repeat]. To prevent this...
The result of a price spread is a transfer of wealth. Maybe that doesn't get witnessed enough to trigger some sense of recognition.

My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

Kori

Quote from: AngleWyrm on September 14, 2017, 09:23:43 AM
Quote from: Kori on September 13, 2017, 09:48:35 PM
I was talking about [sell high, buy low, repeat]. To prevent this...
The result of a price spread is a transfer of wealth. Maybe that doesn't get witnessed enough to trigger some sense of recognition.

What are you talking about? Are you trying to troll me just as you are doing it with others here?
Look, I may be new to posting in these forums, but I've been following them for some time now and couldn't help but recognize what kind of person you are. Just look at things like this: https://ludeon.com/forums/index.php?topic=33098.msg337615#msg337615

In case this isn't a trolling attempt, it looks like you want to be clever but haven't understood what I was saying. Maybe you should read my previous message again.

AngleWyrm

#12
  • Player trader buys low from Environment trader
  • Player trader sells high to Environment trader
  • Repeat as often as possible
And the reverse:
  • Environment trader sells high to Player trader
  • Environment trader buys low from Player trader
  • Repeat as seldom as possible

The rule that there can be no profitable enterprise in the realm of Rimworld effectively eliminates the development of for-profit business communities, as all such endeavors will be operated at various levels of loss.
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh