Simple equation to help with map size

Friendly conversations, and everything that doesn't fit into the other forums.
  • 1
  • 2
19 posts Page 1 of 2
noemen
Posts: 45
Joined: Tue May 29, 2018 3:46 pm
 
  by noemen » Mon Sep 09, 2019 3:11 am
I made a simple equation that makes it easy to calculate the size of a terrain in meters or km
  • sqKM = km²(exe:20.480km*20.480km=419.44Km²
    HM = height map (exe:2048px)
    Cell = meters/px
sqKm/(HM*2)/HM=Cell
(HM*Cell)*(HM*Cell)=sqKm

Calc ex:

(2048px*2)*(2048px*2)=16.777216km²
16.777216Km²/(2048*2)/2048px=2m/px
Last edited by noemen on Mon Sep 09, 2019 4:23 pm, edited 1 time in total.
Duion
Posts: 1377
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Mon Sep 09, 2019 12:57 pm
What is that for? Sounds very complicated. I always used that equasion:

Texture size 2048x2048 = 2x2 km = 4 sqm

Much simpler.
Timmy
Posts: 378
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Mon Sep 09, 2019 3:45 pm
What is that for? Sounds very complicated. I always used that equasion:

Texture size 2048x2048 = 2x2 km = 4 sqm

Much simpler.
Yes much simpler but also potentially incorrect as you are not taking into account the block size.
noemen
Posts: 45
Joined: Tue May 29, 2018 3:46 pm
 
by noemen » Mon Sep 09, 2019 4:09 pm
What is that for? Sounds very complicated. I always used that equasion:

Texture size 2048x2048 = 2x2 km = 4 sqm

Much simpler.
Yes, yes, it's much simpler. You can use a 1: 1 cell, so if you create a slightly larger terran you have to change the size of the cell and that's where my equation comes in.
noemen
Posts: 45
Joined: Tue May 29, 2018 3:46 pm
 
by noemen » Mon Sep 09, 2019 4:16 pm
For example, you can create a terrain larger than 500km² and need to divide it into several grids (example from the map of Life is Feudal). You need an equation for everything to be correct.
Code_Man
Posts: 66
Joined: Fri Jan 26, 2018 9:12 pm
by Code_Man » Mon Sep 09, 2019 8:14 pm
Ugh not to derail, but how do you even get the size of the map/terrain in game units?
A while back i looked for it, but i couldnt find it and till now i forgot about this issue.
Duion
Posts: 1377
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Tue Sep 10, 2019 2:42 am
1 pixel heightmap = 1 meter ingame

Yes you could have different cell sizes, but anything else than 1 is bad, 2 may be tolerable for large scale games that mainly has vehicles or so and does not need the fidelity that is needed in first person shooters. I already tried different cell sizes, even something like 0.5 but it just made the player getting stuck more and will kill the frame rate a lot, since you now have up to 4 times more polygons.

So just forget using anyhting else than 1 for cell size.

@
User avatar
Code_Man

Torque is metric, so one unit is one meter is one pixel is one cell size is one grid size.

For everyone who wants it accurate you can just use 2,048kmx2,048km = 4,194304 sqm for a 2048 pixel heightmap with cell size one, it is not rocket science. If you really want another cell size you can multiply it with that number first, so 2048x2048 with cell size 2 is just like a 4096x4096 terrain.
noemen
Posts: 45
Joined: Tue May 29, 2018 3:46 pm
 
by noemen » Thu Sep 12, 2019 6:46 am
I am working with 4096x4096 and 2.5 p/m on a land of 10240mX10240m. For now I see no problem ... Sometimes it is good to risk. As most players have relatively good computers, try to balance the graphics (if the terrain is heavy, eliminate some polygons of some objects to balance).
noemen
Posts: 45
Joined: Tue May 29, 2018 3:46 pm
 
by noemen » Thu Sep 12, 2019 7:04 am
Ugh not to derail, but how do you even get the size of the map/terrain in game units?
A while back i looked for it, but i couldnt find it and till now i forgot about this issue.
I work with Qgis, making maps and so on. When I need to make a DEM, I need to turn it into UTM (to have control in meters) and then relate pixels to meters; This is where math comes in. With Torque3D I get the same results. I just related.
Duion
Posts: 1377
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Thu Sep 12, 2019 12:48 pm
I am working with 4096x4096 and 2.5 p/m on a land of 10240mX10240m. For now I see no problem ... Sometimes it is good to risk. As most players have relatively good computers, try to balance the graphics (if the terrain is heavy, eliminate some polygons of some objects to balance).
Larger cell size gives you much better performance since you have much less polygons in visible range, so you are actually improving performance in your case. You may not see a problem for now, but you significantly lack detail on the terrain as a new polygon only starts at 2.5 meters. If you use odd numbers like those, you also may encounter engine problems like physics problems as I did with a 0.5 cell terrain. I don't know why you need such a larger terrain, most modern games do not even have that and the biggest issue is probably to fill all that terrain with objects, a 2x2km level is already a huge pain to design.
  • 1
  • 2
19 posts Page 1 of 2

Who is online

Users browsing this forum: No registered users and 2 guests