Game Development Community

Atlas Hole Cutting Update?

by Bryce "Cogburn" Weiner · in Torque Game Engine Advanced · 01/28/2007 (12:35 pm) · 31 replies

I checked the majority of the MS4.2 threads and saw no mention of hole cutting in Atlas terrains. I've also scanned back a bit and the last update was "it's mathematically possible".

Given that it has been stated that Atlas is low-priority until after 1.0, does this mean that there will be no hole cutting until after 1.0?

Has anyone successfully managed to cut holes in Atlas terrain?

Sorry if this duplicates something that was already mentioned... I just couldn't find it if it was.

Seems like this is the one of the few features of TGE that isn't going to be available when TGEA is released. :(
Page «Previous 1 2
#1
01/28/2007 (2:26 pm)
A suggestion for a workaround might be to use a zone loading trigger (load you into the structure entrance in another mission) or some teleport that would warp the player and or AI whatever to the other side of the terrain.
#2
01/28/2007 (4:40 pm)
Bryce, the problem isnt removing the polygons for "cutting" the hole. Thats relatively trivial. The problem is that you effectively have multiple LOD's for each part of the terrain. So you then have to propagate that hole back up the tree of LOD's. Unfortunately, they are pre-optimised meshes, not just regular grids, so basically, the polygons at the lowest LOD arent the same as the polygons at the higher LOD's, so you either have to:

Make sure that somehow, the polygons you are deleting are in all levels of the tree (unlikely) OR you have to propagate the changes back up the tree OR figure out at the creation stage to actually just cut a hole right there and then :)

Actually, option 3 might be the quickest route.
#3
01/28/2007 (10:39 pm)
@Vashner: that was the route we had already planned to persue, but I still can't help but ask. :)

@Phil: A'ight... So that helps... Let me throw a what-if at you that others might find applicable. What if the only place where holes were applied were under buildings, so that only the highest LOD would need the hole... since any further away and you are outside the building, or so far away that it doesn't matter if you can see in the hole or not...

I'm not that savvy with Atlas yet, so this isn't something that I think I'd be able to tackle personally, but what if you could cut the hole only in the highest LOD and ignore it in the others?

How much modification would that be, and what is an example of the "trivial" code for cutting a hole? :)
#4
01/30/2007 (1:15 am)
Well, there are other issues here too Bryce. The main one being, does the hole fit in a chunks bounds? What you might be better off doing, is simply removing a chunk, which would be quite interesting. The hole would be square, is that a problem?

I'm still not sure it'd work properly though, what about collision? would you want that?
#5
01/30/2007 (4:54 pm)
Interesting. I'm starting to get a feel for what's going on.

Chunk size is determined when the mesh is created, no? So terrain meshes that have a smaller distance between verticies (I forget the actual setting in the atlasOldGenerateChunkFileFromRaw16 command), would generate a smaller chunk?

If that's the case, that could still be a workable solution.

And this next bit stems from my ignorance of how Atlas2 is processed, but from your collision question it would seem that the collision mesh is generated at some point after the Atlas2 file is loaded. This indicates that my chunk would need to be removed prior to the generation of the collision mesh, and then the corresponding collision mesh code would require modification to allow for the processing of a "missing" chunk. Otherwise, you would be able to see a hole in the terrain, but would walk across it as though it wasn't there. If collision meshes are rendered exactly on the chunks presented, then it's a done deal.... remove the chunks.

Ideally you would be able to indicate a particular chunk within the editor, or at least have the editor display the "number" of the chunk so you could tell it via scripting not to render that chunk. Once the chunk is removed, you could add a legacy terrain created to match the "hole" in the Atlas2 terrain... You could then cut smaller-than-chunk holes in the legacy terrain to taste... and voila! Atlas2 has all the functionality of the legacy terrain. Even better would be if TGEA could generate a height map (and a texture) of the chunks that were removed so you wouldn't have to spend hours trying to match verticies and textures or placing objects on the seams to hide them.

I'm just talking hypotheticals since that level of Atlas2 manipulation is beyond my skillset to implement.

Maybe you guys could whip it up real fast for 1.0? Just for me? Pretty please? :)
#6
01/30/2007 (5:00 pm)
Don't interior portals prevent terrain from going through? Or maybe I'm thinking of Legacy terrain?
#7
01/30/2007 (6:43 pm)
Would be nice if in the world creator you could just add a terrain gate marker that would just warp players to where you drop the "b" marker.
#8
01/30/2007 (9:09 pm)
I don't think interior portals work on atlas. At least I've seen the terrain jutting through my interiors. Considering Atlas' tools pipeline right now it has made it pretty hard to make a good terrain with flat areas to plop down buildings. Cutting holes in terrain or making the terrain not show in interiors should imo be a high priority.
#9
01/30/2007 (10:05 pm)
The suggestion I read on that was to use DTS as an entrance then connect that to your DIF. But have the DIF low enough to avoid that terrain cut in issue.
#10
01/30/2007 (11:29 pm)
Why not make cave entrance in Max or something. Then you could write a small code set so that these models act a little like interiors and wont render terrain on the inside of the collision bounds. This way you could make all kinds of different entrances, and you wouldn't have to cut into the terrain. I don't see how it really necessary, but thats just me:)
#11
01/31/2007 (8:04 pm)
The problem, as stated, is that the level of resolution for terrain removal is the chunk.

