Wares costs in Market
- Code:
//How many of resource gets produced per minute on AVERAGE //Measured on a test map RES_COUNT / TIME in minutes ProductionRate: array [WARE_MIN..WARE_MAX] of Single = ( 88/120, 414/120, 390/120, 160/120, 160/120, 155/120, 218/120, 330/120, 120/120, 138/120, 336/120, 162/120, 324/120, 510/120, 84/180, 84/180, 180/120, 155/120, 180/120, 155/120, 200/120, 195/120, 200/120, 195/120, 200/120, 195/120, 69/120, 122/120); //How much time it takes from owner taking a house till stable production //1 minute on average for the time it takes to process input into output //Some wares need extra time to grow (e.g. Horses) and some //depend on environment supply (e.g. Trunks) //Trunks 1-15 //Wine 1-8 //Corn 1-11 //Pigs 6 //Skins 6 //Horses 6 ProductionLag: array [WARE_MIN..WARE_MAX] of Byte = ( 6, 1, 1, 1, 1, 1, 1, 1, 4, 5, 1, 1, 1, 1, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1);
- Code:
procedure TKMWaresList.CalculateCostsTable; const NON_RENEW = 1.25; //Non-renewable resources are more valuable than renewable ones TREE_ADDN = 0.15; //Trees require a large area (e.g. compared to corn) WINE_ADDN = 0.1; //Wine takes extra wood to build ORE_ADDN = 0.2; //You can only build a few iron/gold mines on most maps (compared to coal) begin //Take advantage of the fact that we have both classes in same unit //and assign to private field directly Wares[wt_Trunk ].fMarketPrice := (1/ProductionRate[wt_Trunk]) + TREE_ADDN; Wares[wt_Stone ].fMarketPrice := NON_RENEW*(1/ProductionRate[wt_Stone]); Wares[wt_Wood ].fMarketPrice := (1/ProductionRate[wt_Wood]) + (1/2)*Wares[wt_Trunk].MarketPrice; Wares[wt_IronOre ].fMarketPrice := NON_RENEW*(1/ProductionRate[wt_IronOre]) + ORE_ADDN; Wares[wt_GoldOre ].fMarketPrice := NON_RENEW*(1/ProductionRate[wt_GoldOre]) + ORE_ADDN; Wares[wt_Coal ].fMarketPrice := NON_RENEW*(1/ProductionRate[wt_Coal]); Wares[wt_Steel ].fMarketPrice := (1/ProductionRate[wt_Steel]) + Wares[wt_IronOre].MarketPrice + Wares[wt_Coal].MarketPrice; Wares[wt_Gold ].fMarketPrice := (1/ProductionRate[wt_Gold]) + (1/2)*(Wares[wt_GoldOre].MarketPrice + Wares[wt_Coal].MarketPrice); Wares[wt_Wine ].fMarketPrice := (1/ProductionRate[wt_Wine]) + WINE_ADDN; Wares[wt_Corn ].fMarketPrice := (1/ProductionRate[wt_Corn]); Wares[wt_Flour ].fMarketPrice := (1/ProductionRate[wt_Flour]) + Wares[wt_Corn].MarketPrice; Wares[wt_Bread ].fMarketPrice := (1/ProductionRate[wt_Bread]) + (1/2)*Wares[wt_Flour].MarketPrice; Wares[wt_Pig ].fMarketPrice := (1/ProductionRate[wt_Pig]) + (1/2)*4*Wares[wt_Corn].MarketPrice; //1/2 because two products are made simultaneously Wares[wt_Skin ].fMarketPrice := (1/ProductionRate[wt_Skin]) + (1/2)*4*Wares[wt_Corn].MarketPrice; //1/2 because two products are made simultaneously Wares[wt_Leather ].fMarketPrice := (1/ProductionRate[wt_Leather]) + (1/2)*Wares[wt_Skin].MarketPrice; Wares[wt_Sausages ].fMarketPrice := (1/ProductionRate[wt_Sausages]) + (1/3)*Wares[wt_Pig].MarketPrice; Wares[wt_Shield ].fMarketPrice := (1/ProductionRate[wt_Shield]) + Wares[wt_Wood].MarketPrice; Wares[wt_MetalShield].fMarketPrice := (1/ProductionRate[wt_MetalShield]) + Wares[wt_Steel].MarketPrice + Wares[wt_Coal].MarketPrice; Wares[wt_Armor ].fMarketPrice := (1/ProductionRate[wt_Armor]) + Wares[wt_Leather].MarketPrice; Wares[wt_MetalArmor ].fMarketPrice := (1/ProductionRate[wt_MetalArmor]) + Wares[wt_Steel].MarketPrice + Wares[wt_Coal].MarketPrice; Wares[wt_Axe ].fMarketPrice := (1/ProductionRate[wt_Axe]) + 2*Wares[wt_Wood].MarketPrice; Wares[wt_Sword ].fMarketPrice := (1/ProductionRate[wt_Sword]) + Wares[wt_Steel].MarketPrice + Wares[wt_Coal].MarketPrice; Wares[wt_Pike ].fMarketPrice := (1/ProductionRate[wt_Pike]) + 2*Wares[wt_Wood].MarketPrice; Wares[wt_Hallebard ].fMarketPrice := (1/ProductionRate[wt_Hallebard]) + Wares[wt_Steel].MarketPrice + Wares[wt_Coal].MarketPrice; Wares[wt_Bow ].fMarketPrice := (1/ProductionRate[wt_Bow]) + 2*Wares[wt_Wood].MarketPrice; Wares[wt_Arbalet ].fMarketPrice := (1/ProductionRate[wt_Arbalet]) + Wares[wt_Steel].MarketPrice + Wares[wt_Coal].MarketPrice; Wares[wt_Horse ].fMarketPrice := (1/ProductionRate[wt_Horse]) + 4*Wares[wt_Corn].MarketPrice; Wares[wt_Fish ].fMarketPrice := NON_RENEW*(1/ProductionRate[wt_Fish]); end;
Stones 0,362318843603134
Timber 1,06451046466827
Iron ore 1,13749992847443
Gold ore 1,13749992847443
Coal 0,967741966247559
Iron 2,65570068359375
Gold 1,41625726222992
Wine barrels 1,10000002384186
Corn 0,86956524848938
Loaves 1,16229581832886
Flour 1,61030602455139
Leather 2,31136417388916
Sausages 1,52928996086121
Pigs 3,88198757171631
Skins 3,88198757171631
Wooden shields 1,73117709159851
Iron shields 4,39763641357422
Leather armor 2,97803092002869
Iron armor 4,39763641357422
Hand axes 2,72902083396912
Swords 4,23882722854614
Lances 2,72902083396912
Pikes 4,23882722854614
Longbows 2,72902083396912
Crossbows 4,23882722854614
Horses 5,21739149093628
Fish 1,2295081615448
Exported by F11 - Export - Resource values
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de