Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions C7Engine/MapGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,19 @@ public static GameMap GenerateMap(WorldCharacteristics wc) {
// for resources.
AddBonusGrasslands(wc, gameMap);

// Step 10: Add barb camps. We do this towards the end to make sure
// Step 10: Place player starting locations
// Placing this before barb camps so barbs don't spawn <5 tiles away from players
// Tried placing barbs then players, but caused all players to spawn together
DetermineStartingLocations(wc, gameMap);

// Step 11: Add barb camps. We do this towards the end to make sure
// that we don't have barb camps on top of resources.
// Previously step 10
AddBarbarianCamps(wc, gameMap);

// TODO: Goody huts, barbarian camps.

DetermineStartingLocations(wc, gameMap);


// Last step: Assign the terrain file and image ids to each tile so
// we know which texture to use when displaying them.
Expand Down Expand Up @@ -1339,6 +1345,9 @@ private static bool IsValidForBarbarianCamp(WorldCharacteristics wc, GameMap m,
}
}

// No barbarian camps less than 6 tiles away from a player
if (m.startingLocations.Any(x => t.distanceTo(x) < 6)) return false;

return true;
}

Expand Down