Background Processes and checking with a server

I have worked on and have completed many basic and some more complex games, and I’m ready to move on to more complicated ones. I have started to work on an online tycoon-like game for android. I could learn to use another 2d game engine, but i am familiar with unity and I prefer it. My question is, is there really a way to run processes(such as upgrading buildings/items/etc) in the background, and send and receive data to and from servers? I would really appreciate any basic guidance, if it is possible with unity. Thanks

Look into web services and JSON with HTTP.

Is there any way you know to implement it into unity?

How big a concern is cheating/hacking?

You could probably get away with php+mysql and use timestamps to dictate when something is finished. Even EA used php in an html5 “quote"MMO"unquote” game.

Look into the www class for JSON and google for Unity3D web services

A quote within a quote within a quote :slight_smile:

I don’t think hacking/cheating will be a problem - some kind of encryption algorithm should solve the majority of problems.

Thank you for the suggestions, I will look unto using www with mysql and php. Any ideas for checking the server in the background(for providing notifications)

Actually, check out Telerik & Kendo UI - .NET Components Suites & JavaScript UI Libraries

They have a .NET SDK which you should be able to use from Unity, otherwise it’s just a REST API which should be pretty easy to implement.
It provides a lot of services you probably don’t need, but I’m currently looking at using it for some other mobile projects so I don’t see why it wouldn’t work for Unity - much better than trying to roll your own backend IMO.

Push notifications can be sent from platform to specific devices - or everyone. You could also set up the app to poll the server (ie: query every couple of minutes)

Well it was advertised as an MMO, but what it really had was a leaderboard and messaging system and really exaggerated the technical definition of MMO. It used ajax and php and polled every second or twice a second, while the client ran independently and updated when it got info.

To OP, for development you can use almost any web server…I use bluehost, for production you’ll need something more reliable.

With the timestamp, all I mean is when you place a building that takes time to build, you take the current time and add 10 minutes, or however long the build time is, then in the client check whether the current time is greater than the wait time, if it is, then building is complete. It’s really very simple, and you could just maintain a list of timestamps that you check the status of once per second or so…you could even do it locally on the devices and simply update the users online database periodically.

edit:: You still need the WWW class regardless, so check it out. Check out this script for an example of posting to a database: http://wiki.unity3d.com/index.php?title=Server_Side_Highscores

I looked around, and any suggestions on a good method/plugin for sending notifications to the device from the server when the app isn’t running?

Either queue the notifications on the server and wait for a device to retrieve them, or push notifications to the device.