Announcement

Collapse
No announcement yet.

Creating a Terrain System like in Viva Pinata

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Creating a Terrain System like in Viva Pinata

    Hello guys!

    So I've been working on a "Viva Pinata"-like game where you can build and manage your own garden.
    I have serveral questions regarding the Terrain:
    Where do I start regarding manipulating the terrain? Like digging holes for Water or planting grass? (Like in Viva Pinata)
    Also how can I determine how much of my terrain is grass, dirt or water?

    Right now I can paint textures on my terrain for testing stuff. I'm using a render target. Can I somehow get the Information from the texture about how much grass there is?

    I hope my questions are clear, thanks in advance!

    #2
    I wouldn't use an actual terrain for it, I'd use a plane.

    Manipulating map can be done several ways, but I'd recommend using a render target setup for it because you'll need the height data for things like "mound" "dirt" "puddle" etc etc; which would be based on the height value ranges like 1 to 0.75 would constitute a mound, 0.5 to 0.75 would be dirt, 0.25 to 0.5 would be shallow puddle, and so on.

    You'd also need an ID map render target as well, to declare what pixels are what. 0=dirt, 1=short grass, 2=long grass, etc. That would get used for the ground material to blend between the different styles of layers.

    The coverage of something would be done by integration. You'd have to count pixel per pixel, if the area has grass on it. So if you have an ID texture that's 4096^2, that's 16,777,216 pixels. If 6,223,141 pixels are grass short type, that would be (6223141/16777216)*100=37.09% short grass.

    You might have to do some c++ work, but I'm not sure though. I'm pretty sure most of this can be done with blueprints.

    Comment


      #3
      Originally posted by IronicParadox View Post
      I wouldn't use an actual terrain for it, I'd use a plane.

      Manipulating map can be done several ways, but I'd recommend using a render target setup for it because you'll need the height data for things like "mound" "dirt" "puddle" etc etc; which would be based on the height value ranges like 1 to 0.75 would constitute a mound, 0.5 to 0.75 would be dirt, 0.25 to 0.5 would be shallow puddle, and so on.

      You'd also need an ID map render target as well, to declare what pixels are what. 0=dirt, 1=short grass, 2=long grass, etc. That would get used for the ground material to blend between the different styles of layers.

      The coverage of something would be done by integration. You'd have to count pixel per pixel, if the area has grass on it. So if you have an ID texture that's 4096^2, that's 16,777,216 pixels. If 6,223,141 pixels are grass short type, that would be (6223141/16777216)*100=37.09% short grass.

      You might have to do some c++ work, but I'm not sure though. I'm pretty sure most of this can be done with blueprints.
      Thanks IronicParadox !

      These are good ideas. I tried to implement the ID map render target, but i can't get it to work properly. How would you do this? I'm not really into Materials

      Thanks!

      Comment


        #4
        I would use physical geometry, personally - otherwise things like actor collision will become a real pain. You'd need to create a system to dynamically modify a static (procedural) mesh on the fly - this is totally possible so long as it's sufficiently low poly. I would also consider breaking the 'landscape' down into smaller tiles so you can retain higher resolution geometry but edit smaller sections at a time.

        It's a bit of work, but that's likely the best approach.

        Comment


          #5
          Originally posted by ambershee View Post
          I would use physical geometry, personally - otherwise things like actor collision will become a real pain. You'd need to create a system to dynamically modify a static (procedural) mesh on the fly - this is totally possible so long as it's sufficiently low poly. I would also consider breaking the 'landscape' down into smaller tiles so you can retain higher resolution geometry but edit smaller sections at a time.

          It's a bit of work, but that's likely the best approach.
          ambershee Thanks!

          I worked a little bit with procedural meshes for a Minecraft-kinda world. So breaking the landscape down into chunks worked pretty well because it only consisted of cubes.
          I can imagine, that this will be hard for a "realisitc" landscape when the player is editing the mesh close to the border of a chunk.

          Comment


            #6
            Ensuring you don't get seams when editing borders is indeed a trickier exercise, but to be honest I don't think it will be that difficult, so long as you always move verts through the Z-axis by fixed increments.

            Comment

            Working...
            X