# Biome Generation Tool: A Mixed-Initiative Software for the Procedural Generation of Biomes
## 3 Methodology
### Bgt
#### 3.1.2 Crossover and Mutation  
Crossover consists in an exchange of subsections between chromosomes. Both subsections are of size \((N*scale)^{2}\), and the scale is a number between 0 and 1. To avoid rough edges on the crossover, the exchange is performed through interpolation using the distance from the center of the subsection as the change factor. In this way, the innermost values end up corresponding to those of the foreign subsection, while the furthermost values remain as the original ones. The mutation modifies the chromosome in one of three possible ways chosen at random in an area of \((N*scale)^{2}\). The first option works in the same way that the distortion function is used to create new chromosomes. The second option is equivalent to a crossover between the chromosome and a section of the Perlin noise where only the mutated chromosome is modified. The third option works as a crossover between the chromosome and the current state of another layer affecting only the chromosome. The last mutation alternative exists to encourage divergence or convergence among layers based on the fitness function. Table 1 shows the parameters used by the EA in the tool. Since the objective pursued by the designer can be different depending on the game or their vision, the fitness function field was left open, allowing the game developer to implement their own function. For the mixed-initiative tool to work properly, the algorithm must provide various options distinct enough from each other for the user to notice the difference. Therefore, multiple fitness functions are required to allow the EA to evolve through different branches. In this context, BGT provides a basic set of fitness functions:  
* **Connectivity**: Fraction of the layer that does not have elements with a collider (i.e., walkable fraction). * **Reach Fairness**: If there are more than 2 starting positions, it measures how balanced the walking distances between them are. * **Stat fairness**: Configurable per stat. Measures how balanced a given stat is between starting positions. * **Stat gain**: Configurable per stat. Fraction of the layer that provides a given stat. * **Stat deprivation**: Configurable per stat. Fraction of the layer that does not provide a given stat. * **Resemblance**: Similarity measure between suggestion and actual layer. * **MultiLayer**: Applies a given fitness function to multiple layers. Results combined using L2 norm [25]. * **Multievaluation**: Applies multiple fitness functions to a single layer. Results combined using L2 norm. \begin{table}
\begin{tabular}{l l} \hline
**Property** & **Value** \\ \hline Chromosome size & \(128\times 128\) \\ \hline Chromosome generation & Perlin Noise [21] Distortion \\ \hline Population size & 10 \\ \hline Crossover method & k-point crossover \\ \hline Crossover section & \((N*scale)^{2}\), \(N=128,0<scale<1\), where scale is the squared percentage of the square to recombine \\ \hline Mutation method & Perlin Noise Distortion, Perlin Noise Partial Crossover, and Inter Layer Partial Crossover \\ \hline Mutation section & \((N*scale)^{2}\), \(N=128,0<scale<1\), where scale is the squared percentage of the square to mutate \\ \hline Maximum concurrent populations & 8 \\ \hline Stop criteria & 5 generations \\ \hline \end{tabular}
\end{table} 
Table 1: Settings used for the Evolutionary Algorithm properties. * **Coherency**: Fraction of the map where the element's stat requirements are met by contributions from other elements in any layer. For instance, lions require shadow and grass. A layer with only lions, and where every lion is in a tile in which another layer is providing it with shadow and grass, will have a coherency of 1 (maximum). Through the different fitness functions, BGT allows the user to pursue different objectives in the design process. Taking into account that the user may want to explore various options simultaneously, BGT allows the designer to select multiple fitness functions at the same time.