2D Dynamic Mesh Generation


(The tool isn't this laggy, my recording software sucks)

2D Dynamic Mesh Generation

This is a tool I wrote, to mimic how Ubisoft do their 2D mesh generation in the Ubiart Engine. I was pretty blown away with that engine and have always had the urge to recreate it.

What can it do?

This tool allows the designer to customize the terrain by simply modifying a spline, It works exactly how you expect a spline to work, you can add nodes delete them and change the angle with the 2 arms on each node. The tool has multiple layers that is completely editable by the designer, the top layer randomly selects different assets from a collection, and generates meshes across the entire body. This process uses one drawcall because I've got the meshes pulling from a single texture sheet. It also has corner pieces, which are automatically generated. These allow the user to create ledges or cliff-faces and the ledge pieces pulls from a unique asset (Not from the pool of assets used on the top layer). The sides also pull from a collection of side pieces, and the middle is a single texture looped, I do this because I figured it would be quite unoticable if I added variance to the middle.

How did I do it?

The system utilizes a ribbon system I made earlier (Can be found here), It works by taking a path and generating a bunch of meshes in a ribbon. The mesh separation size is completely editable depending on your needs, but this allows for optimized scenes, longer levels and more variance in textures. For the Splines, It uses a system I wrote for cameras (Can be found here). The sides and body are just extensions on the previous systems.

If you'd like to know more, or see some source code, feel free to message me or comment bellow!