Optimizations and Android APKs

Please note that the new shaders unintentionally use real-time shadows, and trees are missing due to upcoming new environments.

While this build features no new gameplay elements, I have managed to increase the frame rate by 15-20% and cut the file size down by half (by two-thirds for the webplayer, even). Now that’s progress!

To achieve this, I upgraded my terrain system to the newest version, Terrain 4 Mobile Black Edition. This has some great new features that I can use, such as billboards for grass and small plants to detail scenes, as well as better editor controls. I’m currently using the demo version of the system to compare and benchmark. The demo has a bug in the shader I want to use, so in this build and frame rate benchmark I’m using a more complex shader than I need to. Obviously I’ll be grabbing the full version for the next build to increase performance even more!

Another optimization I did was removing all unnecessary assets from my assets directory. Over time I’ve accumulated some really great systems, models, and textures. Unfortunately, whenever Unity switches build platforms–from Android to the Web Player, for instance–it re-imports them (to optimize for the platform). Before cleaning it would take me over two hours to build a Web Player demo for you guys and switch back into Android development. Now it takes 15 minutes.

I also found out how to turn on anisotropic¬†filtering on floor textures to make them much more sharp. It adds extra calculations to their rendering, however, which reduces the frame rate by about 5%. In the end, I’m not sure if I like the effect because it brings clarity to all parts of the screen, which makes the overall world appear more empty. The new terrain system’s billboard system will help me fill those areas up with objects that are cheap to render, so it’s kind of a toss-up.¬†Let me know if you notice the emptiness effect, and if you like the sharper textures overall.

Lastly, I’m going to be including compiled Android installation files in every demo from here on out. You’ll find the download link on the Web Player demo. At this point I know few people will actually take the time to install the demos to their device, but hopefully this will change :-)

This entry was posted in Townsend. Post a comment or leave a trackback: Trackback URL.

6 Comments

  1. Smacky
    Posted August 6, 2012 at 7:26 am | Permalink

    Looks nice, BUT double clicks don’t seem to register (I don’t think I am just too slow) so when I try to plant I just go into walk mode twice. I’m guessing planting is fairly critical to gameplay so consequently I don’t achieve much.

    PS, since when could you program? :)

    • Brent Grossman
      Posted August 8, 2012 at 8:21 pm | Permalink

      Hehe, about since I left Daimonin actually. Took a few classes as a freshman, and it was easy from there on!

      But yea, the double click interaction is troubling. On the phone it’s fine because it takes a quarter second to start moving (which is itself annoying to me, because it makes interaction a little laggy. You don’t notice it after a while, though). However, on a computer the move command is instant, and thus the second click is moved off of the original click point. It shouldn’t be impossible to double-click, though; I think what may be happening to you is you aren’t trying to plant in a plantable square. Try planting up by the glittering particles (next to a house). This confusion will be fixed by removing the grid indicator when navigating to un-plantable areas, and instead using a navigation target indicator.

      There are alternative implementations to the double click problem. You can take the first click as the target and just check for a second click in reference to the screen coordinates (as opposed to the world coordinates, which is what I’m doing now). This works well, except for when a user is trying to navigate to a precise area (such as off in the distance). Also, where should the player actually move to? The last touch point or the first?

      Another idea I am thinking of testing is having the camera be a little more elastic. Instead of immediately moving with the character, maybe have it ease in a bit more. That may offset the double-click problem quite well.

  2. Smacky
    Posted August 10, 2012 at 9:58 am | Permalink

    A further alternative: have a keyb shortcut for plant (P seems good).

    Really I think *everything* should have a keyb shortcut, even down to cursor keys/keypad for movement. Yes, mouse is more precise (for movement) — so the dblclick does need fixing. But keyb is a failsafe.

    • Brent Grossman
      Posted August 10, 2012 at 12:06 pm | Permalink

      Well, for a PC based game definitely! But atm the target is exclusively Android and iOS. At the very least once I release on Android and iOS, porting to PC will be very easy if I choose to–and then I would take advantage of the PC’s rather superior input (which, at that point, would be much easier to do than the other way around).

      A thing that is interesting is that the interaction with the game will be largely gesture based. I’m trying to take advantage of the touchscreen instead of just using it like a glorified, inaccurate mouse. For instance, while you’re watering something, you could perform a swirly motion on the screen to increase your yield. Say, if you perform it right, you’ll end up watering three patches in front of you instead of just the one. I’m aiming to add this sort of effect to all gathering processes (planting, watering, harvesting, casting a fishing line, attracting fish, reeling them in, etc).

      As long as the gesture interactions are intuitive, don’t break the immersive experience (by cutting into a minigame or something), and are optional (don’t like gestures? you don’t need to use them), I believe that this kind of interaction scheme will actually make the game fun give playing on a touchscreen a purpose.

      So far, people seem to respond to games that do this (look at Temple Run, Fruit Ninja, Cut the Rope. Think they would have the same success with a mouse?). It would also make the game appear more fast-paced and interactive, which I think is a big problem that has plagued RPGs on touch devices.

      What do you think?

  3. Smacky
    Posted August 10, 2012 at 12:16 pm | Permalink

    Yes, agree 100%.

    Now mouse gestures I just can’t do at all (at least not with any decent chance of doing the one I am trying to do), but touchscreen gestures are a different matter (but even so, as you say, they should be optional).

    • Brent Grossman
      Posted August 10, 2012 at 12:41 pm | Permalink

      Glad you agree! :-) It makes me feel like I’m on to something here.

      Next update coming soon (aiming for a day or two). Doing some pretty big things with this one!

Post a Comment

Your email is never published, nor shared. Entering your website is optional, but good for networking!

*
*

Available HTML
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>