Search Unity

Tanks Multiplayer - complete networking project (Netcode, Photon)

Discussion in 'Assets and Asset Store' started by Baroni, Jun 11, 2016.

?

Which networking solution would you like to use with this asset?

  1. Unity Networking

    136 vote(s)
    51.5%
  2. Photon Networking

    98 vote(s)
    37.1%
  3. Other

    30 vote(s)
    11.4%
  1. strogow

    strogow

    Joined:
    Jan 22, 2019
    Posts:
    1
    Hi, and how to make the camera rotate around the tank ?
     
  2. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    @strogow Please register on our dedicated website forum for asset support. Make sure to specify your question a bit more.
     
  3. airop

    airop

    Joined:
    Sep 4, 2012
    Posts:
    34
    Hi, is it please possible to add a friend list to this demo?
     
  4. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @airop, if you plan on using Photon, I would recommend using their Friends feature. It depends on what your exact recommendations are, but you could save the friends IDs locally and use them for matchmaking, for example. The implementation depends on your programming knowledge of course.
     
  5. chipity

    chipity

    Joined:
    Dec 21, 2016
    Posts:
    7
    I was about to purchase to see how lag compensation was handled but I see it wasn't really, shooting a bullet while moving spawns it way behind your turret at a previous position and other people are constantly freezing and jittering across the screen, also when returning to menu from a game it shows the connection error UI. I guess its more of an asset for first timers at networking, glad you offered a web player version to test though, I'm sure this asset would be helpful to plenty.
     
  6. wrjh29741489

    wrjh29741489

    Joined:
    Nov 10, 2019
    Posts:
    6
    혹시 이 에셋을 상업적용도로 사용해도 되나요?
     
  7. wrjh29741489

    wrjh29741489

    Joined:
    Nov 10, 2019
    Posts:
    6
    Can I use this Asset for commercial use?
     
  8. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Yes. Please see this article and the official Asset Store EULA.
     
  9. wrjh29741489

    wrjh29741489

    Joined:
    Nov 10, 2019
    Posts:
    6
  10. wrjh29741489

    wrjh29741489

    Joined:
    Nov 10, 2019
    Posts:
    6
  11. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
  12. wrjh29741489

    wrjh29741489

    Joined:
    Nov 10, 2019
    Posts:
    6
    I imported the Asset, downloaded the port tones, and performed WIndow- Tank MultiPlayer-Network Setup - Photon Network Setup, but three errors occurred

    Library\PackageCache\com.unity.render-pipelines.lightweight@5.13.0\Editor\ShaderGraph\LightUnlitSubShader.cs(370,47): error CS7036: There is no object given that parameter.

    An error occured wile resolving packages:
    Package com.unity.render-pipelines.lightweight@5.13.0 has invalid stresses:
    Come.unity.render-pipelines.core: Version [5.13.0] is compatible with the selected version [6.9.0]
    Come.Version [5.13.0] is available with the selected version [6.9.0]

    A re-import of the project may be required to fix the issue or a manual modification of G:/4/FD/Packages/manifest.json file.

    So three.

    How do?
     
  13. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
  14. Claudiotheworm

    Claudiotheworm

    Joined:
    Jul 27, 2018
    Posts:
    30
    Hi Rebound Games. Any idea how i would go about adding a jump in the Player script?
     
  15. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @Claudiotheworm, please use our forum for support. We're keeping all topics about bugs, issues and solutions there.
     
  16. redaEL

    redaEL

    Joined:
    Apr 3, 2017
    Posts:
    4
    I'm interested to buy this asset .. but i need to know what happen if my game doesn't have enough online players ... its automatically switch to offline mode ??
     
  17. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    @redaEL Thanks for your interest. There's no "not enough players" in the current networking workflow. If there are no other players (rooms), the player will open a new room to play in. In that room he/she can wait for other players to join.

    An online room does not switch to offline or vice versa automatically. You can select the play mode in the settings menu beforehand which is then used for the connection. If you want to switch between modes on the fly you might want to look into creating an online lobby first and start an offline scene while waiting.
     
  18. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Hi @Baroni do you guys have a discord server? It would be great to add a Discord Server for supporting your products. As it would be easier for the community of users to help each other out as well in real-time. Just a thought. Either way I am looking forward to purchase your Tank Multiplayer Kit soon and begin working on something with it. Thank you for an awesome game kit.
     
  19. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @jonmalave_, real-time support (e.g. on a Discord server) but also via TeamViewer sessions or similar methods is not something we are planning to do, due to the high effort and availablility needed to really make this work. Often very basic questions would be asked back and forth, instead of reading our (already comprehensive) documentation prior to that. Our dedicated support forum allows for self-registration of valid customers and even allows sharing code. This is the place for sharing guides, common knowledge and problems including solutions.
     
    jonkuze likes this.
  20. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    207
    Hi @Baroni ! I cannot seem to find the setting or code that changes the mouse cursor to the crosshair. Could you (or anyone) point me in the correct direction? I've looked through a lot of project settings and searched through the whole visual studio solution and it seems to be eluding me :)
    Thanks!
     
  21. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @toddkc, I do not answer support questions here because the chance is high that they get asked over and over again. Please use the support forum on my website.
     
  22. bboysil

    bboysil

    Joined:
    Jun 1, 2013
    Posts:
    11
    Hi, is this using PUN or PUN2 ?
    Also, I assume everything works with unity 2019.4 LTS. Am I correct?
     
  23. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @bboysil, PUN2 and yes, no issues were reported using Unity 2019.4.
     
  24. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    207
    Can confirm this works great with 2019.4 LTS.
     
  25. bboysil

    bboysil

    Joined:
    Jun 1, 2013
    Posts:
    11
    Can PUN and mirror be used at the same time?
    i.e. run one game over PUN and after the game is finished (even closed) start the next one over mirror?
     
  26. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    207
    Yes, but not without you doing the coding to set that up. And I can't really imagine why you would want to do that?
     
  27. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    I would like to provide a short roadmap regarding network providers in Tanks Multiplayer over the coming months, so you can plan accordingly:

    2021
    - Photon Fusion, the next networking milestone from Exit Games, will be implemented as soon as features and documentation are on par with Photon PUN
    - Unity MLAPI will be implemented when it has undergone several more releases or reached a somewhat stable release including support for relay servers and matchmaking
    - Photon PUN and Mirror are still supported and receive bug fixes

    2022
    - With Unity 2019 LTS going out of support early next year, the asset will be upgraded to Unity 2020 or 2021 LTS
    - At that point, Photon Fusion will replace PUN
    - Unity MLAPI will replace Mirror. Mirror really was just an intermediate solution when UNET was cancelled by Unity. It was good for what it was, but not that great or fun to develop with.
    - As a summary, Photon Fusion and MLAPI will be your options in Tanks Multiplayer going forward. Since the asset is designed to serve as a multiplayer code base and teach different networking approaches, it makes sense to keep it up to date with current networking solutions.
    - Dedicated server builds (instead of client-side hosting) are a popular topic and with both Photon Fusion and Unity MLAPI supporting it, there will be a new "Battle Royale" mode featuring a player lobby, server-generated map and server-managed zone damage.
     
    toddkc likes this.
  28. Flex1ne

    Flex1ne

    Joined:
    Nov 30, 2017
    Posts:
    1
    Hi when I come up to use the step 1 and step 2 when choose using Mirror in Window -> Tank -> your tool , I got compile errors like:
    Code (Boo):
    1. TanksMultiplayer/Scripts/NetworkListServer.cs(6,14): error CS0234: The type or namespace name 'Cloud' does not exist in the namespace 'Mirror' (are you missing an assembly reference?)
    and same error like
    Code (Boo):
    1. Assets/TanksMultiplayer/Scripts/NetworkListServer.cs(15,30): error CS0246: The type or namespace name 'ApiConnector' could not be found (are you missing a using directive or an assembly reference?)
    2.  
    I believe i had imported Mirror from My Asset.

    What can I do now?
     
    Last edited: Aug 4, 2021
  29. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @Flex1ne, what version of Mirror are you using? Basically each version of Mirror has breaking changes so I am not always able to keep it up to date. You can also just delete the NetworkListServer script (if you do not use it), since it is optional.
     
  30. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Tanks Multiplayer now supports Unity MLAPI! For those looking for more samples on how it works, synchronization techniques and documentation, this asset is another starting point.

    v1.6.0
    • added support for Unity MLAPI (0.1.0). The package is still experimental, expect some bugs until moving to a production release. For known issues or currently missing functionality see here
    • reworked network setup to include the full package of each network provider. The base package does not contain scripts until you run the network setup
    • Photon compatibility updated to 2.34 (no changes)
    • Mirror compatibility updated to 42.2.12: the NetworkListServer was removed. An alternative to online matchmaking is now e.g. to use Epic Online Services and their lobbies
    • finally removed support for UNET
    • minimum Unity version: 2020.3.0
     
    Last edited: Aug 22, 2021
    ibyte, toddkc and zyzyx like this.
  31. genify

    genify

    Joined:
    Dec 1, 2018
    Posts:
    1
    Hi Baroni,

    Do you implement anything to improve player/bullet movement smoothly? (Ex: interpolation, prediction,...).
    I need to improve the player's movement more smoothly when synchronizing between clients, so I need to know before I purchase your asset.
     
  32. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @genify, thank you for your interest. The underlying networking libraries do not support interpolation techniques that well - I hope this changes with MLAPI and Photon Fusion in the future, where good progress has been made already.

    The asset comes with a few workarounds instead to compensate for some lag: instead of syncing bullet movement, only the initial position and shot direction is sent to all clients. If the bullet changes directions, the server sends the new direction. The client does the bullet movement part between these positions on its own. Additionally, the initial shot position is calculated using the position where the client currently is (on the client), and where the client actually is on the server (position received). Depending on movement speed this could make a difference of +-1 units.

    It really depends on your requirements and game type what kind of synchronization and sync correctness you need. While I would like to implement more advanced interpolation approaches at some point, for this asset the current approach was sufficient.
     
  33. agogiam_1

    agogiam_1

    Joined:
    Jul 6, 2021
    Posts:
    3
    Hi Baroni @Baroni,

    I am very keen on trying your asset for the purpose of learning. I wish to know if you have a generic NetworkManager that caters to MLAPI, Mirror and Photon? How easy it is to switch from one Net Core API to another? I hope the package contains the full source code.
    Thank you in advance!
     
    Last edited: Aug 26, 2021
  34. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @agogiam_1,

    thank you for your interest. The NetworkManager has the same structure and also almost the same method naming for all network providers. However, each networking solution is different so you cannot simply swap them out. Each script, for each networking package, makes use of the specific networking API it was created for. You can have a look at the API reference (see Docs link in first post) if you are curious.
     
  35. agogiam_1

    agogiam_1

    Joined:
    Jul 6, 2021
    Posts:
    3
    Thank you so much for your prompt response! I have purchased it now. Looking forward to having fun!
     
    Baroni likes this.
  36. zBerde

    zBerde

    Joined:
    May 26, 2021
    Posts:
    3
    Is there a fix for the tanks because you can glitch through corners?
     
  37. Keash

    Keash

    Joined:
    Jun 28, 2017
    Posts:
    2
    @Baroni FYI there is an issue with your support forums.
     

    Attached Files:

  38. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Could you post a screenshot showing the issue? Is this with the default movement speed?

    This website does not exist anymore, I changed domains (see first post, my signature, or Asset Store links). Where did you get it from?
     
  39. Keash

    Keash

    Joined:
    Jun 28, 2017
    Posts:
    2
    Haha - That makes sense then.

    I got it from this thread on a post you suggested another user to go to the forum. (posts 265, 263 etc).

    I just wanted to read through the forum to learn more about the asset.

    I dont require support, but in the case that I do, is this thread to be used for support?
     
  40. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Yes! The other support forum basically was a list of unique user issues, so I removed it (2 weeks ago actually) as it didn't really serve a purpose other than seeing that I am answering them :)
     
  41. zBerde

    zBerde

    Joined:
    May 26, 2021
    Posts:
    3
    I didnt change anything about the movement.
    upload_2021-8-29_16-38-47.png
     
  42. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    @zBerde thanks for the screenshot! I was able to reproduce this, mainly on all colliding corners. There is no fix in the asset for this, but in the Project Settings. Please see this post.

    Doubling the Default Max Depenetration Velocity (to 20) fixed it for me.
     
  43. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    107
    Hi, I know its mentioned as such but just to confirm, this single asset has choice of all multiplayer solutions whether MLAPI or mirror or PUN ?

    And can this be build for browser (I know you provided a example but still confirming), any known issue or limitation ? I have a tank MP project which will be browser focused only with microtransactions so need to confirm this will suit me good
     
  44. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @shubhank008!
    Yes! There is a package included for each of the networking solutions. It is your choice to choose the one you are familiar with.

    My browser build uses Photon PUN. MLAPI currently does not support WebGL and Mirror has some issues here and there with hosting and joining via WebGL too (hosting would not work at all). If you are primarily targeting browsers, I would recommend going with Photon.
     
  45. bashgaming

    bashgaming

    Joined:
    Sep 9, 2021
    Posts:
    1
    Hello, I downloaded this package, but there is no Scenes folder? Where can I find it?
     
  46. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    @bashgaming you have to read the first chapter of the documentation PDF. In there you have to decide which network solution you want to use and then run the Window > Tanks Multiplayer > Network Setup.
     
  47. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    As an alternative to the Unity Asset Store, you can now buy this and my other assets directly on my website. You get:
    • Instant access to updates
    • Access to previous versions
    • Exclusive bundle discounts
    • Special bulk and student discounts, just ask!
     
    toddkc likes this.
  48. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    207
    I'm not in any hurry for this, but just to mention it....I would totally buy an update for this asset with photon fusion. I totally understand if you don't want to do that while it's in beta or whatever state it is now. Just throwin it out there :)

    I learned everything I know about PUN from this. I love these little tanks haha.
     
  49. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Thanks for the feedback! It will come, as a free update ;) At this point there are breaking changes on nearly each Fusion nightly build though, so I would not be able to keep up. Also, documentation was very sparse few months ago, let's hope for a fully working and documented release somewhen next year :cool:
     
    toddkc likes this.
  50. davinder_unity

    davinder_unity

    Joined:
    Sep 17, 2021
    Posts:
    1
    hi!
    I bought tanks multiplayer but i am having issues with starting game!
    Everytime the tdm_Game scene loads, I get this error which says:

    "Disconnecting connId=0 to prevent exploits from an Exception in MessageHandler: ArgumentException The Object you want to instantiate is null."

    and the tank doesn't instantiate!
    I have checked in network manager custom and there is reference present in player prefab.

    Also i am getting this warning which says:

    "NetworkManager - Player Prefab should not be added to Registered Spawnable Prefabs list...removed it."

    Any idea what could be wrong? Any help would be greatly appreciated!
     
    Last edited: Nov 8, 2021