Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

NeXius

Making True Terrain

This topic is 5756 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I''m in the designing stages of a game right now... and I can''t get something right I want to include large outdoor scenes, with large cliffs, holes, maybe caves... which is a problem because heightmaps can no longer help me I''m not sure I want to learn something like voxels as this would complicate things and I''d rather focus on gameplay So, I came up with this: I design and code a simple level-editor that starts with an initial heightmap. I can then modify the position of each vertex or add new faces to create the cliffs, caves, whatever. And store all the vertex locations with texture coordinates and normals in one big honking file. Will this work?

Share this post


Link to post
Share on other sites
Advertisement
Here is just something I''m coming up with,.

perhaps use the height maps.
and basicly define a level, and place it on the map
and the level will make a cutout from the height map
eh?
just define a box or write code to find a box that is tight to the edges of your level... and cut all vertices that fall within that box and interpolate all triange vertices that are in and outside the box.
kinda like octree rendering if that helps
i gotta go
Lemme know what you come up with
Andy
Hope this helps.
andy@leadant.com

Share this post


Link to post
Share on other sites
The terrain engine I am writing right now (or am going to write as soon as I finish other sections of my engine), allows caves by linking heightfields together in a tree structure. Another cool way that seems viable is a voxel landscape. Check the IOTD on flipcode from a day or two ago.

Gamedev for learning.
libGDN for putting it all together.

Share this post


Link to post
Share on other sites
I''m sorry I don''t understand either of those!

And as I said I don''t want to make it a voxel landscape... I want to keep things simple and actually complete this thing =)

Could you please elaborate on your way of achieving this?
Thanks for your replies!

Share this post


Link to post
Share on other sites
www.vterrain.org is good for everything landscape like, you might want to try octrees instead of quad trees if you want to add layers like caves and so on, do a google search and check the gamedev artciles (gamasutra have soem I think).

Ballistic Programs

Share this post


Link to post
Share on other sites
Ok here is what i meant.

-You have a 8 bit heightmap. maybe 1024x1024(+1) or whatever.
-You also have a level. For our purposes say it is a box.
+A box in a file that you load.
-Somewhere in code or in that file or whatever your heart desires you load the position that this level ( the box ) and it''s position relative to your heightmap.

now you have a box and your heightmap
oh.. when i say level i mean box and when i say heightmap i mean terrain and vice versa

if you were to render this right now... perhaps walk within your box ( if it has a door or whatever ), chances are your terrain would be coming through the walls. ( obviosly based on where the level is. But since you wanted CUT INTO THE terrain.. you would probably have some terrain lapping into your box.

From here you would just want to clip all the vertices that fall within your box, so your terrain doesn''t come inside.

This is where i touched on octrees.
If you have a triangle whos 3 vertices which define it are within your level... you can simply remove that triangle and all of its vertices. However if you have a triangle whos has perhaps one or two vertices within the level.. and one out.. you will want to reshape the triangle and not simply remove it. Otherwize you would get a bunch of jagged edges around the mouth of the terrain and your level. So you will want to interpolate these new points. I said octrees because if you lookup, data on that, they explain that you need to trim triangles. So that might be a good place to begin looking for an algo on how to reshape your triangles.
I hope this was clearer. I may have been a bit wordy and not well thought out, but the idea should be there.
Email me if you have any more questions.
andy@leadant.com
Andy


<< XP SUCKS >>

Share this post


Link to post
Share on other sites
For overhangs why not use heightmaps and create overhangs as separate 3d objects, which you place by hand so that they appear to be attached to the terrain? Hmmmm, you might not get smooth texturing though. The overhang object may actually sit partway underneath the terrain, but I''m sure you may still see the join. So this probably isn''t a good idea! It seemed like one when I started typing this!

Cheers!

Share this post


Link to post
Share on other sites
heh... I considered models too, but I don''t think I could pull it off without having it look like crap

skillfreak, I really like your idea (now that I understand it =)

Problem is connecting the level to the terrain smoothly, right?

I''m taking www.gameinstitute.com''s bsp/level-editor course right now so I''ll probably learn all about carving objects into levels, but this is what I''m thinking of right now:

Actually first I was thinking of just lining up the box with a point on the terrain where dividing up triangles wouldn''t be necessary (it would be set up in a triangle-strip pattern with nicely organized columns and rows) but then I wouldn''t be able to apply any LOD on the terrain... if you know what I mean

So what if I set up every ''level'' to have four basic polygons--one along each edge--and then subdivide those polygons to attach to each vertex produced when a triangle intersects the box... Four basic polgons being something like this:
http://www.alientrap.com/neproxource/thing.jpg

Does that make any sense at all?

Share this post


Link to post
Share on other sites
I don''t know about the cliffs and such, but for caves/holes you would probably be better off using portals. If this terrain is for in game graphics, it would speed up the frame rate a bit if you use portals.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!