MapRegions
Types
Functions
Assigns a luxury to each region. No luxury can be assigned to too many regions. Some luxuries are earmarked for city states. The rest are randomly distributed or don't occur att all in the map
Recursive function, divides a region into numDivisions pars of equal-ish fertility
Evaluates a tile for starting position, setting isGoodStart and startScore in MapGenTileData. Assumes that all tiles have corresponding MapGenTileData.
Creates numRegions number of balanced regions for civ starting locations.
Adds numbers to tileData in a similar way to closeStartPenalty, but for different types
Places all Luxuries onto tileMap. Assumes that assignLuxuries and placeMinorCivs have been called.
Assigns civs to regions or "uninhabited" land and places them. Depends on assignLuxuries having been called previously. Note: can silently fail to place all city states if there is too little room. Currently our GameStarter fills out with random city states, Civ V behavior is to forget about the discarded city states entirely.
Given a tileList and possible resourceOptions, will place a resource on every frequency tiles. Tries to avoid impacts, but falls back to lowest impact otherwise. Goes through the list in order, so pre-shuffle it! Assumes all tiles in the list are of the same terrain type when generating weightings, irrelevant if only one option. Respects terrainsCanBeFoundOn when there is only one option, unless forcePlacement is true.
Splits a region in 2, with the first having firstPercent of total fertility
Attempts to place amount on tiles, checking tiles in order. A ratio below 1 means skipping some tiles, ie ratio = 0.25 will put a resource on every 4th eligible tile. Can optionally respect impact flags, and places impact if baseImpact>= 0. Returns number of placed resources.
Attempts to randomly place civs from civsToPlace in tiles from tileList. Assumes that tileList is pre-vetted and only contains habitable land tiles. Will modify both civsToPlace and tileList as it goes!