by date
Visions (retro-)Update: All about Terrain
Visions (retro-)Update: All about Terrain
| Name: | Mark Dynna | ![]() |
|---|---|---|
| Date Posted: | May 25, 2007 | |
| Rating: | Not Rated | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Mark Dynna |
Blog post
I'm calling this a "retro" update because it actually covers stuff that I completed a few months ago. We initially made the switch from TGE to TGEA (then called TSE) to take advantage of the enhanced terrain size that Atlas offered. After seeing that most of the scripts could be ported over from TGE without modifications we estimated it would take us 6 weeks to make the switch. As with all things, this turned out to be a massive UNDER estimation. However, looking back, it certainly wasn't wasted time. Our project grew through changes from Atlas1 to Atlas2, and I learned a lot in the process.
Source: Real world Data
Our project is set in a real-world location (Israel) and sometimes this makes things complicated and sometimes this makes things easier. In the case of terrain, this realism made things much easier. Through extensive Internet searching we were able to acquire a Digital Elevation Model (DEM) image of an area 1 degree of Lat and 1 degree of Lon, which contains the site of Jerusalem. We figured this was a great place to start. The DEM image was a GeoTIFF image that was then converted and exported as a black and white height map using MicroDEM. The use of MicroDEM became extremely useful later. The size of the height map image was subject to experimentation, but eventually we settled on 8192. This source size allowed us to keep the Atlas Square Size relatively small (4) while still giving us a fairly good game world to real world scale (about 1/3).

Texturing: L3DT
The next problem was how to texture our terrain. Understand that many of the features in Atlas were not available when we were creating this terrain. All that was available at the time was the "unique" version, which used a single large texture. The idea of texturing the map by hand in PhotoShop was mind-boggling so we started searching for a tool. Eventually I discovered L3DT. At the time, the integration between TGEA/Atlas and L3DT was no where near as tight as it is now. However, it had an extremely nice set of features including the ability to import height maps and re-export them as RAW. So, using L3DT's "desert" climate we were able to create an initial texture for our terrain, with baked-in shadowing to boot. The addition of the new height map mesh editor, as well as the ongoing development of the Export to Atlas plugin makes L3DT the best choice for creating Atlas terrains, in my opinion.
Importing Adventures
So, we had a real-world height map, and a nice texture to go with it. Both of which came fairly quickly, and we thought we were well on our way. Then I hit a big wall called generatechunkFileFromRAW16. Documentation was thin (what else is new?), so it was pretty much down to the "guess and test" method. After playing with many different variations of vertical scale, tree depth, and error metric, we were able to get something that looked decent. This is the part that took the most time, but boy did I learn a lot about generating an Atlas terrain from a height map. There were lots of "adventures" along the way, especially when Atlas2 first appeared. There was the "colour channel swap" bug (maybe be known as the "blue terrain" bug), and then there was the "bungled texture" bug, where you needed to rotate the terrain texture 90 degrees to the right and mirror flip it before importing. However, all of those things got fixed eventually and now we have a terrain we are content with.
Finding Things
The final problem we had with our terrain was to find real-world locations on our game terrain. For quite some time, we could not find a solid "mathematical" way to accomplish this. We simply examined the "approximate" location of the site (like the location of Jerusalem) on the height map, tried to identify key terrain features, and then attempted to find them in the game. This was a slow and highly subjective method. Just a few weeks ago, a key feature of MicroDEM was re-discovered and became the key in cracking this issue. MicroDEM has the ability to take Longitude and Latitude coordinates and create a marker on the height map indicating the exact location.
(See the little red box?)

