Game Development Community

Mesh Road Issue

by Nils Eikelenboom · in Torque 3D Professional · 08/03/2012 (11:23 am) · 11 replies

Often out of the blue, Mesh Roads get messed up. While the nodes are placed correctly, at some points the rendered mesh will deform between 2 or more nodes (while collision stays in place). In this case (see image) the mission file is already 2 weeks old and the Mesh Road was untouched for a week continious working with the editor. When removing nodes the Mesh Road pops back into a normal state but to find it messed up again every time the mission is restarted.

i-dropper.net/torque/MeshRoadBug-800.jpg
Bigger image (jpg/830kb)

(In the example the mesh road is used for an other purpose then driving on it but that should not be the problem :)

The code of the mesh roads in the mission file always remain the same and doesn't show any anomalies...

new MeshRoad(GuardRailA) {
      topMaterial = "GuardRailTOp";
      bottomMaterial = "GuardRailTOp";
      sideMaterial = "GuardRailRustySide";
      textureLength = "5";
      breakAngle = "1";
      widthSubdivisions = "1";
      position = "61.9349 1579.64 190.455";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      canSave = "1";
      canSaveDynamicFields = "1";

      Node = "61.9349 1579.64 190.455 0.1 1.2 0 0 1";
      Node = "62.8199 1579.34 191.196 0.1 1.2 0 0 1";
      Node = "65.036 1578.41 192.051 0.1 1.2 0 0 1";
      Node = "67.3747 1577.52 192.344 0.1 1.2 0 0 1";
      Node = "77.4754 1573.59 193.027 0.1 1.2 0 0 1";
      Node = "90.0605 1568.24 193.926 0.1 1.2 0 0 1";
      Node = "106.379 1561.36 195.561 0.1 1.2 0 0 1";
      Node = "121.734 1554.92 196.883 0.1 1.2 0 0 1";
      Node = "145.681 1544.79 198.927 0.1 1.2 0 0 1";
      Node = "164.095 1537.28 200.196 0.1 1.2 0 0 1";
      Node = "186.32 1529.02 200.576 0.1 1.2 0 0 1";
      Node = "210.378 1519.93 200.841 0.1 1.2 0 0 1";
      Node = "231.852 1510.58 201.309 0.1 1.2 0 0 1";
      Node = "261.446 1495.17 201.179 0.1 1.2 0 0 1";
      Node = "312.796 1468.12 198.601 0.1 1.2 0 0 1";
      Node = "343.955 1450.92 197.336 0.1 1.2 0 0 1";
      Node = "386.56 1426.54 197.466 0.1 1.2 0 0 1";
      Node = "425.026 1402.13 198.269 0.1 1.2 0 0 1";
      Node = "470.811 1373.58 200.153 0.1 1.2 0 0 1";
      Node = "500.71 1355.65 201.837 0.1 1.2 0 0 1";
      Node = "525.015 1340.4 203.172 0.1 1.2 0 0 1";
      Node = "552.101 1323.28 204.055 0.1 1.2 0 0 1";
      Node = "588.563 1300.27 204.868 0.1 1.2 0 0 1";
      Node = "608.227 1287.02 205.299 0.1 1.2 0 0 1";
      Node = "618.28 1278.55 205.706 0.1 1.2 0 0 1";
      Node = "621.476 1273.5 205.693 0.1 1.2 0 0 1";
      Node = "622.532 1269.28 205.579 0.1 1.2 0 0 1";
      Node = "622.879 1267.81 205.678 0.1 1.2 0 0 1";
      Node = "623.009 1266.65 205.633 0.1 1.2 0 0 1";
      Node = "623.116 1265.86 205.473 0.1 1.2 0 0 1";
      Node = "623.243 1265.15 205.154 0.1 1.2 0 0 1";
      Node = "623.345 1264.46 204.653 0.1 1.2 0 0 1";
   };

Is there a fix avaible? Thanks!

- I'm using Torque 3D Pro 1.1 with the 1.2 update
- Dit not change meshRoad.cpp, guiMeshRoadEditorCtrl or guiRoadEditorCtrl yet

#1
08/03/2012 (11:54 am)
Did you make sure to recompile the project after merging in the patch? I know, it seems like a silly question to ask, but you'd be surprised at the number of people that have reported bugs related to the the patch that were all due to the fact they didn't recompile.

Try fidgeting with the nodes in the affected area, a small tweak here or there will usually get them to snap back in to place.
#2
08/03/2012 (12:36 pm)
@Scott, thanks for the quick reply.

Yes, I recompiled the solution after merging the patch. This problem was there before and still after compiling. I also did not see a new meshRoad.cpp within the patch.

I removed the nodes, created new ones, rotated them, moved them around, moved the object in a another SimGroup, replaced 'good' (old) code back into the mission file etc...

But every time I restart Torque and load the mission file it's messed up again. Pretty frustrating :S
#3
08/04/2012 (10:12 pm)
@Scott

About recompiling, now I see, I indeed did not recompile the project, I only recompiled the solution and merged the new files from the FPS example 1.2. After doing the whole patching proces again too many errors occured. So I just put back a backup to avoid spending too much time on this.

I noticed the MeshRoad in the example get messed up every time I remove groundcover manually (Torsion) from the mission file. Now I used the editor instead to remove it en everything seems to be fine so far.

I changed the title of this thread.

Thanks for the support
#4
08/10/2012 (3:28 am)
After a few days, what ever I do in the editor, meshroads are getting messed up. It has clearly something to with the mission file, whenever things are added or changed this happens.

It's a real bummer having this during the development of a game.
#5
08/10/2012 (1:34 pm)
Try doing a diff on mission files to make sure there is not something weird going on. It could be something not easily visible is happening. Then again it might just be a strange bug.
#6
08/13/2012 (4:13 am)
@Frank, the mission files seem ok. Can't find any strange things in there. Thanks

'Cut & paste' the roads in a new simgroup in the editor seems to help to prevent this for a period of time. Was already automaticly backing up the mission files folder and with future missions I'll just put the meshroads in as late as possible.
#7
08/16/2012 (7:20 am)
I think your having a problem that I ran into. Check out my post:

www.garagegames.com/community/forums/viewthread/130037

Try running in debug mode. I bet you'll get an assert when you load the mission. The problem is more likely to happen with long spline based object.

No one from GarageGames responded to my post. This is an issue with the engine. The spline data either needs to be stored in a separate file that is transmitted to the clients and not in the mission or someone needed to rewrite how data is transmitted from the client to the server.
#8
08/16/2012 (10:22 am)
That's interesting Dave.

The PathManager class used to (edit: still does, actually!) overflow the BitStream because it attempts to pack all of the spline node data into a single packet. I thought MeshRoad may be doing the same thing but that doesn't seem to be the case. Looking at the code, MeshRoad seems to send spline node data in separate NetEvent 'chunks' to avoid overflowing a packet.

I did a quick test by creating a road with 50 nodes (which is well above what'd be required to overflow a packet) and had no issues, even when connecting to a dedicated server with a debug build.

Need to do more testing.
#9
08/16/2012 (7:36 pm)
I have ported the project from 1.1 to T3D 1.2 (fresh) mainly to solve this problem, if it's still there...

Collision remains at its place, it seems to be not effected by this. It's only the visual part that shows this strange behaviour.
#10
08/16/2012 (7:48 pm)
If the collision is okay then it would be something in the render code. Is it going toward the origin of the world? Maybe it is overflowing a buffer in the render code?

Or indexing into the wrong place?
#11
07/05/2013 (10:33 am)
Issues still remain with 3.0