Jump to content

Village generator


VeTaL
 Share

Recommended Posts

After looking at CityEngine, i got an idea, that it would be nice to make something similar for Leadwerks :)

 

So, i decided to start with simple Village generator: i extend standard rode, so no it have some additional parameters:

1) By default, generator is disabled, its enabling by checking "Enabled" flag

2) "Seed" is just a seed for random generation.

If you need exact position of each model after each restart, you may use the same seed, and buildings would be guaranteed generates on the place you see.

If you need to change position after ever restart (some random-generations), you may just generate new seed number, and models would be generated in new positions every time.

3) "Density" is density: the higher variable - the more tries to position new buildings.

4) "Distance" is distance to the road, this is simple

5) "Models" is just a list of models, that you want to generate: it can be houses, trees, whatever you want.

 

also, tested with racing demo - looking very nice.

 

TODO list:

- add "distance" and "density" to each model or to list of models. In this way user'll be able to generate something like "i want field1, field2 and field3 be randomly generated near the road, i want house1 and house2 to be randomly generated after the fields and i want tree1, tree2, tree3 and tree4 to be generated right after houses"... this would allow user to create villages very fast.

Working on LeaFAQ :)

Link to comment
Share on other sites

//I am going to assume, you don't have collisions on those models?

 

Of course, they are :)

 

Thanks, guys, for replies :)

 

I think he means "is there's something built in so that the models won't intersect each other".

AMD Phenom 9850 (X4 2.5GHz) | 1066MHz CL5 GEIL Black Dragon (800MHz) | Powercolor ATI 4870 1GB | DFI 790FXB-M2RSH | 24" 1920x1200 | Windows Vista 64-bit Ultimate

Link to comment
Share on other sites

After model generation, its checked by bboxes if this place is free, so models would never stuck in each other.

Moreover, there is also height check: it takes 4 down points of bbox and checks their height, so models would never fly in space.

 

And finally, there is collision with all boxes, so player cant go through buildings.

Working on LeaFAQ :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...