Using Parse SDK with Unity – running on an Android Device

unityandroid

If you are using Parse for your back-end server in a Unity app, and you want to deploy the app to Android, you may run into some issues with the built-in Parse plugin. Specifically (at least in my case with Unity 4.6 and Android KitKat) the Parse query object doesn’t ever return a result.

As a work-around I ended up going with a solution using Unity’s WWW class and the Parse REST API.

 

 

 


private IEnumerator GetParseDataForAndroid () {

	//new WWW object
	WWWForm form = new WWWForm();


	//set headers, not sure why but I had to set twice to get it to work
	Hashtable headers = form.headers.AddAuthorizationHeader("Your-Parse-Application-Id", "javascript-key=Your-Parse-REST-API-Key");

	headers.Add("X-Parse-Application-Id","Your-Parse-Application-Id");
	headers.Add("X-Parse-REST-API-Keyd","Your-Parse-REST-API-Key");

	WWW parseRequest = new WWW("https://Your-Parse-Application-Id:javascript-key=Your-Parse-REST-API-Key@api.parse.com/1/classes/yourObject", null, headers);


		//yield until request is done
		yield return parseRequest;


		//request is done, process results
		Debug.Log (" MergeVRBridge parse query eror result is " + parseRequest.error);


		//using simplejson
		var V = JSON.Parse (parseRequest.text);

		JSONArray results = V ["results"].AsArray;

		for (int i=0; i<results.Count; i++) {

			JSONClass jObject = results[i].AsObject;
			
			//do something interesting with results
			string sTitle = jObject["title"];
			Debug.Log(" yourObject " + sTitle);

			
			
		}




}


Using SourceTree on the Mac with github

Screen Shot 2015-02-19 at 4.40.17 PM

I’m using github for a large project with multiple developers – there have been a few wrinkles using the github mac client so we switched to SourceTree – a free github client. We’re using it to implement gitflow – I’ve been very happy with it so far – below is our process…

<>

Before you start a new feature

  • make sure you have the latest copy of the dev branch (do a fetch on remote, then pull if dev branch shows any changes)
  • use gitflow command ‘new feature’ and name it
  • make your changes to code
  • stage files, then commit and push all changes to your feature branch
  • before finishing feature (merging with development) – use fetch to check status of development branch,
    • if there have been commits by other members of the team since you downloaded the development branch you will need to merge those changes to your feature branch before finishing the feature
      • checkout the development branch, then pull it to get current
      • re-checkout your new feature branch
      • use gitflow ‘finish current’ (set to ‘delete branch’ and ‘force delete’)
      • merge conflict message, go to working copy, right click resolve conflicts – launch external merge tool, choose resolution, file save merge, quit merge tool (do not quit merge tool until you’re done with all merges
      • commit and push merge results
      • now push the new dev branch
    • if there are no merge issues then just push the new dev branch up to the remote origin
  • push develop changes up to remote (if not done already)
  • check github site to confirm your changes are present (just until you are comfortable with this process)

New iOS social game ‘Just Picture It’ launched in the App Store

Image

The social image sharing game that we developed in partnership with Mason Software Company has just been launched in the Apple App Store – it is called Just Picture It.

The iOS game uses Parse.com and Amazon AWS as the primary back-end components for storing data and sharing images.

It is free and quite a bit of fun to play with friends – please download and give it a try…

Initial Impressions of Unity3D

After evaluating 3d engines for iOS development I’ve decided we’re going to go with Unity3D.

I would prefer a native Objective-C engine but the ability to deliver for multiple platforms is very attractive (Unity can deploy to Android, iOS, Mac, Linux, XBox 360, and the Wii).

Unity development so far has been straight forward – scripts can be in c# or javascript – I’ve created several 3d scenes, used the extensive resources from the forum and Unity Answers to create a ship that uses realistic physics to move in orbit. The Unity Asset store has thousands of additional resources for Unity3D dev. Initially I’m using atmospheric planets and vectrosity for line drawing.

Unity3d scene

We play tested the game as turn based and real time multi-player – I was initially planning on a turn based approach using Apple’s Game Center for iOS but the game plays much better in real time. We evaluated several multi-player network solutions and are going to go with Photon Cloud  – very well integrated with Unity, a great price, and should be able to scale.

3D engines for iOS Development

I’m evaluating several different 3d engines for our planned iOS space combat game Torchships.

I found good overviews at Never Read Passively, Open Source iPhone game engine comparison, and The Commercial iPhone Game Engine Comparison (3D and 2D).

This week I’m digging more into Unity and cocos3d to get a better understanding of the pros and cons. Unity looks very nice but I’m not sure I want to go with a non-iOS-native solution.

Here is the list of 3D engines I’ve looked at so far…

<>

UDK – Unreal Development Kit for iOS – PC & iOS

The same toolset used to make Gears of War and Infinity Blade.

+ Beautiful graphics

+ Industry Standard, high performance

+ Completely integrated development system

– Development on PC only

– proprietary scripting

Unity 3D – web, flash, iOS, Android, PC & Mac, Wii, PS3, xBox 360

Very popular 3d engine that supports a large number of platforms.

+Large developer base and very active community

+Very nice 3d Graphics, physics, and particle effects.

+Integrated editor and asset pipeline

+Largest number of platforms available

+Javascript or C#

+Mac native development

-Not a native iOS app, all new iOS features may not be available right away

Marmalade

Engine to create of richer apps and games on iOS, Android and other platforms.

+based on c++

-based on c++ 🙂

Shiva3d

3D game engine with a graphical editor to create applications and games for Windows, MacOS, Linux, iPhone, iPad, Android, BlackBerry QNX, WebOS, Marmalade and Wii

SIO2

An OpenGLES based cross-platform 2D and 3D game engine for iOS, Android, MacOS and Windows

cocos3d

An extension to cocos2d. A sophisticated 3D application development framework for the iOS platform.

+open source

+based on and can integrate with the very powerful and popular cocos2d library

+native iOS

ISGL 3D

iSGL3D (iOS Scene Graph Library) is a 3D framework for the iPhone, iPad and iPod touch written in Objective-C, enabling the creativity of developers to flourish in a 3D world without the complexities of OpenGL.

+based on OpenGL

+iOS native

-author is not actively supporting, looking for new contributors

iOS Game – Torchships

One of the very nice new features of iOS 5 from Apple is that GameCenter will handle all of the mechanics and hosting for multiplayer turn based games. This creates an opportunity to build a very feature-rich multiplayer game without a lot of infrastructure costs.

Accordingly we’re going to design and develop a 3d turn based space combat game for the iPhone and iPad with realistic physics. The game will be ad-supported and free to download and play. We will release rapid iterations and add features as we go….

  • Using iSGL3D for the 3d graphics.
  • 4 gameplay modes – tutorial/training, hotseat (same device), peer to peer (wifi/bluetooth via gamekit), game center hosted
  • Realistic Newtonian physics.
  • Weapons include – gamma ray lasers, missiles, and kinetic launchers.
  • Terrain – terran planets, moons, asteroid fields, ring systems, dust and debris clouds.

Working title for the game is Torchships.

If you’re interested in following our progress follow this blog (see the right hand pane of this page to sign up)

If you’d like to help beta-test Torchships then please sign up at our TestFlight page – you will need an iPad, iPhone, or next generation iTouch to participate.