Request, generate terrain **done, download inside**

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
Frank87
Posts: 28
Joined: 05 Sep 2011, 16:10

Request, generate terrain **done, download inside**

Post by Frank87 »

Hello there!

In the track editor you can now use script to place 10 tree blocks at random location at the map.
What I am wondering about: Could someone be able to create a script that created a terrain for you, completely random? This terrain would be of both water, hills, cliffs, mountains and so on.

Or is it impossible to make it completely random?
Last edited by Frank87 on 08 Sep 2011, 15:03, edited 2 times in total.
konte
Posts: 236
Joined: 15 Jun 2010, 12:36
Location: Germany

Re: Request, generate terrain

Post by konte »

I thought of this already as well. But making an authentic terrain script is a lot harder than just placing tree blocks, as you can imagine, I guess^^

If no one else has had the idea already and is working on it, I would like to make one :)
krial057
Posts: 57
Joined: 13 Nov 2010, 20:15

Re: Request, generate terrain

Post by krial057 »

Here my first try: 8-)

Image
atm you can set the min and max height and the number of terrain "blocks" with random size.
Tryed first with generating a heightmap(with a fractal function) and then rendering the terrain with the heightmap hights. however, this took very long and so I gave it up and my new algorithm is simply get a random block height, position and size and place it...

regards Alain
Frank87
Posts: 28
Joined: 05 Sep 2011, 16:10

Re: Request, generate terrain

Post by Frank87 »

Nice! :) But please don't give up, see if there is a way to make a good algorithm. But of course ,if it's too hard I understand that - afterall, I canot make shit at all ;p
konte
Posts: 236
Joined: 15 Jun 2010, 12:36
Location: Germany

Re: Request, generate terrain

Post by konte »

I created a terrain generator, I'm very pleased with it :)

Image

It places all the three kinds of terrain randomly at random positions. As you can see, you can determine how man blocks will be set and if a certain block type should occur more often (this means, twice as much as normally).

Download: http://konte.org/daten/skripte/Bulldozer.Script.txt
(Place it in \Documents\ManiaPlanet\Scripts\EditorPlugins\TrackMania)
Last edited by konte on 05 Feb 2012, 16:26, edited 1 time in total.
Frank87
Posts: 28
Joined: 05 Sep 2011, 16:10

Re: Request, generate terrain

Post by Frank87 »

This is absoluty amazin, thanks a lot!!
Thumbs up man.

Quick question tho: Would it be hard implenting so the game also used the various water and hill cliffs (the ones in the block selection) ? =)
krial057
Posts: 57
Joined: 13 Nov 2010, 20:15

Re: Request, generate terrain **done, download inside**

Post by krial057 »

Nice one konte :thumbsup:
(Thank you for your very nice tutorial btw :D I linked it in my old reference)
(one question I coulnd't find out so far: is it possible to capture the keypress event in an editor plugin? oO if yes, I would have some nice ideas, like a 3d snake inside the editor xD)

My one is not yet as customizable as yours, but you can change some variables inside the script (making an interface too later...) You can: change the minimum and maximum height (f.ex. if you want to get very height mountains you can set a minimum height that is nearly on the maximum, or if you want to have small hills, you can set the minimum to ground height and the maximum to 1, 2 or 3 hills stacked)
My algorithm is a bit different. It has some Terrain templates with different height values (for example if you want height 5, the algorithm will take the terraintemplate:1 time mountain and 2 times hill).
Here my very best result so far:(had a lot of luck xD)

Image

The terrain generator is now also in my plugin collection(check the forum threadfor more infos)

If you want you can give my plugin a try too and give feedback(the download is in the collection thread or direct link

regards
Alain
konte
Posts: 236
Joined: 15 Jun 2010, 12:36
Location: Germany

Re: Request, generate terrain

Post by konte »

Well, my script doesn't pay a lot attention to the height, if there's a 2-level (or more) mountain, that's rather coincidence :D
And that's certainly a advantage of your code.

But the disadvantage is that you create only rectangles which doesn't look well on bigger sizes. My script adds always some smaller "add-on" blocks to the main block, if the block is large.
Frank87 wrote:This is absoluty amazin, thanks a lot!!
Thumbs up man.

Quick question tho: Would it be hard implenting so the game also used the various water and hill cliffs (the ones in the block selection) ? =)
Thank you :)
I don't think so, I'll take a look at it tomorrow or Sunday ;)
Dany0
Posts: 97
Joined: 29 Jun 2010, 17:04

Re: Request, generate terrain **done, download inside**

Post by Dany0 »

I think Konte's script is better for map making and AK's better for deco.
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest