I’ve been having problems with my landscape collision ever since Physx3.3 was introduced sometime during the Beta.
I have been struggling with the issue ever since because I cannot release my game until this issue is resolved!
**Newer projects and newer landscapes may never encounter this issue!
I was unable to reproduce the collision issue on a new project that was also a third person c++ template project.
But if you are like me and you have landscape collision issues with your existing project / landscape assets…
I have just finished testing my Victory Landscape Collision Plugin!
And it is available to you for your enjoyment!
**Landscape Collision is Fixed!** I now have perfect landscape collision with the help of my plugin! **The plugin has two options** 1. Replace all landscape collision 2. Only add triangles of collision to "patch" steeply sloped parts of the landscape, which is where the Physx3.3 collision issues arise. **You can control all aspects of the feature!** 1. timer tick rates, to reduce any FPS lag for very large landscapes 2. What amount of slope qualifies for needing supplemental collision, if only patching and not replacing all landscape collision 3. Can be applied to multiple landscapes!
How It Works
I generate a dynamic mesh with no scene proxy, just physx collision data after retrieving the landscape vertex data.
I generate the triangles myself from the raw landscape vertex data.
If replacing all landscape collision, all triangles are always created, and regular landscape actor’s collision should be turned off to conserve resources.
If only patching sloped parts of the landscape, you can determine what qualifies as sufficiently sloped to warrant adding the additional triangles
**Performance** Performance is unchanged, after initial loading. :) There's a bit of an initial drag on the FPS when the initial setup is done, but if you do this at Begin Play time with fast timers (0.01) you wont notice, it just looks like normal loading time. For very very large landscapes a slower timer (0.1 or 0.333) might be better for the triangles and components. You can completely customize how the loading is done. You can choose to do it all at once and have it be part of the normal loading delay. Or you can spread it out if you don't need the collision immediately. This plugin has saved my project, I can now continue building more of the landscapes for my game and enjoy running around on them!
Entire C++ Source Code
The entire C++ source code is in the plugin!
**Videos** I have 2 videos to share! **Video 2 ~ Victory!!!** See next post for video of my Navmesh-free AI jumping around on the steepest slopes of my landscape! https://forums.unrealengine.com/showthread.php?9215-Videos-Rama-s-Victory-Landscape-Collision-Plugin&p=72995&viewfull=1#post72995 **Video 1** **Replacing Sloped Parts of Landscape Only** The red triangles are only in this development build, not the final version :) I needed to visualize the collision triangles to make sure I was building them correctly :) https://www.youtube.com/watch?v=-pfeUuWZvpI
Direct Download Link from UE4 Wiki
Indirect Wiki Download Link
**Installation** 1. drag the plugin to a folder named exactly "Plugins" in your project main directory where the .uproject is located. 2. open editor, go to window->plugins 3. check to enable my plugin 4. restart the editor 5. click on a landscape 6. go to level blueprint 7. right click and add the reference to your clicked landscape 8. right click and search for victory landscape 9. connect the landscape to my node 10. add the event begin play 11. Celebrate! **Picture of Final BP Setup** https://d26ilriwvtzlb.cloudfront.net/f/fc/Blueprint2.jpg
Some pictures of my development process
Here I am testing my slope detection algorithm