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

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.

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.