Devlog #37-39 - MarketSystem BUG fix - Major Update*** Unlocking products *** , added fuelConsumptionPerday (love the data) , and some minor stuff, Growth Explained! Spoiler alert
***** Unlocking products! GAME DESIGN CHANGE**** - from the devlog before? i think
Anyhow, what this changed and now I implemented it, is the unlocking products per city, before we had each city has all the products and play should supply each city with all, but now i changed it so each city has specific 2 products and later unlocked 4, and then when the city grows, more and more. But ther are different, which is what we discussed about before, and that is that it is cross-city, so industry in city 1, ahs to deliver goods to City 3, but City 3 industry has to sell goods into City 5.. etc
So, the whole system was changed because before it was on the start of the game, addedall the products from the list, now I kinda hardcoded the values and products of each city( idealy i will be able to make seed generation one time..in this ..year..or next..) , so now each product has a certain amount and requirement of the given city in order to get unlocked. That is how it works, the pop threshold is passed and then the products unlocks, and its added to the required products for city to grow.
Yeah, you heard it,
very beautiful mechanism of self growth limiter ( like anyone will ever read this haha) , so lets say for city lets say tier1, in order to grow takes 2 products, so growth multiplier is multiplied by the amount of saturation ont he market ,demand/supply, and then also divided by the amount of products that are supplied at all, which means, that if the city 1 has 2 products, when it has,4 the speed of growth depends upon filling up all the 4 markets if one wants to have same growth as for the first 2 products.. so the more it grows that harder it is to upkeep, essneitally this mechanism keeps cities from exploding. but as well as gives realism to it. This is one of most beautiful ideas I have had i think here, and one of the reasons why the game si called Equilibrium, is because i love self balancing systems. lovee
Anyhow, back to data p**n , which i love, data data and more data, anyhow,
Truck fuel consumption, after some deliberation where it should be calculated, simply adding it to the hub which actually contains the trucks, and then in the company dashboard calculating it all was the best solution. So, it simply goes through all trucks and += the consumed fuel calculated by the previous methods, that also calculated live for UI in order to show the future consumption etc.. all connected, beautiful.. But its not necessary just fun to see, how much hundreds of trucks *hopefuly hah, will spend fuel, and perhaps later also have an impact on enviroment.. ( good idea, writing this down ha)
Sorry for comments in Serbian, basically it divides by the price of the fuel, which now is fixed, but it will be dynamic later, because its all conected and prices are also global of fuel etc.. ( still in development)
______________________________________________________________________
Major bug and annoyance by freaking MarketSystem:
What happened is when the population started to grow
Tiny code snippet, because I dont want to reveal all the game mechanisms :D
Anyhow, it will be easier if i explain it, so lets say the terms are valid for unlocking the new product of the city, and then when the product unlocks this up goes, changes the value of the market for the city( product). into active and vital, but, then it updates market data. That was the first issue, what is inside is of UpdateMarket Data, is that it goes through markets, then resets them to 0, and then calculates the new value. Which was essentially reseting the value for the markets even that are not new. So it would reset for old, but even that it would work. the REAL MADNESS of this bug was that if the population grows , then the market actually stays on 0. So lets go through it once again, city grows, it has certain supply lets say product a and product b have supply of 20% , then a new product appears, resets it goes well, but the population grows, for even a single person, and all markets are back to 0. Funny thing is that the store sells, city buys, revenue is there, but the graphs are totally wrong, and shows totally wrong information.
So what was actually happening, becuase of the population growth it would be valid this :
if (popRatio >= product.populationRatioThreshold && city.tier >= product.minimumTier)
then it would reset the values to 0 of markets, but the MarketSystem comes way before the CitySystem, which actually runs this, because the unlocking of the products and markets is a part of the city. So essentially The citySystem overrides the values to 0 .. The real question was why didnt it always reset ? I couldn't figure that out, but the values would basically reset each other, so the first would reset the second etc.. constantly overwriting. I couldn't figure it out. But what i did was simpel fix, i removed the UpdateMarketData, and simply added this:if (popRatio >= product.populationRatioThreshold && city.tier >= product.minimumTier)
{
// so here we only resetthe values for the new market, and not touch the all markets in the city. Yeah, i couldnt find the reason why, no one could realize why it was the issue.
if (!market.isActive)
{
market.demand = city.population * market.demandMultiplier;
}
***and here it changes to true , and to vital.
Thank you!!!



Comments
Post a Comment