Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/rmgen-common/gaia_entities.js
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | createObjectGroups( | ||||
0, | 0, | ||||
new AndConstraint([avoidClasses(clMine, 5), ...arrayConstraints]), | new AndConstraint([avoidClasses(clMine, 5), ...arrayConstraints]), | ||||
randomSmallCount, | randomSmallCount, | ||||
50); | 50); | ||||
} | } | ||||
/** | /** | ||||
* Helper for createBalancedMines with default metal counts. | * Helper for createBalancedMines with default metal counts. | ||||
* The current settings are so that a Small 1v1 has about 40K metal, | |||||
* and a Normal 4v4 has about 140K. | |||||
* The setup is biaised so that with fewer players, there are more small mines, | * The setup is biaised so that with fewer players, there are more small mines, | ||||
* and with more players there are proportionally more big mines, to maintain | * and with more players there are proportionally more big mines, to maintain | ||||
* some randomness to the distribution but keep it somewhat fair in 1v1. | * some randomness to the distribution but keep it somewhat fair in 1v1. | ||||
*/ | */ | ||||
function createBalancedMetalMines(oSmall, oLarge, clMine, constraints, counts = 1.0, randomness = 0.05) | function createBalancedMetalMines(oSmall, oLarge, clMine, constraints, counts = 1.0, randomness = 0.05) | ||||
{ | { | ||||
return createBalancedMines( | return createBalancedMines( | ||||
oSmall, | oSmall, | ||||
oLarge, | oLarge, | ||||
clMine, | clMine, | ||||
constraints, | constraints, | ||||
{ | { | ||||
"largeCount": (Math.max(scaleByMapSize(1, 9), getNumPlayers() * 1.8 - 0.8)) * counts, | "largeCount": (Math.max(scaleByMapSize(1, 9), getNumPlayers() * 1.5 - 0.8)) * counts, | ||||
"smallCount": (scaleByMapSize(4, 12)) * counts, | "smallCount": (scaleByMapSize(4, 12)) * counts, | ||||
"randomSmallCount": (scaleByMapSize(1, 8)) * counts, | "randomSmallCount": (scaleByMapSize(1, 8)) * counts, | ||||
}, | }, | ||||
randomness | randomness | ||||
); | ); | ||||
} | } | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator