First Steps in the Use of a Game Engine for Historical Roads and Paths Research

Geographic Information Systems (GIS) are widely used in research for the visualization and spatial analysis of historical data. Their power lies in the fact that they are able to combine and visualize diverse datasets containing geographical information. Archaeological research questions, for example, can be investigated by combining landscape models with historical data and applying Least Cost Path (LCP) analysis to reconstruct historical routes and identify potential corridors for unknown routes ( Citter 2012; Doneus 2013; Herzog & Posluschny 2012; Van Lanen et al. 2015; Verhagen 2013). The use of gaming engines in archaeology is not new (Anderson et al. 2010). In the gaming world pathfinding is often used and discussed (Buro 2004; Hagelbäck & Johansson 2008; Matthews 2002; Orkin 2002 & 2004; Stout 2000) However, gaming engines for investigation of movement in the past are very little applied (Anderson et al. 2010; Ch’ng 2007). Moreover, comparisons based on pathfinding (route modeling) between gaming engines and GIS were not found. Nevertheless, gaming engines are interesting from the perspective of movement research. The term “believable” in games is often used in the context of movement (Anderson et al. 2010; Ch’ng 2009; Jurney 2008; Nareyek 2004; Olsson 2008). For example, it is not considered believable for humans to walk through walls nor across water. Therefore, the movement of an agent should be constrained by believable physical barriers such as a wall or body of water. Believable movement in games has similarities with realistic movement within GIS where constraints can be modelled and thus, behavior approaches, rational decision-making or artificial intelligence. In this sense, the scientific spatial analysis of movement within GIS and the movement of agents in a game environment share a common interest. Game engine features are currently advancing within a growing market. It is interesting, therefore, to consider whether results from a game engine are comparable to commonly used GIS calculations. For the purpose of this paper, the game engine Unity is used. Its capabilities include: excellent rendering, ease of use, multi-player options and expandability through custom scripting. Unity also boasts a large support community for development (Ch’ng 2007). The full range of Unity’s capabilities is not explored here as the specific purpose of this analysis is to investigate the potential in historical road and path research. Within this scope, a comparison will be made between the LCP results in ArcGIS and Unity. Datasets derived from previous research into historical routes of the Leitha Hills in Austria (Doneus & Briese 2011) are used for this comparison.


