# Simple equation to help with map size

## Recommended Posts

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

Edited by noemen
##### Share on other sites

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

Texture size 2048x2048 = 2x2 km = 4 sqm

Much simpler.

##### Share on other sites

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.

##### Share on other sites

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.

##### Share on other sites

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.

##### Share on other sites

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.

##### Share on other sites

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.

##### Share on other sites

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

##### Share on other sites

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.

##### Share on other sites

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.

##### Share on other sites

To make it easier on rendering and performance u can have multiple terrains that only load once the player is within visible range this way a cell size of 1 with say 3 terrains of 2048 will load well have everything working accurately such as physics and will at best only have 1 terrain rendering at any given time. Alot of other things are tied to the terrain in torque as duion had problems with the physics because the terrain with a cell size of 0.5 each face is calculating physics, the best thing to do is to scale everything else in half as well which defeats the purpose really. Or just design your terrain in a 3d modelling app like blender, cut it into blocks and then import them into the engine with different lods

##### Share on other sites

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.

I liked your tip ... I have you as a great reference. I would like to play a game based on the region where I live. The map will be divided into two parts; Atlantico and Caatinga Region. Since the player can go anywhere on a closed island.

To make it easier on rendering and performance u can have multiple terrains that only load once the player is within visible range this way a cell size of 1 with say 3 terrains of 2048 will load well have everything working accurately such as physics and will at best only have 1 terrain rendering at any given time. Alot of other things are tied to the terrain in torque as duion had problems with the physics because the terrain with a cell size of 0.5 each face is calculating physics, the best thing to do is to scale everything else in half as well which defeats the purpose really. Or just design your terrain in a 3d modelling app like blender, cut it into blocks and then import them into the engine with different lods

Liked it! But there is a way to sew these terrains so that the lines (borders) are not visible

##### Share on other sites

A workaround is to have islands, so you can submerge the ugly seams of the terrain blocks and you can have multiple terrain blocks without it being visible, the ocean floor I cover with a ground plane, but you also can look it up in my levels how I did it.

But overall don't start with too big projects, a 4096x4096 terrain with cell size 1 is all you need and maybe all you can have. You can almost fit Skyrim in that, look it up, here for example where people tried to calculate the size of Skyrim: https://www.quora.com/How-large-is-Skyrims-overworld

Skyrim is estimated to be between 13 and 20 square kilometers and a 4096x4096 terrain will give you 16 square kilometers at best. If you want a game world larger than that, you need to be skilled and use higher level tricks or just use a game world with much less detail.

##### Share on other sites

Liked it! But there is a way to sew these terrains so that the lines (borders) are not visible

A smart way to hide these depending on what you want in your level would be to use the mesh road tool to add in things like river beds, a road or something like that to hide the seems

If you look at the map of skyrim here as an example i wouldnt be surprised if the rivers running through skyrim were used to break up or hide seems in separate terrain blocks. Even mountains or cliff faces can be used to hide seems with very convincing results.

##### Share on other sites

No they did not hide seams with rivers, Terrain blocks are square and the seams are the borders of the square, so you either have square rivers or your rivers do not work to cover it up at all, most effective thing is an ocean.

The world in Elder Scrolls is much bigger and only a small part is playable, so their borders will be well beyond what you can play on and the borders are hidden with either mountains or ocean, that's the best way to do it, you can also try a flat terrain to cover the borders, something like a backdrop or skybox, I tried this with my paintball levels PB_Gummifeld, I made a lower resolution terrain and scaled it up by a high factor cell size, so you have a very large backdrop terrain with very few polygons, but the borders are still visible, you need to block people from going there through invisible walls then.

##### Share on other sites

Apparently there are many ways to hide borders. You two were great. I think this will help me and also help other people. Very grateful indeed!

Now I see things differently, thanks to you.

##### Share on other sites

No, there are not that many ways to hide borders, I only know three, ocean, mountains and invisible walls plus backdrop.

##### Share on other sites

There are as many ways as u can think of to hide borders and joins between terrain blocks, and terrain blocks do not need to be square either and you can cut holes in terrain blocks to make them any shape you want. Sometimes separate terrain blocks are even used for mountain regions too to get better texture quality so there are multiple ways.

A press conference on terrain generation and landscape creation

https://twvideo01.ubm-us.net/o1/vault/GDC2014/Presentations/Gollent_Marcin_Landscape_Creation_and.pdf

##### Share on other sites

• 3 weeks later...

another great resource is a series of youtube videos by Shesez, you can see in this video that GTA5 has many terrain blocks used together but also that terrain blocks can be any shape you want

Little off topic:

Its also an amazing series to learn a few other tricks to save polygon counts in other areas such as how fps games usually use a simple model for the body and arms without a head, or sometimes no torso just legs and arms like they did with doom 2016 and how they did the visor, its literally just a model of the visor animated close enough to the camera that it looks like some fancy screen space effect but nope its just a high poly model with some bump mapping lol

Also shows with the weapons in that particular episode that in first person there are usually different animations for handling weapons than that of 3rd person, like the way doom guy moves the bfg is a hilarious viewing lol

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×

• #### Games

• Discord
×
• Create New...