• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

DatBoi's Terrain Generator (1.2)

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
「DatBoi's Terrain Generator of DOOM」

By@DatBoi


[TD] Description [/TD]
I present to you: a highly configurable random terrain generator with multiple terrain presets capability.

Features
Highly Configurable
Mostly leakless

Credits
Blizzard Entertainment, IcemanBo, Grey Knight, Remixer, kellym0, Kuhneghetz, HappyTauren, Deolrin, Sunchips, Fingolfin, Nightelfbuilder, HerrDave, olofmoleman, Verdun

Changelog
1.00: Release
1.01: Added "LoopQuantity" variable to CFG, for easier customization. (Suggestion by Abovegame), Also added automatic "iseedeadpeople"
1.02: Fixed errors in the tile part of the generator, removed unused models.
1.1: Every change @MyPad pointed out has been made.
1.2: Updated the generator to work in 1.29+
Map Description Generator 「By Vengeancekael」
Contents

DatBoi's Terrain Generator (Map)

Reviews
MyPad
^^ Before the generation starts, apply a cinematic fade out. After the generation ends, apply a cinematic fade in. Notes: The generator system itself must be separate from the dialog button that appears on Map Initialization. The trigger in...
Dr Super Good
Comments and Suggestions: Possibly useful for people who have no idea where to start with creating a terrain generator. However the performance of this system is just impossibly bad. I strongly advise people do not use this system without heavy...
Level 22
Joined
Apr 9, 2017
Messages
1,681
Tested it a few times and it works very well. No crashes, just the small lag spike you warned us about. (1-2 seconds lag spikes are my eternal bane :D)
The terrain generated also looks very well made.
 

Deleted member 247165

D

Deleted member 247165

Excepting the lag spikes that occur but there's a warning about that at the very beginning, this tool is really useful and is a good addition to any w3 modder. I suggest you add more types of terrain in this generator. 5/5
 
Level 5
Joined
Mar 27, 2017
Messages
106
I would like to know:
Why do you add grass and flowers(the destructible for both of them) within the trees at the end of the generation?
You can barely see the grass within the trees and when you do it looks weird.
(however putting grass texture under the trees is fine)
 
Level 6
Joined
Jul 1, 2016
Messages
98
I would like to know:
Why do you add grass and flowers(the destructible for both of them) within the trees at the end of the generation?
You can barely see the grass within the trees and when you do it looks weird.
(however putting grass texture under the trees is fine)

That's just for the example, you can easily remove it :p

I should probably offset those to not be exactly below the tree tho

I suggest that you have an instant fade out and fade in once the generation is done.

What do you mean?
 

^^ Before the generation starts, apply a cinematic fade out. After the generation ends, apply a cinematic fade in.


Notes:

  • The generator system itself must be separate from the dialog button that appears on Map Initialization. The trigger in question is
    • Config
    .

  • The following variables are not constants:
    • TERRAINPOINT
    • DESTRUCTABLESPOINT
    • DEFORMATIONSPOINT
  • In trigger
    • Special Terrain
    , (have mercy on the mapmaker), you can optimize the trigger so that it only enumerates each destructable once. You can check the destructable type internally with this script:


    • For each (Integer A) from 1 to STMax, do (Actions)
      • Loop - Actions
        • Destructible - Pick every destructible in (Entire map) and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Destructible-type of (Picked destructible)) Equal to DestructibleType[(Integer A)]
              • Then - Actions
                • Set STPOINT = (Position of (Picked destructible))
                • Environment - Change terrain type at STPOINT to SpecialTerrain[(Integer A)] using variation SpecialTerrainVariation[(Integer A)] in an area of size SpecialTerrainSize[(Integer A)] and shape SpecialTerrainShape[(Integer A)]
                • Custom script: call RemoveLocation(udg_STPOINT)
              • Else - Actions



    • Destructible - Pick every destructible in (Entire map) and do (Actions)
      • Loop - Actions
        • For each (Integer A) from 1 to STMax, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Destructible-type of (Picked destructible)) Equal to DestructibleType[(Integer A)]
              • Then - Actions
                • Custom script: exitwhen true
              • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Integer A) less than or equal to STMax equal to true
          • Then - Actions
            • Set STPOINT = (Position of (Picked destructible))
            • Environment - Change terrain type at STPOINT to SpecialTerrain[(Integer A)] using variation SpecialTerrainVariation[(Integer A)] in an area of size SpecialTerrainSize[(Integer A)] and shape SpecialTerrainShape[(Integer A)]
            • Custom script: call RemoveLocation(udg_STPOINT)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • And - All (Conditions) are true
              • Conditions
                • STInteger Equal to 1
                • Or - Any (Conditions) are true
                  • Conditions
                    • (Destructible-type of (Picked destructible)) Equal to Tree1
                    • (Destructible-type of (Picked destructible)) Equal to Tree2
                    • (Destructible-type of (Picked destructible)) Equal to Tree3
                    • (Destructible-type of (Picked destructible)) Equal to Tree4
                    • (Destructible-type of (Picked destructible)) Equal to Tree5
                    • (Destructible-type of (Picked destructible)) Equal to Tree6
                    • (Destructible-type of (Picked destructible)) Equal to Tree7
                    • (Destructible-type of (Picked destructible)) Equal to Tree8
                    • (Destructible-type of (Picked destructible)) Equal to Tree9
                    • (Destructible-type of (Picked destructible)) Equal to Tree10
          • Then - Actions
            • Set Temp_Point = (Position of (Picked destructible))
            • Destructible - Create a Grass[(Random integer number between 1 and 4)] at Temp_Point facing (Random angle) with scale 0.80 and variation 1
            • Custom script: call RemoveLocation (udg_Temp_Point)


    The (Integer A) variable is a placeholder, wherein you can substitute another variable for it.
    Also, another variable should hold picked destructable, as it can become costly to reference it all over and over again.

  • Is this intended for multiplayer as well? If so, this trigger might prove problematic:


    • GeneratorStop
      • Events
      • Conditions
      • Actions
        • Trigger - Turn off Destructibles <gen>
        • Trigger - Turn off Deformations <gen>
        • Trigger - Turn off Critters <gen>
        • Trigger - Turn off Terrain <gen>
        • Wait 2.00 seconds
        • Trigger - Turn off Special Terrain <gen>
        • Trigger - Turn on CritterSpawn <gen>
        • Custom script: call DestroyTrigger( GetTriggeringTrigger() )


    The Wait function could potentially desync other players if this is to be for multiplayer maps as well.

  • Although it isn't pointed out in the Spell Submission Rules, it is recommended not to use (Integer A) or (Integer B) as variables, since they are for public use. (Imagine 20 families using the same C.R. Things could get ugly.)

