Our Scripts Vault contains many game scripts that you can use to create your own game!
That's similar to the loot formula you asked for some time ago, right?
1) calculate as if the cost is the same2) divide the calculated material costs by the multiplier3) divide the target total materials by the sum of costs from (2)4) divide each of the costs from (2) by the coeficient from (3)
I also realized that instead calling the materials for each level "percentage", it should be "weight".
$totalMaterials = getTotalMaterialsCost(); // e.g. 1750$materials = getMaterialsCosts(); // array[wood, stone, bricks...] ints, 1750 * respective %foreach($materials as $key => $material) $materials[$key] *= $materialCostRatio[$key];$totalRatio = $totalMaterials / array_sum($materials);foreach($materials as $key => $material) $materials[$key] *= $totalRatio;var_dump($materials); // final materials costs
Imho doesn't matter, you can convert percentage <= => weight
1) I believe you're the only one that can answer that right now ... difficult for us to say with no info and no balance testing availible
OK, I got the answer to the second question, it's rather trivial after thinking wood_needed=totalprice*wood_percentage/100/wood_price; // repeat for stone, bricks and marbleSo level 7 would be 1750*30/100/0.40=1312 wood (worth 524 gold which is about 30%)Quote from: Nox on January 14, 2012, 04:26:47 PMImho doesn't matter, you can convert percentage <= => weightIndeed...Quote from: Nox on January 14, 2012, 04:26:47 PM1) I believe you're the only one that can answer that right now ... difficult for us to say with no info and no balance testing availibleNo, no. Just the general concept here. You build a mansion. At the beginning it is just a meager hut made of wood, then you start using stone, next bricks, and finally marble. I'm here for the "mood", just an impression. Because mathematically it does not matter, since you can always buy the materials and the materials total cost will be the same no matter which composition of materials you used.I guess, its turning into a design/eastetic question
aesthetic? reading your spelling is driving me insane.