Scene makeup: Will my dream scenario be possible?

A secret forum for people who preorder Overgrowth!
User avatar
TheBigCheese
Posts: 856
Joined: Sun Feb 08, 2009 11:01 am
Location: Lost in the Alps.

Re: Scene makeup: Will my dream scenario be possible?

Post by TheBigCheese » Mon Jul 27, 2009 1:41 pm

Bjartr wrote:So I had an interesting idea for using an advanced variation of heightmaps to create caves. Basically you have three terrain 'layers' to work with, one for each color channel in the heightmap. With a special value like 0 or -1 being that that layer does not exist at this pixel. I made the following image as a quick mockup of a really simple tunnel/cave.
TheBigCheese wrote:This is just me thinking up crazy ideas about how it might be possible, but what about storing extra channels in the height map to represent tunnels? One channel could represent the height of bottom of the tunnel at that point, and another could represent the height of the tunnel at that point. Then it would be a matter of converting that into vertices, but it should be similar to the algorithm they use to get the mesh from the grayscale height map.
I had a similar idea a few posts back, only it'd only take 2 channels to make a tunnel. (1 for the floor of the tunnel, 1 for the ceiling level)

It'd look like this:

Normal Heightmap (Done in green layer as opposed to Alpha for clarity)
Image
Red Layer: (The floor of the tunnel)
Image
Blue Layer: (The Ceiling of the tunnel)
Image
Combined:
Image
Note that I don't know how to put the individual channels into grayscale images in GIMP, so they're colored by their channel.

User avatar
Vrav
Posts: 83
Joined: Tue Oct 21, 2008 1:35 am
Location: Seattle, WA
Contact:

Re: Scene makeup: Will my dream scenario be possible?

Post by Vrav » Tue Aug 04, 2009 5:04 am

I don't really understand why you have to cut out of the terrain mesh; it's just as reasonable to simply have the terrain concave there and build up a rock formation/cave/whatever using appropriate rock props. Was done in Lugaru.

User avatar
TheBigCheese
Posts: 856
Joined: Sun Feb 08, 2009 11:01 am
Location: Lost in the Alps.

Re: Scene makeup: Will my dream scenario be possible?

Post by TheBigCheese » Tue Aug 04, 2009 10:13 pm

The reason being that it wouldn't require premade cave objects. You would be confined to using a certain shape of cave, and it wouldn't be possible to cut straight through a mountain (The object could not copy the terrain texture to mesh properly). Objects also are hard to mesh well with the terrain. A cave is much different than a single rock; it has to actually take some of the properties of the terrain.

If done properly, it would be a heck of a lot easier than objects and look much better.

User avatar
Endoperez
Posts: 5668
Joined: Sun Jan 11, 2009 7:41 am
Location: cold and dark and lovely Finland

Re: Scene makeup: Will my dream scenario be possible?

Post by Endoperez » Tue Aug 04, 2009 11:31 pm

TheBigCheese wrote:The reason being that it wouldn't require premade cave objects. You would be confined to using a certain shape of cave, and it wouldn't be possible to cut straight through a mountain (The object could not copy the terrain texture to mesh properly). Objects also are hard to mesh well with the terrain. A cave is much different than a single rock; it has to actually take some of the properties of the terrain.

If done properly, it would be a heck of a lot easier than objects and look much better.
Decals! Decals can be used to fix the "seam".

The triple-height-map would be easier for the user, but harder for the coders. It would take longer to get scriptable map objects or animation editor. Those are more important than easy-to-do caves.

User avatar
TheBigCheese
Posts: 856
Joined: Sun Feb 08, 2009 11:01 am
Location: Lost in the Alps.

Re: Scene makeup: Will my dream scenario be possible?

Post by TheBigCheese » Wed Aug 05, 2009 10:10 pm

Decals are great for rocks, but not an actual cave. In the end it will just look like you piled a bunch of rocks over a trough in the land.

It's always a trade-off between programmer time for artist time. Also, there's already some frameworks that could be used to some degree from converting the heightmap to a mesh.