So, because Atlas is a perfect scale model of the height map, it was just a matter of math to find the game coordinates. First, we placed the "dot" on the MicroDEM map, then exported it out of geoTIFF to PNG. The PNG was scaled to 8192 x 8192, then the exact pixel coordinates of the "dot" were located in PhotoShop. Take those pixel coordinates and multiply them by the Atlas import Square Size (4 in our case). Viola! What you then have is the EXACT game coordinates of any aribtrary real-world Lat and Lon location. This allows us to take the known coordinates of any important site or city (and we know quite a few including Jerusalem, Nazareth, and Bethlehem), and find the precise game-world location. Once we had this technique pioneered, we created a series of "flags" to mark important locations or city sites. We generated DTS's for the flags then popped them into the game world at the given coordinates.
(Here's the location for Bethlehem)

This latest development is very exciting for us as it gives our game a huge boost in the historical accuracy category. In fact, anyone who has visited the real-world locations in our game world should be able to recognize terrain features!
That about wraps up my experience with Atlas terrains. It was a longer trip than I was hoping for, but looking back, I feel the knowledge I gain was worth the effort. We are now busy creating all the base gameplay systems that future content will be built on top of. Future updates will be coming on those, so stay tuned!
Bye for now,
Mark
Source: Real world Data
Our project is set in a real-world location (Israel) and sometimes this makes things complicated and sometimes this makes things easier. In the case of terrain, this realism made things much easier. Through extensive Internet searching we were able to acquire a Digital Elevation Model (DEM) image of an area 1 degree of Lat and 1 degree of Lon, which contains the site of Jerusalem. We figured this was a great place to start. The DEM image was a GeoTIFF image that was then converted and exported as a black and white height map using MicroDEM. The use of MicroDEM became extremely useful later. The size of the height map image was subject to experimentation, but eventually we settled on 8192. This source size allowed us to keep the Atlas Square Size relatively small (4) while still giving us a fairly good game world to real world scale (about 1/3).
Texturing: L3DT
The next problem was how to texture our terrain. Understand that many of the features in Atlas were not available when we were creating this terrain. All that was available at the time was the "unique" version, which used a single large texture. The idea of texturing the map by hand in PhotoShop was mind-boggling so we started searching for a tool. Eventually I discovered L3DT. At the time, the integration between TGEA/Atlas and L3DT was no where near as tight as it is now. However, it had an extremely nice set of features including the ability to import height maps and re-export them as RAW. So, using L3DT's "desert" climate we were able to create an initial texture for our terrain, with baked-in shadowing to boot. The addition of the new height map mesh editor, as well as the ongoing development of the Export to Atlas plugin makes L3DT the best choice for creating Atlas terrains, in my opinion.
Importing Adventures
So, we had a real-world height map, and a nice texture to go with it. Both of which came fairly quickly, and we thought we were well on our way. Then I hit a big wall called generatechunkFileFromRAW16. Documentation was thin (what else is new?), so it was pretty much down to the "guess and test" method. After playing with many different variations of vertical scale, tree depth, and error metric, we were able to get something that looked decent. This is the part that took the most time, but boy did I learn a lot about generating an Atlas terrain from a height map. There were lots of "adventures" along the way, especially when Atlas2 first appeared. There was the "colour channel swap" bug (maybe be known as the "blue terrain" bug), and then there was the "bungled texture" bug, where you needed to rotate the terrain texture 90 degrees to the right and mirror flip it before importing. However, all of those things got fixed eventually and now we have a terrain we are content with.
Finding Things
The final problem we had with our terrain was to find real-world locations on our game terrain. For quite some time, we could not find a solid "mathematical" way to accomplish this. We simply examined the "approximate" location of the site (like the location of Jerusalem) on the height map, tried to identify key terrain features, and then attempted to find them in the game. This was a slow and highly subjective method. Just a few weeks ago, a key feature of MicroDEM was re-discovered and became the key in cracking this issue. MicroDEM has the ability to take Longitude and Latitude coordinates and create a marker on the height map indicating the exact location.
(See the little red box?)
So, because Atlas is a perfect scale model of the height map, it was just a matter of math to find the game coordinates. First, we placed the "dot" on the MicroDEM map, then exported it out of geoTIFF to PNG. The PNG was scaled to 8192 x 8192, then the exact pixel coordinates of the "dot" were located in PhotoShop. Take those pixel coordinates and multiply them by the Atlas import Square Size (4 in our case). Viola! What you then have is the EXACT game coordinates of any aribtrary real-world Lat and Lon location. This allows us to take the known coordinates of any important site or city (and we know quite a few including Jerusalem, Nazareth, and Bethlehem), and find the precise game-world location. Once we had this technique pioneered, we created a series of "flags" to mark important locations or city sites. We generated DTS's for the flags then popped them into the game world at the given coordinates.
(Here's the location for Bethlehem)

This latest development is very exciting for us as it gives our game a huge boost in the historical accuracy category. In fact, anyone who has visited the real-world locations in our game world should be able to recognize terrain features!
That about wraps up my experience with Atlas terrains. It was a longer trip than I was hoping for, but looking back, I feel the knowledge I gain was worth the effort. We are now busy creating all the base gameplay systems that future content will be built on top of. Future updates will be coming on those, so stay tuned!
Bye for now,
Mark
Recent Blog Posts
| List: | 05/12/08 - Debugging an Action Map - possibly of very little interest 09/28/07 - Torque School: What is the value? 07/18/07 - Torque School Instructor 06/06/07 - Visions Update: The Importance of Cow Surfing 05/25/07 - Visions (retro-)Update: All about Terrain 05/03/07 - Visions: The MMORPG with the Bible |
|---|
Submit your own resources!| Aaron E (May 25, 2007 at 22:21 GMT) |
| Sparkling (May 25, 2007 at 22:45 GMT) |
Thanks for taking the time to post this Mark. I hope that our experiences are able to benefit others as well.
-Sparkling
http://www.visionsgame.com
| Andy Hawkins (May 26, 2007 at 00:07 GMT) |
You must be a member and be logged in to either append comments or rate this resource.



Not Rated


