Saturday, 23 November 2019

Terrain Collisions vs AI

For the last couple of days I've noticed that the AI opponents have started to swerve on the first bend, sliding off onto the terrain. I had no idea what it was, I tried re-baking navigation meshes, toggling static objects and even reimporting the level models.

It turns out that the terrains height value is to blame. The terrain was made from a script to convert mesh to terrain data. Doing so seems to ignore height information. So even though I've edited the terrain to match the curvature of the track, the AI is still in collision with it.
This is a problem because I've put a physical material modifier on it to simulate slippery grass. So if the player explores it, it feels as expected.

There are 3 options:
  • I either remove the physical properties so neither AI or player will interact with it properly and will just stick to it.
  • I re-create the terrain by hand instead of automating it.
  • Or Instead I use the mesh again but improve the quality via 3D Max.*

*One thing to note is that the third option will disable the use of nice looking grass placement, due to the object no longer being a 'terrain'.

I think I will just have to spend time and re-create it by hand (which might be beneficial as there are 2 other smaller areas that need terrain too).

No comments:

Post a Comment