Market Value

Discussion in 'Press Start' started by Quincunx, Mar 2, 2007.

  1. Quincunx

    Quincunx anti-anti Staff Member Administrator

    Joined:
    Mar 31, 2004
    Messages:
    20,211
    Location:
    U.S.A.
    Ratings:
    +24,062
    This is about how your profit decreases over time as you trade between the same ports. I assume that when you buy a commodity the price goes up and when you sell the price goes down. If I knew how to read the source code I could go dig up the numbers, but since I can't I'll have to wait for somebody else to help us out.

    The real question I have is, how long does it take for the values to reset? Is it when you log off or is it after a certain length of time?

    Can the change in price affect the next player who comes along and wants to trade at a port?
  2. NAHTMMM

    NAHTMMM Perpetually sondering

    Joined:
    Mar 29, 2004
    Messages:
    14,699
    Location:
    Wisconsin
    Ratings:
    +9,909
    Depends; I believe they "restock" at least partway at each update; absolutely.
  3. Nautica

    Nautica Probably a Dual

    Joined:
    Aug 10, 2005
    Messages:
    11,555
    Location:
    St. Louis
    Ratings:
    +6,504
    Not sure about the value reset timing. I tend to vary my trade routes--do 5 or 10 cycles on one of them, then hop over and do more on another one--just to avoid the diminishing returns. I can burn a lot of turns very quickly that way, and by the time I'm ready to trade again, the values are almost always reset.
    • Agree Agree x 1
  4. NAHTMMM

    NAHTMMM Perpetually sondering

    Joined:
    Mar 29, 2004
    Messages:
    14,699
    Location:
    Wisconsin
    Ratings:
    +9,909
    This appears to be the main bit of the code relevant to price (other kinds of tradables are presumably treated similarly):

    PHP:
    if($sectorinfo[port_type] == "ore")
      {
        
    $ore_price $ore_price $ore_delta $sectorinfo[port_ore] / $ore_limit $inventory_factor;
        
    $sb_ore $l_selling;
      }
      else
      {
        
    $ore_price $ore_price $ore_delta $sectorinfo[port_ore] / $ore_limit $inventory_factor;
        
    $sb_ore $l_buying;
      }
    Which looks to me like (I could easily be wrong, I don't even know whether PHP follows the expected order of operations):

    (Change the + to a - at a port where you're selling the stuff, of course.)

    With ore, the Nominal_price is set to 6 and Nominal_amount_in_port is set to 100,000,000, and the above simplifies to

    Hmmm, no, that doesn't work--charting the function shows it's got a hump in the middle. Probably that stupid unexplained inventory factor is getting in the way.


    Here's part of the file dealing with restocking of bases:
    PHP:
    QUERYOK($db->Execute("UPDATE $dbtables[universe] SET port_ore=port_ore+($ore_rate*$multiplier
    WHERE port_type='ore' AND port_ore<
    $ore_limit"));
      echo 
    "Adding ore to all ore ports...";
      
    QUERYOK($db->Execute("UPDATE $dbtables[universe] SET port_ore=port_ore+($ore_rate*$multiplier
    WHERE port_type!='special' AND port_type!='none' AND port_ore<
    $ore_limit"));
      echo 
    "Ensuring minimum ore levels are 0...";
    I would guess the $multiplier is just the number of turns per update (3 in our game).
    • Agree Agree x 1
  5. Patch

    Patch Version 2.7

    Joined:
    Aug 26, 2006
    Messages:
    3,450
    Ratings:
    +904
    I noticed these problems at one of my trade routes. Then when I found to spot to build my home sector, I made a trade route that barely decreased in productivity and I always made profit in both directions of the route. Just gotta find two ports that help level out each other.
  6. matthunter

    matthunter Ice Bear

    Joined:
    Apr 26, 2004
    Messages:
    26,996
    Location:
    Bottom of the bearstack, top of the world
    Ratings:
    +48,821
    Ore->Goods and vice-versa makes a profit both ways, factoring in the energy you gain realspacing with a fuel scoop. Organics and Energy don't sell for enough to make much of a profit.
  7. Patch

    Patch Version 2.7

    Joined:
    Aug 26, 2006
    Messages:
    3,450
    Ratings:
    +904
    I knew that, but I found an ore <-> goods route to be more profitable than another one of the same type and distance. In fact, on the goods stop I didn't make profit, but always came out ahead due to the stop at the ore port.
  8. Powaqqatsi

    Powaqqatsi Haters gonna hate.

    Joined:
    Apr 15, 2004
    Messages:
    8,388
    Ratings:
    +1,341
    Once you get high enough upgrades, (when you get to a point where market value changes happen very quickly), trading becomes pretty useless.

    Start working on planet production. Then eventually you won't have to do that, your cash will come from interest.
    • Agree Agree x 1
  9. Nautica

    Nautica Probably a Dual

    Joined:
    Aug 10, 2005
    Messages:
    11,555
    Location:
    St. Louis
    Ratings:
    +6,504
    Once you get to Hull level ~26 or above, the Profit margin decreases pretty quickly on Trade Route runs, especially if you automate the repetitions. Luckily, there are ways around that.
  10. Elwood

    Elwood I know what I'm about, son.

    Joined:
    Mar 23, 2004
    Messages:
    30,008
    Location:
    Unknown, but I know how fast I'm going.
    Ratings:
    +25,065

    Yep. I just did one trade route just for shits and giggles and I completely emptied both ports after only one run. :(

    But, that's okay because I just watched the clock. My interest is growing. I make well over 1 trillion credits every six minutes just in interest. ;)
  11. matthunter

    matthunter Ice Bear

    Joined:
    Apr 26, 2004
    Messages:
    26,996
    Location:
    Bottom of the bearstack, top of the world
    Ratings:
    +48,821
    I'm at Level 25 hull, and I empty a full port in 40 runs. At present, I use a few runs to get up enough cash to supply sectors with more fighters and mines and not have to touch my interest (it's not insubstantial, but I need a fair chunk to buy the next upgrade).