User avatar
Endoperez
Posts: 5668
Joined: Sun Jan 11, 2009 7:41 am
Location: cold and dark and lovely Finland

Re: Scene makeup: Will my dream scenario be possible?

Post by Endoperez » Thu Aug 06, 2009 2:28 am

TheBigCheese wrote:Decals are great for rocks, but not an actual cave. In the end it will just look like you piled a bunch of rocks over a trough in the land.

It's always a trade-off between programmer time for artist time. Also, there's already some frameworks that could be used to some degree from converting the heightmap to a mesh.
I meant that once you have a mountain mesh that perfectly matches the terrain mesh, decals can be used to cover the "seam" that'd be left in the texture. I don't see why that wouldn't work.

Also, to match the "mountain" with terrain, you'd need a terrain mesh in your favourite 3D program. If you can't import the Overgrowth-mesh, it might be possible to create a mesh in the program (using the same heightmap) and then base the mountain-mesh on that.

User avatar
TheBigCheese
Posts: 856
Joined: Sun Feb 08, 2009 11:01 am
Location: Lost in the Alps.

Re: Scene makeup: Will my dream scenario be possible?

Post by TheBigCheese » Sat Aug 08, 2009 3:04 pm

Endoperez wrote:I meant that once you have a mountain mesh that perfectly matches the terrain mesh, decals can be used to cover the "seam" that'd be left in the texture. I don't see why that wouldn't work.

Also, to match the "mountain" with terrain, you'd need a terrain mesh in your favourite 3D program. If you can't import the Overgrowth-mesh, it might be possible to create a mesh in the program (using the same heightmap) and then base the mountain-mesh on that.
Ah, I was trying to avoid needing a 3D modeling program just to create a tunnel. Plus, once you do create a model, you have to line it up exactly on the terrain, and the cave can't go below where the terrain's heightmap already is.

User avatar
Endoperez
Posts: 5668
Joined: Sun Jan 11, 2009 7:41 am
Location: cold and dark and lovely Finland

Re: Scene makeup: Will my dream scenario be possible?

Post by Endoperez » Sat Aug 08, 2009 3:28 pm

TheBigCheese wrote:Ah, I was trying to avoid needing a 3D modeling program just to create a tunnel. Plus, once you do create a model, you have to line it up exactly on the terrain, and the cave can't go below where the terrain's heightmap already is.
Well, Overgrowth isn't going to haave that great terrain tools any way, so some third-party program is probably necessary. I'm not sure how the caves would be carved into the heightmap, and the smooth transition would probably be quite difficult.

User avatar
TheBigCheese
Posts: 856
Joined: Sun Feb 08, 2009 11:01 am
Location: Lost in the Alps.

Re: Scene makeup: Will my dream scenario be possible?

Post by TheBigCheese » Sat Aug 08, 2009 9:45 pm

Endoperez wrote:Well, Overgrowth isn't going to haave that great terrain tools any way, so some third-party program is probably necessary.
You only need the free Paint.NET to create a terrain, it's just a 2D image. You couldn't use it to create the 3D model.

Which looks easier, drawing some lines into an image with the painting program of your choice, or making the entire 3d model of a cave along with texturing, and then importing it into the game.
I'm not sure how the caves would be carved into the heightmap, and the smooth transition would probably be quite difficult.
What? I explained it above...
You draw into the image channels (effectively 4 greyscale images in one), then the game converts it to the terrain mesh based off the already implemented system that makes an image a 3D mesh of the terrain.

:?

User avatar
Endoperez
Posts: 5668
Joined: Sun Jan 11, 2009 7:41 am
Location: cold and dark and lovely Finland

Re: Scene makeup: Will my dream scenario be possible?

Post by Endoperez » Sun Aug 09, 2009 3:12 am

TheBigCheese wrote:You only need the free Paint.NET to create a terrain, it's just a 2D image. You couldn't use it to create the 3D model.

Which looks easier, drawing some lines into an image with the painting program of your choice, or making the entire 3d model of a cave along with texturing, and then importing it into the game.


