Game Development Community

Networked Terrain Deformation Problem

by Gary Preston · in Torque Game Engine · 09/12/2006 (5:57 am) · 26 replies

The following resource www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7343 covers terrain deformation using deformer objects to allow for networked play. I'm running a different version to this resource but experiencing the same problem as Nicholas Sandow describes in the resource comments.

When a player fires a projectile at the ground and deforms the terrain, the host client sees the correct deformation and will collide correctly with it (eg can sit on the bottom of the crater). Any other connected clients however will see a crater that is perhaps half (rough guess) as deep, yet will still collide the same as the server and thus end up underneath the terrain from their pov but resting on the bottom of the crater from the host clients pov.

Or as Nicholas puts it:
Quote:
The client does in fact see holes appear, but they are not drawn deep enough. In other words, when the client walks across a hole, the avatar will descend approximately the same amount as the server player, but will be drawn with half or all of his body in the ground.

There is no such problem for the server player. He sees the avatars positioned correctly on top of the terrain at the bottom of the hole.

Having spent last week looking into the above bug, I'm still not really any closer to a solution. Does anyone with a working knowledge of the terrain code have any suggestions as to why connected clients are rendering the deformations differently to the server, yet appear to be using the same "correct" collision data as the host client?

So far I've checked the following:-

1) As the host client renders and collides with the deformations correctly, yet any connected clients do not, I thought this could be a problem with the networking side, with the host client seeing things correctly due to the networking "short circuits". However, I've checked the data transmit to each client by the deformation object's pack/unpack and it's the same as the data used/sent by the server.

2) The code looks like it should be deterministic and the log info on both client and server suggest this is the case. I've also implemented just the deformation code in a clean TGE1.4 to ensure the rest of the terrain modifcations made are not having a knock on effect.

Could it be that the terrain deformer object when processing on the server is updating some other structure used by the terrain code for rendering which isn't currently network enabled and thus only the short circuited host is seeing the correct deform. I'm a little stuck as to what this could be though, reading/tracing through the terrain source so far hasn't highlighted anything obvious.

The code makes a call to updateGrid which I read in another forum thread was created for working with the terrain editors and may not be suitable for a networked environment, but again reading through this doesn't suggest it's doing anything that would cause the above problem.

I've resolved the other problems with the resource such as forcing shapebase objects to update their working collision set to handle the case of terrain deforming directly underneath them but this one has got me stumped. My knowledge of the terrain code is very limited so if anyone has any insight/suggestions as to where to focus my attention I'd appreciate it.

If you need any more information, let me know.
Page«First 1 2 Next»
#21
10/15/2007 (5:52 pm)
Is there any code that has been released? I would really like to fix this for my game as it is a really cool feature.

Thanks.
#22
10/15/2007 (6:30 pm)
Nothing has been released of the working version. Frankly since its not my work to post as a resource, I believe you will need to get Gary Preston's permission before I share mine. I really have no interest in making another resource until I get those two bugs hammered. out.
#23
11/28/2007 (1:34 am)
I'd like to see the latest version of this if anyone would be so kind as to send it to me. Perhaps I could help hook the object into the decal manager. What's the problem with the particle emissions? Can you explain in more detail? Thank you.

Robert
#24
11/28/2007 (6:43 pm)
Actually Robert, I already got that one with the decals and a few other nice additions too.

Also, the particle thing turned out to be a bad explosion script on my end.

As for the update to it, I released the updated version as a resource for everyone to play with. Hopefully it will be approved soon. It credits you for the original and Gary and I for the updates.

You can find it here:

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=13884

It works very well for me now.
#25
11/28/2007 (7:12 pm)
Wow, this is a nice read.
#26
11/29/2007 (1:35 am)
Thanks Ron. I'm glad this resource is getting the play it deserves. It's pretty awesome. Stephen Zepp was also instrumental in getting it to work. Thanks Stephen.

Robert
Page«First 1 2 Next»