Introduction
Geographic Information Systems (GIS) are widely used in research for the visualization and spatial analysis of historical data.Their power lies in the fact that they are able to combine and visualize diverse datasets containing geographical information.Archaeological research questions, for example, can be investigated by combining landscape models with historical data and applying Least Cost Path (LCP) analysis to reconstruct historical routes and identify potential corridors for unknown routes ( Citter 2012;Doneus 2013;Herzog & Posluschny 2012;Van Lanen et al. 2015;Verhagen 2013).
The use of gaming engines in archaeology is not new (Anderson et al. 2010).In the gaming world pathfinding is often used and discussed (Buro 2004;Hagelbäck & Johansson 2008;Matthews 2002;Orkin 2002Orkin & 2004;;Stout 2000) However, gaming engines for investigation of movement in the past are very little applied (Anderson et al. 2010;Ch'ng 2007).Moreover, comparisons based on pathfinding (route modeling) between gaming engines and GIS were not found.Nevertheless, gaming engines are interesting from the perspective of movement research.
The term "believable" in games is often used in the context of movement (Anderson et al. 2010;Ch'ng 2009;Jurney 2008;Nareyek 2004;Olsson 2008).For example, it is not considered believable for humans to walk through walls nor across water.Therefore, the movement of an agent should be constrained by believable physical barriers such as a wall or body of water.Believable movement in games has similarities with realistic movement within GIS where constraints can be modelled and thus, behavior approaches, rational decision-making or artificial intelligence.In this sense, the scientific spatial analysis of movement within GIS and the movement of agents in a game environment share a common interest.
Game engine features are currently advancing within a growing market.It is interesting, therefore, to consider whether results from a game engine are comparable to commonly used GIS calculations.For the purpose of this paper, the game engine Unity is used.Its capabilities include: excellent rendering, ease of use, multi-player options and expandability through custom scripting.Unity also boasts a large support community for development (Ch'ng 2007).
The full range of Unity's capabilities is not explored here as the specific purpose of this analysis is to investigate the potential in historical road and path research.Within this scope, a comparison will be made between the LCP results in ArcGIS and Unity.Datasets derived from previous research into historical routes of the Leitha Hills in Austria (Doneus & Briese 2011) are used for this comparison.

Case Study Area
The Leitha Hills are forested, middle-range mountains lying about 40 km southeast from Vienna covering an area of c.25 km 2 (Figure 1).Many roads and paths are present here, which may date from prehistoric times.Certain routes are dated to the Middle Ages and make the area interesting for investigation.The availability of highresolution relief data for the area further enhances the suitability of the Leitha Hills for historical route research (Table 1).This dataset will be discussed in detail below.

Methods and Workflow
A comparison between GIS (ArcGIS software) and a game engine is the central theme of this paper.
A game engine is a platform where computer games are developed with integrated tools or alternatively, by writing additional computer scripts.
LCP modelling provided the analytical basis for the comparison between ArcGIS and Unity.LCP analysis calculates a path between two points, which represents the lowest cost in movement (Howey, 2011).The corresponding cost function should be built on variety of factors which influence travel, like personal preference, administrative borders, religious incentives, social customs, existing sites and terrain circumstances.However, quantifying all these factors is often complicated.Indeed, terrain circumstances are probably the easiest to incorporate.Slope factor in particular is almost always used as it is easily applied and has often been the sole factor in LCP calculations (Herzog & Posluschny, 2011).However, the use of slope as a sole input is criticized for making the models too dependent on topography (Wheatly & Gillings, 2002).Nevertheless, they are two good reasons to start only with slope.First, it is difficult to incorporate other factors, especially if they have to function equally in both GIS and a gaming engine.Second, it is good modelling practice to begin with a simple model.Once the model works, other factors can be added.The Dijkstra algorithm is used in both applications for the LCP analysis (Anderson et al. 2010;Herzog 2014;Nareyek 2004).This is important as research has proven that different algorithms can deliver different results in LCP modelling, even with the same datasets and parameters (Gietl et al. 2007;Herzog 2013).The Dijkstra algorithm calculates the lowest cost on the basis of a cost surface and the backwards calculation of the lowest cost from destination to end points (Herzog 2014).A cost surface represents cost values based on the cost function of all the pixels in a digital terrain model (DTM) (Crutchley 2010;Opitz & Cowley 2012).
The relief or digital terrain model (DTM) for the analysis is derived from an Airborne Laser Scan (ALS) dataset of the study area.The most important parameters of the collection of the ALS data are listed the table below.
Both Unity and ArcGIS make use of the same DTM to calculate the LCP.In ArcGIS, the import of the DTM is straightforward.In Unity extra steps are necessary to import the DTM in a format that allows LCP modelling.
The initial step in ArcGIS involves amalgamating all the terrain tiles into a continuous surface.The model is then rotated as the Unity grid has an origin point in the top left corner, whereas the grid origin point of the ArcGIS data is  the bottom left corner.The next step is to convert the tiff format file into a raw format file necessary for terrains in Unity, by using a simple line command in GDAL.The latter is software which enhances raster data.By the same command, the original tiff file is rescaled and changed into the 16-bit type necessary to complete the import preparation of the DTM into Unity.
A shape file of roads and paths extracted from previous research (Vletter 2014) can also be imported.It is crucial that the roads and paths align with the terrain very closely to enhance the analytical purposes.The complexity lies in the fact that a shape file is 2D and the terrain model in Unity is 3D.This means that the shape file should be draped over the terrain model.This problem is resolved by converting shape file into raster format.
However, importing the complete DTM and the whole extracted route network in one step results in a loss of detail.This issue is caused by the maximum pixel size allowed for images in Unity.At the moment of writing, the limit is 4096 × 4096 pixels.It renders the DTM with little detail and extracted roads blurry when zoomed in.It was decided therefore, to repeat the steps for a smaller tile of 1 km 2 .
As can been seen in Figure 2 below, the roads and paths align fairly well with the height model and are sufficiently visible.This means that to maintain high resolution during import, the original DTM must be split up in smaller tiles; similar applies to the import of the extracted routes files.

The Reconstruction Possibilities in Unity
In order to reconstruct the historical road and path networks in a gaming engine like Unity, the following minimum components are needed: physical landscape, roads and paths, aspects of time, vegetation and players (agents) in the landscape.The topography and extracted roads are already mentioned above, while the possibilities for incorporating the influence of surface, time, vegetation and players (agents) are discussed below.

Terrain Characteristics
The cost of movement varies for different terrains and terrain covers (Herzog 2013).Additionally, the surface itself influences the energy cost (Caspersen et al. 1985;Soule & Goldman, 1972).These varieties in energy cost can be reflected in Unity by using different layers, whereby each layer represents a certain soil and its relative cost (factor) in comparison with other soils.This determines the speed for the movement of an agent and enables comparison.

Vegetation
No trees were implemented in the model for two main reasons.First, there is insufficient information about the historical development of vegetation of the Leitha area to recreate it in Unity.Second, the transport mode chosen influences the level of obstructions such as trees.For example, trees do not seem to be real obstacles for pack animals nor humans following small paths, as can they easily go around them.Navigation of a wooded area though, is more complex for wheeled transport, especially a horse-drawn wagon.Consequently, the influence of vegetation was set aside as the predominant mode of transport is uncertain.

Time
The use and the conditions of road and path networks can change over time.Time plays a role for roads and paths on two levels.First, there is 'seasonal time', in other words the influence of the seasons on the use of the roads and paths.Second, there are periods of time, thus speaking of periods covering decades, or even centuries.Over longer periods of time, road networks can disappear and be replaced by others due to political, economic or natural reasons.The dynamics of roads is often underestimated (Fovet & Zaksek 2014).
In order to visualize the road and path networks from separate periods, a 'slider' function can be applied in both Unity and GIS (Figure 3).By moving the slider to a given period, an imported shape file of roads and paths pertaining to that same period can be visualized.This function allows development of route networks to be analyzed the chronologically.The periods linked to the slider depend on the available data.For more recent periods, historical maps are primary source material.For earlier periods, topography and interpretation of the known archaeological record are most important.The result though makes the earlier reconstructed networks less reliable.

Agents
The final components for the analysis are the players or agents.In order to reconstruct/model them, some knowledge of how and when people went into the hills is necessary.Historically, the Leitha Hills have attracted human activity for many reasons, including economic (quarry, forestry, viticulture and stock breeding), religious and travel (Krizsanits & Horvath 2012).We can translate these motives into possible characters or transport modes.
For forestry, it is probable that a two-wheeled cart was used.Such a cart is considered most suitable for transportation in the forest because of flexibility of movement compared to a four-wheeled wagon.Medieval paintings with two-wheeled carts from other middle-mountain areas in Europe support this theory (Tarr 1978).
Pack animals such as mules or horses are an even more flexible transportation mode than the two-wheeled cart.Cows, also good climbers, were traditionally pastured on the Leitha Hills.Pasturing was part of a cattle trading route stretching from the Hungarian plane to Vienna (Krizsanits & Horvath, 2012).We have also people who went on foot up into the Leitha Hills for a multitude of reasons; religion, smuggling, travel, hunting, or for leisure.Finally, although the horse-drawn four-wheeled car was a transport mode which was intentionally not taken in consideration here, historical photographs from around 1900 demonstrate that it was used for quarrying.However, the quarries of the 19 th and 20 th century were mostly located on edge of the Leitha Hills area and linked with good roads to major centres, such as Vienna.Two-wheeled carts were most probably used for quarries located deeper in the forest.

Analytical Possibilities in Unity
The primary concern of this study is to investigate is the analytical potential of Unity.In this section, LCP analysis utilizing integrated tools within Unity as well as LCP analysis based on the scripting will be tested and compared to similar results produced within ArcGIS.However, before proceeding, it is necessary to test first the validity of LCP analysis for roads and paths in the Leitha Hills.

Validation of LCP in ArcGIS
The validity for LCP modelling was tested in ArcGIS.In other words, how well do the results of LCP modelling approximate known historical roads and paths?Previously, LCP and variations of this technique have been tested for the Leitha Hills using ArcGIS 9.3 and a 10 m raster DTM (Doneus 2013).The most important outcome of that study was how a combination of ' openness' analysis and slope analysis delivered excellent results within the Leitha Hills area.
Ideally, for the purpose of the present study, openness analysis should also be applied within Unity.However, a problem was caused by the known smoothing of the terrain in Unity.This smoothing would influence the outcome of an openness analysis and thus reduce the objectivity of the comparison with ArcGIS.Therefore, it was decided to investigate with only one variable in the first instance: the influence of the terrain within Unity and ArcGIS.The validity was checked by a LCP model based on slope raster calculation in ArcGIS 10.3.
For consistency to the above mentioned case study, a 10m raster was used.However, this resulted in unrealistic routes including enormous detours over virtually flat areas and unnecessary crossings of streams.After some trial and error, a 0.5 m raster delivered the best results and was used in all subsequent calculations.In order to make the analysis more realistic and provide a possible time depth, a path was modelled between two caves, both of which had known long use in the past.
The results were encouraging.About 87% of the path lined up with, or was parallel (within a 50 m range) to, documented roads and paths (Figure 5).The reverse Figure 3: The relative costs of different surfaces.
exercise had the same result.However, close examination of the outcome resulted in two observations.First, examination of the topography showed that the calculated path to be logical and almost the only feasible solution.Second, the path partly follows modern roads, which caused some suspicion.
Subsequently, a second test was done in another part of the Leitha Hills between caves of which the historical usage is unknown (Figure 6).The results of the LCP modelling were also encouraging.About 78% of the modeled route lines up with, or are parallel (within 50 m) to roads and paths visible on the ALS data.For this reason, it was assumed that LCP modelling based solely on slope was a sufficiently valid tool for determining roads and paths in the Leitha Hills.
For comparison to the analysis within Unity, a smaller area (tile) of one square kilometer was considered due to the limitations of the maximum image size resolution of the game engine.In ArcGIS, three points were created and the least cost path between these three points was calculated (Figure 7).The same exercise was done within Unity.

LCP Navigation Tool
Movement within Unity is based essentially on the 'navigation' tool.This tool is set up to let an agent move around in a game environment.The standard parameters set for this tool were worthy of further investigation.
Slope or inclination is an important parameter.Overcoming the slope gradient was of importance for all the transportation modes.For modes of wheeled transport, this was especially true.According to other studies, between 8% and 12% was the maximum inclination range a cart or wagon could overcome (Herzog & Posluschny 2011).The load, of course, played a contributing factor.It is important to insert a slope threshold when navigating within Unity; the navigation tool permits the setting of a maximum slope which can be traversed.
The width of roads is another parameter, which is also of importance for wheeled vehicles.Establishing a suitable road/path width though, is difficult as there was not only a huge variation in the size of cars and carts over time, but also within a certain time periods (Denecke 1969).This variation and uncertainty surrounding cart widths makes setting a limiting factor (i.e. the narrowest path one can pass through) difficult.Moreover, setting a radius similar to that of a probable cart width, limited the processing capability of Unity and the parameter was unused.
As mentioned above, different relative costs can be set by creating different layers which can be applied (Figure 4).Once all the parameters have been set, a Navigation Mesh (NavMesh) that shows the areas where the agent can move can be generated.Unfortunately, the outcome of the NavMesh baking did not produce the desired outcome.(See Figure 9).
From Figure 8, it is clear that artificial terraces are created using NavMesh.These processing artefacts hinder the pathfinding within the navigation tool as they form unnatural obstacles.Adjusting the analysis parameters to make the terrain flatter risked creating an equally unrealistic landscape.This limitation is possibly the result of a too-low resolution of the DTM or alternatively, the  to roads and paths visible on the ALS data.
unsuitability of the navigation tool.Both possibilities may be related to the maximum image size resolution (2048 × 2048) allowed within Unity.Unfortunately, this issue remains unresolved at the time of writing.

LCP Scripting
Besides the navigation tool, scripting provides another possibility to move around a gaming environment using languages like Java (adapted for Unity), C# and Booh.Indeed, the power of a game engine like Unity is that user can create a lot of features by scripting.For this research, a script has been used that comes from the A* Pathfinding Project of Aron Granberg (Granberg 2018), a free-to-use script written in C# for Unity.One interesting feature of this tool is that multi-agents can be created.A* can also be combined with the standard navigation tool of NavMesh, described earlier.However, the grid option was chosen for modelling movement as the NavMesh did not function well and made computation too heavy.This means that the agent walks over a grid.Parameters are set within A* pathfinding script and defines where the agent actually can go.
Several tests were carried out in order to find 'realistic' settings, meaning movement parameters which approximate human movement.The lowest climb (vertical) height was 30cm and the inclination was 20% to allow the agent reach its destination.Below these thresholds, the agent either does not reach its destination or an error message related to processing capacity is triggered.To summarize, these settings come close to realistic movement for a human being or a draught animal.For movement of cart and wagons the 20% inclination is probably too high.
In the following steps, routes were computed between the same three points used above in ArcGIS.The comparison demonstrated that in general, Unity delivers comparable results to ArcGIS.Both applications avoid the main obstacles in a similar way.However, the results between the two don't align, with the Unity results seeming unrealistically too straight.The fact their results diverge doesn't constitute a real problem as different software packages can result in different results using the same data and parameters for creating a least cost path model (Gietl et al. 2008).Their sensitivity to minor obstacles, meaning micro relief differences, is a major point of difference between the two applications.The outcome in ArcGIS seems to be too sensitive to these obstacles as   a relatively high number of small turns are made over short distances, which does not appear realistic.Unity, on the other hand, shows a 'lack' of sensitivity, choosing a very straight path which ignores minor obstacles.This is probably due to the smoothing in Unity, which is also visible in Figure 9.It means that for analysis in ArcGIS, a lower resolution on a small scale or, alternatively, changing the analysis parameters, would possibly work better.However, worse results in ArcGIS were obtained when a lower resolution was used in the path modelling for larger areas (see section 5.1).In Unity, a higher sensitivity must be created either through a higher resolution or by changing the settings of DTM.

Discussion
There are clearly disadvantages in the use a game engine.The principal one is that computational power is needed (Nareyek 2004).Increasing the processing complexity leads to a rise of computational power.Insufficient processing power will slow down the game or even make the game crash.The level of detail of large areas (such as a study area DTM) is also limited due to the large computational power needed.Further scripting skills are needed to bring the analytical strength of gaming engine to a higher level (Nareyek 2004).However, these issues can be resolved through the continued evolution of scripting languages as well as the development of computing power of PCs.
There are also several advantages in using a game engine.First, the landscape can be made more realistic, which enlarges the embodiment and perception of the land under investigation (Ch'ng 2007(Ch'ng & 2010)).The movement of the player can be shown from the agent position, like a video, instead of the 2-D outcome of logarithm in GIS.Incorporating multi-players which can interact with one another is also possible.An experimental study could be carried out by 'walking' in the reconstructed landscape with a non-predefined agent (Ch'ng 2009).This also adheres to the embodiment of the landscape.Additionally, areas to be avoided can be created by making use of influence maps (Paanakker 2008), which could in turn simulate border areas (Casimir & Roa 1992).

Conclusion
Resolution issues are a possible limitation if large DTMs or extracted roads and paths are imported.Such issues can be solved by splitting up the DTM or the roads and paths file into smaller tiles and reassembled in Unity.The resolution of the 1 sq.km tile presented in this study produced good results, while the roads and paths texture lined up encouragingly well with the height model.A slider function created a temporal-spatial model by visualizing the road and path networks through different periods.
The use of the navigation tool of Unity was, instead, disappointing.The NavMesh baking did not result in walk-able areas which could be used for analytical purpose.This may be due to either a resolution issue or to a limited capacity of the navigation tool.This issue has yet to be resolved before spatial modelling can take place with this tool.
In comparison, the script of the A* pathfinding project worked well on the imported DTM.The comparison of results to the GIS analysis results showed that Unity delivers similar results, despite not aligning exactly.This outcome, together with the advantages of the fast developing gaming world, make that the application of game engines for route modelling look promising and hopefully future research will live up to these expectations.

Figure 2 :
Figure 2: Imported as a texture file, the extracted roads and paths line up well with the Leitha Hills height model in Unity.

Figure 5 :
Figure 5: The location of the two caves (in green).The LCP path (in blue) and the sections that didn't align (in purple)to roads and paths visible on the ALS data.

Figure 6 :
Figure 6: The location of the two caves (in green); the LCP path (in blue) and the parts that didn't align (in purple) to roads and paths visible on the ALS data.

Figure 7 :
Figure 7: The results of LCP analysis in ArcGIS between points of the selected tile of 1 km 2 .The final part of paths with different starting points and the same destination overlap.This can be explained by the distribution of the points in the corners of the square kilometer.

Figure 9 :
Figure 9: Comparison of LCP results between ArcGIS (left) and Unity (right) on area of 1 km 2 .Due to resolution differences, the DTM in ArcGIS is much clearer.Furthermore, it shows that in both applications the stream in the lower left is clearly avoided.In the central part of both tests the results show the largest differences in routing.Additionally, the routes in ArcGIS are more winding than the ones in Unity which tends to produce long straight sections.