Simple equation to help with map size

Friendly conversations, and everything that doesn't fit into the other forums.
• 1
• 2

Simple equation to help with map size

noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm

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.

Re: Simple equation to help with map size

Duion
Posts: 1622
Joined: Sun Feb 08, 2015 1:51 am

What is that for? Sounds very complicated. I always used that equasion:

Texture size 2048x2048 = 2x2 km = 4 sqm

Much simpler.

Re: Simple equation to help with map size

Timmy
Posts: 378
Joined: Thu Feb 05, 2015 3:20 am
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.

Re: Simple equation to help with map size

noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 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.

Re: Simple equation to help with map size

noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 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.

Re: Simple equation to help with map size

Code_Man
Posts: 66
Joined: Fri Jan 26, 2018 9:12 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.

Re: Simple equation to help with map size

Duion
Posts: 1622
Joined: Sun Feb 08, 2015 1:51 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.

@
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.

Re: Simple equation to help with map size

noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 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).

Re: Simple equation to help with map size

noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 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.
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.

Re: Simple equation to help with map size

Duion
Posts: 1622
Joined: Sun Feb 08, 2015 1:51 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).
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

Who is online

Users browsing this forum: No registered users and 6 guests