← Devlog

Updated

Price tables that do not explode

Keeping a trade economy readable when every port has a stock, a price and a player who keeps buying the cheap thing.

A trade economy looks like a table of numbers until you let the player touch it. Then it is a system with feedback, and the feedback is what decides whether the game is interesting or whether it has one route that beats everything.

Galaxy Trader’s first price table had 6 ports, 4 goods, and 24 numbers I chose by feel. It worked for the length of one test run. Then I bought ore at Kepler, sold it at Halo, and discovered the pattern was so obvious that the second port was already the last decision in the game.

The three things I keep

The rewrite has three values per port and good, and nothing else:

  • Stock, the amount actually sitting at the port right now.
  • Ideal stock, what the port would like to hold, which comes from its production and consumption.
  • Base price, the price at ideal stock.

Price falls out of the first two, and the drift rule pulls stock back toward ideal every tick. That is the entire economy. Everything else I tried — elasticity constants, per-good multipliers, a demand curve — was a knob that made the table harder to read without making the game better.

Why the player can still break it

Because stock moves, a route that pays today may not pay in ten minutes. That is the feature. The problem is that it is also a way for the player to find a loop that feeds itself: buy at Kepler, sell at Halo, the stock returns to ideal over time, repeat. It is not an exploit — it is the intended trade route — but the simulation should not reward it forever.

Two rules fix the worst of it. Arbitrage between two ports is capped by the drift rate, so a circuit only pays as fast as the ports recover. And every port consumes something it does not produce, so the loop has to include a leg that is not the profitable one. Neither rule is visible to the player. Both show up as “this route stopped being worth it” and “I need a third stop”.

The note I left myself

The economy is the first system in this project that I can change without re-tuning. That is worth more than the numbers being right, because the numbers are not right; they are merely not yet wrong in a way the player notices.

I have not touched the combat, the crew or the missions. The economy is the part of Galaxy Trader I can defend, so it gets the posts until it stops being the interesting problem.