Hi,
I like to create my serverside code with PHP and user web services to talk to it. Knowing very little about the way Unity does its client server operation, is this a practical thing to do?
tomcat
Hi,
I like to create my serverside code with PHP and user web services to talk to it. Knowing very little about the way Unity does its client server operation, is this a practical thing to do?
tomcat
Yupp practical and pretty simple
The WWW and WWWForm classes are best friends of you in this case.
Great. Just had a look at the runtime classes and I think I get it. Can see a perl example but not a php one.
Have you seen any php server side example, so I can figure out what to do at that end?
BTW, does it mean that I can do my own server and not using the unity’s client/server model?
tomcat
do not fully understand, sorry. On PHP its $_POST[“your variable name”] and whatever you send to the page and back
No, WWW / WWWForm is HTTP communication
For realtime games you either have to use unitys networking or integrate a 3rd party solution or work with .NET Sockets
Ok, so for low bandwidth and casual communication WWW is good, but if I have many users (I am going to have about 100), I have to use unity’s networking which is raknet.
Do I have to pay to use raknet? or is there a free version?
tomcat
No not exactly.
The WWW is only usable for web communication or very low frequency turn based games handled by a CGI / PHP end (basically a Unity version of a browser game)
Anything thats more realtime requires unity networking or a 3rd party networking.
The networking integrated into the unity clients can be used for free.
Ok, so I can create a game supporting about 100 users (running unity clients) which can talk to a single server running on a remote site. This wouldn’t cost me anything.
If I want to support more users, then I have to use something else like raknet which would then cost me. Is this right?
tomcat
Yes and no
There is no Unity Server
Only the client which you would use as server if you want to run something like a dedicated server.
That would be free yes.
But you can not run that on a remote website. You need to have a (virtual) dedicated Windows / OSX Server
You can not run realtime game servers on webhosts
(already browser game type server loads are commonly not allowed on webhosts)
Yes, I see. I got to get a co-located server where I can run my own server software or host it at home.
I guess I have to run it on a webplayer and develop my own server using WWW to exchange data between client and the server.
I guess there is no chance of creating a simple world shared between clients as the comms overhead makes it slow to update the world!!
tomcat