- Home /
What do I need to implement web-server for multiplayer without Unity services?
Assuming i have a PHP or java backed server, how do i have it sync everything and be able to handle the multiplayer without using unet or other paid service, I know it sounds very challenging, but, if there is a guide or tutorial, I am willing to do it, I just need to be pointed in the right direction.
Thank You
Answer by bobisgod234 · Jul 10, 2017 at 04:44 AM
You can use raw TCP/UDP sockets from Unity, allowing you to connect to other arbitrary applications regardless of what language they were made with (as long as those languages also support TCP/UDP sockets). You can use this to create your own networked multiplayer system, but keep in mind this is not a trivial task.
There are also WebSockets, which are simpler to work with. I don't know how well they would work when being used to sync a high-speed FPS game, or something like that.
AFAIK, unet is free, except for some optional extras, such as Matchmaking, so I don't see a reason not to use it.
Answer by FlaSh-G · Jul 10, 2017 at 08:49 AM
It's important to not confuse the multiplayer cloud services with the UNet library. Using UNet, you can create a Unity app that will function as a server aside from the usual game client. That server app can run on your physical server instead of a Java backend. This allows you to use the same codebase for server and client; instead of defining your own multiplayer protocol and implementing that in both your Unity project and your Java code.
And - most importantly - UNet is part of the Unity engine. It costs nothing extra or anything, just like GameObjects and Light components. It's just there. People often confuse the UNet networking library with the paid cloud services.
Now, if you want multiplayer in the sense of people seeing other people, forget using PHP, and HTTP in general. You just can't push enough data through HTTP requests without going insane while creating a faulty system. However, if you want multiplayer in the sense of browsergames, a PHP backend might work.
Your answer
Follow this Question
Related Questions
What approach do I need for persistent multiplayer game? 1 Answer
Unity networking tutorial? 6 Answers
Unet: Discern between user disconnection and connection lost 1 Answer
UNet - Connecting and Testing a 'choose your character' scenario 0 Answers
Best way to choose Google Play Realtime Multiplayer Host? 0 Answers