Jump to content

Holes in terrain not working


Recommended Posts

Hello,


So, I decided to test out an in-progress build of a land feature I'm working on, with a quick and ugly texturing job, and I noticed a bug in the terrain system. Maybe it's known about, but I couldn't find anything about it.


Basically, the game engine ignores holes in the terrain for character collision, but it seems to work okay for other items; I threw out one of the mines, and it went through the hole as it should. The model is set down into the ground, with the area inside it emptied out, as it would be in an actual scene.


I thought maybe it was an issue with my model or something during export, so I did an A/B test... one with the heightmap terrain, and one without it. Without the terrain in the scene, it works fine.


Here's a couple short vids demonstrating it...

With Terrain

Without Terrain


Any idea why that might be happening?

Link to post
Share on other sites
Hello,


So, I decided to test out an in-progress build of a land feature I'm working on, with a quick and ugly texturing job, and I noticed a bug in the terrain system. Maybe it's known about, but I couldn't find anything about it.


Basically, the game engine ignores holes in the terrain for character collision, but it seems to work okay for other items; I threw out one of the mines, and it went through the hole as it should. The model is set down into the ground, with the area inside it emptied out, as it would be in an actual scene.


I thought maybe it was an issue with my model or something during export, so I did an A/B test... one with the heightmap terrain, and one without it. Without the terrain in the scene, it works fine.


Here's a couple short vids demonstrating it...

With Terrain

Without Terrain


Any idea why that might be happening?

 

I don't know much about these things, but Player collision is handled differently than all the other stuff's collision (among other things it's a lot more precise I believe), so maybe there is a bug in the Player collision code?

Link to post
Share on other sites
Just got this tested and working with PhysX 2.8 SDK and versions T3D 3.8 and 3.10. I don't see any floating issues so far..


rDwe6tAvVXc


You should probably post more details about your setup.

 

It looks like you've lowered the terrain at that point, as you have the sandy ground at the bottom of the water/pool.


In my case, I've set the terrain to "empty", so there's actually a hole in the ground, which I have my 3D model set into.


So, the terrain is visibly not there, but it appears the collision is still being calculated for it. The collision on the 3D model is working fine; I have collision set to "visible mesh" on that. It's only when the terrain is present in the map that it's not working and I'm "running on air".


Also, the problem isn't even related to the 3D model. Here's a screenshot I just took where I'm outside that 3D model, on an area I'd just set to "empty", and am getting the same result.

http://dl.dropboxusercontent.com/u/53548203/Screenshot%202016-12-19%2015.17.35.png


I don't recall which physics I set it up with, unfortunately. I want to say it's either Torque or Bullet, though.

Link to post
Share on other sites


It looks like you've lowered the terrain at that point, as you have the sandy ground at the bottom of the water/pool.


In my case, I've set the terrain to "empty", so there's actually a hole in the ground, which I have my 3D model set into.


So, the terrain is visibly not there, but it appears the collision is still being calculated for it. The collision on the 3D model is working fine; I have collision set to "visible mesh" on that. It's only when the terrain is present in the map that it's not working and I'm "running on air".

 

Ok got it. So here's the terrain with a hole cut through it, not lowered and still don't see any issues. I also have placed another terrain below it.


cfYPK1B31i4


I could post or send the binary files if you would like to test them out.

Link to post
Share on other sites

For those asking,


I'm using Bullet Physics, and OpenGL rendering, and I'm using 3.8 (can't seem to get 3.9 to work right).


But really, should the physics version really matter? I'd imagine the terrain system would be programmed to recognize when a part of its surface has been set to "empty", regardless.

Link to post
Share on other sites

Hey guys, try this and test 'er out. Seemed like it worked for me.


https://github.com/GarageGames/Torque3D/pull/1876.


Credit goes to @Lopuska from his PhysicsGMKRefactor work, and Az and Timmy for remembering about it ;)

 

For those asking,

But really, should the physics version really matter? I'd imagine the terrain system would be programmed to recognize when a part of its surface has been set to "empty", regardless.

 

The setup passes through the physics abstraction layer on to the physics library in question. The issue was that the abstraction part didn't properly translate the holes in such a way for bullet to know about all that. the stock and physx stuff happened to. The above code change should make bullet properly aware of holes in the terrain, so give it a shot and let me know :)

Link to post
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...