unity pro tips

Lately we really ran into the problem that we could not modify the scene without lag, starting a game in the editor took about 40 secs and saving almost the same time.

What we did and found out:

  • First, this may seem trivial, but it’s really the poly count in the meshes. We reduced many meshes for the landscape to about half of the count they had before. Trick here was not doing better meshes, but since our meshes are like 300mx300m, we used decimation algorithms (ZBRush, 3dCoat). What’s really good is the reducer brush in 3d coat (beta tools) that allows you to reduce unseen spots of the mesh. So i.e. we have a mesh that is exported with 50k polygons and then reduced again to 20k by using the reducer brush. Still, this is a lot faster than doing it by hand.
  • Second, the drawcalls: it’s not only about the polygons that the meshes have, but also how many times they are drawn. We found that we had a mirror script on the oases, that naturally has to render the scene again to create the reflections. But if that is done at great distances, too, you have like 10 oases in range and your scene is rendererd 10 times more often. So we created a script that turns that only on when the player is in a radius of 20m or so.
  • third, and this is the most awkward thing we found out: If you try to rotate a 30k mesh which simply lies in the scene under the scene root, that’s no problem at all. If you parent it unter, say 3 empties, it gets so laggy that you can’t use the transform gyro anymore! So the really stupid solution is to keep ALL hierarchies as simple as you can. Every layer in the hierarchy seems to make unity calculate all the transforms again for the parent (which kinda makes sense, but the extreme lag doesn’t)

So now that we found all that out the scene is usable again and building the world of caravan is fun again. How much fun can games be if making them is a pain?

Advertisements
Dieser Beitrag wurde unter Caravan veröffentlicht. Setze ein Lesezeichen auf den Permalink.

Eine Antwort zu unity pro tips

  1. Pingback: unity: hunting for performance (again) | Spielebaustelle.wordpress.com

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s