I was thinking about making a multiplayer web game, but i can't find the proper way to do that. I can't even find a solution because i don't know what to search. The game will be like button based. For example, there is a button and when i pressed it player will go on a mission which is just waiting, not like moving around with other players or anything else. Or we search for a player name and press the button we will just see the simulated war which is already calculated in the server. I know a bit about Unet, but i always see it when there is a realtime game like shooter, race etc. It is clear that i want a Unity front end for this. The problem is what should i do with the server side. Is UNET a good choice for this or what should i use ? I don't have knowledge about these kind of stuff. Sorry if it has been answered before, i could not find the words to describe this and couldn't search. Thanks in advance for your answers and time.
You may want to take a look at this list of many solutions: https://forum.unity.com/threads/wha...of-available-network-solutions-assets.609088/
This is a nice thread, but for someone like me, this is like staring at a scribbled paper. I don't even know how these pros and cons will help me to find the way.
I see. I guess the only way is to check the documentation of a few solutions, experiment with them and find the one you are more comfortable with. For example in the SmartFoxServer documentation we provide a lot of examples starting from the basics (how to connect to the server) up to complex realtime games.
Thanks for the advise, but i don't think i need a realtime server solution. I have been searching about this. I think what i need is an API to communiate with database according to data that i got from the client. My problem wasn't to find the server solutions, i was to find what is required for that kind of a system. I would be happy if someone has knowledge about this can give some information.
It sounds like UNet is probably overkill for you. If you're familiar with php and mysql you could write some REST type scripts and use UnityWebRequest to query them.
It is as secure as the security you implement. PHP is just a web server programming language, and web sites aren't inherently secure. Web sites have to be programmed with security in mind.
But the problem is , i won't really have a website. It would just be UnityWebgl game. In this case, what should i do to deal with security issues ?
You mentioned things calculated on the server side, so you seem to be thinking of an authoritative server approach. What this means is that you keep the state of the game in a single place (the server side) which also makes decisions about who wins or looses, if certain requests are valid for a certain player etc... With this approach you need server side logic, implemented in whatever language you're comfortable with. PHP could work, for example. The only reservation I would have on PHP is that it essentially works via HTTP which is a slow protocol for games. If the game is not real-time and you don't expect 1000s of players, you might be fine using PHP. Otherwise I would take a look at a real server-authoritative solution such as SmartFoxServer.
Since i am not really familiar with these kind of things i want to ask that (It can be a wrong question) how these things are working ? For example, let say i wrote a code for a button that will use coin according to a calculation of 2x. Do i write this code on php i meant, if i write the code, will it look like this: client button > php (where 2x calculation happens) > db > php > client. Will it be the php where calculations happen ?
Yes that's correct. Client sends input to server, server validates and processes input, server sends update to client(s).
Thanks a lot. Do you know is there a security problem with this system ? There probably is. How to deal with them ? I wish we could have a world without hacking.
Well, not necessarily but you should always be aware of potential security issues when developing the server side portion of your game. The question about how to deal with them depends on the specific issue, so it's pretty hard to generalize. Hackers could be targeting your client app, the server side logic, or even the lower level components of the server (such as an old PHP or Apache version, or even the OS itself). Unless you're developing the next PUBG I don't think you need to be too paranoid too soon and instead start with basic anti-cheat measures, such as validating player's requests correctly.