Announcement

Collapse
No announcement yet.

Calculating Exact Map Size

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

    Calculating Exact Map Size

    I have an enormous map that I've just imported in as a heightmap. How would I go about calculating the exact size of the map in miles2 or km2?

    If it helps, these are the settings I used when importing the height map (the 4033x4033 line):

    Last edited by JohnAbruzzi; 01-26-2015, 02:42 AM.

    #2
    AFAIK, with a scale of 100x100, a landscape that is 4033x4033 = 403,300 km2.

    At least, this seems to be true with my 1-Meter block object that I imported. It appears to match up with 1/10th of a non-LOD poly.
    Last edited by Kjasi; 01-26-2015, 08:16 AM.

    Comment


      #3
      I think it works differently. It's a bit tricky. First of all you need to understand how to calculate landscape dimensions (https://docs.unrealengine.com/latest...ide/index.html is a good resource). UE4 uses 1 unit = 1cm scale proportion. Landscape is scaled to 100x100x100 (as Kjasi mentioned).

      To calculate exact size you need to do a little math: (Overall Resolution - 1) * 100 (which is X scale) by (Overall Resolution - 1) * 100 (which is Y scale)

      Let's take a very small landscape as an example:
      Section size: 7x7
      Sections per component: 1x1
      Number of Components: 2x2
      so the Overall Resolution: 15x15

      (15-1)*100 = 1400 cm
      1400 cm * 1400 cm = 1960000 cm^2 = 196m^2

      In your case the surface area is: 16257024 m^2 = ~16,26 km^2

      Correct me if I'm wrong
      UE4 blog: www.michalorzelek.com/blog/ - Tutorials, free content and more!

      Comment


        #4
        Originally posted by m.orzelek View Post
        I think it works differently. It's a bit tricky. First of all you need to understand how to calculate landscape dimensions (https://docs.unrealengine.com/latest...ide/index.html is a good resource). UE4 uses 1 unit = 1cm scale proportion. Landscape is scaled to 100x100x100 (as Kjasi mentioned).

        To calculate exact size you need to do a little math: (Overall Resolution - 1) * 100 (which is X scale) by (Overall Resolution - 1) * 100 (which is Y scale)

        Let's take a very small landscape as an example:
        Section size: 7x7
        Sections per component: 1x1
        Number of Components: 2x2
        so the Overall Resolution: 15x15

        (15-1)*100 = 1400 cm
        1400 cm * 1400 cm = 1960000 cm^2 = 196m^2

        In your case the surface area is: 16257024 m^2 = ~16,26 km^2

        Correct me if I'm wrong
        Can anyone back this math up?

        Comment


          #5
          First of all, yes, it should be in cm, (I forgot about that...), second, while his method works, (see my final result below) it feels a bit too complicated for my tastes. Plus I fail to see the correlation between his labels and the ones listed on the Landscape Sizes table.

          My formula is to calculate the surface area, based on the edges: Overall Size (Verts) * Scale = Xcm = Ykm * Ykm = Zkm2

          Using my method:
          4033 * 100 = 403300cm * 0.01 = 4033m * 0.001 = 4.033km
          4.033 * 4.033 = 16.265089km2

          As you can see, my formula is simpler, but gets similar results as his formula. So while I can't quite duplicate his equation for 4033, I can get similar results with another formula.
          Last edited by Kjasi; 01-26-2015, 07:33 PM.

          Comment


            #6
            Landscape is 1 vertex per meter. This is 100 UE4 units per landscape vertex. So a landscape size of 4033 vertices is 4033 meters, or 4.033 km. Pretty basic.

            Comment


              #7
              ...But, um, holy ****, 1024 components?! Please don't do that. If my math is correct, you can use 4065 vertices: 127 quads/section, 4 sections per component (2x2), and 256 components (16x16). With a quarter of the components, this will drastically reduce your draw calls on CPU and run a lot smoother. You might have to render some more polygons on the GPU because it can't handle LODs as efficiently and doesn't cull out as well, but compared to the other option of wreaking havoc on the CPU with 4x the draw calls, it's totally worth it. Too many components will totally screw with your system: it's very unstable. Alternatively, I would reduce the section size to 63 quads to get the benefit of better LODs with smaller pieces that can also cull more easily. Ideally, 63 quads/section, 4 sections per component, and 64 components (8x8) for a total of 1009 vertices, or 1.009 km. This would be 4 times smaller (in width, it's actually 16x less area), but 960 less components than the size you want, and it would totally run on mid-grade hardware to the utmost of efficiency.
              Last edited by mariomguy; 01-26-2015, 11:12 PM.

              Comment


                #8
                Originally posted by mariomguy View Post
                ...But, um, holy ****, 1024 components?! Please don't do that. If my math is correct, you can use 4065 vertices: 127 quads/section, 4 sections per component (2x2), and 256 components (16x16). With a quarter of the components, this will drastically reduce your draw calls on CPU and run a lot smoother. You might have to render some more polygons on the GPU because it can't handle LODs as efficiently and doesn't cull out as well, but compared to the other option of wreaking havoc on the CPU with 4x the draw calls, it's totally worth it. Too many components will totally screw with your system: it's very unstable. Alternatively, I would reduce the section size to 63 quads to get the benefit of better LODs with smaller pieces that can also cull more easily. Ideally, 63 quads/section, 4 sections per component, and 64 components (8x8) for a total of 1009 vertices, or 1.009 km. This would be 4 times smaller (in width, it's actually 16x less area), but 960 less components than the size you want, and it would totally run on mid-grade hardware to the utmost of efficiency.
                Thing is, I need the map to be 4km x 4km. What can I do to make the performance better while keeping the same size? Are there any other techniques that you know of that would help run it smoother?

                Comment


                  #9
                  Originally posted by Kjasi View Post
                  First of all, yes, it should be in cm, (I forgot about that...), second, while his method works, (see my final result below) it feels a bit too complicated for my tastes. Plus I fail to see the correlation between his labels and the ones listed on the Landscape Sizes table.

                  My formula is to calculate the surface area, based on the edges: Overall Size (Verts) * Scale = Xcm = Ykm * Ykm = Zkm2

                  Using my method:
                  4033 * 100 = 403300cm * 0.01 = 4033m * 0.001 = 4.033km
                  4.033 * 4.033 = 16.265089km2

                  As you can see, my formula is simpler, but gets similar results as his formula. So while I can't quite duplicate his equation for 4033, I can get similar results with another formula.
                  I think, your method is not working correctly. I did a practical test with small landscape (overall size: 57x57) so I could measure the edge in editor in top view.

                  Using your math:
                  57 * 100 = 5700cm * 0.01 = 57m
                  57 * 57 = 3249m2

                  which is not exactly true:
                  http://imgur.com/8TkXEhS

                  It should be 5600cm per edge, so the surface areas is 3136m2.
                  UE4 blog: www.michalorzelek.com/blog/ - Tutorials, free content and more!

                  Comment


                    #10
                    No one that can suggest what to do for me?
                    My landscape is now 1920 sections!
                    The heightmap has the resolution of 24.000x20.000. I want to keep the reolution and size, but it is set on 255*255 qauds, sections size2x2, so I can only lower resolution and/or divide into more sections.
                    I went in the source and exposed a 510*510 quad size, but the editor can't handle it so I couldn't use it. I tried using the 510*510 to clip to lower section number but for the editor to try to lower 1920 sections to 480, would take it reading in all the sections AND making calculations based on 510*510 quad size on them on , and that is where my computer can't take it anymore..


                    When I imported the heightmap it automatically set it to the largest amounts of quads and section size, what can I do to LOWER AMOUNT OF SECTIONS??

                    Please help, it has halted all developing for me.
                    Last edited by ImperiumPandemonium; 12-11-2015, 12:27 PM.
                    WIP Thread _ Modular Packs
                    ___________________________________
                    http://www.permafrostdevelopment.com/

                    http://www.indiedb.com/games/the-absence
                    https://twitter.com/PermafrostDevs

                    Comment


                      #11
                      this is totally confusing
                      Game Designer @ Masked Pharaohs ..
                      I'm Providing Arabic Support For Any One ..

                      Comment


                        #12
                        Sometimes, even when the scaling is right, it looks/feels different against realworldfeeling/size.
                        Originally posted by Andrew Bedier View Post
                        this is totally confusing
                        +1
                        My small game on IndieDB ****** Beams on Twitter ****** Beams on Steam ****** VideoStuff ****** PictureStuff
                        UE brings Math back into my life or i am not sure.

                        Comment


                          #13
                          Okay guys so this is a lot more simple than the math stated above. You can calculate EXACT map size based on resolution size.

                          When you import a map or even make a map using the landscape tools it starts everything at X 100 Y 100 Z 100 and then offsets the landscape by half the size of the landscape(usually, sometimes the whole landscape) If you're not sure if its the whole landscape add any object to the scene and position it at X 0 Y 0 Z 0 and if its right on the edge of the landscape, then the entire landscape is offset which then its easy and you just look at the X and Y position to figure out how large the landscape is.

                          Other than that, here is a simple breakdown that calculates the map size

                          Landscape Scaling = Resolution * 100 @ 100%. (Example: 8129 * 100 = 812900 @ 100%)

                          812900 uu = 812900 cm = 8129 Meters = 8.129 Kilometers @ 100%
                          For 200% its just 812900 * 2 and so on.

                          X= 100% Y = 100% @ 8129 Resolution - Landscape Size is X = 812900 Y = 812900

                          Z = 512 @ 100%

                          Z = 2048, Then Z must be 400%

                          Z = 512 * 4 = 2048

                          Z * 4 = 400%

                          So a Landscape with resolution at 8129 and a height of 2048 will be
                          X = 100 Y = 100 Z = 400

                          Final result in uu is
                          X = 812900 Y = 812900 Z = 204800

                          Everything is in Centimeters, so to have everything converted into Kilomters or Meters you need to do a little math.

                          1 Meter is 100 Centimeters
                          1 Kilomters is 1000 Meters

                          So 812900 Centimeters(uu) = 8129 Meters

                          8129 Meters = 8.129 Kilometers.

                          Simple.

                          Comment


                            #14
                            Originally posted by EscapeTheFate0921 View Post
                            Okay guys so this is a lot more simple than the math stated above. You can calculate EXACT map size based on resolution size.

                            When you import a map or even make a map using the landscape tools it starts everything at X 100 Y 100 Z 100 and then offsets the landscape by half the size of the landscape(usually, sometimes the whole landscape) If you're not sure if its the whole landscape add any object to the scene and position it at X 0 Y 0 Z 0 and if its right on the edge of the landscape, then the entire landscape is offset which then its easy and you just look at the X and Y position to figure out how large the landscape is.

                            Other than that, here is a simple breakdown that calculates the map size

                            Landscape Scaling = Resolution * 100 @ 100%. (Example: 8129 * 100 = 812900 @ 100%)

                            812900 uu = 812900 cm = 8129 Meters = 8.129 Kilometers @ 100%
                            For 200% its just 812900 * 2 and so on.

                            X= 100% Y = 100% @ 8129 Resolution - Landscape Size is X = 812900 Y = 812900

                            Z = 512 @ 100%

                            Z = 2048, Then Z must be 400%

                            Z = 512 * 4 = 2048

                            Z * 4 = 400%

                            So a Landscape with resolution at 8129 and a height of 2048 will be
                            X = 100 Y = 100 Z = 400

                            Final result in uu is
                            X = 812900 Y = 812900 Z = 204800

                            Everything is in Centimeters, so to have everything converted into Kilomters or Meters you need to do a little math.

                            1 Meter is 100 Centimeters
                            1 Kilomters is 1000 Meters

                            So 812900 Centimeters(uu) = 8129 Meters

                            8129 Meters = 8.129 Kilometers.

                            Simple.
                            As said in here, if I want a 15Km (9.32 miles) map, I make a Greyscale 15,000 pixels squere map in Photoshop? or whats the size of the document I should do in order to make a map of that size (15 Mk)?

                            Sorry to bring up this OLD post, just wanted to be sure.

                            Comment


                              #15
                              I'm adding to this, OLD thread but its logical to place it here and sorry Extile Ihave no idea without more research how PS units compares ;l)

                              My question:


                              8129 Meters = 8.129 Kilometers.

                              ^^ that as above, does not 'match' the 'KM' I see in left view of my terrain in viewport.

                              is that a known issue of the 'viewport' measurement, or am I missing something here ? )
                              Solo but Seismic - feel free to apply
                              https://neighborlee1.wixsite.com/theheartseed

                              Comment

                              Working...
                              X