diff --git a/Game/Assembly-CSharp-vs.csproj b/Game/Assembly-CSharp-vs.csproj
index 04da2d9..e84df18 100644
--- a/Game/Assembly-CSharp-vs.csproj
+++ b/Game/Assembly-CSharp-vs.csproj
@@ -1,92 +1,93 @@
-
-
-
- Debug
- AnyCPU
- 10.0.20506
- 2.0
- {DDFBC18F-9396-3137-9CFE-DEB2CDB74636}
- Library
- Properties
-
- Assembly-CSharp
- v3.5
- 512
- Assets
-
-
- true
- full
- false
- Temp\bin\Debug\
- DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN
- prompt
- 4
- 0169
-
-
- pdbonly
- true
- Temp\bin\Release\
- TRACE
- prompt
- 4
- 0169
-
-
-
-
-
-
-
- E:/SDKs/Unity/Editor/Data/Managed/UnityEngine.dll
-
-
- E:/SDKs/Unity/Editor/Data/Managed/UnityEditor.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- E:/Facultate/$ Licenta/Game/Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll
-
-
- E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll
-
-
-
-
- {D8888F6A-ABE1-C49B-1A38-F65A81021668} Assembly-CSharp-firstpass-vs
-
-
-
-
-
+
+
+
+ Debug
+ AnyCPU
+ 10.0.20506
+ 2.0
+ {DDFBC18F-9396-3137-9CFE-DEB2CDB74636}
+ Library
+ Properties
+
+ Assembly-CSharp
+ v3.5
+ 512
+ Assets
+
+
+ true
+ full
+ false
+ Temp\bin\Debug\
+ DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN
+ prompt
+ 4
+ 0169
+
+
+ pdbonly
+ true
+ Temp\bin\Release\
+ TRACE
+ prompt
+ 4
+ 0169
+
+
+
+
+
+
+
+ E:/SDKs/Unity/Editor/Data/Managed/UnityEngine.dll
+
+
+ E:/SDKs/Unity/Editor/Data/Managed/UnityEditor.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ E:/Facultate/$ Licenta/Game/Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll
+
+
+ E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll
+
+
+
+
+ {D8888F6A-ABE1-C49B-1A38-F65A81021668} Assembly-CSharp-firstpass-vs
+
+
+
+
+
diff --git a/Game/Assembly-CSharp.csproj b/Game/Assembly-CSharp.csproj
index 3a6d074..d98b992 100644
--- a/Game/Assembly-CSharp.csproj
+++ b/Game/Assembly-CSharp.csproj
@@ -1,91 +1,92 @@
-
-
-
- Debug
- AnyCPU
- 10.0.20506
- 2.0
- {DDFBC18F-9396-3137-9CFE-DEB2CDB74636}
- Library
- Properties
-
- Assembly-CSharp
- v3.5
- 512
- Assets
-
-
- true
- full
- false
- Temp\bin\Debug\
- DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN
- prompt
- 4
- 0169
-
-
- pdbonly
- true
- Temp\bin\Release\
- TRACE
- prompt
- 4
- 0169
-
-
-
-
-
-
-
- E:/SDKs/Unity/Editor/Data/Managed/UnityEngine.dll
-
-
- E:/SDKs/Unity/Editor/Data/Managed/UnityEditor.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll
-
-
-
-
- {D8888F6A-ABE1-C49B-1A38-F65A81021668} Assembly-CSharp-firstpass
-
- {6F824ECF-F2BC-827E-A29D-FB10759A3283} Assembly-UnityScript-firstpass
-
-
-
-
-
+
+
+
+ Debug
+ AnyCPU
+ 10.0.20506
+ 2.0
+ {DDFBC18F-9396-3137-9CFE-DEB2CDB74636}
+ Library
+ Properties
+
+ Assembly-CSharp
+ v3.5
+ 512
+ Assets
+
+
+ true
+ full
+ false
+ Temp\bin\Debug\
+ DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN
+ prompt
+ 4
+ 0169
+
+
+ pdbonly
+ true
+ Temp\bin\Release\
+ TRACE
+ prompt
+ 4
+ 0169
+
+
+
+
+
+
+
+ E:/SDKs/Unity/Editor/Data/Managed/UnityEngine.dll
+
+
+ E:/SDKs/Unity/Editor/Data/Managed/UnityEditor.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll
+
+
+
+
+ {D8888F6A-ABE1-C49B-1A38-F65A81021668} Assembly-CSharp-firstpass
+
+ {6F824ECF-F2BC-827E-A29D-FB10759A3283} Assembly-UnityScript-firstpass
+
+
+
+
+
diff --git a/Game/Assets/Data/Config/tergen.xml b/Game/Assets/Data/Config/tergen.xml
index a61e03e..06d1924 100644
--- a/Game/Assets/Data/Config/tergen.xml
+++ b/Game/Assets/Data/Config/tergen.xml
@@ -3,5 +3,8 @@
9
2.4
1.9
- 0.0005
+ 0.001
+ 100
+ 60
+ 0.1
\ No newline at end of file
diff --git a/Game/Assets/Main.unity b/Game/Assets/Main.unity
index 627d16f..24a8cb2 100644
Binary files a/Game/Assets/Main.unity and b/Game/Assets/Main.unity differ
diff --git a/Game/Assets/Scripts/Generator/TerrainEroder.cs b/Game/Assets/Scripts/Generator/TerrainEroder.cs
new file mode 100644
index 0000000..35ad4ee
--- /dev/null
+++ b/Game/Assets/Scripts/Generator/TerrainEroder.cs
@@ -0,0 +1,234 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using TransportGame.Business;
+using TransportGame.Model;
+
+namespace TransportGame.Generator
+{
+ ///
+ /// Simulates water erosion
+ ///
+ public class TerrainEroder
+ {
+ #region Constants
+
+ /// Direction vector (X)
+ ///
+ /// In order: Center, North, North-East, East, South-East, South, South-West, West, North-West
+ ///
+ readonly static private int[] DirectionsX = { 0, 0, 1, 1, 1, 0, -1, -1, -1 };
+
+ /// Direction vector (Y)
+ ///
+ /// In order: Center, North, North-East, East, South-East, South, South-West, West, North-West
+ ///
+ readonly static private int[] DirectionsY = { 0, -1, -1, 0, 1, 1, 1, 0, -1 };
+
+ #endregion
+
+ #region Public properties
+
+ ///
+ /// Gets the terrain to erode
+ ///
+ public Map Terrain { get; private set; }
+
+ #endregion
+
+ protected int SpringCount { get { return ConfigurationManager.TerrGenConfig.ErodePoints; } }
+ protected int IterationCount { get { return ConfigurationManager.TerrGenConfig.ErodeIterations; } }
+ protected float ErosionAmount { get { return ConfigurationManager.TerrGenConfig.ErodeAmountPercent; } }
+
+ #region Private variables
+
+ private Random random = new Random();
+ private float[,] water;
+ private int[] springsX;
+ private int[] springsY;
+
+ #endregion
+
+ public TerrainEroder(Map terrain)
+ {
+ this.Terrain = terrain;
+ }
+
+ public void Erode()
+ {
+ Initialize();
+ GenerateSprings();
+
+ for (int i = 0; i < IterationCount; i++)
+ NextIteration();
+ }
+
+ private void Initialize()
+ {
+ // Initialize matrices
+ water = new float[Terrain.Width, Terrain.Height];
+ }
+
+ private void GenerateSprings()
+ {
+ // Step 1: Generate random points, which will be the water springs
+ springsX = new int[SpringCount];
+ springsY = new int[SpringCount];
+
+ for (int i = 0; i < SpringCount; i++)
+ {
+ springsX[i] = random.Next(0, Terrain.Width);
+ springsY[i] = random.Next(0, Terrain.Height);
+ }
+
+ // Step 2: Find local maximums, where the springs are placed
+ bool changed;
+ int iterations = 100;
+
+ do
+ {
+ changed = false;
+ for (int i = 0; i < SpringCount; i++)
+ {
+ // Find best neighbour
+ float maxHeight = Terrain[springsX[i], springsY[i]];
+ int maxDir = 0;
+
+ ForEachDirection(springsX[i], springsY[i], (dx, dy, dir) =>
+ {
+ if (Terrain[dx, dy] >= maxHeight)
+ {
+ maxHeight = Terrain[dx, dy];
+ maxDir = dir;
+ }
+ });
+
+ if (maxDir > 0)
+ {
+ springsX[i] += DirectionsX[maxDir];
+ springsY[i] += DirectionsY[maxDir];
+ changed = true;
+ }
+ }
+
+ --iterations;
+ } while (changed && iterations > 0);
+ }
+
+ private void NextIteration()
+ {
+ Step1_RainAndErode();
+ Step2_MoveWater();
+ Step3_Evaporate();
+ }
+
+ private void Step1_RainAndErode()
+ {
+ // Springs generate a lot of water
+ for (int i = 0; i < SpringCount; i++)
+ water[springsX[i], springsY[i]] += 100f;
+
+ // Rain in the rest of the terrain
+ for (int x = 0; x < Terrain.Width; x++)
+ for (int y = 0; y < Terrain.Height; y++)
+ {
+ water[x, y] += 1f;
+
+ // Erode some terrain
+ Terrain[x, y] -= ErosionAmount * water[x, y];
+ }
+ }
+
+ private void Step2_MoveWater()
+ {
+ for (int x = 0; x < Terrain.Width; x++)
+ for (int y = 0; y < Terrain.Height; y++)
+ {
+ List directions = new List();
+
+ // Find relevant directions
+ ForEachDirection(x, y, (dx, dy, dir) =>
+ {
+ if (Level(x, y) > Level(dx, dy))
+ directions.Add(dir);
+ });
+
+ // Order directions by level
+ directions.Sort((dir1, dir2) =>
+ {
+ float level1 = Level(x + DirectionsX[dir1], y + DirectionsY[dir1]);
+ float level2 = Level(x + DirectionsX[dir2], y + DirectionsY[dir2]);
+
+ return Convert.ToInt32(100 * (level1 - level2));
+ });
+
+ // Distribute water
+ for (int dirIndex = 0; dirIndex < directions.Count; dirIndex++)
+ {
+ int dir = directions[dirIndex];
+
+ // We distribute all the water equally to cells from
+ // directions 0..dir.
+ float distributeAmount = water[x, y] / (dirIndex + 1);
+
+ // If the resulting level is higher than the level of the next direction,
+ // we only add the level difference
+ if (dirIndex < directions.Count - 1)
+ {
+ int dx = x + DirectionsX[dir], dy = y + DirectionsY[dir];
+ int dx1 = x + DirectionsX[directions[dirIndex + 1]], dy1 = y + DirectionsY[directions[dirIndex + 1]];
+
+ distributeAmount = Math.Min(distributeAmount, Level(dx1, dy1) - Level(dx, dy));
+ }
+
+ // Distribute water & sediment
+ for (int dirDistribIndex = 0; dirDistribIndex < dirIndex; dirDistribIndex++)
+ {
+ int dirDistrib = directions[dirDistribIndex];
+ water[x + DirectionsX[dirDistrib], y + DirectionsY[dirDistrib]] += distributeAmount;
+ }
+
+ // Subtract from current cell
+ water[x, y] -= distributeAmount * (dirIndex + 1);
+ }
+ }
+ }
+
+ private void Step3_Evaporate()
+ {
+ for (int x = 0; x < Terrain.Width; x++)
+ for (int y = 0; y < Terrain.Height; y++)
+ {
+ // Some sediment deposits
+ Terrain[x, y] += water[x, y] * ErosionAmount;
+
+ // Water evaporates
+ water[x, y] *= .5f;
+ }
+ }
+
+ private void ForEachDirection(int x, int y, Action action)
+ {
+ for (int dir = 1; dir < DirectionsX.Length; dir++)
+ {
+ int dx = x + DirectionsX[dir];
+ int dy = y + DirectionsY[dir];
+
+ if (Terrain.IsInside(dx, dy))
+ action(dx, dy, dir);
+ }
+ }
+
+ ///
+ /// Gets the soil + water level
+ ///
+ /// x coordinate
+ /// y coordinate
+ /// level
+ private float Level(int x, int y)
+ {
+ return Terrain[x, y] + water[x, y];
+ }
+ }
+}
diff --git a/Game/Assets/Scripts/Generator/TerrainGenerator.cs b/Game/Assets/Scripts/Generator/TerrainGenerator.cs
index 0a8eea6..032d9f2 100644
--- a/Game/Assets/Scripts/Generator/TerrainGenerator.cs
+++ b/Game/Assets/Scripts/Generator/TerrainGenerator.cs
@@ -15,10 +15,13 @@ namespace TransportGame.Generator
{
public class TerrainGenerator
{
+ ///
+ /// Gets or sets the underlying noise generator
+ ///
public NoiseGenerator Noise { get; set; }
private System.Random random = new System.Random();
-
+
public TerrainGenerator()
{
Noise = new PerlinNoiseGenerator();
@@ -48,10 +51,10 @@ namespace TransportGame.Generator
map.WaterLevel = Mathf.Pow(waterAmount, ConfigurationManager.TerrGenConfig.WaterNonLinearPower) * map.Biome.Height;
DumpData(map, "1generated.map");
-
+
// Simulate water erosion
- //Erode(map);
- //DumpData(map, "2eroded.map");
+ new TerrainEroder(map).Erode();
+ DumpData(map, "2eroded.map");
return map;
}
@@ -68,16 +71,9 @@ namespace TransportGame.Generator
{
for (int x = 0; x < map.Width; ++x)
for (int y = 0; y < map.Height; ++y)
- map[x, y] = Noise.Generate(x, y, 0, 1);
+ map.Heights[x, y] = Noise.Generate(x, y, 0, 1);
}
- //private void Erode(Map map)
- //{
- // float[,] water = new float[map.Width, map.Height];
-
-
- //}
-
private void DumpData(Map map, string filename)
{
XmlSerializer serializer = new XmlSerializer(typeof(Map));
diff --git a/Game/Assets/Scripts/Model/Config/TerrainGeneratorConfig.cs b/Game/Assets/Scripts/Model/Config/TerrainGeneratorConfig.cs
index 157195d..f6a76e3 100644
--- a/Game/Assets/Scripts/Model/Config/TerrainGeneratorConfig.cs
+++ b/Game/Assets/Scripts/Model/Config/TerrainGeneratorConfig.cs
@@ -20,5 +20,14 @@ namespace Assets.Scripts.Model.Config
[XmlElement("waterNonLinearPower")]
public float WaterNonLinearPower { get; set; }
+
+ [XmlElement("erodePoints")]
+ public int ErodePoints { get; set; }
+
+ [XmlElement("erodeIterations")]
+ public int ErodeIterations { get; set; }
+
+ [XmlElement("erodeAmountPercent")]
+ public float ErodeAmountPercent { get; set; }
}
}
diff --git a/Game/Assets/Scripts/Model/Map.cs b/Game/Assets/Scripts/Model/Map.cs
index ed0b4a7..86f6c7a 100644
--- a/Game/Assets/Scripts/Model/Map.cs
+++ b/Game/Assets/Scripts/Model/Map.cs
@@ -24,7 +24,7 @@ namespace TransportGame.Model
public Biome Biome { get; set; }
///
- /// Gets the heights array
+ /// Gets the heights array in range [0,1]
///
[XmlIgnore()]
public float[,] Heights
@@ -102,7 +102,7 @@ namespace TransportGame.Model
}
///
- /// Gets or sets the cell at specified position
+ /// Gets or sets the cell at specified position in range [0, Biome.Height]
///
/// X
/// Y
@@ -112,11 +112,11 @@ namespace TransportGame.Model
{
get
{
- return grid[x, y];
+ return grid[x, y] * Biome.Height;
}
set
{
- grid[x, y] = value;
+ grid[x, y] = value / Biome.Height;
}
}
@@ -140,7 +140,18 @@ namespace TransportGame.Model
///
public bool IsWater(int x, int y)
{
- return grid[x, y] * Biome.Height <= WaterLevel;
+ return this[x, y] <= WaterLevel;
+ }
+
+ ///
+ /// Returns true if given coordinates is inside the map
+ ///
+ /// X
+ /// Y
+ /// True if coordinates are inside the map
+ public bool IsInside(int x, int y)
+ {
+ return x >= 0 && y >= 0 && x < Width && y < Height;
}
}
}
diff --git a/Game/Game-csharp.sln b/Game/Game-csharp.sln
index aa9b779..0b8a5e1 100644
--- a/Game/Game-csharp.sln
+++ b/Game/Game-csharp.sln
@@ -23,7 +23,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
- GlobalSection(MonoDevelopProperties) = preSolution
+ GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Assembly-CSharp.csproj
Policies = $0
$0.TextStylePolicy = $1
diff --git a/Game/Game.sln b/Game/Game.sln
index 6dab6bc..47f9210 100644
--- a/Game/Game.sln
+++ b/Game/Game.sln
@@ -29,7 +29,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
- GlobalSection(MonoDevelopProperties) = preSolution
+ GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Assembly-CSharp.csproj
Policies = $0
$0.TextStylePolicy = $1
diff --git a/Game/Library/CurrentLayout.dwlt b/Game/Library/CurrentLayout.dwlt
index 1dc4bad..7b27619 100644
Binary files a/Game/Library/CurrentLayout.dwlt and b/Game/Library/CurrentLayout.dwlt differ
diff --git a/Game/Library/ScriptAssemblies/Assembly-CSharp.dll b/Game/Library/ScriptAssemblies/Assembly-CSharp.dll
index ab92445..9632bb3 100644
Binary files a/Game/Library/ScriptAssemblies/Assembly-CSharp.dll and b/Game/Library/ScriptAssemblies/Assembly-CSharp.dll differ
diff --git a/Game/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb b/Game/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
index de9ac1d..6bf59f9 100644
Binary files a/Game/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb and b/Game/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb differ
diff --git a/Game/Library/assetDatabase3 b/Game/Library/assetDatabase3
index aab2862..7c322ab 100644
Binary files a/Game/Library/assetDatabase3 and b/Game/Library/assetDatabase3 differ
diff --git a/Game/Library/guidmapper b/Game/Library/guidmapper
index 43e46c1..3338cef 100644
Binary files a/Game/Library/guidmapper and b/Game/Library/guidmapper differ
diff --git a/Game/Library/metadata/00/00000000000000004000000000000000 b/Game/Library/metadata/00/00000000000000004000000000000000
index 4706f26..4581279 100644
Binary files a/Game/Library/metadata/00/00000000000000004000000000000000 and b/Game/Library/metadata/00/00000000000000004000000000000000 differ
diff --git a/Game/Library/metadata/00/00000000000000009000000000000000 b/Game/Library/metadata/00/00000000000000009000000000000000
index 91ef734..255cf91 100644
Binary files a/Game/Library/metadata/00/00000000000000009000000000000000 and b/Game/Library/metadata/00/00000000000000009000000000000000 differ
diff --git a/Game/Library/metadata/1e/1eca86e155e8dfc48b71dded971f7d2c b/Game/Library/metadata/1e/1eca86e155e8dfc48b71dded971f7d2c
index 368bda6..51fd76f 100644
Binary files a/Game/Library/metadata/1e/1eca86e155e8dfc48b71dded971f7d2c and b/Game/Library/metadata/1e/1eca86e155e8dfc48b71dded971f7d2c differ
diff --git a/Game/Library/metadata/67/672be213b87b4064b8c12fe4e4ec29aa b/Game/Library/metadata/67/672be213b87b4064b8c12fe4e4ec29aa
new file mode 100644
index 0000000..a050dbd
Binary files /dev/null and b/Game/Library/metadata/67/672be213b87b4064b8c12fe4e4ec29aa differ
diff --git a/Game/Library/metadata/67/672be213b87b4064b8c12fe4e4ec29aa.info b/Game/Library/metadata/67/672be213b87b4064b8c12fe4e4ec29aa.info
new file mode 100644
index 0000000..1d30dcf
Binary files /dev/null and b/Game/Library/metadata/67/672be213b87b4064b8c12fe4e4ec29aa.info differ
diff --git a/Game/Library/metadata/8a/8a3817f3a7058cc41b46eb849acf069b b/Game/Library/metadata/8a/8a3817f3a7058cc41b46eb849acf069b
index 2c61750..89349b6 100644
Binary files a/Game/Library/metadata/8a/8a3817f3a7058cc41b46eb849acf069b and b/Game/Library/metadata/8a/8a3817f3a7058cc41b46eb849acf069b differ
diff --git a/Game/Library/metadata/f4/f4042531a480f4149bdda36c67975b0c b/Game/Library/metadata/f4/f4042531a480f4149bdda36c67975b0c
index dbc9127..5cde43a 100644
Binary files a/Game/Library/metadata/f4/f4042531a480f4149bdda36c67975b0c and b/Game/Library/metadata/f4/f4042531a480f4149bdda36c67975b0c differ
diff --git a/Game/Library/metadata/fc/fc6d250254fab4447aa1b764a56d3373 b/Game/Library/metadata/fc/fc6d250254fab4447aa1b764a56d3373
index bf4edec..dd45605 100644
Binary files a/Game/Library/metadata/fc/fc6d250254fab4447aa1b764a56d3373 and b/Game/Library/metadata/fc/fc6d250254fab4447aa1b764a56d3373 differ
diff --git a/Game/Library/shadercompiler-32bit-1.log b/Game/Library/shadercompiler-32bit-1.log
index 3f027e0..508253b 100644
--- a/Game/Library/shadercompiler-32bit-1.log
+++ b/Game/Library/shadercompiler-32bit-1.log
@@ -1,3 +1,9 @@
-Base path: E:/SDKs/Unity/Editor/Data
-Pipe name: \\.\pipe\UnityShaderCompiler-32bit-1-4308
-Cmd: getPlatforms
+Base path: E:/SDKs/Unity/Editor/Data
+Pipe name: \\.\pipe\UnityShaderCompiler-32bit-1-5636
+Cmd: getPlatforms
+Unhandled exception: Readfile from pipe failed. GLE=The pipe has been ended.
+
+
+Quitting shader compiler process
+
+Crashed!
diff --git a/Game/Library/shadercompiler-64bit-1.log b/Game/Library/shadercompiler-64bit-1.log
index d7aab80..4746c96 100644
--- a/Game/Library/shadercompiler-64bit-1.log
+++ b/Game/Library/shadercompiler-64bit-1.log
@@ -1,7 +1,3 @@
Base path: E:/SDKs/Unity/Editor/Data
-Pipe name: \\.\pipe\UnityShaderCompiler-64bit-1-4308
+Pipe name: \\.\pipe\UnityShaderCompiler-64bit-1-5636
Cmd: getPlatforms
-Cmd: compileSnippet
- api=4 type=0 insize=14871 outsize=3492 kw=DIRECTIONAL SHADOWS_OFF LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF ok=1
-Cmd: compileSnippet
- api=4 type=1 insize=14871 outsize=10090 kw=DIRECTIONAL SHADOWS_OFF LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF ok=1
diff --git a/Game/UnityVS.Game.CSharp.csproj b/Game/UnityVS.Game.CSharp.csproj
index 261e377..0e74138 100644
--- a/Game/UnityVS.Game.CSharp.csproj
+++ b/Game/UnityVS.Game.CSharp.csproj
@@ -67,6 +67,7 @@
+
diff --git a/Game/UnityVS.Game.v11.suo b/Game/UnityVS.Game.v11.suo
index ebccf73..0644c30 100644
Binary files a/Game/UnityVS.Game.v11.suo and b/Game/UnityVS.Game.v11.suo differ
diff --git a/Game/obj/Debug/Assembly-CSharp.dll b/Game/obj/Debug/Assembly-CSharp.dll
index 840c3af..3281c29 100644
Binary files a/Game/obj/Debug/Assembly-CSharp.dll and b/Game/obj/Debug/Assembly-CSharp.dll differ
diff --git a/Game/obj/Debug/Assembly-CSharp.pdb b/Game/obj/Debug/Assembly-CSharp.pdb
index 32ab33d..6df30f6 100644
Binary files a/Game/obj/Debug/Assembly-CSharp.pdb and b/Game/obj/Debug/Assembly-CSharp.pdb differ
diff --git a/Tools/MapViewer/MapViewer/Business/MapRenderer.cs b/Tools/MapViewer/MapViewer/Business/MapRenderer.cs
index a14b842..8a8e58b 100644
--- a/Tools/MapViewer/MapViewer/Business/MapRenderer.cs
+++ b/Tools/MapViewer/MapViewer/Business/MapRenderer.cs
@@ -79,7 +79,7 @@ namespace TransportGame.MapViewer
// Draw elevation
else if (elevation)
{
- float alpha = map[mapX, mapY]; // map height range is [0,1]
+ float alpha = map.Heights[mapX, mapY]; // map.Heights range is [0,1]
bitmap[x, y] = Color.Multiply(ElevationTerrainColor, alpha);
}