Index: binaries/data/mods/public/maps/random/rmgen-common/player.js =================================================================== --- binaries/data/mods/public/maps/random/rmgen-common/player.js +++ binaries/data/mods/public/maps/random/rmgen-common/player.js @@ -83,23 +83,22 @@ ++i; } - // Place entities surrounding it - let space = 2; + // create a circle with a point for each type of starting unit + let entityPoints = distributePointsOnCircle(civEntities.length - i, orientation, dist, location); + + // place starting units for (let j = i; j < civEntities.length; ++j) { - let angle = orientation - Math.PI * (1 - j / 2); let count = civEntities[j].Count || 1; - for (let num = 0; num < count; ++num) - { - let position = Vector2D.sum([ - location, - new Vector2D(dist, 0).rotate(-angle), - new Vector2D(space * (-num + (count - 1) / 2), 0).rotate(angle) - ]); - - g_Map.placeEntityPassable(civEntities[j].Template, playerID, position, angle); - } + // create a new group for each type of entity + let group = new SimpleGroup( + [new SimpleObject(civEntities[j].Template, count, count, 1, 1)], + true, + null, + entityPoints[0][j - i] + ); + group.place(playerID, new NullConstraint); } }