Nitpicks:

  • The description of the resource could use some work. Have confidence in presenting your map, and do not be too down on yourself when describing it.
  • As mentioned by @Abovegame, some more configurability would be desired.
Nevertheless, the system itself is quite capable, and functional, and I envision that it will be updated later on.

Status:

  • Awaiting Update
 
Last edited:
You can move a lot of the variable assignment to a map Initialization trigger, since configurables are generally assigned on that time frame.

The trigger Config, though mostly true to its namesake, is executed on a dialog-click, which would then initialize a lot of things, before starting up the respective triggers. That is why I would prefer moving those variable assignments to another trigger, or the statement above.

The dialog button input and the terrain generator should be separate from each other, but that does not mean I am discouraging you from using it. Rather, have the terrain generator do all the things it needs to do and just build the dialog from there.
 
Level 6
Joined
Jul 1, 2016
Messages
98
You can move a lot of the variable assignment to a map Initialization trigger, since configurables are generally assigned on that time frame.

The trigger Config, though mostly true to its namesake, is executed on a dialog-click, which would then initialize a lot of things, before starting up the respective triggers. That is why I would prefer moving those variable assignments to another trigger, or the statement above.

The dialog button input and the terrain generator should be separate from each other, but that does not mean I am discouraging you from using it. Rather, have the terrain generator do all the things it needs to do and just build the dialog from there.

That would remove the multiple preset configuration possibility completely...
 
Level 22
Joined
Jul 25, 2009
Messages
3,091
I wanted to use this system myself for an Age of Empires sort of rip off I'm doing but there are some problems with it from a practicality standpoint. Trees and doodads block building paths making it useless for RTS matches, there are no cliffs (I feel like this would be relatively easy to add too,) the randomness of it isn't that dramatic, I've ran it a few times and the tiles don't vary much nor does the environment in general. You need water, cliffs, less saturation of trees, and the option for different environments/tilesets or greater variation within the existing tileset.
 
Level 6
Joined
Jul 1, 2016
Messages
98
I wanted to use this system myself for an Age of Empires sort of rip off I'm doing but there are some problems with it from a practicality standpoint. Trees and doodads block building paths making it useless for RTS matches, there are no cliffs (I feel like this would be relatively easy to add too,) the randomness of it isn't that dramatic, I've ran it a few times and the tiles don't vary much nor does the environment in general. You need water, cliffs, less saturation of trees, and the option for different environments/tilesets or greater variation within the existing tileset.

You can add ALL that except cliffs via configuration.
 
Level 8
Joined
Oct 4, 2016
Messages
208
When I started the map, the cinematic mode never disappears. So I checked the triggers and you turn on the Cinematic Mode but never turn it off.

This is too good, I'll wait for updates that implements cliffs or elevations. + rep.
 
Cool system though the cause of lag is from double loops, why do you need/use them? Wouldn't the version below of this be better?



Edit: Should create the destructibles after terrain height is done, a destructible matches the height of the terrain it is made at or at the height of a walkable destructible.
 

Attachments

  • DatBois Terrain Generator v1.2.w3x
    4.3 MB · Views: 141
Last edited:

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,178
Comments and Suggestions:
Possibly useful for people who have no idea where to start with creating a terrain generator. However the performance of this system is just impossibly bad. I strongly advise people do not use this system without heavy modification for any kind of mapping project.

My CPU is 10 years old however that is no excuse for the terrain generation process to take over 10 minutes of 1 frame per minute to complete. And the map is only 192x128, a 480x480 map might take many hours or even worse. Clearly there is an issue with algorithmic complexity, especially seeing how on the 1.31 PTR William was able to generate a fair sized map with deformations, doodads and tile variation in seconds.

Since the author said that they plan to remake this system from scratch in the future I am sending this to Substandard. Any such major remake should be submitted as a new resource to avoid carrying over mismatching comments and ratings.​
 
Top