gonzikcz / GeoSkylines

Cities: Skylines game mod for import/export of geodata.
MIT License
28 stars 5 forks source link

GeoSkylines general info

Cities: Skylines game mod for import/export of geodata.

Install game mod (if not on Steam workshop):

See the Word document for full details on data-related preparations etc. !

GeoSkylines methods are called using the threading hooks via hotkeys, combination of ONLY RIGHT Ctrl + R, L, W, Q, T, V, S, Z, P, G, H, J, K. To avoid conflicts with hotkeys of other mods, it is recommended to turn off other mods before using GeoSkylines. After using import or export methods of GeoSkylines then you can turn the mod off. (Though this has been limited now to right Ctrl)

Three stages of creating playable model in Cities: Skylines based on geodata:

  1. Prepare geodata for import
  2. Create base model using GeoSkylines methods
  3. Create playable model (manual post-processing)

Prepare vector geodata for import

I chose to use a simple CSV format with geometry data recorded as WKT. Thus, any geo-dataset can be used. For testing I used OSM predominantly. For the CSV file preparation I used OSMSharp library (other programs such as QGIS or FME would suffice). See the code examples of the data preparation using OSMSharp. For preparing the data in QGIS see the Word document! During the data preparation phase I followed these initial steps:

Prepare raster image for tree coverage

There is a GeoSkylines method for creating tree coverage from raster image (trees.png saved in c:\Program Files (x86)\Steam\steamapps\common\Cities_Skylines\Files). See the Word document to prepare the raster image in QGIS.

Prepare tree vector layer

Alternatively, tree coverage can be created from vector data as well. To prepare the file trees_rwo.csv, follow the steps described in the Word document.

Import methods of GeoSkylines mod

GeoSkylinesImport.ImportRoads():

GeoSkylinesImport.ImportRails():

GeoSkylinesImport.ImportWaterBody():

GeoSkylinesImport.ImportWaterWay():

GeoSkylinesImport.ImportTreesRaster():

GeoSkylinesImport.ImportTreesVector():

GeoSkylinesImport.ImportZonesArea():

GeoSkylinesImport.ImportServices():

GeoSkylinesImport.ImportBuildings():

Export methods of GeoSkylines mod

GeoSkylinesExport.ExportSegments():

GeoSkylinesExport.ExportBuildings():

GeoSkylinesExport.ExportZones():

GeoSkylinesExport.ExportTrees():

Helper methods of GeoSkylines mod

GeoSkylinesExport.DisplayLLOnMouseClick():

GeoSkylinesExport.OutputPrefabInfo():

Configuration of import and export methods

CSV files for import, CSV files for matching types of objects, trees.png file and import_export.txt file have to be stored in folder: c:\Program Files (x86)\Steam\steamapps\common\Cities_Skylines\Files. This folder is also used to store CSV files to output game objects as GIS data using the export methods (e.g. roads_cs.csv).

File import_export.txt lists parameters for configurying the import and export methods. Here's the complete list of parameters.

MapName:

CenterLatitude:

CenterLongitude:

ImportRoadsCoordMax:

ImportRailsCoordMax:

ImportBuildingsCoordMax:

ImportTreesRasterOffTolerance:

ImportTreesRasterOffsetX & ImportTreesRasterOffsetY:

ImportTreesRasterMultiply:

ImportTreesTreeTypes:

ImportTreesCoordMax:

ImportWaterWayTypes:

ImportWaterWayDepths:

ImportWaterWayWidths:

ImportWaterDepth:

ExportCoordsBox:

Create a playable model in Cities: Skylines (post-processing)

Calling the GeoSkylines' import methods creates just a geographically accurate base model. However, it has to be manually processed to create a playable model. Sources of water have to be added to the water basins. Connection to a highway has to be created in order for new citizens to move in. The created game objects must be fixed in some cases (e.g. due to bad input GIS data). It is recommended that the post-processing is done by an experienced C: S player.

Acknowledgements

This mod was inspired by another C: S mods, mainly Cimptographer (Mapper). The curved segments in this mod are created with library burningmime.curves. Data from OSM were mainly prepared with library OSMSharp. Big thanks to all these creations and their authors!