Search Unity

Unet Or What ?

Discussion in 'UNet' started by BikaYoBadi, Apr 15, 2019.

  1. BikaYoBadi

    BikaYoBadi

    Joined:
    Jan 1, 2016
    Posts:
    50
    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.
     
  2. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    281
  3. BikaYoBadi

    BikaYoBadi

    Joined:
    Jan 1, 2016
    Posts:
    50
  4. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    281
    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.
     
    BikaYoBadi likes this.
  5. BikaYoBadi

    BikaYoBadi

    Joined:
    Jan 1, 2016
    Posts:
    50
    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.
     
  6. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    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.
     
    BikaYoBadi likes this.
  7. BikaYoBadi

    BikaYoBadi

    Joined:
    Jan 1, 2016
    Posts:
    50
    I heard about it. Do you know if it is a secured way or is it too hard to make it secured ?
     
  8. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    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.
     
    MrsPiggy and TwoTen like this.
  9. BikaYoBadi

    BikaYoBadi

    Joined:
    Jan 1, 2016
    Posts:
    50
    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 ?
     
  10. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    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.
     
    BikaYoBadi likes this.
  11. BikaYoBadi

    BikaYoBadi

    Joined:
    Jan 1, 2016
    Posts:
    50
    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 ?
     
  12. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    Yes that's correct.
    Client sends input to server, server validates and processes input, server sends update to client(s).
     
    BikaYoBadi likes this.
  13. BikaYoBadi

    BikaYoBadi

    Joined:
    Jan 1, 2016
    Posts:
    50
    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. :)
     
  14. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    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.
     
    BikaYoBadi likes this.