Skip to content
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

[Potential Bug]: a problem with sell offer prices #150

Open
lznoob opened this issue Jan 27, 2022 · 13 comments
Open

[Potential Bug]: a problem with sell offer prices #150

lznoob opened this issue Jan 27, 2022 · 13 comments
Assignees
Labels
Bug Somthing isn't right.

Comments

@lznoob
Copy link

lznoob commented Jan 27, 2022

A new game start (Project Genesis), Brennan's Triumph sector, partially explored. Other extensions: terran/split DLCs, cheat menu.
Using a cheat menu:

  • reputation with PIO/TER was set to +30
  • a Courier Vanguard ship was spawned
  • 1,000,000 Cr were added to my account

In the map trade overlay I can see:

  • RGA-700 sells Metallic Microlattice for 46.66 Cr (50 Avg, modifiers: Low Supply +2%, Partnership Agreement -8%).
  • RHD-932 buys it for 47.25 Cr (Low Demand -6%).

After setting up a supply mule, I can see these lines in debug logs:

Current priority is to supply "stationOrShip" by buying "resources" from "ai"
------------------------------------------------------------------------------------------------------------------------------------
----- needs (1):
PIO Segaris Pioneers Shipyard (RHD-932) wants to buy 55083 (desired 55083, offer 97083, stocklevel 0.127505) Metallic Microlattice for 4725 (-0.34375)

specialWareBasket: [ware.metallicmicrolattice]
----- supply offers (2):
PIO Microlattice Factory II (RGA-700) wants to sell 34984 Metallic Microlattice for 5066 (0.0942857)
PIO Microlattice Factory I (DHC-616) wants to sell 33557 Metallic Microlattice for 5127 (0.181429)

ship capacity: 1960
Occupied Cargo: 0
----- trade offer comparisons
Metallic Microlattice target desired amount 55083 supply amount: 1960 ship can hold: 1960 amount will be: 1960 need unitprice: 4725 supp unitprice: 5066 faction buy modifier: 100 fill level: 0.872495 fill level mod: 1 profit: -6,683.60 Cr
Metallic Microlattice target desired amount 55083 supply amount: 1960 ship can hold: 1960 amount will be: 1960 need unitprice: 4725 supp unitprice: 5127 faction buy modifier: 100 fill level: 0.872495 fill level mod: 1 profit: -7,879.20 Cr
no valid trade found

It seems that find_sell_offer does not take into account a faction reputation modifiers:
50.66 / 50 = 1.0132, 1.32% modifier from high supply only.

I've seen the same behaviour with different modifiers and with different wares, so I'm sure that 1.32% here and 2% shown in game (rounded-up) are the same.

Just to clarify:

  • this bug only applies to a trade offer search
  • the actual amount of credits I gain when trading manually and using a mule is the same
  • the same bug may exist in other mule types, I'm too lazy to look into it
@lznoob lznoob added the Bug Somthing isn't right. label Jan 27, 2022
@bhayden53
Copy link
Collaborator

I poked around vanilla scripts for 10-15 minutes and I don't think they're using the faction discounts either.

So far I do not see a simple scriptproperty that let's me pull the actual discount for a faction. I can find booleans to see if the player has any discount with a faction.

I think there must be a way to actually find the player's modifier, I'm just not seeing it at the moment.

@lznoob
Copy link
Author

lznoob commented Jan 27, 2022

Same here, couldn't find anything in .xml scripts.
In menu_map.lua they are using GetWareExchangeTradeList() function to get tradeDataArray structure and parse it's .pricemodifiers.

And I think it's useless to look for some bool flag.
From the Lua function overview:

pricemodifiers = {
[1] = {
name = modifier name,
level = modifier level,
amount = modifier amount,
expire = modifier expire time
},
[2] = { ... }
}

I think the modifier level is bound to your reputation with a faction, but the actual modifier amount can be just anything.
In the mentioned savegame, I've seen values from 8% to 20% in the same sector.

@bhayden53
Copy link
Collaborator

DeadAir seems to have done some digging into the md, but never got anything quite working

@bhayden53
Copy link
Collaborator

I am going to make a post on the ego forums referencing this issue.

@bhayden53
Copy link
Collaborator

Are you on 4.2 or 5.0 beta?

@lznoob
Copy link
Author

lznoob commented Jan 27, 2022

First noticed it on 4.2, then switched to beta - same problem.

@bhayden53
Copy link
Collaborator

@Misunderstood-Wookiee
Copy link
Owner

Misunderstood-Wookiee commented Jan 28, 2022 via email

@lznoob
Copy link
Author

lznoob commented Jan 28, 2022

No, it's about traders ignoring profitable deals.

Maybe I should summarize in a simplified form, it will also be better for people coming from forum.

Please see the screenshot.

An NPC station is selling Stimulants for 114.32 Cr.
This number already includes 3 modifiers:

  • high supply -27%, self-explainory
  • partnership agreement -27%, comes from my reputation with PIO faction (atleast google says so)
  • VIP customer -11%, from hacking a trade terminal in the station's engineering section

My station wants to buy stimulants for 200 Cr.
It's a good deal, right?

Well, mules / tater trader / probably default autotrader don't think so.

PIO Stimulants Lab I (MFZ-558) wants to sell 4914 Stimulants for 24692 (-0.497754)

- is what they see. 246.92 Cr.
It comes from an average ware price, which is 340 Cr and a high supply price modifier:
340 * (1 - 0.27) = 248.2
Two other modifiers are ignored.

Depending on market situation, your station may sit forever waiting for supplies as you can't rise the price above a certain limit. You also can't manually set prices for drones/amunnition supplies.

@Misunderstood-Wookiee
Copy link
Owner

Misunderstood-Wookiee commented Jan 28, 2022 via email

@lznoob
Copy link
Author

lznoob commented Jan 28, 2022

Yes, <find_sell_offer> only includes low/high supply modifier, not the others (I can't call it a bonus since it can also increase the price).
But I just did a few tests with and without other extensions, the one from screenshot was from 5.0 beta. Would be nice if someone else confirmed this.

And as I said before, only <find_sell_offer> is affected.
If this price is still good enough for the trader to decide to buy something, then when the actual trade happens, the amount of credits withdrawn from my account will be valid.

@bhayden53
Copy link
Collaborator

haven't seen any update from ego on this

@tizubythefizo
Copy link

IIRC, it doesn't actually ignore the other bonuses. Those are (or were) applied in the backend code itself instead of the scripts (granted it's been ~2 years since I was last mucking around in trade scripts so who knows what's changed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Somthing isn't right.
Projects
None yet
Development

No branches or pull requests

5 participants