Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question Possible External Web Interface?

Discussion in 'Game Design' started by Autumn_Leaf_Technologies, Sep 25, 2022.

  1. Autumn_Leaf_Technologies

    Autumn_Leaf_Technologies

    Joined:
    Apr 5, 2021
    Posts:
    3
    I am a relatively new Unity Developer only having been here for a year or so, however in that time I have learned the engine and a lot of its capabilities. I was wondering though if any more experienced developers could potentially answer this question. I am working on a game called PDEP where you play as the Police or Fire Department in a fictional city named Emirs Port. I have wanted to make the game multiplayer for a while now but simply the way I have my game set up multiplayer would not work. So I had another Idea. I was going to make a website and web interface that would allow players to use it as a CAD system and then when something happens in game for them they can enter it to the CAD and it would then spawn in on everyone else's game. Not in a multiplayer server just as separate single player instances. I doubt this is possible being able to remotely trigger in game events from a 3rd Party web site, but if it is could someone please let me know, and also maybe give me an idea on how to go about doing this. Thank you in advance!
     
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    14,959
    If it doesn't have to be real-time then yes, it's definitely possible. It's a pretty big task, though, almost of the "if you have to ask, you're not ready" variety. But here goes.

    1. You need to be able to store scenario data from your game to a file. For security reasons, you want a text-based format rather than a binary format, so look at JSON and XML. Note that you need to be able to save this at runtime, not just from the Unity Editor, which means giving your built game some way to identify what to save.
    2. Your game needs to be able to load and run that saved data. People may try to upload junk and otherwise compromise the integrity of your system, so you should first validate the data before running it.
    3. Once you can round-trip that data, you need to be able to store it online. When saving a scenario file, instead of storing it locally it needs to be sent to an online service which stores it and adds it to a list or catalogue.
    4. Finally, your game needs a way to check if there's stuff in that catalogue, and allow players to download and use it. This could be a periodic check, or done on startup, or a menu in the game, or whatever you want.

    For steps 3 and 4, don't write the service yourself. Security on the internet is a significant concern, even when you think it's not. Even if people aren't interested in hacking your game itself, they could use it to access other things. For example, if player accounts require passwords then some players will almost certainly re-use the same password they use with their bank. So use an established, reputable service, and make sure you read their instructions about how to do things properly and understand any limitations. You'll still have to do the game-specific parts, but account management, user validation, etc. should be ready to go, along with tools for general data storage and the like.
     
  3. Autumn_Leaf_Technologies

    Autumn_Leaf_Technologies

    Joined:
    Apr 5, 2021
    Posts:
    3
    Ok. I will look into this a bit more, I am not sure if I am ready for a task like this but it is worth a shot. Thanks for the help. I will let you know how it goes.
     
    angrypenguin likes this.
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    14,959
    It can't hurt to give it a go. Everyone starts somewhere. Just know your limitations, and be willing to treat it as a learning experience.
     
  5. Autumn_Leaf_Technologies

    Autumn_Leaf_Technologies

    Joined:
    Apr 5, 2021
    Posts:
    3
    Yes I defiantly will.