Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

[Showcase] lilBig Ninja (bomber man inspired multiplayer game)

Discussion in 'Project Tiny' started by TwoorbJan, Dec 6, 2021.

  1. TwoorbJan

    TwoorbJan

    Joined:
    Mar 6, 2013
    Posts:
    38
    Hi everyone,
    Just wanted to showcase a game built with Tiny (UI is done in HTML/CSS), its a multiplayer game with currently up to 8 players (it can go higher but its not properly tested yet) real players and/or bots.



    Game client is created using Unity Tiny and when we started out we thought that regular updates would be a thing, but no, so it has been a bit of a struggle at time but I am happy with how it turned out. Its currently an alpha version and production is paused for now.

    The avatars are customizable with skins and various accessories. Currently there are 5 types of bombs and 4 powerups.

    Game server (authoritative) uses DOTS and shares a large code base with the client. Game data is hosted in the cloud and fetched as binary then directly copied into memory as components for systems to handle, all aspects of the game is customizable (such as level generation, bombs, powerups, bots).

    Bots will be automatically added after a fixed amount of real players has joined and a varied amount of time has passed.The AI is behavior based and has 3 core brain properties (Greed, Mental Fortitude and Psycho) producing varied "fake players".

    A fully scalable backend runs in the cloud using Kubernetes, game servers are managed using Agones, Open-Match for matchmaking and various support applications for data management / logging. The project as a whole is highly complex and the backend is currently the most advanced piece of technology I've put together so far.
     
  2. dallin_unity

    dallin_unity

    Joined:
    Dec 18, 2019
    Posts:
    40
    great, thanks for sharing
     
  3. Kiwiownage

    Kiwiownage

    Joined:
    Mar 26, 2014
    Posts:
    14
    This is great!

    Would you mind sharing some more on the networking setup? Do you have references or examples to any libraries used? Or is it really mostly handled by Agones?
     
  4. TwoorbJan

    TwoorbJan

    Joined:
    Mar 6, 2013
    Posts:
    38
    So in short:
    • Net code is created by me (so no libraries sorry, there is a DOTSNET on the asset store but I don't think it runs in Tiny)
    • Client uses standard websockets in a JS plugin
    • Server uses websocket-sharp
    • Agones only handles the allocation / management of the servers

    Overview on how a match work
    • Client asks open match for a suitable match (matchmaking based on players and type of match), client can include level and powerup/bomb filter
    • Open match asks Agones for a available server (this is done using backfill so no need to wait for the right amount of players to join before the match can be started, after X time (+extra time when someone new joins) bots can be added to start the match early)
    • Open match sends the server information back to the client so it can connect to the server
    • After the match is done (last player alive) the server is shutdown and Agones prewarms a new server (this could be improved upon if it would reset to a clean state instead and returned as an available server instead, will be added in the future)
     
    GilCat likes this.
  5. Kiwiownage

    Kiwiownage

    Joined:
    Mar 26, 2014
    Posts:
    14
    Absolute saint! Thanks for much for the extra info
     
    TwoorbJan likes this.