Prepping for Mobile

posted in: Senior Team | 0

Back when we were pitching Ripples initially, we got feedback on how it would be cool to see how a mobile version of the game would work. So during some extra time we put together a mobile build and have been showed it off at testing. The original build had for different control schemes for the player to test out. Overtime, based on feed back, we brought it down to one control scheme where the characters movement mimics your thumbs movement on the screen. Since then we have had a mobile build put together during each milestone to see how well it would run.

The last mobile build we showed off was some time ago. We definitely had to tweak some settings in the game, and turn of special effects for it to run smoothly compared to the PC version. Recently we have been adding more effects to the game, and changing up the art direction. Performance-wise, the mobile version has taken a slight hit. But that was to be expected because performance was not a huge focus during the making of the original prototype.

However, performance is now a focus since we have extra hands working on the project. So I have been working on ways to optimize performance. Looking at the profiler in Unity, the biggest culprit to performance was our vector grid effect. The effect is something we want to keep in the game, as it helps show off the idea that the characters are fighting on water. There are two components that are essential to the vector grid functioning. First there is the vector grid itself, and then there are the vector grid forces that act upon the grid that cause the distortion. We have been making various tweaks on the grid to get the best performance and visual effects.

First we changed the dimensions of the grid itself to lower the number of points it needs to calculate. Second, we culled the number of forces on a ripple to get optimal performance. Before each point on the ripple had a force that would check with the grid. This was fine with smaller sided ripples, such as the diamond and octagon. But with the PI character, we used a full circle, which consisted of 50 points. And there would be multiple circle ripples on the screen at once generated by one character, which cause the ripple force calculations to add up quickly. So I created a function that would cull the number of forces attached to the ripple. So for PI it’s set up so every 5 points there is a ripple force. Another thing that caused some issues was that the ripples themselves got bigger than the vector grid. So there where a lot of unnecessary calls to¬† the forces update function. That was modified so after a certain distance away from the center of the vector grid the forces are shut off, decreasing the number of calls that need to be made.

The final optimization I have been working on is pooling the ripples. We made a mistake waiting too long to get this implemented. I am trying to reuse as much code as I can, but we have to make some modifications to it, mainly to how the special ripples are formed. Currently we have pooling working with the standard ripples that each of the characters make and they work for theta’s special rotating ripples. Delta’s special ripple, where you can adjust the size will also be fairly straight forward in getting to work with the new pooling system. Omega’s however, will be a challenge and require some reworking of it’s code. Which is a shame, since that character just got implemented.

But, hopefully after these optimizations, the mobile build will be doable again.