But JC's also got a good point, which is any Atlas2 terrain generation system (be it HTC or L3DT/Photoshop) just doesn't have the terrain control of the legacy terrains.

Which is why I suggest a solution that merges the two. You can use Atlas2 as your base, and then select chunks that would be replaced by legacy terrain blocks. You could then use those terrain blocks to transition above and below ground, or flatten it out perfectly to place interiors.

* Select chunks for removal
* Generate legacy terrain heightmaps and a texture "swatch" from the atlas terrain chunks selected
* Remove the chunks
* Replace the chunks with legacy terrain blocks

Our project has other demands at the moment and we just can't spare the resources to vet it ourselves. I'm hoping to inspire someone into digging into this solution a little further and maybe ... just maybe ... solve the problem TGE style ... collectively :)
#12
02/18/2007 (2:33 pm)
Have I totally misunderstood what the options for not rendering terrain inside interiors does?

Like... we can make interiors that pass through the terrain? It doesn't seem to work that well in 1.0, although you can tell it's trying really, really hard. :)

If this is the case, is there a bounty up for making this work?
#13
02/19/2007 (6:50 am)
I really dont have the need of cutting holes in terrain for my game (its a space game) but, instead of trying to hack the engine in order to alter the terrain mesh, why dont you trick the engine using the texture alpha information?

I mean... Im pretty sure atlas use a LARGE colored texture which is stretched over the terrain. Why dont you just try to make use of the alpha channel of that texture and paint alpha holes in the appropiate places? This may impact a little in your rendering (as you need to enable alpha) but if your game requires it, this will be a nice silution anyway.

If you need to go through the hole, then you may add an object in the appropiate place to test if the player is approaching and move him up/down as required.

Havent analyzed the problem anyway so feel free to flame me and throw me away of this thread :)

Luck!
Guimo
#14
02/23/2007 (9:55 am)
Hopefully this isn't a hijack of this thread but:

A long time ago, in TGE, wasn't there an option for not rendering terrain INSIDE interiors? Would that be a route to explore with TGEA?

I'm not sure if, in the end, that would be easier/beneficial/ or any different than doing any of the above. One benefit however, would be that one wouldn't have to actually mess with the terrain at all. You could just throw buildings wherever you wanted them and any terrain that intruded past the edge of the diff space, would not be rendered.

Although I guess, just because the terrain wasn't being rendered, doesn't mean it wasn't still there. Does collision still work on invisible terrain? Lol.

At any rate, maybe that could be explored...
#15
02/23/2007 (10:13 am)
You'd still have a problem of collision.
#16
02/23/2007 (12:50 pm)
Hi,

Of course collision will be a problem, but maybe you can add an area where collision is disabled for the player when he comes inside. After you go through the terrain you may enable collisions again so you can place your foot in something else... maybe a platform... or a level change...

Luck!
Guimo

Edit: Of course that would require to hack the code and add a property in order to enable/disable the collisions against the terrain for a while but I guess that will be easier than trying to cut hole regions of the terrain and all that.
#17
02/23/2007 (1:01 pm)
You know what's scary? This is exactly the kind of functionality that an Atlas Terrain Editor will need. So, unless Ben jumps in here with a "No problem, look at it like this...", I'm starting to think (more and more) that the Atlas Terrain Editor exists in "I don't have a freakin' clue" land.
#18
02/24/2007 (12:32 am)
EDIT: I should have read all the posts...

I'm wondering if you just set a flag on a shapeBase object... inZone or some such...

Then in ShapeBase::notifyCollision if the colliding object is a terrain and inZone is true skip the collision notification.
#19
02/26/2007 (11:46 am)
Hi Bryce,

Yes... that would be an option. The basic idea here is that you really can paint holes in the terrain using some alpha information and trick the collison with the terrain. Add some makeup to the problem (like a nice and defined hole edge using a scaled 3D model that approximately matches the hole) and the final result will probably have the same functionality than trying to cut the hole in the terrain.

Just remember that the game programmer has some of illusionist inside. You always have to present things 'like' the real ones but not quite the same. Its the idea behind bump maps instead of using detailed models, or using imposters in order to save some polygons, plan your trick and show it. The player doesnt care how you do it... he just wants to see it done.

Luck with your illusions!
Guimo
#20
02/27/2007 (11:29 am)
Ben has posted in the TGEA forum that hole cutting will be available in the next TGEA update.

Luck!
Guimo
Page «Previous 1 2