Efficient Implementation of Dynamic Snake-Like Body in UE5: Seeking Advice on Optimized Approach

Started by
1 comment, last by cgrant 3 months, 3 weeks ago

Hello!

Platforms: iOS, Android, and PC.

I want to implement a snake body that can dynamically grow in length, narrow, and bend (simulate body movement, similar to bending in an arc).

I'm using UE5, and initially, I used components where each body part was a spline mesh. However, this approach proved to be resource-intensive, resulting in numerous draw calls.

I aim to find a more efficient solution, possibly leveraging vertex shaders. However, I lack the necessary experience and don't know how to approach the decision-making process to find a solution for my idea.

Does anyone know how this can be implemented? Please share your advice!

Advertisement

You probably won't get “anything better than a spline base approach". I put that in quotes because there is going to be tradeoffs in any approach you take. A snake general shape when bending can be approximated closely with splines( piece-wise or complete). You can optimize one more level by approximating the splines with some linear representation. In the end, you will most likely end up with multiple segment/mesh. Another approach you could take is skinning, which is going to require some artistic input to place the ‘bones' in the correct position in order to have a somewhat realistic animation. One question I would ask, if if the issue is resource intensive with numerous draw calls, did you look into ways to minimize those concerns with the current approach ?

This topic is closed to new replies.

Advertisement