Market deal cost.
-
I just wanted to try to figure something out.
Game.map.getRoomLinearDistance("W60S50", "E68S57", true)
33
Game.market.calcTransactionCost (5000,"W60S50", "E68S57")
7676
Game.map.getRoomLinearDistance("W60S50", "E68S57", false)
129It seems like calcTransactionCost is not wraping the ends of the map, isn't it supposed to? I did a deal between these room, and the cost was what was returned by calcTransitCost.Something else I thought was curious, is that the range indicated in the market screen was 13.I tried to use excel to estimate the cost, but I couldn't get it to match up with the cost returned by calcTransactionCost. Normally I'm pretty good with excel, but I figured I'd see if someone had an answer, or if it just doesn't work as documented.
-
OK, found the answer, screen is wrapping as expected. Turns out the excel function I was looking for was LN not LOG.
=CEILING(amount*(LN(0.1*distance + 0.9) + 0.1))
The market UI still was showing a different distance than the game, my guess is the the wrapping point changes over time, and the UI is lagging a bit.
-
I'd like to confirm your findings; as I observed the same.
- calcTransactionCost does not wrap the map. However, the market UI does.
- calcTransactionCost uses natural log and not log base 10
The formula found in the calcTransactionCost documentation uses javascript's Math.log routine, which uses the natural log by default.
Coincidentally, if you chart this, you'll find that for a room of distance 15, the energy cost will equal the units transferred. IE, spend 1000 energy to sell 1000 energy 15 rooms away.
Strictly my opinion, but I feel the energy cost for transfers is rather high. I'm sitting on a resource surplus, but am unwilling to unload it as all transactions appear to be a significant net negative.
-
> Strictly my opinion, but I feel the energy cost for transfers is rather high. I'm sitting on a resource surplus, but am unwilling to unload it as all transactions appear to be a significant net negative.
Yup.
-
*bump* There appears to be a bug either in the market UI or in `Game.market.calcTransactionCost()`, depending on developers intentions for wrapping behavior.
I'm currently positioned in the far south-east corner of the map. When attempting to deal with a player in the far north-west corner, the market UI echos a distance of 4 rooms. However, `calcTransactionCost` and `deal` are using the non-wrap distances for determining energy transfer cost.
-
There was an issue due to recent world size increase. It is fixed, distances are now the same in the market UI and game API.