Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/unknown.js
Show First 20 Lines • Show All 632 Lines • ▼ Show 20 Lines | for (let mountain of distributePointsOnCircle(numPlayers, startAngle + Math.PI / numPlayers, fractionToTiles(0.5), mapCenter)[0]) | ||||
// Small mountain at the map border between the players to ensure separation of players | // Small mountain at the map border between the players to ensure separation of players | ||||
createArea( | createArea( | ||||
new ClumpPlacer(diskArea(scaleByMapSize(4, 22)), 0.95, 0.6, Infinity, mountain), | new ClumpPlacer(diskArea(scaleByMapSize(4, 22)), 0.95, 0.6, Infinity, mountain), | ||||
new SmoothElevationPainter(ELEVATION_SET, heightMountain, 0), | new SmoothElevationPainter(ELEVATION_SET, heightMountain, 0), | ||||
avoidClasses(clPlayer, 5)); | avoidClasses(clPlayer, 5)); | ||||
} | } | ||||
g_Map.log("Creating passages between neighboring players"); | g_Map.log("Creating passages between neighboring players"); | ||||
let passes = distributePointsOnCircle(numPlayers * 2, startAngle, fractionToTiles(0.35), mapCenter)[0]; | const passes = distributePointsOnCircle(numPlayers * 3, startAngle, fractionToTiles(0.35), mapCenter)[0]; | ||||
for (let i = 0; i < numPlayers; ++i) | for (let i = 0; i < numPlayers; ++i) | ||||
{ | { | ||||
// Create one pass between each neighboring base, create two passes in the case of two players. | |||||
// Notice we can't use the passes formula for n > 2 because the path might end inside the mountains. | |||||
lyv: What does this mean? That the passage through the mountain is a subset of the mountain area?
I… | |||||
createArea( | createArea( | ||||
new PathPlacer( | new PathPlacer( | ||||
passes[2 * i], | numPlayers > 2 ? playerPosition[i] : passes[3 * i + 1], | ||||
lyvUnsubmitted Not Done Inline ActionsTo be more specific, why isn't this just playerPosition[i] and playerPosition[(i+1) % numPlayers] for 0 <= i < numPlayers? Trying to calculate the path endpoints seems redundant when the target player position is already known. lyv: To be more specific, why isn't this just `playerPosition[i] and playerPosition[(i+1) %… | |||||
passes[2 * ((i + 1) % numPlayers)], | numPlayers > 2 ? playerPosition[(i + 1) % numPlayers] : passes[3 * i + 2], | ||||
scaleByMapSize(14, 24), | scaleByMapSize(14, 24), | ||||
0.4, | 0.4, | ||||
3 * scaleByMapSize(1, 3), | 3 * scaleByMapSize(1, 3), | ||||
0.2, | 0.2, | ||||
0.05), | 0.05), | ||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 2)); | new SmoothElevationPainter(ELEVATION_SET, heightLand, 2)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 422 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
What does this mean? That the passage through the mountain is a subset of the mountain area?
I am more curious as to why this isn't just simply a path from base to base that stays on the mountain? What goes wrong in that case?