diff --git a/isometric-park-fna/CellMap.cs b/isometric-park-fna/CellMap.cs --- a/isometric-park-fna/CellMap.cs +++ b/isometric-park-fna/CellMap.cs @@ -13,6 +13,9 @@ public int ZoneWidth = 10; public int ZoneHeight = 10; + + + public int MapMultiplier; //Adjusts for larger maps. public int tree_count { @@ -56,6 +59,9 @@ this.cells = new List>(); + this.MapMultiplier = (int)(((this.MapWidth / 50) + (this.MapHeight / 50)) / 2); + + for (int i = 0; i < height; i++) { List newRow = new List(); diff --git a/isometric-park-fna/Engines/Spawners/ContractSpawner.cs b/isometric-park-fna/Engines/Spawners/ContractSpawner.cs --- a/isometric-park-fna/Engines/Spawners/ContractSpawner.cs +++ b/isometric-park-fna/Engines/Spawners/ContractSpawner.cs @@ -32,6 +32,8 @@ private int MapWidth; private int MapHeight; + private int MapMultiplier; //Adjustment factor for larger maps + private Simulation simulation; private Grammar grammar; @@ -45,7 +47,8 @@ this.simulation = simulation; this.grammar = grammar; - } + + this.MapMultiplier = this.simulation.map.MapMultiplier; } private Vector2 FindStart(HashSet occupied_squares) { @@ -53,7 +56,7 @@ for (int i = 0; i < 5; i++) { - new_square = new Vector2(random_generator.Next(0, 50), random_generator.Next(0, 50)); + new_square = new Vector2(random_generator.Next(0, this.MapHeight), random_generator.Next(0, this.MapWidth)); if (!occupied_squares.Contains(new_square)) { @@ -70,7 +73,7 @@ var squares_to_add = new HashSet(); var attempts = 0; - var maxAttempts = max_size * 10; + var maxAttempts = max_size * this.MapMultiplier * 10; while (squares.Count < max_size) { @@ -148,10 +151,10 @@ int max_squares = (organization_type, message.min_squares) switch { - (OrganizationType.Family, null) => random_generator.Next(50, 100), - (OrganizationType.LargeCorporation, null) => random_generator.Next(90, 250), - (OrganizationType.Cooperative, null) => random_generator.Next(50, 75), - (_, null) => random_generator.Next(DEFAULT_MIN_SQUARES, DEFAULT_SQUARES), + (OrganizationType.Family, null) => random_generator.Next(50, 100 * this.MapMultiplier), + (OrganizationType.LargeCorporation, null) => random_generator.Next(90, 250 * this.MapMultiplier), + (OrganizationType.Cooperative, null) => random_generator.Next(50, 75 * this.MapMultiplier), + (_, null) => random_generator.Next(DEFAULT_MIN_SQUARES, DEFAULT_SQUARES * this.MapMultiplier), _ => (message.max_squares == 0) ? DEFAULT_SQUARES : message.max_squares }; diff --git a/isometric-park-fna/Simulation.cs b/isometric-park-fna/Simulation.cs --- a/isometric-park-fna/Simulation.cs +++ b/isometric-park-fna/Simulation.cs @@ -39,6 +39,7 @@ public int trees; public int dead_trees; public int crowded_trees; + //Kind of a hack but allos for tracking figures over time without creating a whole new infrastructure } @@ -236,9 +237,6 @@ } } - //Historical counts - // public List tree_count - public Simulation(int width, int height, float[] millisecondsPerAdvance) { this.random = new Random();