Page 2 of 2 FirstFirst 12
Results 13 to 16 of 16

Thread: How does the system calculate the average of prices

  1. #13
    Lesser Wizard
    Join Date
    Jun 2018
    Location
    Nowhere
    Posts
    407

    Default

    Quote Originally Posted by JimIzPro View Post
    How does the system calculate the average of prices?

    Player trades and vends or there's a fixed price

    and also, why are there some items that have no value checks
    Code:
    std::map<short, float> prices;
    
    void OnTrade(int item, int count, int locks)
    {
      float price = (float)locks / (float)count;
      bool isPer = price < 1;
      if (isPer)
        prices[item] = (float)(-((float)count / (float)locks) + prices[item]) / 2;
      else 
        prices[item] = (float)(price + prices[item]) / 2;
    }
    somewhat how I think it works (average so one price does not overwrite another immediately

    - - - Updated - - -

    Quote Originally Posted by Starkos View Post
    We'd really rather not get into specifics on this one in order to reduce the possibility of manipulation. We've done a few things to hedge against it already, but you can never be too careful, y'know?

    Even without knowing how it works behind the scenes, I really hope you all enjoy the update. We've been working on this one for a while! I know it may seem like a small thing, these pricing checks, but believe me, getting all the tracking in place and funneling it correctly was a ton of work!
    "a while"
    literally changed the trade function to also calculate prices stored in a std::map *** is wrong with you how's that a while's worth of work

  2. #14
    Master Sorcerer JimIzPro's Avatar
    Join Date
    Mar 2018
    Location
    Never-ending Darkness
    Posts
    2,943

    Default

    Quote Originally Posted by pannenkoek2012 View Post
    "a while"
    literally changed the trade function to also calculate prices stored in a std::map *** is wrong with you how's that a while's worth of work
    the hell is your problem

    RISK - A Love Story | The Ruined (Growtopia Film)

    "The future belongs to those who believe in the beauty of their dreams."
    - Eleanor Roosevelt

  3. #15
    Lesser Wizard GodEater's Avatar
    Join Date
    Oct 2016
    Location
    In Front of my laptop
    Posts
    488

    Default

    I wonder why these eggs are cheap.
    Name:  Screenshot_2020-01-02-21-20-28-192_com.rtsoft.growtopia.png
Views: 108
Size:  472.4 KB

    IGN: FULLOFREGRET
    Leader of Egg Guild
    Instagram: @fullofregret.gt
    Discord:f FullOfRegret#4466
    YouTube Channel: FullOfRegret Official

  4. #16
    Lesser Wizard Coldshots's Avatar
    Join Date
    Nov 2019
    Location
    Location
    Posts
    235

    Default

    Quote Originally Posted by GodEater View Post
    I wonder why these eggs are cheap.
    Name:  Screenshot_2020-01-02-21-20-28-192_com.rtsoft.growtopia.png
Views: 108
Size:  472.4 KB
    Imma sell my eggs for 25/1 then
    Oof

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •