Porting Neon Battleground

Porting Neon Battleground to Unity 5

Progress:
1. Photon update – Done
2. Removing old libs – Done

At this time I have .zip archive containing working Unity 5 game. Problem is that Photon is outdated and third party libraries are disabled thanks to Andriy (original developer) since otherwise Unity 4 to Unity 5 conversion won’t work. Goal for this mini project is to:

1. Update photon libs for Unity 5 since current version will generate some strange errors in Xcode. Also it is good idea to have up-to-date libraries for many reasons. Main one is that I will maintain this game and add additional photon and game-play features so we might as well have updated project.
2. Make sure photon settings are ok, that is photon ID, RPC calls and that “SpecialName” in the source files.
3. Fix in-and-out bug that blocks the game after 14 attempts to enter the level.
4. Add code for different player colour under photon-online env.
5. Install in-app purchase libraries.
6. Install Unity-AD libraries.
7. If needed install iTunes-GameCenter and GoogleGameCenter Libraries and connect everything.
8. Update all art and branding.

Environment:
1. OSX v 10.11.6 El Capitan
2. Unity 5 (v5.4.0f3)

Step 1
Decompress Neon_Android_U5.zip
Update Unity to v5.4.0f3
Import new Photon assert from asset store
Delete /Assets/Plugins/wp8
Edit Assets/Photon Unity Networking/Plugins/PhotonNetwork/PingCloudRegions.cs
And comment: Console.WriteLine(e);
Replace all [RPC] with [PunRPC] in the project
Edit Assets/Scripts/RoomManager.cs
Replace PhotonNetwork.CreateRoom(null, true, true, 6);
With RoomOptions roomOptions = new RoomOptions() { isVisible = true, maxPlayers = 6, IsOpen=true }; PhotonNetwork.CreateRoom(null, roomOptions, TypedLobby.Default);
Comment in PhotonEditor.cs since Unity will try to setup windows plugins and OSX Unity Editor does not like this?!
// AssetDatabase.ImportPackage(win8Package, false);
Since we are building for iOS, don’t forget to switch to iOS.
Turn on Auto-Join Lobby in Photon Unity Editor (PhotonServerSettings)
Next step is to remove references to old third-party-libraries for iOS.

Open StoreManager.cs
Comment out:
#if UNITY_IPHONE

 [ DllImport (“__Internal”)]

 private static extern void _init();

 [ DllImport (“__Internal”)]

 private static extern void _parseTrackEvent(string eventId);

 [ DllImport (“__Internal”)]

 private static extern void _parseTrackEventWithDimensions(string eventId, string key, string value);

 [ DllImport (“__Internal”)]

 private static extern void _showFullscreenAd();

 [ DllImport (“__Internal”)]

 private static extern void _showChartboostAnyway();

 [ DllImport (“__Internal”)]

 private static extern void _showMoreGames();

 [ DllImport (“__Internal”)]

 private static extern void _checkVideoAd();

 [ DllImport (“__Internal”)]

 private static extern void _showAdColonyAd();

 [ DllImport (“__Internal”)]

 private static extern void _sendMail();

 [ DllImport (“__Internal”)]

 private static extern void _Buy(string itemid, string myobject, string callback);

 [ DllImport (“__Internal”)]

 private static extern void _checkPromoCode(string promocode);

 #endif

Now go thru code and comment out all references for _init(); _parseTrackEvent(string eventId); …. etc…
Just a side note. If you user replace function in Mono to add comments to _buy keep in ming there is a few buttons named *_buy*.

At this time i should be able to compile the project in XCode and run it on the iPhone…. And it runs! Woohoo.. Lets move forward..

Now make sure you have proper Photon AppId in place, setup RPC List in PhotonServerSettings and change PhotonNetwork.ConnectUsingSettings(“*****”); Finally check Log HashCode and make sure you have the same number with older version.

Add your comment

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