What? I explained it above...
You draw into the image channels (effectively 4 greyscale images in one), then the game converts it to the terrain mesh based off the already implemented system that makes an image a 3D mesh of the terrain.

:?
I didn´t claim the third-party program would need to be anything special. I did, however, mention that making a smooth transition could be difficult, and I still claim it is.

You can't actually see the 3D-shape when you're working on the heightmap, unless you use a program that's been made to allow it, and depending on the program that could be either difficult or expensive.

I know some programs actually let you edit a 3D terrain mesh and convert it into a heightmap, or show a heightmap as a 3D-mesh as you work on it. I have never done it myself, but I believe at least Terragen could do it, there might be few more free programs out there, Photoshop CS 4 can do it IIRC, any 3D-modeling program could probably do it if you knew how to convert a plane into a heightmap, and there's undoubtedly more, perhaps as easy-to-use plugins for older versions of Photoshop or various modeling programs, tools made for various game engines etc etc.

I don't count your theoretical answer as anything but a theory. I still don't know of any project that has successfully used it. It looks like it could work, I grant you that, but I'm not sure if it's actually as simple as one would think. Editing the three channels into a single terrain could be quite confusing, for one.

User avatar
TheBigCheese
Posts: 856
Joined: Sun Feb 08, 2009 11:01 am
Location: Lost in the Alps.

Re: Scene makeup: Will my dream scenario be possible?

Post by TheBigCheese » Sun Aug 09, 2009 9:29 am

Endoperez wrote:I didn´t claim the third-party program would need to be anything special. I did, however, mention that making a smooth transition could be difficult, and I still claim it is.
It seems to work well with the normal terrain, which uses the same feature. The mountain slopes can be fairly smooth.
Endoperez wrote: You can't actually see the 3D-shape when you're working on the heightmap, unless you use a program that's been made to allow it, and depending on the program that could be either difficult or expensive.

I know some programs actually let you edit a 3D terrain mesh and convert it into a heightmap, or show a heightmap as a 3D-mesh as you work on it. I have never done it myself, but I believe at least Terragen could do it, there might be few more free programs out there, Photoshop CS 4 can do it IIRC, any 3D-modeling program could probably do it if you knew how to convert a plane into a heightmap, and there's undoubtedly more, perhaps as easy-to-use plugins for older versions of Photoshop or various modeling programs, tools made for various game engines etc etc.
But the key point is it doesn't require these tools. Creating caves would be extremely simple. Draw in some lines, add a gradient if you want the exit to be smooth or use the eraser, and you're done.
Endoperez wrote: It looks like it could work, I grant you that, but I'm not sure if it's actually as simple as one would think. Editing the three channels into a single terrain could be quite confusing, for one.
I'm positive that channels can be read from a 32bit .tga image in C++. It's just a matter of reading the R, B, and G values of each pixel and separating them into 3 separate images in cache.

User avatar
Endoperez
Posts: 5668
Joined: Sun Jan 11, 2009 7:41 am
Location: cold and dark and lovely Finland

Re: Scene makeup: Will my dream scenario be possible?

Post by Endoperez » Mon Aug 10, 2009 2:33 am

