Have a few comments about the above:You would think that with all of the revamping and improving the author has done, they would have jazzed up the commodities market a bit, but no....
b=Pleides, g=Beehive and r=Orion sectors.Code:label trade_price: $ grain_b = round(32*(1+0.2*math.sin(day*0.25)),1) $ protein_b = round(180*(1+0.1*math.sin(day*0.2+3)),1) $ fuel_b = round(254*(1+0.08*math.sin(day*0.1+1)),1) $ machinery_b = round(86*(1+0.12*math.sin(day*0.25+4)),1) $ titanium_b = round(60*(1+0.15*math.sin(day*0.15+2)),1) $ beryllium_b = round(120*(1+0.1*math.sin(day*0.2+5)),1) $ grain_g = round(40*(1+0.2*math.sin(day*0.2+2)),1) $ protein_g = round(200*(1+0.1*math.sin(day*0.25+3)),1) $ fuel_g = round(226*(1+0.08*math.sin(day*0.15+4)),1) $ machinery_g = round(74*(1+0.12*math.sin(day*0.2+1)),1) $ titanium_g = round(69*(1+0.15*math.sin(day*0.1)),1) $ beryllium_g = round(132*(1+0.1*math.sin(day*0.15+3)),1) $ grain_r = round(48*(1+0.2*math.sin(day*0.1+4)),1) $ protein_r = round(220*(1+0.1*math.sin(day*0.15+5)),1) $ fuel_r = round(240*(1+0.08*math.sin(day*0.12+2)),1) $ machinery_r = round(80*(1+0.12*math.sin(day*0.22+5)),1) $ titanium_r = round(51*(1+0.15*math.sin(day*0.13+6)),1) $ beryllium_r = round(110*(1+0.1*math.sin(day*0.22+3)),1)
Python has a very nice random number module in its standard library to make things a bit spicier than a sinusoidal pattern. Also events can be put into the market news like panics and gluts. Don't forget the effect of the actions of grifty pirates trying to corner the market, or the Callisto version of Reddit sticking it to the Man when he tries to short sell the user community's childhood memories into the dumpster.
- Did you realise that the commodities were controlled by sine functions before you looked at the code?
- Totally aware of the random function and they are used all over the place in the game. If you make the affect of a random number noticeable, you will frequently have the player loose money on a trade (pisses off the player). If it is small enough, to avoid this, it's pointless.
- Trying to model supply / demand aspects would require a system to advise the player of events that may affect the stock market. This could be news stories (too much effort or repeatable boring content). Alternatively an inventory quantity of the commodities in each sectors (doable, however how much would it really add to the game?). Also to have this make sense, you would need to store goods for more than just 1 day, which flies in the face of being a trader.
- Things like shorting, leverage, options etc. are all part of a stock market, however you are only a trader taking items from A to B.
When it comes down to it, the trading aspect is just a mechanic to increase immersion into the game. It's a sci fi game and not trading simulator 2137. The currently employed system is simple and effective and my focus is on other aspects of the game. From this point onwards, the mechanics in the game (trading / salvage / piracy) have been squared away and I am now predominately focused on story development.
PS: I recently played Mech Mechanic Simulator which has a stock market aspect, allowing you to purchase shares of the three main mech manufacturers. The system in this game is exploitable and completely breaks the finances in the game. Actually devising a decent system is a little harder than you think.