# IORand: A Procedural Videogame Level Generator Based on a Hybrid PCG Algorithm
## 3 Proposed Level Evaluation  
Content evaluation metrics are necessary to guide the search algorithms and to verify the generated content quality. However, it is difficult to define metrics that capture subjective factors, such as the player's experience or aesthetics. In [45], the authors propose to measure the reactions of the players through cameras during gameplay. Despite the acceptable results, this approach is impractical for content generation. In this work, we propose to measure the content characteristics and then search for affordance and its relation to the player experience. A graph-based description has proven useful to describe the game construction at a conceptual level, capturing the interactions between elements [22; 46; 47]. The proposed methodology splits the game elements into functional objects considering each platform, bonus, enemy, and marker as objects, and analyzes the interactions between them. In the first step, we selected the platform objects as the node-set (\(V\)), and each node was analyzed considering the risk (\(rk\)) and reward (\(rw\)). The risk represents the level of threat that may harm a player when standing in a node [48]. The reward is a measure of the level of bonification a player may have while standing in a node [49]. The second step consists of determining all possible transitions (\(E\)) between nodes using a reachability metric [50; 51]. Each transition is described within six measures: risk (\(rk\)), reward (\(rw\)), obstruction (\(o\)), precision (\(p\)), motivation (\(m\)), and distance (\(d\)). While risk and reward are the same measures, with one difference they are computed for the threats and rewards a player may have or suffer during the transition. The obstruction measures the degree a platform may interfere during a transition [52], and the precision measures how exact a jump between platforms needs to be performed [50; 51]. The reward metric is divided into two types, the _level reward_ (lrw) which measures the points obtained for reaching the marker rings and completing the level, and the _bonus reward_ (brw) that measures points earned for defeating enemies and for reaching bonus items (bonuses). This division is made in order to have a better description of the type of reward that the player can obtain on a platform or during a transition. Motivation is the measure of reward attenuated by accuracy, it represents the degree of interest the players will have in transitioning, given the points they can earn and the degree of skill such a transition would entail. Being a measure derived from the reward, it is also divided into _level motivation_ (lm) and _bonus motivation_ (bm). Distance is a measure of the length of a line or path between two points. For the purposes of this project, the Euclidean distance was used, which measures the length of the shortest line connecting the two points. Each level is represented by a set of nodes V, Equation (1), and a set of transitions, Equation (2). We describe each node \(v_{i}\) using its object identification number \(ID_{ei}\), the risk and reward of the node (Equation (3)), and each transition \(e_{j}\) using the nodes it connects in order \(v_{p},v_{k}\), its risk, reward, obstruction, precision, motivation, and distance (Equation (4)). \[V =\{v_{1},v_{2},v_{3},...,vi\} \tag{1}\] \[E =\{e_{1},e_{2},e_{3},...,e_{j}\}\] (2) \[v_{i} =[ID_{vi},r_{ki_{pi}},lrw_{vi_{pi}},brw_{vi_{pi}}]\] (3) \[e_{j} =[e_{v_{p},v_{k}},rk_{ej},lrw_{ej},brw_{ej},o_{ej},p_{ej},lm_{ej},bm_{ej},d_{ej}] \tag{4}\]  
The evaluation process of a game is exemplified in Figure 3. In it, the nodes or platforms are shown in green, the markers in blue, and with black lines, the transitions that allow the player to go through the level from the starting point to the final point are illustrated. The red circles mark the enemies that are used for risk calculation and the yellow circles mark the bonus used in the reward metrics.