TheBigCheese wrote:
Endoperez wrote:I didn´t claim the third-party program would need to be anything special. I did, however, mention that making a smooth transition could be difficult, and I still claim it is.
It seems to work well with the normal terrain, which uses the same feature. The mountain slopes can be fairly smooth.
Yes, you can do it in any 2D program. No, extra tools aren't required - but they may let one get better results. Editing the heightmap to produce a smooth cave entrance might be difficult. It's like doing a color gradient in Ms Paint - it's possible, but it's not as easy as with a program with proper tools.
Any way, even if I'm wrong and it's easy to do with a heightmap (and you could well be right since I haven't worked much with heightmaps), it's easier to do it well if you can see what's happening in the 3D mesh, especially the first few times.

edit: it seems I'm speaking about merits of seeing the heightmap in 3D, since I'm used to working with 3D, and you're speaking about merits of working with a 2D heightmap. You wouldn't happen to be used to working with 2D more than 3D, would you?
I'm positive that channels can be read from a 32bit .tga image in C++. It's just a matter of reading the R, B, and G values of each pixel and separating them into 3 separate images in cache.
As I said, the idea seems like it would work, even if there always are some unforeseen problems. However, unless it's incorporated into Overgrowth, I'm not interested in it ATM.

User avatar
TheBigCheese
Posts: 856
Joined: Sun Feb 08, 2009 11:01 am
Location: Lost in the Alps.

Re: Scene makeup: Will my dream scenario be possible?

Post by TheBigCheese » Mon Aug 10, 2009 3:08 pm

Endoperez wrote:Yes, you can do it in any 2D program. No, extra tools aren't required - but they may let one get better results. Editing the heightmap to produce a smooth cave entrance might be difficult. It's like doing a color gradient in Ms Paint - it's possible, but it's not as easy as with a program with proper tools.

Any way, even if I'm wrong and it's easy to do with a heightmap (and you could well be right since I haven't worked much with heightmaps), it's easier to do it well if you can see what's happening in the 3D mesh, especially the first few times.
The method for creating a smooth slope would be to simply stick down a gradient. Obviously, you don't want to be using MSPaint for this. Paint.NET is free and easy to use.

My point is mainly that it would take more time and effort to create. With the engine being geared towards user-friendliness, whatever's easiest makes sense.

Here's my logic for what would need to be done with 3D:
  • Convert the current heightmap to a 3D mesh somehow using the same off the grid techniques that the engine uses currently.
  • Add a trough in the ground somewhere to be the bottom of the cave(or to be the lower limit of the map)
  • Create an object that lines up perfectly with the trough you just made, and cut a hole through the center for the cave itself.
  • Export the terrain as a new heightmap.
  • Export the mesh object to be compatible with the engine.
  • Import the map, and load the new object.
  • Place the object exactly over the trough. Otherwise you will get a crease where the object intersects with the terrain.
The logic for 2D is:
  • Import the heightmap to Paint.NET.
  • Split the image into channels.
  • Draw in the cave top and bottom.
  • Save the file.
  • Load the map.
Obviously those steps are probably a bit biased, but I still don't see how 3D is any easier. The only reason I can see to use 3D would be that you have direct control over the exact vertices, but for a quick cave or concave shape in the terrain, 2D editing would be much faster.
Endoperez wrote:edit: it seems I'm speaking about merits of seeing the heightmap in 3D, since I'm used to working with 3D, and you're speaking about merits of working with a 2D heightmap. You wouldn't happen to be used to working with 2D more than 3D, would you?
Actually, I'm about equal in both. I'm fairly good using Paint.NET or GIMP for images, and I've used Blender for a while. My area of expertise is more in the coding side of things.

User avatar
Vrav
Posts: 83
Joined: Tue Oct 21, 2008 1:35 am
Location: Seattle, WA
Contact:

Re: Scene makeup: Will my dream scenario be possible?

Post by Vrav » Tue Aug 11, 2009 2:53 am

You should make a beautiful cave mod, Cheese.

User avatar
Endoperez
Posts: 5668
Joined: Sun Jan 11, 2009 7:41 am
Location: cold and dark and lovely Finland

Re: Scene makeup: Will my dream scenario be possible?

Post by Endoperez » Tue Aug 11, 2009 10:37 am

TheBigCheese wrote:Actually, I'm about equal in both. I'm fairly good using Paint.NET or GIMP for images, and I've used Blender for a while. My area of expertise is more in the coding side of things.
We're just saying "I'd do it like this" "I'd do it like that" again and again. If your system was already implemented, it'd allow many more people to do caves. Persoinally, I doubt it will be in Overgrowth , so I've presented alternatives. However, I'm not much of a coder, so I don't even know how easy or hard it would be to incorporate the layered heightmaps into an engine. If you make or find an engine with that, contact me. I might even make a tutorial for slopes or something. :P

Post Reply