-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traders have trading standards #57660
Conversation
Halved generous pricing reduction for damaged items
Cleaning filthy items is trivial so why would faction traders refuse them? It would make sense for NPCs with the squeamish trait to refuse them though. |
src/trade_ui.cpp
Outdated
@@ -69,6 +70,8 @@ std::string trade_preset::get_denial( const item_location &loc ) const | |||
npc const &np = *_trader.as_npc(); | |||
if( !np.wants_to_buy( *loc, price, market_price ) ) { | |||
return string_format( _( "%s does not want to buy this" ), np.get_name() ); | |||
} else if( loc->has_flag( flag_FILTHY ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this in with the rest of the refusal logic in npc::wants_to_buy()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, thats a better spot for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could change the return value of wants_to_buy()
to ret_val<bool>
which can store a string for additional context
Now checks in the npc::wants_to_buy() section
Added cost threshold - since you could buy 1000 thread, 500 solder, 500 rags from refugee center for nothing. Now if an item costs less than 1c it will revert its price to 1c minimum. Only applies to buying, not selling. Since traders will refuse to buy items that cost less than 5c. It was a little hard chasing down this bug. It seems the cost calculation was being done in a few different places. Especially for ammo type items such as solder or thread, they were being calculated down to below 1. So I added sanity checks that forced them to revert to 1 if they were calculated lower. |
I would also lower the value of rigid kevlar sheets, they are really easy to get from soldier zombies and sell for an overwhelming 150. You can get like over 15+ from their vests |
Oh yeah. Im sure there are other items like that too - But that is a json item level problem so youd need to edit item jsons themselves to balance. This PR is a merchant c++ code PR, it might be better for a separate PR for json item rebalance stuff |
Working on fixing another problem with traders - which is #47569 To fix you being able to cheese the barter system by selling objects back for more than you bought them for - npcs have a selling advantage. You can still make deals and adjust the pricing if your INT and social are higher, but it is harder. Observe the pricing difference with a pocket knife here This is with both npc and you having default INT/social of 8/0 When my player gets an INT of 12 and social 4 the pricing becomes thus This is when the NPC has an INT of 12 and social of 4 (and player INT 8, social 0) Can still change the numbers here... Id like to be able to bring the npc pricing down more |
You're doubling the NPC's prices at no stat/skill difference. 5 points of skill advantage then double it again. That seems a little extreme. |
Just trying things out. Though, Kevin said that npc buy and sell prices should not be anywhere near the same and I agree - its typical for game trading mechanics to have the prices nowhere near each other and shops irl are the same. Ever try to buy something you sold at the pawn shop back? I'll have a look at your pr in a while though and play test it out ... Though Id like to combine your PR with mine if its better - because the other changes Im doing here may conflict and cause unpredictable results so Ive been testing it all together |
implemented andrei8ls code for; filthy item price reductions (changed to half price) removed redundant visit_items code
Could you please resolve conflicts? |
Looks like all the issue that this was supposed to solved have already been solved, also stale |
Traders have better trading standards - Pay less for filthy, damaged items, wont sell stuff for free and barter more sensibly.
Summary
Balance "Traders have better trading standards - Pay less for filthy, damaged items, wont sell stuff for free and barter more sensibly."
Purpose of change
It is really easy to cheese the trading system by just mass-selling filthy trash you get from corpses - especially soldier zombies. And no sensible shopkeeper wants to fill their store up with torn apart filthy bloodsoaked broken shoes and gloves. Or give away their stock for nothing. Or let you sell something to them for more than you just bought it from them for.
So the changes proposed will make that harder to do, making traders behave more sensibly, closing exploits.
Minimum price fixes
Fixes #55444
Barter adjustment and caps fixes
Fixes #47569
Fixes #55368
Fixes #46081
Describe the solution
Traders will behave differently, with their own welfare in mind and with the intention of making a profit.
The price penalty for damage is now doubled, so you no longer get a little 30-40% price reduction for an almost destroyed item. It is now 60-80% reduction for almost destroyed items.
Added low cost threshold for npc selling - They will no longer sell stuff to you for free, but for 1c minimum. A trader gotta make a living. They will also refuse to buy items from you that cost 1c or less.
Filthy items will be sold to them at half price.
Barter price adjustment is reworked - they get a trade advantage - which depends on their INT/social and your INT/social. Your selling prices are unaffected, but their stock, they will sell to you at a higher cost, a markup - like real shops do. There is a cap in place - so they can't get too high, and the cap prevents buy/sell prices ever overlapping.
Player sell price adjustment can range from 50% to 140% and NPC price adjustment can range from 160% to 220%.
You can barter them down and your items value up to counteract, but you should not be able to sell them items for more than they sell to you anymore.
Currency items that were getting price adjusted (merch strap for example) leading to money exploits will not be adjusted anymore. You can still trade other faction currency at adjusted rates as normal though.
Describe alternatives you've considered
Considered #57706 for barter solution, but that PR is not conductive to a good barter system at this stage.
I implemented some of their code as it was better and is working with the same code as this PR, but implementing it better. I hope this is okay, I dont know how to add a co-author. Thanks andrei8l
Testing
Filled up on filthy and damaged pants / socks from debug killing some zombies and then tried to trade to an evac center npc to see the changes are working. The pricing and trade refusal are working better.
Additional context
Cheaper damaged items.
Minimum cost of sold items now 1cent