Author Topic: [Repost] Landscape Generator by NiXiLL/Lumirays  (Read 25531 times)

Landscape Generator
This handy tool can generate lanscapes of huge sizes. I released due to huge demand. -NiX
Latest Stable Version: 1.1a


Change log:

V1.0

    * Simple landscape generation.
    * Quite user friendly GUI.
    * Very simple system of extending it (look in zip/methods).
    * Comes with 1 mode (Lol?).
    * If you liked the generated landscape, you can save it.
    * Comes with an editor if you want to draw with it/corrcect landscapes or anything.
    * Works in any colorset becasue you can select colors.
    * Doesn't only use colors, uses heights too.

V1.1

    * One more method: Plains.
    * Numerous GUI fixes.
    * Editor update.
    * Editor Grid
    * Brick Type selection, Height selection.
    * Brick size detection

V1.1a

    * Fixed the saving bug.
    * Fixed a bug in the brick textboxes.
    * Added the browse option for methods.
    * Various small bugs.

Features:

- Create landscapes very easily
- Customizabe colors
- Landscape saving/loading
- Method saving/loading



Usage

Before starting:

- Make sure you downloaded LSG properly
- Please set-up your LSG hotkey first at your options:



- Take note that some servers only accept an acceptable rate of planting bricks. You might rebuild the empty parts over and over.

Overview:



Instructions:

1. The first question is what brick are you going to use so that you can know the size of your baseplate (You need baseplates below your landscape so you can easily delete them).

For example, you want to use a 8x8 cube and the desired landscape size is 64x64. Then you would multiply 8 by 64, which is 512. Therefore, the total size of your baseplates must be 512x512, which is converted to 8x8 64x64 baseplates.

Its a good thing to know that the landscape sizes (see on the overview) are NOT the exact total dimensions of your landscape (in brick units). They are multiplied on the dimensions of your brick. For example, you put a 64x64 landscape, and you used a 4x4 brick. Then the resulting size of your whole landscape will be: 64x4 = 256. 256x256 is the whole size of your landscape.

2. We are going to use 8x8 cubes in this tutorial. We are not going to put baseplates in this tutorial. But if you are going to build at other servers I suggest you do it in a baseplate.



3. Now we see that the default brick set is this:



4. Now go to the Brick Inventory (press B), and clear the brick cart:



Clearing your cart



5. Now fill your cart with 8x8 cubes, then click "Done":



Fill your cart with 8x8 cubes



6. Now let's place a 8x8 temp brick here:



7. Now open up your LSG window:



8. Put in your landscape size, which is by default 64x64, then click "Create":



9. Now customize the settings in this pane and click "Generate" (it might lag a bit):



10. Change the colors of your blocks by clicking the color palette and changing their colors to the right one (I never changed the color in the GUI screenshots,  but I changed it later if you see when LSG is building the landscape):



11. Now, press Autodetect. (Autodetect is function that automatically detects your current brick and its dimensions. Always remember to press this before building):



12. Click "Build". NOTE: You must face the direction where the LSG is planting bricks! If you changed your direction, the LSG will generate at wrong directions! Better to stay in one direction:



13. It will rapidly plant bricks, then wait until its done:







Custom Methods

This a quote from M (Clockturn):

Okay. Open a new text file.

Now, for an example I'm using my Plains method. (Yes, I made it)
Terrain Types
Code: [Select]
Types:
Plains_Grass 0 , 2
Plains_Dirt 1 . 2
Hill 2 / 3
Cliff 3 ^ 4
Lake_Shallow 4 - 1
Lake_Deep 5 = 0
Beach 6 ~ 2
End
These define what the different terrain types are.
Code: [Select]
Type_Name Index SaveCharacter ZlevelType_Name: The name that shows in the color selection area in the GUI
Index: The number that defines the terrain in the Method area.
SaveCharacter: The character that shows in save files where this terrain type is.
Zlevel: How many blocks there is UNDER the colored block of this terrain (to color those blocks, you set the color of the "Unused Terrain").
So, the Cliff type shows as 3 in the method, shows as ^ in savefiles, and is lifted 4 blocks off the level.

Note: Terrain types list is prefixed by Types: and suffixed by End.

Variables
Code: [Select]
Var:
Dirt 16 [D]
Dirt_Loop 8 [DL]
Dirt_Grow 50 [DG]
Mountains 8 [M]
Mountain_Loop 8 [ML]
Mountain_Grow 50 [MG]
Mountain_Hills 20 [MH]
Lakes 8 [W]
Lake_Loop 8 [WL]
Lake_Grow 40 [WG]
End
You know those entries in the GUI? That's them. You set them as such:
Code: [Select]
Var_Name DefaultValue TokenVar_Name: The name of the variable (that shows in the GUI)
DefaultValue: The value that is set in the box by default
Token: What you use in the Method to use this variable
So the variable "Lakes", default 8 lakes, is tokened as [W] in the method. In this particular method, it shows the number of lake spots to place and then [WG] is used as the seed (chance) for those spots to grow outwards. They get [WL] tries to expand, and the final result is the lake areas.

Note: Variables list is prefixed with Var: and suffixed with End.

Method
This is the juicy part - the method by which the terrain is generated.
Code: [Select]
Method:
FILLMAP 0

PlaceRandom [W] 5 0

REPEAT [WL]
PlaceAround 0 5 5 -1 [WG]
Finish

