With the upload of the .apk file, I consider this project “done”. (It’s not actually done, I’d like to expand it, but whatever.) Here’s some of my thoughts on the process of building the thing:
Bake EVERYTHING
Mobile phones are limited in their processing power. Realtime lights look awesome, but will bring a mobile phone to its knees. Just say no. But…
Don’t forget to factor in build times
“Hmm, I don’t like the way the lightmaps look. I know, I’ll just kick off a final compile and go to bed.” 27 hours later…
Not good for estimating release dates.
On a related note…
Do learn how to use your darn tools
I had the lightmap settings cranked up way too high for no good reason. Some tweaking brought the build down to a much more manageable 30 minutes or so.
Lots of different materials == rendering state changes == bad
One of the main problems with the game is that it lags terribly because of a high number of state changes and a high number of vertices. Even static batching didn’t help much. The problem is that 1) I’m using Unity’s built-in shaders and 2) I assigned multiple materials per mesh to make things like windows…and I made a ton of windows. In the future I’ll experiment with my own shaders and using some textures and/or vertex colors to pull off different colored materials. On a similar note…
Using vertex displacement for undistortion looks interesting
I’m referring to Brian Kehrer’s excellent talk on achieving smooth VR performance on older devices. The gist of it is to use the vertex shader to correct for lens distortion by moving vertices around, instead of by using a more expensive render texture or postprocessing shader. I really wanted to implement this but did not have time. (As a side note, this is why some objects, like the bed, have way too many vertices–denser meshes is a requirement for this technique, but I went overboard, also contributing to the performance issue.)
And finally…
Gamedev is hard work
I mean, this should be obvious, but the project reaffirmed my belief. The 2-5 minutes of gameplay, relatively unpolished and still a bit buggy (I’ll let my kind readers discover the bugs–yay using users as beta testers!), took over a week to produce. A large game title with hours and hours of content, lots of high quality textures, beautiful graphical effects, a custom soundtrack, animated models, etc etc etc, quickly becomes prohibitive for one person to produce. But it was still fun, and I’m up for another project in the future! Stay tuned.