Recommended Posts

On 10/8/2019 at 6:27 AM, SylvainLS said:

Height variation option has been added.  A few improvements too (corrections, texts, input, error reporting…).

I’m not happy with the results yet: a flat top may look unnatural (though Lego-like) but a “varied” top looks roof-like, especially without plants (as the plates are all parallel).  I tried to add a bit of simple “noise” but it doesn’t work well often enough. :hmpf_bad:  Of course, one solution would be to make a complete “rolling hills” generator for the top but making a complete world was not the goal of the script :grin:

One more suggestion should you want to keep on down this path. Foe the multiple colors on the wall, can you make it an option ti be color variation through out the wall vs layers of color?

Share this post


Link to post
Share on other sites

Random colours?  Done.

But you won’t like it: the colours are computer-random, not human-(non)random.  The bigger the wall, the more uniformly spread they are (use black and white and you get “newspaper grey”).

Share this post


Link to post
Share on other sites

Actually I like the result, eg. with a low density of grey over white (71,15:10). Did you improve top covering with randonm height option? it seems to look even better now ;)

Share this post


Link to post
Share on other sites
5 hours ago, Philo said:

Actually I like the result, eg. with a low density of grey over white (71,15:10). Did you improve top covering with randonm height option? it seems to look even better now ;)

It’s just random luck, or should I say luck with random() :wink:

Share this post


Link to post
Share on other sites
14 hours ago, SylvainLS said:

Random colours?  Done.

But you won’t like it: the colours are computer-random, not human-(non)random.  The bigger the wall, the more uniformly spread they are (use black and white and you get “newspaper grey”).

This is exactly perfect!

9 hours ago, Philo said:

Actually I like the result, eg. with a low density of grey over white (71,15:10). Did you improve top covering with randonm height option? it seems to look even better now ;)

This tip helped a lot. I did a very high number of the main color and then lower fo the accent colors. It can be tweaked and improved but I really like the result! 

LDraw%20Cliff%20Test.png

Share this post


Link to post
Share on other sites

Hi,

Outstanding work, This is how the beta version of Lego Worlds generated terrain, using 'procedural generation'.

The only thing that the game had missing was the ability to import advanced models (an example of which could be SNOT.)

I wonder how much of a performance hit there would be if your generated maps had a few simple hand made SNOT models on top, maybe a small car or house.

Maybe LEGO will see this topic one day and make a real lego create and build game.

Edited by SNIPE

Share this post


Link to post
Share on other sites

Using models instead of bricks doesn’t change the performance.
Instead of using “3001.dat,” you use “house.dat,” and you arrange the building process to allow for your submodels.  Either you need a bit more complex rules to know if you can put a house (is the terrain big and flat enough?) or you arrange the terrain before putting it (like we do in real life).  Those changes aren’t time expensive.

But you need to build the models first :wink: and the more complex the models, the less generic the generated landscape.

I had another script which generated a lunar base from a few models (module skeletons, side panels, roofs, connecting corridors, and a few accessories).  The rules are pretty simple: a few types of connections and collision avoidance and just randomly connect models to each available connection.  And it gave something like that (latest version had a few spaceships, astronauts and robots sprinkled around):

autobase.png

(Old LDView render.)

The difficult part is making the modules and their connection.  And it’s fun but not very realistic.

Share this post


Link to post
Share on other sites
3 hours ago, SylvainLS said:

Using models instead of bricks doesn’t change the performance.
Instead of using “3001.dat,” you use “house.dat,” and you arrange the building process to allow for your submodels.  Either you need a bit more complex rules to know if you can put a house (is the terrain big and flat enough?) or you arrange the terrain before putting it (like we do in real life).  Those changes aren’t time expensive.

But you need to build the models first :wink: and the more complex the models, the less generic the generated landscape.

I had another script which generated a lunar base from a few models (module skeletons, side panels, roofs, connecting corridors, and a few accessories).  The rules are pretty simple: a few types of connections and collision avoidance and just randomly connect models to each available connection.  And it gave something like that (latest version had a few spaceships, astronauts and robots sprinkled around):

autobase.png

(Old LDView render.)

The difficult part is making the modules and their connection.  And it’s fun but not very realistic.

This is amazing. Could you give a course on this stuff? I would love to get more procedural generated roads and cities and other terrain types. 

Share this post


Link to post
Share on other sites

That's nice @SylvainLS - my early attempts at procedural modelling (these images are from a couple of years ago now) rotated and placed "sub-models" from a "library" of 11 sub-models on a 48x48 base plate.  Although the code selects and places the sub-models on the base, this isn't really procedural as I built the sub-models for the library, but I'm currently working on some code to create more appealing sub-models (as opposed to the completely random sub-models that I posted here initially) 

48909652051_11b16b2bb4_z.jpg  

48909120233_b53e0b47ec_z.jpg

48909861842_9754461ce2_z.jpg

48909856527_ce8f7d0a61_z.jpg

 

 

Share this post


Link to post
Share on other sites
41 minutes ago, supertruper1988 said:

Could you give a course on this stuff?

Gee!  You know you’re practicaly asking me to write a book? :grin:

 

@pennyforge Nice microcity!  Just randomizing the buildings’ heights would do wonders.  Parametrise the models (say, same building but 3, 4, or 5 storeys; or 2-, 3-, or 4-stud-wide).  It’d add diversity but keep the style.  Or add random details (chimney, tank, giant ad/screen… on the roof).  After all, that’s how architects do it! :wink:

Share this post


Link to post
Share on other sites

Hi @SylvainLS yes - height is key - over the last couple of years I've disappeared down a rabbit hole trying to track height (and density) of the model build!  However I think I'm starting to make progress...

48910193273_8186688f4d_z.jpg

Share this post


Link to post
Share on other sites
4 hours ago, SylvainLS said:

Gee!  You know you’re practicaly asking me to write a book? :grin:

I am well aware haha! I would love to learn or at lease get some pointers. I have a basic understanding of coding but no real specific knowledge and would like to learn more but I feel lost in the vast amount of material available and how that would apply to this. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.