Jump to content

Random terrain...?


Game Producer
 Share

Recommended Posts

forum search didn't find me info on this matter, so I'm asking here.

 

Will LE3D give some handy tools/options for generating random terrain?

Is there such tool available for LE2 already.

 

And if not... any insight on this matter on how this could be achieved?

Intel Dual Core 3GHz / GeForce GTS 450 - 1024 MB / Driver ver 267.59 / 8 GB RAM / Win 7 - 64 bit / LE2.50 / BMAX 1.48

game producer blog - Dead Wake Zombie Game powered by Leadwerks Engine

Twitter - Unfollow me

Link to comment
Share on other sites

I wasn't thinking about this too much yet, but I don't know. We have some pretty challenging requests for the terrain system, and it will be a big chunk of work just to figure out how it should work.

 

People want really really big terrains, so this might fit into that design.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

..its perfectly doable in LE2..you could create terrain on the fly, out of quads, based on perlin noise as Gardowyr suggested..

Agreed. I managed to get simple procedural terrain meshes going in LE2 relatively quickly previously. Theoretically you could implement some sort of cell framework like Oblivion did and have endless procedural terrain.

Programmer, Modeller

Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64

Visual Studio 2008 | Photoshop CS3 | Maya 2009

Website: http://srichnet.info

Link to comment
Share on other sites

ok, cool.

 

I don't need endless terrain, as I'm into creating an isle. I wonder how easy it would be to paint/texture the terrain properly - taken into account that sand should be near sea level, grass somewhere etc.

 

Any code samples or links to resources about these quads/perlin noise? I'm very unfamiliar with these topics

Intel Dual Core 3GHz / GeForce GTS 450 - 1024 MB / Driver ver 267.59 / 8 GB RAM / Win 7 - 64 bit / LE2.50 / BMAX 1.48

game producer blog - Dead Wake Zombie Game powered by Leadwerks Engine

Twitter - Unfollow me

Link to comment
Share on other sites

I'm currently experimenting with such a "tool" I've made for LE2, which allows me to generate/modify LE terrain(not custom mesh) in code or editor, it's pretty easy to make. If you want to give this a try yourself, there's a lot of good material on this just google perlin noise to get started, or PM me if you have specific questions..

I could make a mini tutorial on this or I was thinking about releasing the "tool" once I update with some improvements and more features.. (see here )

 

I don't need endless terrain, as I'm into creating an isle. I wonder how easy it would be to paint/texture the terrain properly - taken into account that sand should be near sea level, grass somewhere etc.

It might be better to use tools like L3DT or EarthSculptor to generete a much more realistic terrain, and import that into LE (or modelling apps) .. you can also make good terrain meshes in blender/mudbox/3dcoat/etc (with caves, over-hangings, cliffs, etc)..

Link to comment
Share on other sites

..quad is basically single surface, consists of 2 triangles..its very handy and you can use it for just about anything, from building up terrains, up to particle systems with physics response, decals, and so on...anyway, here is example how to create a quad..I hope this helps..

 


     MY_quad_parent = CreatePivot()
     MY_Quad = CreateMesh(MY_quad_parent)
     QUAD_Surface = CreateSurface(MY_Quad)

     AddVertex QUAD_Surface, Vec3(-1, fRatio * 1, 0)
     AddVertex QUAD_Surface, Vec3(1, fRatio * 1, 0)
     AddVertex QUAD_Surface, Vec3(-1, fRatio * -1, 0)
     AddVertex QUAD_Surface, Vec3(1, fRatio * -1, 0)

     AddTriangle QUAD_Surface, 0, 1, 2
     AddTriangle QUAD_Surface, 1, 3, 2

     SetVertexNormal QUAD_Surface, 0, Vec3(0, 0, -1)
     SetVertexNormal QUAD_Surface, 1, Vec3(0, 0, -1)
     SetVertexNormal QUAD_Surface, 2, Vec3(0, 0, -1)
     SetVertexNormal QUAD_Surface, 3, Vec3(0, 0, -1)

     SetVertexTexCoords QUAD_Surface, 0, Vec2(0, 0)
     SetVertexTexCoords QUAD_Surface, 1, Vec2(1, 0)
     SetVertexTexCoords QUAD_Surface, 2, Vec2(0, 1)
     SetVertexTexCoords QUAD_Surface, 3, Vec2(1, 1)

     UpdateMesh MY_Quad

 

..where fRatio is..

fRatio = (QUAD_VSpace / QUAD_USpace) ..

 

..and QUAD_VSpace and QUAD_USpace is ratio between texture segment size and texture size you wanna apply .. otherwise, you can keep it just 1..in case of terrain creation, you could skip creation of pivot..

 

I hope this helps..

 

Link to comment
Share on other sites

Thanks guys.

 

