3
\$\begingroup\$

I'm working on a top down 2D game in Unity and I want to create levels dynamically. All tutorials I find tend to talk about generating meshes so I've followed some great tutorials such as this one. However, here's where I'm not understanding the point. What's the difference between doing all that work to render a plane when you can just use the Plane object with the height/width configured to match what the manual creation has?

\$\endgroup\$
4
\$\begingroup\$

First of all if you are interested in generating meshes I recommend to you this series of articles in gamasutra about procedural meshes

Modelling by numbers

So returning to the main question, generate planes procedurally allows you to define the distribution of the vertex, for example I use this kind of methods to generate low poly terrains

enter image description here

So if you want to generate surfaces dynamically and you want to create your own tools to generate your levels, I think that procedural generation its the way

cheers!

\$\endgroup\$
  • \$\begingroup\$ Thanks, that's a great link but it seems to show advantages of 3D but I'm working on a 2D game (top-down view) - why should I generate mesh manually than just using a plane (e.g. instantiate a new Plane object) which seems to be the same thing? \$\endgroup\$ – TryNCode May 1 '16 at 21:43
  • \$\begingroup\$ If you are using unity, you have to know that the plane by default is 10X10 Quads, and you cant control that. So if you want to have some control, you need to generate it procedurally. For top-down shooter I recommend to learn about celular algorithm, they are really basic and you can create levels like in Nuclear throne \$\endgroup\$ – Santiago murillo May 1 '16 at 21:57
  • \$\begingroup\$ Thanks Santiago, that's what I was wondering. Unless 10x10 quads are fine, the plane object isn't suitable. What about just using a bunch of quads instead? \$\endgroup\$ – TryNCode May 2 '16 at 10:19
  • \$\begingroup\$ There are lots of problems if you use quads, every quad represents an instance and that is not worth, they are not join and maybe you will have problems with the light. So I encourage you to use procedural generation, it opens you a wide world of possibilities. \$\endgroup\$ – Santiago murillo May 2 '16 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.