schombert / Project-Alice

An open-source game
https://schombert.github.io/Project-Alice/
GNU General Public License v3.0
306 stars 55 forks source link

Goods price is not limited #1766

Closed EmpathieB closed 3 weeks ago

EmpathieB commented 3 weeks ago

Hello,

The price of goods is not limited contrary to base game. On the wiki it is specified that prices should be :

I have read the project docs and it says the following : Prices are then limited to being within 1/5th to 5x the base price of the commodity.

It seems there is a bug somewhere preventing the limits to work.

Both higher limits : liquor price

And lower limits : tropicalwood

And while quickly checking the code, I can see no reference to these limits : https://github.com/schombert/Project-Alice/blob/main/src/economy/economy.cpp#L3896

        float speed_modifer = (overdemand_factor - oversupply_factor);

        float price_speed = 0.05f * speed_modifer;

        if(current_price < 1.f) {
            price_speed *= current_price;
        } else {
            price_speed *= math::sqrt(current_price);
        }

        current_price += price_speed;

        state.world.commodity_set_current_price(cid, std::clamp(current_price, 0.001f, 100000.0f));
schombert commented 3 weeks ago

Yes, these limits were removed as part of the work to make the economy more generally functional. Hitting the limit would make supply and demand "wacky" at those extremes, and the limits being so small in range made that behavior quite common