Objects in Space

Objects in Space

davecortesi 2019 年 6 月 1 日 下午 5:04
Trying to decode "trading_xxx.txt" files
I thought I'd write a little python script to process the "trading_sysname.txt" files, aiming to extract info for a trading guide. However, although the files are readable (a big plus, they could easily have been unreadable binary) the data items are not as easy to interpret as I'd hoped. Here's a couple of lines from Leo/Crassus,

commodity=ale,8,1_100_5,1d8+4,0d0+0 commodity=spirits,6,1_100_5,1d6+6,1d6+6 commodity=rwaste,-2,1_100_5,1d4+4,1d2+2 commodity=scrap,1,1_100_5,1d2+4,1d8+8 commodity=prometh,92,10_10_23,1d14+2,0d0+0 commodity=organs,54,6_50_15,1d2+0,1d2+0

Now, neither Ale nor Prometheum are advertised for sale at Crassus, so I'm guessin' that the final item,
0d0+0
means "don't display" and others, like
1d6+6
, refer to how to display this commodity on the trading terminal.

The number after the name seems to be related to the displayed price but not identical to it, and not convertible to it by a simple multiplier. What the two middle items, like
1_100_5,1d8+4
are about, I've no guess. Anyone?
< >
正在显示第 1 - 4 条,共 4 条留言
Dr_Bicinium 2019 年 6 月 2 日 上午 11:10 
For me this is dice: 1d6+6 means roll 1d6 and add 6, like in traditional roleplaying games. You probably already spotted this, but just in case i explicit it.
So the last one might be the number of items available.
The 1_100 could be some kind of scale, adjusted by another dice roll? Maybe it's why you don't spot multipliers?
最后由 Dr_Bicinium 编辑于; 2019 年 6 月 2 日 上午 11:11
davecortesi 2019 年 6 月 5 日 上午 10:17 
That's very ingenious, thank you! I don't do role-playing games so didn't spot it. So 1d6+6 means basically, a random number between 7 and 12. Minimum 7 because a die doesn't have a "zero", the roll will be between 1 and 6, plus 6. Kind of a roundabout way to do it in a computer algorithm, but what do I know.

I'm going to test this. I'm gonna dock and undock with Crassus a bunch of times and see what it offers.
davecortesi 2019 年 6 月 5 日 上午 11:08 
Well, not that simple. I went back and forth between Crassus and Penitent, noting prices. There is something going on but it is not obvious what.
Crassus offers four commodities coded thus:
commodity=spirits,6,1_100_5,1d6+6,1d6+6 commodity=rwaste,-2,1_100_5,1d4+4,1d2+2 commodity=scrap,1,1_100_5,1d2+4,1d8+8 commodity=organs,54,6_50_15,1d2+0,1d2+0
On six visits the offers were
spirits rwaste scrap organs pr. qu. pr. qu. pr. qu. pr. qu. 25 9 -5 4 5 14 480 2 25 10 -5 3 5 15 390 2 25 7 -5 3 5 12 270 2 30 9 -5 4 5 12 270 2 30 10 -5 3 5 13 270 2 30 7 -5 4 5 11 270 1
I was going back and forth between Crassus and Penitent, which has three commodities coded
commodity=rwaste,-2,1_100_5,1d4+4,1d2+2 commodity=scrap,1,1_100_5,1d2+4,1d8+8 commodity=organs,54,6_50_15,1d2+0,1d2+0
(i.e., identically) and their prices were very similar.

A couple of things pop out to me. Considered as die rolls as @Dr_Bicinium suggested, the final item could account for quantity offered: "1d2+2" for the quantity of rwaste, "1d8+8" for the quantity of scrap, "1d6+6" for spirits and "1d2+0" for having either 1 or 2 organs.

The first item, an integer, must be related to price, for example "rwaste,-2" and rwaste is always a negative number. That integer is proportional to the price (6 versus 25-30, -2 versus -5, 1 versus 5, and 54 versus 480-270), but it must be perturbed by another factor which I don't see.

Scrap and rwaste are very stable, which suggests that the die roll in the third position is not applied to the price. If it were, the "1d2+4" would be moving the price of scrap away from 5.

That's all I have for now.
最后由 davecortesi 编辑于; 2019 年 6 月 5 日 上午 11:10
Dr_Bicinium 2019 年 6 月 5 日 下午 2:01 
You're welcome, happy to help!

I guess there is at some point a low and a high value for price, and maybe for quantity too. I mean the way trade is usually done, one system produce a good and another needs it. So we should find that difference in the scale too. At glance, the 1_100_5 makes me think of it, with a low integer first (1) and a high in the end (5). The 100 makes me think of a kind of percentage, or threshold. But considering your logs, i can't see a relation.

Maybe it's the same low / high stuff for the quantity, with one xdy+z for min and the other for max? But it doesn't seem constant, although the fact that the two dices are equal for spirits and organ must mean something.
< >
正在显示第 1 - 4 条,共 4 条留言
每页显示数: 1530 50