Archived

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

terrain / structure generator???

This topic is 5096 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

say I have a data file that looks something like this: 11110001111 10011111001 10010001001 10011111001 10001001111 11111000000 *for example & I want all the 1''s to represent raised terrain or some sort of unit blocking structure (like a maze wall) & all the 0''s to represent passable terrain or a walkable path. Are there any cool tuts or ideas that I could use to generate the 3d image/model of such a thing? This is for a 3d game where the entities can only travel on tight paths, not with complete freedom in 3d space. I don''t want to hard-code my levels & this perhaps would be the foundation of a level editor in the future. I already have all my code for generating the graph from such a data file (for the entity path-finding routines & the like), I just need to generate the model/image of such paths & blockages so the player can actually see them. thanks

Share this post


Link to post
Share on other sites
Check out my maze program here. It's really basic, but it might get you going. Just so you know, it is a really early opengl project of mine that I never really finished. I wanted to be able to edit the maze in the program, but that doesn't work. I'm sure I do some dumb opengl stuff, but I think the actual maze technique is decent. Hope it helps.

[edited by - Mr Grinch on January 4, 2004 3:40:59 AM]

Share this post


Link to post
Share on other sites
Thanks for your help grinch, it looks like you got some pretty cool classes built up in your maze program. I was thinking of something a lil more exotic looking than cubes for my map/maze walls, with curves & perhaps textures mapped to it. Or even rough looking terrain.

Share this post


Link to post
Share on other sites
Depending on how varied you want your terrain to look, you could change the straight 90 degree wall to a slope. I don''t think that would be too hard. Getting the joints to work right might take a little work, but I think you could do it.

I was thinking about this a little and you may just want to do a heightmap image. I''m not sure how much you know about heightmaps, I won''t waste your time with a hurried (ie poor) explanation, look up one of a billion heightmap tutorials if you even need it. Anyway, your terrain could look much more natural than the blocky version. That may not matter if you are going for a warcraft 3 kind of a look, though.

Another benefit is that since the heightmap only needs 1 of the colors of an RGB image, you could use the other color channels to store other data. For instance, you could use the red channel for the heightmap and the blue channel for objects. You could have all pixels with a blue value of 0 be a empty space, 1 might represent a big tree, 2 could be a house, 3 could be a big rock, etc.

It''s also a little easier to work with a 1024x1024 image than a text file with 1024 rows and columns. Anyway, that''s just something else to think about.

Share this post


Link to post
Share on other sites
thanks Grinch,

I finally broke down & just "modeled" (with code) my basic building block structures for wall generation, its kinda like cubes, but they have rounded edges. I will post the crap when I get my level editor up & running. You are right though... getting the edges to match up is kinda tedious... & the rounded edges just make things painful. I''m using vertex arrays though.

I will definitely look into height maps... I would love to include a terrain option instead of just normal looking walls, I think they have four really good tuts on this HERE if anybody is interested.

Luke

Share this post


Link to post
Share on other sites