PlaceAround 0 4 5 -1 100
PlaceAround 0 6 4 -1 100

PlaceRandom [M] 3 0

REPEAT [ML]
PlaceAround 0 3 3 -1 [MG]
Finish

PlaceAround 0 2 3 -1 [MH]

PlaceRandom [D] 1 0

REPEAT [DL]
PlaceAround 0 1 1 -1 [DG]
Finish

End
Now, this is lengthy. I'm going to go through it function by function.

FILLMAP
Code: [Select]
FILLMAP ii: Terrain Index to fill the map with.
This is fairly easy to understand - it fills the map with a terrain index, ie 0, 1, 4, etc.

PlaceRandom
Code: [Select]
PlaceRandom n i tn: Number of spots to place
i: Terrain index to place
t: Terrain type to place on (if omitted; places anywhere)
You only need to use PlaceRandom once for one terrain type, unless you want to place them randomly at different times during generation.

PlaceAround
Code: [Select]
PlaceAround f t n s cf: From terrain index
t: To terrain index
n: Near terrain index
s: What to become if surrounded by n
c: Chance to place
Most of this bears little explanation; if a spot of type f is next to a spot of type n, it will become a spot of type t. If this spot has n on all four sides, it will turn to index s. None of that will take effect if a random from 0-100 falls over c; so if c=70, there is a 30% chance of failure. If that's confusing, I think you should read it again... then again, it may make sense to me because I already understand this.

REPEAT->Finish
Code: [Select]
REPEAT r
DO STUFF HERE
Finish
r: Number of times to repeat
Basically, a loop. Everything between REPEAT r and Finish will be done r times, each time on the landscape after the results of the previous iteration.

Note: Method is prefixed with Method: and suffixed by End.


If you have any questions, feel free to brew them, because it all makes perfect sense to me. But because I'm too nice for my own good, I will likely answer them anyway.

If you quote this entire post, your right to use the forums will be revoked. Well, not really, I'll just be very very angry, and I will write you a letter - nay, several letters, telling you how angry I am. And I propose that many others do the same.

-Thanks M! :D



Download

Download Client_LandscapeGenerator.zip into your add-ons folder
If you have the old Script_LSG.zip in your add-ons folder, delete it




F.A.Q.

Q: Will this work on anyone's colorset or my colorset?
A: Yes it will, LSG automatically adjusts to your current colorset.

Q: How did you get that awesome Blockland skin?
A: This was made by Svenne. Here's the thread from the RTB forums.

Q: Will this work even if I below the average computer?
A: It depends how much bricks your computer can handle.

Q: Is this a new version?
A: No, I never changed any major part of the code. The thing that I only changed are the paths and the filename of the add-on.

Q: Can I use any brick instead of an 8x8 cube?
A: Yes.

Q: Will there me be more methods?
A: Hopefully, yes. I'm still studying it too.

Q: Will there new versions?
A: Let's hope that NiXiLL/Lumirayz does.

Q: I really can't get it to work! What will I do?
A: Look at the "Before you start" section. If everything on it is alright, maybe you're doing something wrong.

Q: Okay so I generated a landscape on  a baseplate, but it keeps planting beyond the baseplates and kept giving me "Float" errors! What do I do?
A: See step 1 at the instructions. If you just don't know how to do simple math, don't do it in baseplates.

Q: HURR DURR I DO NOT TRUST THIS PORT!!! it dont have permissioN!!!1111 hurp durp huuuurrrpp
A:
Sure you can repost it. :3

Q: OMG!! it shud me namd Script_LSG.zip becos it will not wrok!!!11 trust me im smart!!111
A: The add-on prefix does not fit the add-on itself, and it doesn't even have a server.cs in the archive. It is a client-sided add-on, and that's how it should be named. Don't worry it wouldn't work, I have fixed it so that it will work

Q: Do I always need to have the same brick at all my brick slots?
A: No, actually, you can do different bricks. For example, you want the water block to be water: You see that the water brick has the brick value of 1? It means its corresponding to slot 2 in your brick cart. Just replace a 8x8 water in the slot 2 of your brick cart, and all water blocks will become water.



I reposted a new topic because the old one has a broken download link and the tutorial needed more detail.

Credits:

    * NiXiLL/Lumirayz: Creator of LSG
    * Clockturn (M on forums): Plains method.
    * Trader: Some suggestions.
    * Reactor Worker: Some suggestions.
    * Me: New tutorial, mirrors, and topic.
« Last Edit: April 08, 2010, 07:21:26 AM by Jaydee »

Great job, Jay.  Not only have people been demanding a repost for this; half the people who have it don't know how to use it.

Many thanks.
« Last Edit: March 06, 2010, 05:32:56 AM by Manty »

You have explained it very well, thank you

What was wrong with the old one?

What was wrong with the old one?

Outdated and the tutorial kinda need more detail

AWESOME!!!!!!!!!!!!!!!! NIXILL YOU ARE A GOD!!!!!!!!!!!

When i make it there are no islands D:

When i make it there are no islands D:

How did that happen? What did you do?

How did that happen? What did you do?
exactly the same as you :( is it meant to work on custom colorsets?

exactly the same as you :( is it meant to work on custom colorsets?
Your colorset does not matter it comes with it's own colors

Your colorset does not matter it comes with it's own colors
LSG works off of user-assigned colors from their colorset.

Thanks for the guide Jaydee I can get it to work now.

Thanks for the guide Jaydee I can get it to work now.

No problem :D