System Terrain Generator

PurgeandFire

zxcvmkgdfg
Reaction score
509
> IT probably wouldn't lag as much if done in JASS

Hmm. That would be possible if I knew JASS.

C'mon! Stop hiding it! I taught you practically everything you need to know about JASS and you're still avoiding it! Face it, you'll have to use it sooner or later.
Like in our map. :p

Lol... I'm just messin' with ya. I can't really tell what it means because I don't know GUI anymore... :(

I'll still try to understand the code though. :D
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
I <3 GUI

Though, how do you like the system?
 

monoVertex

I'm back!
Reaction score
460
Haven't looked at the map, but I strongly suggest Jass for it.

Ghan, do you have any programming language? If yes, learning Jass wouldn't be a biggie. If not, you can always take a break from improving the system and learning Jass will help you in all your mapping from then.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> Ghan, do you have any programming language?

I'm taking a Java class in school. :rolleyes:

Purge is right. I know a fair amount of JASS. However, I'm still much better and faster with GUI. At least for now.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> Which is impossible via triggers I think.

Yes. It is. Destructables only. :(
 
B

Bwack_Wat

Guest
Pathing Generator.

I have thought about doing this for a long time, but I couldn't find a use so i never got to it.

Now that someone has done it, I can present thoughts:

Pathing, I've thought of a way to do it.

Code:
Untitled Trigger 001
    Events
    Conditions
    Actions
        Set TerrainSpot = (Position of Terrain Spot Dummy)
        Set RandomDirection = (Random integer number between 1 and 3)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                PresentDirection Equal to 1
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        RandomDirection Equal to 1
                    Then - Actions
                        Environment - Change terrain type at (TerrainSpot offset by 100.00 towards 180.00 degrees) to Lordaeron Summer - Rock using variation -1 in an area of size 1 and shape Square
                        Set PresentDirection = 2
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                RandomDirection Equal to 2
                            Then - Actions
                                Environment - Change terrain type at (TerrainSpot offset by 100.00 towards 90.00 degrees) to Lordaeron Summer - Rock using variation -1 in an area of size 1 and shape Square
                                Set PresentDirection = 3
                            Else - Actions
                                Environment - Change terrain type at (TerrainSpot offset by 100.00 towards 0.00 degrees) to Lordaeron Summer - Rock using variation -1 in an area of size 1 and shape Square
                                Set PresentDirection = 4
            Else - Actions

Each number is a direction, as of this, 1 = left, 2 = up, 3 = right, and 4 = down. The randomed number is different each time based on "PresentDirecion".

Now this would only work if the path starts going up, you would copy this 3 more times, to replicate other directions and set the variables as follows.

Basically, it randomizes a direction, it wouldn't calculate any crazy things like finding where its already been, but it would suffice as a random path generator.

> For finding the start of a path you could randomly move "TerrainSpot" as a dummy unit to a random spot, and set "PresentDirection" to random number in 4 and it would then generate the path as follows.

> For finding where its been before, you would have to add some sort of probability engine, something that adds how many times its gone in one direction, and then changes the randomized number by number of number of times its been in one direction and then, you would simply round that down.

If this has inspired you, have fun.

o.o
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Hmm. So, do you run this multiple times? Some of that code looks unnecessary to me. I think you might be better off doing a loop. Just use a random offset. Also, it leaks points. But it's a start.
 
B

Bwack_Wat

Guest
...

No no no... Its not a WIP I just cooked it up to preview how a random pathing trigger could work.
 
B

Bwack_Wat

Guest
Covered

Yep, and then it would keep going to randomly pop out more squares of repetition. :D

"Basically, it randomizes a direction, it wouldn't calculate any crazy things like finding where its already been, but it would suffice as a random path generator."

"> For finding where its been before, you would have to add some sort of probability engine, something that adds how many times its gone in one direction, and then changes the randomized number by number of number of times its been in one direction and then, you would simply round that down."

o.o
 

monoVertex

I'm back!
Reaction score
460
I think this native:
JASS:
native SetDoodadAnimation       takes real x, real y, real radius, integer doodadID, boolean nearestOnly, string animName, boolean animRandom returns nothing


Might create a doodad. But I'm not sure. :)

"SetDoodadAnimation" I don't think that sounds as a "CreateDoodad" :p. It just sets the animation of the doodad, as the name sais. Simple as that. Plus, it doesn't returns anything. Believe me, I've tried once to play with doodads. Didn't worked :p.

You could make dummy units to use doodads models. However, that would work only if the model doesn't has a skin depending on the tileset...
 

elmstfreddie

The Finglonger
Reaction score
203
You could make dummy units to use doodads models. However, that would work only if the model doesn't has a skin depending on the tileset...

You sure? Doodads have a material layer that is Replaceable Id (some number) that means change with the tileset, or tree, etc. For example the mountain king's stick is Replaceable Id 31, which changes according to what type of tree he grabs for a stick.
So I'm thinking it would work.
 

monoVertex

I'm back!
Reaction score
460
The mountain giant is special. He recognizes the tree he grabs, not the tileset.

However, I noticed that doodads do not have changing skins :D. So it's perfectly possible. What I said there applies to destructibles like trees and such.
 

monoVertex

I'm back!
Reaction score
460
I think that was somewhat rude and unnecessary. You made yours, well, bravo!, but you don't need to advertise it in the rival thread.

And it was off-topic, btw.
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Nah, I tested it, and it didn't work. I just assumed it would work because it is the same thing with dialogs, you create them without even using a createdialog thing.

:p

I guess you can always do what dhk did as in make them destructables. Also, it may make yours more possible if you make it in JASS!! :D
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
1. Thank you all for your comments. You've helped me a lot on this. :D

2. Major update. Execution limit threat greatly reduced. I added waits in the triggers that will stop the trigger from freezing up so much. This allows you to set the Generation Seed lower, which will increase the randomness, but also the amount of modifications, meaning you can end up with higher terrain, and you will definitely have more trees. Though, the destructable probability is changeable.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top