Game Development Community

Clear Terrain from Working Collision Set

by Ronald J Nelson · in Torque Game Engine · 08/18/2006 (11:32 pm) · 12 replies

I am moving my post to here since this is really more of a terrain based subject.

Referencing my previous post:
www.garagegames.com/mg/forums/result.thread.php?qt=49001

What I need to know is how to clear the terrain from an object's working collision set? Since I am modifying the terrain in real-time, I need to ensure each object's workng collision set is updated to reflect this each time.

#1
08/28/2006 (3:30 pm)
No suggestions yet?
#2
08/29/2006 (12:27 pm)
Curious - lets elaborate on the problem with some specifics....
#3
08/29/2006 (3:04 pm)
If you reference the previous post with the url, I thought I was specific. What other information do you need? If you can give me a solution or point me in the right direction I would be very grateful.
#4
08/29/2006 (9:39 pm)
Development, testing (debugging) c/c++ is one aspect, torque script is another. Each has its own approach in solving problems. So lets elaborate in your own words the problem then the solution.
#5
08/30/2006 (9:50 pm)
You have to understand that the problem is not a failure of the game engine, but a function in it. The fact is that for each object in a map it keeps what is called a working collision set for each object that contains a cache of whatever that item is colliding with. In this case, it is the terrain. It keeps approximately one tile of terrain cache beneath the item that is eventually updated within that items movement code if it is applicable. After the object has moved a certain distance it refreshes this cache.

This is typically a good system until you have something like real-time terrain deformation that actually modifies the terrain while in game. The problem that is created is when the object is within the radius of the deformation because it does not recognize the deformation. It continues to rely on it's working collision set for it's terrain information because it has not met it's requirements to update it.

The obvious solution for this is to create a radius search at the site of the deformation to look for objects within that radius. I did this successfully.

Next for each object within that radius that object needs to have it's working collision set updated to reflect the real-time terrain change. This is where I am having issues.

If you read the post that this one is linked from above, you will see this is the problem that I have been trying (unsucessfully) to fix.

If you refer to the resource I got this from you can see that Torquescript is a very small portion of the overall process and is used primarily for the creation of the deformation object when it is wanted in came. It only does this by creating a new instance of it based upon location and the size specifcations you give it.

As for C++, other than the code I already listed in the posted linked at the top, the code is exactly as it is released in the resource.

Debugging makes no difference at all, primarily because the engine in its original state, does not have a problem as far as it is concerned.
#6
08/31/2006 (3:22 pm)
Curious. Using the process of elimination: Are you using a mission and terrain file and are they unlocked?
#7
08/31/2006 (4:29 pm)
In response to you questions: First, yes I am using a mission and terrain file. Second, I have tried it with each in both locked and unlocked and both at the same time in each, no help.

By the way I found this that gives a good explantion of what is going on:

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5414
#8
08/31/2006 (5:20 pm)
After the terrain changes does the static objects remain in the same location and the avatar? I am trying to see this visually.
#9
08/31/2006 (5:21 pm)
Yes except in the case of vehicles, where it drops down to the chassis. Apparently the wheels are dealt with differently.
#10
09/02/2006 (4:13 pm)
OK I found an interesting result that I was unaware of before but it may very well have the source of the problem in it. My team and I hosted our first internet game only to find that if you leave the game and return, the terrain deformation does not show.
#11
09/09/2006 (4:34 am)
Yes it does seem to be be a client notification issue that I have no feaking idea how to fix yet. I will have to delve into it more but for now I have a ton of other stuff to do besides this thing I wanted for the coolness factor.
#12
09/09/2006 (4:44 am)
Perhaps this is obvious to you Ron, but what you have to do is send the terrain deformation data in the initial state update, when a client joins.