Total Eclipse

Game Development & Consulting

From our blog

Unity Port for A Clockwork Brain – DevLog #8

DevLog Header 8 SmallWeek 10/11-16/11

Well, another week has flown by, and boy, have we been busy! You might have noticed a slight delay in the releases of our dev logs. Work has piled up, to the detriment of the log’s punctuality. But here we are! 🙂

Last week, we worked a lot on the Leaderboards and Achievements side of the game. We included both Amazon Game Circle and Google Play Services; they both have official plugins for Unity so the integration was not very difficult. We also created abstractions in our custom Framework, so now we can just say:

 public void OpenAchievements() {
    SW.Achievements.PresentAchievementsOnScreen();
 }

We don’t specify any specific provider (Amazon/iOS/Google Play), our Framework handles the rest.

Another task that we finished this week was the setup of the Daily Rewards panel. This panel awards the Player with an increasing number of Tokens for every consecutive day she logs in the game.

We also solved our problems with Flurry – it turns out that the culprit was none other than the android manifest file and our sloppy copy/paste. Prime 31’s plugin overrides Unity’s default native activity, and for the plugin to work, it should be the only native activity authority in the android manifest file. For example:

<activity android:name="com.prime31.UnityPlayerNativeActivity" android:label="@string/app_name" android:screenOrientation="sensorPortrait">
 <intent-filter>
 <action android:name="android.intent.action.MAIN" />
 <category android:name="android.intent.category.LAUNCHER" />
 <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
 </intent-filter>
 <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
 <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
 </activity>

Our mistake was that we had also forgotten to erase the default Unity activity:

 <activity android:label="@string/app_name" android:name="com.unity3d.player.UnityPlayerActivity" android:screenOrientation="sensorPortrait" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
 <intent-filter>
 <action android:name="android.intent.action.MAIN" />
 <category android:name="android.intent.category.LAUNCHER" />
 </intent-filter>
 <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
 <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
 </activity>

So remember, only ONE can handle UnityPlayerActivity. Sort of like Highlander, really.

As we’re nearing the end of the porting project, our QA process is becoming more and more rigorous. Each time we do QA, we try to follow each platform’s Core testing guidelines:

We have an Excel file where we tick off the passed tests for each build target. That helps a lot.

So that’s all for last week, thanks for reading!

Maria

1 comment

  1. Once again, an excellent post. I didn’t know there were official QA guidelines, at least not before 3y when I was developing for Android.
    Thank you for sharing the experience with the manifest. That might be useful in the future! 😛

Leave a Reply

Your email address will not be published. Required fields are marked *