- Reaction score
- 888
Hate creating terrain? Want to have great terrain without the work? Well, this system is for you! It will create completely random, good-looking terrain when the game starts.
Pros
You can specify up to 5 different terrain types
You can also have 5 different destructable-types that will be randomly generated.
No more wasting time on terrain!
The Generation Seed allows you to specify how much generation there is!
You can specify a specific region to be modified.
If a region is specified, it will not be a perfect square.
Works on any size map. Even 256x256!
Cons
The larger the map, the longer the generation takes.
The new terrain does not show up on the minimap.
If a region is specified, it will not be a perfect square.
Here are some screenshots of the randomly generated terrain. This was created from a blank, flat 64 x 64 dirt map:
Just download the map, open it, and hit the test button to see it in action!
Improvement suggestions and critiques are welcome.
Yes, I know the code is a little bit of a mess. But it works.
Pros
You can specify up to 5 different terrain types
You can also have 5 different destructable-types that will be randomly generated.
No more wasting time on terrain!
The Generation Seed allows you to specify how much generation there is!
You can specify a specific region to be modified.
If a region is specified, it will not be a perfect square.
Works on any size map. Even 256x256!
Cons
The larger the map, the longer the generation takes.
The new terrain does not show up on the minimap.
If a region is specified, it will not be a perfect square.
Here are some screenshots of the randomly generated terrain. This was created from a blank, flat 64 x 64 dirt map:
Just download the map, open it, and hit the test button to see it in action!
Improvement suggestions and critiques are welcome.
Yes, I know the code is a little bit of a mess. But it works.
Code:
Terrain Generator
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
For each (Integer Loop) from 1 to (Integer(((Width of (Playable map area)) / (Real(GeneratorSeed))))), do (Actions)
Loop - Actions
For each (Integer A) from 1 to (Integer(((Height of (Playable map area)) / (Real(GeneratorSeed))))), do (Actions)
Loop - Actions
Set TempPoint = (Point(((Real(Loop)) x (Real(GeneratorSeed))), ((Real((Integer A))) x (Real(GeneratorSeed)))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at TempPoint) Equal to Lordaeron Summer - Dirt
(AffectedRegion contains TempPoint) Equal to True
Then - Actions
Environment - Change terrain type at TempPoint to TerrainTypes[(Random integer number between 1 and 5)] using variation -1 in an area of size (Random integer number between 1 and 5) and shape Circle
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Point(((Real(Loop)) x (-1.00 x (Real(GeneratorSeed)))), ((Real((Integer A))) x (Real(GeneratorSeed)))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at TempPoint) Equal to Lordaeron Summer - Dirt
(AffectedRegion contains TempPoint) Equal to True
Then - Actions
Environment - Change terrain type at TempPoint to TerrainTypes[(Random integer number between 1 and 5)] using variation -1 in an area of size (Random integer number between 1 and 5) and shape Circle
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Point(((Real(Loop)) x (Real(GeneratorSeed))), ((Real((Integer A))) x (-1.00 x (Real(GeneratorSeed))))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at TempPoint) Equal to Lordaeron Summer - Dirt
(AffectedRegion contains TempPoint) Equal to True
Then - Actions
Environment - Change terrain type at TempPoint to TerrainTypes[(Random integer number between 1 and 5)] using variation -1 in an area of size (Random integer number between 1 and 5) and shape Circle
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Point(((Real(Loop)) x (-1.00 x (Real(GeneratorSeed)))), ((Real((Integer A))) x (-1.00 x (Real(GeneratorSeed))))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at TempPoint) Equal to Lordaeron Summer - Dirt
(AffectedRegion contains TempPoint) Equal to True
Then - Actions
Environment - Change terrain type at TempPoint to TerrainTypes[(Random integer number between 1 and 5)] using variation -1 in an area of size (Random integer number between 1 and 5) and shape Circle
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Code:
Destructable Generator
Events
Time - Elapsed game time is 1.25 seconds
Conditions
Actions
For each (Integer Loop) from 1 to (Integer(((Width of (Playable map area)) / (Real(GeneratorSeed))))), do (Actions)
Loop - Actions
For each (Integer A) from 1 to (Integer(((Height of (Playable map area)) / (Real(GeneratorSeed))))), do (Actions)
Loop - Actions
Set TempPoint = (Point(((Real(Loop)) x (Real(GeneratorSeed))), ((Real((Integer A))) x (Real(GeneratorSeed)))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 15
Then - Actions
Set TempGroup = (Units within 400.00 of TempPoint)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in TempGroup) Equal to 0
(Terrain type at TempPoint) Not equal to Lordaeron Summer - Rock
(AffectedRegion contains TempPoint) Equal to True
Then - Actions
Destructible - Create a Destructables[(Random integer number between 1 and 5)] at TempPoint facing (Random angle) with scale 1.00 and variation 0
Else - Actions
Custom script: call DestroyGroup(udg_TempGroup)
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Point(((Real(Loop)) x (-1.00 x (Real(GeneratorSeed)))), ((Real((Integer A))) x (Real(GeneratorSeed)))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 15
Then - Actions
Set TempGroup = (Units within 400.00 of TempPoint)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in TempGroup) Equal to 0
(Terrain type at TempPoint) Not equal to Lordaeron Summer - Rock
(AffectedRegion contains TempPoint) Equal to True
Then - Actions
Destructible - Create a Destructables[(Random integer number between 1 and 5)] at TempPoint facing (Random angle) with scale 1.00 and variation 0
Else - Actions
Custom script: call DestroyGroup(udg_TempGroup)
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Point(((Real(Loop)) x (Real(GeneratorSeed))), ((Real((Integer A))) x (-1.00 x (Real(GeneratorSeed))))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 15
Then - Actions
Set TempGroup = (Units within 400.00 of TempPoint)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in TempGroup) Equal to 0
(Terrain type at TempPoint) Not equal to Lordaeron Summer - Rock
(AffectedRegion contains TempPoint) Equal to True
Then - Actions
Destructible - Create a Destructables[(Random integer number between 1 and 5)] at TempPoint facing (Random angle) with scale 1.00 and variation 0
Else - Actions
Custom script: call DestroyGroup(udg_TempGroup)
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Point(((Real(Loop)) x (-1.00 x (Real(GeneratorSeed)))), ((Real((Integer A))) x (-1.00 x (Real(GeneratorSeed))))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 15
Then - Actions
Set TempGroup = (Units within 400.00 of TempPoint)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in TempGroup) Equal to 0
(Terrain type at TempPoint) Not equal to Lordaeron Summer - Rock
(AffectedRegion contains TempPoint) Equal to True
Then - Actions
Destructible - Create a Destructables[(Random integer number between 1 and 5)] at TempPoint facing (Random angle) with scale 1.00 and variation 0
Else - Actions
Custom script: call DestroyGroup(udg_TempGroup)
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Code:
Terrain Generator Height
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
For each (Integer Loop) from 1 to (Integer(((Width of (Playable map area)) / (Real(GeneratorSeed))))), do (Actions)
Loop - Actions
For each (Integer A) from 1 to (Integer(((Height of (Playable map area)) / (Real(GeneratorSeed))))), do (Actions)
Loop - Actions
Set TempPoint = (Point(((Real(Loop)) x (Real(GeneratorSeed))), ((Real((Integer A))) x (Real(GeneratorSeed)))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(AffectedRegion contains TempPoint) Equal to True
Then - Actions
Environment - Create a 0.10 second Permanent crater deformation at TempPoint with radius (Random real number between 64.00 and 512.00) and depth (-1.00 x (Random real number between -32.00 and 32.00))
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Point(((Real(Loop)) x (Real((-1 x GeneratorSeed)))), ((Real((Integer A))) x (Real(GeneratorSeed)))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(AffectedRegion contains TempPoint) Equal to True
Then - Actions
Environment - Create a 0.10 second Permanent crater deformation at TempPoint with radius (Random real number between 64.00 and 512.00) and depth (-1.00 x (Random real number between -32.00 and 32.00))
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Point(((Real(Loop)) x (Real(GeneratorSeed))), ((Real((Integer A))) x (Real((-1 x GeneratorSeed))))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(AffectedRegion contains TempPoint) Equal to True
Then - Actions
Environment - Create a 0.10 second Permanent crater deformation at TempPoint with radius (Random real number between 64.00 and 512.00) and depth (-1.00 x (Random real number between -32.00 and 32.00))
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Point(((Real(Loop)) x (Real((-1 x GeneratorSeed)))), ((Real((Integer A))) x (Real((-1 x GeneratorSeed))))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(AffectedRegion contains TempPoint) Equal to True
Then - Actions
Environment - Create a 0.10 second Permanent crater deformation at TempPoint with radius (Random real number between 64.00 and 512.00) and depth (-1.00 x (Random real number between -32.00 and 32.00))
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)