I'm currently experimenting with such a "tool" I've made for LE2, which allows me to generate/modify LE terrain(not custom mesh) in code or editor, it's pretty easy to make. If you want to give this a try yourself, there's a lot of good material on this just google perlin noise to get started, or PM me if you have specific questions..

I could make a mini tutorial on this or I was thinking about releasing the "tool" once I update with some improvements and more features.. (see here )

This looks most interesting. Any chance for sneak peak on those 40 lines of code ;)

 

It might be better to use tools like L3DT or EarthSculptor to generete a much more realistic terrain, and import that into LE (or modelling apps) .. you can also make good terrain meshes in blender/mudbox/3dcoat/etc (with caves, over-hangings, cliffs, etc)..

This won't do, as I'd really prefer that the terrain is created in the beginning of the game... and thus would make it possible to have new map every time you start the game.

 

..quad is basically single surface, consists of 2 triangles..its very handy and you can use it for just about anything, from building up terrains, up to particle systems with physics response, decals, and so on...anyway, here is example how to create a quad..I hope this helps..

Ahh, yeh, of course. Okay, I know quads :)

 

Although, won't those get darn slow... just think of it, you'd have quite bunch of quads to render?

 

P.S. Luv your goggles.

 

Before writing your own noise generator, you could use something like LibNoise.

It can do pretty cool stuff, like planets.

I haven't really used it apart from the planet example, but i think it's worth a look.

Thanks.... although I want an island rather than planet surface this might have some use anyway.

Intel Dual Core 3GHz / GeForce GTS 450 - 1024 MB / Driver ver 267.59 / 8 GB RAM / Win 7 - 64 bit / LE2.50 / BMAX 1.48

game producer blog - Dead Wake Zombie Game powered by Leadwerks Engine

Twitter - Unfollow me

Link to comment
Share on other sites

..of course you will have bunch of quads for rendering, but its not different than a rendering triangles in any other mesh or terrain and far as i can tell, it shouldnt be slow because u will merge them in to one monolith surface, or very few, depending on your design....for instance, well known bug in decals is easy overtaken by use of quads and you can have it much as you want, no slowdown..eventually you could determine quads budget for object you wanna create and apply output of perlin noise generator on to such quad space..something like that I have got in B3D, ages ago, and it was unlimited terrain you never reach its end..so i know its perfectly doable..again, for such structure, avoid building pivots for each quad, but only for final terrain..

 

Link to comment
Share on other sites

..of course you will have bunch of quads for rendering, but its not different than a rendering triangles in any other mesh or terrain and far as i can tell, it shouldnt be slow because u will merge them in to one monolith surface, or very few, depending on your design....for instance, well known bug in decals is easy overtaken by use of quads and you can have it much as you want, no slowdown..eventually you could determine quads budget for object you wanna create and apply output of perlin noise generator on to such quad space..something like that I have got in B3D, ages ago, and it was unlimited terrain you never reach its end..so i know its perfectly doable..again, for such structure, avoid building pivots for each quad, but only for final terrain..

 

Ah, of course. Do'h.

 

Okay, so to my understanding your code does this:

- adds 4 vertices

- adds 2 triangles ("attached/based on vertices")

- then does some magic placing vertices, which together help form a quad

- all these are inside 1 mesh

 

And basically, I could "just" add more vertices, triangles and move them around... to get meh quad done.

 

And then after I have my mesh, I can paint it.

 

And... hmm, what about physics. Is there tool for creating mesh physics via leadwerks, so that I get collisions? (in case the mesh is self-built)

Of course... there's still stuff like adding layers so that I can have my "sand" portion and "grass" portion using different materials, but that's something to worry later.

Intel Dual Core 3GHz / GeForce GTS 450 - 1024 MB / Driver ver 267.59 / 8 GB RAM / Win 7 - 64 bit / LE2.50 / BMAX 1.48

game producer blog - Dead Wake Zombie Game powered by Leadwerks Engine

Twitter - Unfollow me

Link to comment
Share on other sites

yes, your quads vertices position you will adjust based on generator output, and yipp..you have got your terrain..as for physics in LE, i cant say much for newton, but for Bullet i use, is possible to create physics triangle out of coordinates from any triangle you provide (in your case from quad)..also i know that with physx you can do similar things with trimeshes, but i cant say for Newton really .. Im not sure how it works binded to LE..

 

Link to comment
Share on other sites

Careful with the painting part of it - If you plan to merge entire regions of terrain into a single mesh then you'll only have a set number of textures to play with.

Programmer, Modeller

Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64

Visual Studio 2008 | Photoshop CS3 | Maya 2009

Website: http://srichnet.info

Link to comment
Share on other sites

Using newton physics with LE:

TBody CreateBodyTree(TSurface surf, TEntity parent=NULL)

Creates a new collision tree body (static only) from the specified surface's geometry data. This is an exact representation of the triangles in the surface.

 

Using more textures on single surface: just use texture atlases, and sacrifice one channel of vertex color data as an offset into the atlas

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...