Devlog #12-17 , MarketSystem update, city system update, BugFixes , TruckSystem, code restructuring, new features
Summarising, from the github commit history,
----------------------------------------------------------------------
New Game design direction was changed here slightly, added store attractiveness for the multiple stores in the same city, added foottrafic per day, which introduces the amount of visitors per day. shoppers* ?
-------------------------------------------------------
MarketSystem - improved and upgraded logic of city buying goods from stores.
Problem 1: Bug Issue with the city order of buying goods depending if there are many stores selling the same product. So for example, the city calculates demand for each product, buys it, but the goes to another store, which then buys again the same amount, so it buys double then what it can take or people can eat.
Problem 2: Bug / architectural issue
Same way another issue was that the stores have a bottleneck per size, of how many items and products it can sell per day. So it would have to first calculate the demand overall, depending on the market size and available products, then decide which products should get or not, and. then divide that in proper proportions so it can onyl buy the maximum amount of goods that store can sell.
Solution : Solution was to introduce store attractiveness, first it goes through all products and decide the attractivness based upon the amount of available goods, the current market price, and then fill up virtual basket with the goods, after which it is fractioned and divided for each store by the amount of purchased goods / divided by the maximum of what stores can actually sell.
Solution 2 : Demand solution for city buying more then it needs. The solution was to introduce the remainingDemand, which essentially starts with full demand, and then the amount of sold goods for each product is removed from the remaining demand. Then the remaining demand is what is left for the demand that is then calculated for the second store (if there is any). and then purchased from the store.
CitySystem, changed for the starting city, hubs are now part of the main tick, and not the tick within the city.
TruckSystem - Now here it was introduced the location and the destination, so sourcelocation and destination. Becuase the Truck will have to be selected in Ui, the source location and destination, and second reason because it has to know from which building it is taking and to which is it transporting.
Obvious issue here is that it can only take from source as industry, and deliver it to store. (althought the code with the store wasn't shown, but trust me hah. But that is something that it will be adjusted later, this way this was working flawlessly. It woudl also use PRoductType as we said it was an Enum with the right order of products, which was used by all systems in the game basically. City makets, trucks, and also database with product information and details, weight etc. all had to be synced perfectly.
Also many other minor changes that will be added later, ( my own feature creep hah) , like average salary, then for trucks fuel consumption, which again had to be with the database with each truck, so from the database with fixed values, the values are copied in the game and used. This approach was way better then hardcoding it directly on the code, beucase i could easly change and adjust balance the game using only inspector in unity..



Comments
Post a Comment