Game Development Community

Atlas modification at runtime?

by James Brad Barnette · in Torque Game Engine Advanced · 08/09/2007 (8:18 am) · 6 replies

I have noticed that one of thie big things in a lot of the up and comming games is terrain deformation.
I was watching a development video for world in conflict where they were showing how the terrain deformed to show damage. Like say a bomb drops or a artillery shell hits it leaves a crater. These craters play a strategic role in the tactics of how you would fight a battle. For instance providing cover and or limiting line of site.
Their terrain system didn't sound that much different than atlas. Other than the nice shadows they had it looked a lot like atlas.

So my question is this is it possible to modify Atlas terrain at runtime or is this something that would require a whole new terrain system?

I was thining that a localized hightmap could be projected into the atlas as a modifier. somthing like this:

pixollusion.com/tgea/hole.jpg
and then of corse you would need a crater texture to project onto the surface as well. the method that Jeff Faust uses for his zodiacs would likely work. " just guessing though"

#1
08/09/2007 (6:19 pm)
I created a method where you can change the existing atlas terrain that I called Atlas Tweak. You can find a resource on it here: www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12673. However this only allows you to make minor changes to the height of the terrain at runtime. You can, for example, flatten an area for a town or something. In the end I found this method informative but not of much use.

One of the things I learned here was that the atlas mesh is much coarser than you might expect when compared to the data used to create it. In my test model (from L3DT) I used a square size of a few meters. In the area where I was creating a flat spot the atlas mesh nodes were 100's of meters apart. If you want to modify the existing mesh you are limited to that kind of scale - increments in 100's of meters for my case. The original mesh data does not exist in atlas so you'd essentially have to regenerate everything from scratch.
#2
08/09/2007 (9:08 pm)
Hmm. isn't atlas done in very small tiles? perhap it would be possible to only regenerate those tiles affected?

or and I'm not sure if this would even be possible but to create a resonbly detail but very small atlas mesh consisting of just the crater and perform a boolean operating on the affected tiles.

What is the smallest square size possible with atlas? is there a hard limit on how close the vertexes can be?
#3
08/26/2007 (7:22 pm)
Dennis,

Just as a side not. I have noticed the lack of detail coming out of L3DT as well and I just wanted to say that I don't think this has anything to do with atlas itself (the rendering engine) or even L3dt (clearly the detail is there if you look at the heightmap). The problem is the conversion process. Its a bug likely in the exporter. The atlas maps produced by the exporter are very small (1-2meg that's with the unique terriagn texture map included). Clearly something is off. It doesn't matter what you set for your square size either. There is definatly something broken in that exporter (notice how FAST it compiles an atlas map compared to how long it takes doing it the "old" way).

Ves
#4
08/27/2007 (5:45 pm)
Ves,

Do you mean the L3DT to Atlas exporter? Most of the terrains that I have been working with are 4096 square and larger so I've stayed with the manual method implemented in a dialog. Regardless there are a surprising number of considerations to get a reasonably good looking terrain. In my experience square size, tree depth of the heightmap, texture size, and density of the texture are all important. The first three are related and the way L3DT applies textures can be changed. I've pretty much abandoned unique terrain since the results aren't as good as blended.


James,

Sorry for not responding but I haven't been involved in other things (life) for a while and didn't see your post. As I understand Atlas and the underlying ROAM algorithm you can use as fine of an input mesh as you want. I suppose that you could use a square size 0.1 mm with an appropriate height range and tree depth. However the mesh that Atlas calculates will have vertices that are as far apart as they can be and the mesh still satisfies the error metric. With an error metric of 1 meter, for example, and a really flat plain a vertex could be 100 meters across as long as it doesn't deviate from the input terrain data by more than 1 meter. Steep areas like in the crater would have vertices much closer together. The only way to really know is to run the calculations that Atlas does in the beginning.
#5
08/28/2007 (8:56 am)
The atlas exporter was fixed for terrains larger than 2048. you can thank Mark dynna for it. I have hosted the file here
#6
08/28/2007 (11:02 am)
[Just my opinion]

James,
The 'localized heightmap' object is interesting but it breaks down quickly in that if the heightmap extends below the Atlas terrain (as a crater would) then the Atlas terrain would be visible again and effectively fills in your crater except for the rim. But, the biggest problem with using other objects to modify the Atlas terrain is that of collision and the ability for players to walk on the new surface. You can't just use a box around the heightmap object and expect the player look like they are walking on the surface of the new heighmap.
I just don't think runtime modification/deformation of the Atlas terrain will ever be possible.

Dennis,
Don't sell your 'Atlas Tweak' resource short. I have not gotten a chance to really explore it more, but I think load time modification of the Atlas grid can have many interesting uses. A big one would be the possibility to give the terrain a geo-curvature like Bill Vee is doing in DayOfWar. And if you saved the original heightmap with a different X and Y horizontal spacing, then you process it with the same spacing but then use load time modification of the spacing would result in displaying an Atlas terrain that was rectangular instead of square. Load time modification of Atlas terrain could also be used to exaggerate the Z or height by some scale as a special effect such as on a menu where you select the terrain for the game.

[/Just my opinion]