Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Released] Mars' Modular Multiplayer Photon FPS Kit

Discussion in 'Assets and Asset Store' started by Mars314, Aug 24, 2017.

  1. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    UPDATE: 0.4.1.0 is released on Sellfy and submitted to the Asset Store.
     
    Neviah likes this.
  2. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    That's very nice. The audio for battlechat is hilarious haha.

    anyways, is the data saved for leveling and unlocking? Does it persist through turning off the game and restarting? Is it saved through player prefs?
     
  3. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Yes, it is saved in PlayerPrefs, it is tied to the username you choose in game. Someone made a login/register system for the kit that you can find in our Discord which will soon be integrated into the kit too, so it can be saved online.
     
    Neviah likes this.
  4. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    UPDATE: 0.4.2.0 is released on Sellfy and submitted to the Asset Store.

    It adds a few new cool features:
    • Minimap
    • Mobile Controls
    • Improved Main Menu
    • First Person Hit Reactions
    • Quickplay
    • Password protected rooms
    • Air control (selectable)
     
  5. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    That's a lot of updates. You're going hard on these updates! These are awesome! Keep up the good work man.
     
    Mars314 likes this.
  6. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Thank you.
     
    Neviah likes this.
  7. Tomza

    Tomza

    Joined:
    Aug 27, 2013
    Posts:
    596
    Hi,

    It would be great to have Third Person Shooter instead of FPS? Is it possible with your asset?
     
  8. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    With some work, it would be possible, but it was not designed for a third person shooter, after all, it has FPS in its name and was designed as such.
     
  9. Tomza

    Tomza

    Joined:
    Aug 27, 2013
    Posts:
    596
    Just replace the FPS object with TPS for spawning. Is it difficult?
     
  10. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    There is no "fps object" and no "tps object" as such. The player is completely set up for first-person usage. It was never intended for third person usage and third person is only used for shadows / for other players to see. In your case it's better to get a kit that was designed for third person applications.
     
    Last edited: May 5, 2018
  11. Tomza

    Tomza

    Joined:
    Aug 27, 2013
    Posts:
    596
    Ah, OK, thank you. I see almost all multiplayers are for FPS games. Strange.
     
  12. Vasilkb

    Vasilkb

    Joined:
    Jun 4, 2015
    Posts:
    15
    I have error in Unity2017.1.3
    After exporting the package and change to WebGL i have this error:

    Assets/314 Arts/MarsFPSKit/Plugins/PhotonLoadbalancingApi/LoadBalancingClient.cs(739,22): error CS1061: Type `ExitGames.Client.Photon.LoadBalancing.LoadBalancingClient' does not contain a definition for `Listener' and no extension method `Listener' of type `ExitGames.Client.Photon.LoadBalancing.LoadBalancingClient' could be found. Are you missing an assembly reference?







    Code (CSharp):
    1.  #if UNITY_WEBGL
    2.             if (this.TransportProtocol == ConnectionProtocol.Tcp || this.TransportProtocol == ConnectionProtocol.Udp)
    3.             {
    4.                 this.Listener.DebugReturn(DebugLevel.WARNING, "WebGL requires WebSockets. Switching TransportProtocol to WebSocketSecure.");
    5.                 this.TransportProtocol = ConnectionProtocol.WebSocketSecure;
    6.             }
    7.             #endif
    My protocol is websecure and still get this error.
     
  13. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Hello,
    that's odd, I'll do a build myself real quick and see if I can find a fix for it.
     
  14. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    This is odd. It must've happened when I updated photon. The line, as far as I can tell, is simply a debug line. Commenting it out fixed the issue for me. It must be some oversight on the side of Photon.

    Another thing, I forgot to modify Photon Voice after I updated for WebGL usage, so you will get errors from Photon Voice because the Microphone class is not available in WebGL.
     
  15. Vasilkb

    Vasilkb

    Joined:
    Jun 4, 2015
    Posts:
    15
    I can comment on the line and the error is fixed but when i try to export i get this mocrophone errors and i cant export.
    can you suggest unity version that will work ?
     
  16. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Like I stated above, it's not a Unity problem, because Microphone class is simply not available on WebGL. I am uploading fixed Photon Voice files for you right now (just making sure they work properly).
     
  17. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Here, download these files and replace them and it should work.
    You will also need to disable the Voice Chat in the ingame main prefab (just unassign it), otherwise you will get some errors in your webgl build (it will still work though).
    https://mega.nz/#!khwQURjZ!40OdwANn_bSScOBhlSbRM-06z78hM1hjRh31PZ7kjgI

    Sorry about the inconvenience.
     
    Vasilkb likes this.
  18. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    It's finally here, the first of a series of video tutorials.
    #1: How to add a new weapon:
     
    Vasilkb likes this.
  19. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    stvster, Tomza and Neviah like this.
  20. Tomza

    Tomza

    Joined:
    Aug 27, 2013
    Posts:
    596
  21. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    Any Luck with WebGL? I tried the above fixes but no luck.2017.1.3 and 2018+. Is there a link to a working WebGL build?
    Thanx!
     
  22. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    What errors are you getting exactly?
     
  23. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    voicehandler.cs (26,24)
     
  24. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    Assets/314 Arts/MarsFPSKit/Plugins/PhotonVoiceApi/Platforms/Unity/MicWrapper.cs(8,23): warning CS0649: Field `MicWrapper.mic' is never assigned to, and will always have its default value `null'
    Assets/314 Arts/MarsFPSKit/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs(35,25): warning CS0649: Field `PhotonHandler.sendThreadShouldRun' is never assigned to, and will always have its default value `false'

    Assets/314 Arts/MarsFPSKit/PUNVoice/Scripts/PhotonVoiceRecorder.cs(266,21): warning CS0162: Unreachable code detected

    Assets/314 Arts/MarsFPSKit/PUNVoice/Scripts/PhotonVoiceHandler.cs(26,24): warning CS0649: Field `PhotonVoiceHandler.sendThreadShouldRun' is never assigned to, and will always have its default value `false'
     
  25. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Those shouldn't prevent a build as they're just warnings, anything else?
     
  26. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    hmm, no others. You have a build online?

    BTW: Great Support!!
     
  27. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    The update is done and I have just done a webgl build to confirm that it's working.
    It is working perfectly fine in Unity 2018.1.5f1. That is if you don't update Photon Voice, which will break webgl again.
     
    Vasilkb likes this.
  28. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Just submitted the new version to the asset store. Here's the update video:
     
    Neviah and Vasilkb like this.
  29. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    The Update is now released on the asset store.
     
  30. lolclol

    lolclol

    Joined:
    Jan 24, 2013
    Posts:
    212
    As this is at very early stage lots of improvement needed but whatever you done is highly appreciated. Whats next on your roadmap ? Will you add more game modes ?
     
  31. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    It isn't that early tbh, not early and even more not very early stages. Check here: https://trello.com/b/HtfXnKkl/
     
  32. lolclol

    lolclol

    Joined:
    Jan 24, 2013
    Posts:
    212
    I think i will wait for more for what surprises you come up with.
     
  33. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Do as you like :)
     
  34. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Note regarding Unity 2018.2:
    Unity removed old networking, which will cause an error to be thrown in PhotonEditor.cs

    Updating Photon will solve the issue, however it will create more errors in the current kit version because Photon changed the way OnEventCall works.

    Until next update, the way to fix it (for now) is, to comment this part out:
    Code (CSharp):
    1.                 // we let the Editor check for outdated RPC attributes in code. that should not cause a compile warning
    2.                 if (method.IsDefined(typeof (RPC), false))
    3.                 {
    4.                     countOldRpcs++;
    5.                     isOldRpc = true;
    6.                 }
     
    Neviah likes this.
  35. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Update 0.5.0.0 is released on Sellfy and submitted to the Asset Store:
     
    Tethys and Neviah like this.
  36. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
  37. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Excellent framework. Seems like a solid foundation. Got a quick question, how would you recommend implementing abilities without breaking functionality from future updates?

    My initial thought is to follow the same approach as your Kit_WeaponManagerBase class, and utilize those callbacks for the ability class. I'm not sure if that would work with the approach of having the AbilityManager class with an Ability superclass that is called from the AbilityManager, of which the actual ability subclasses themselves are derived from.
     
    Last edited: Sep 24, 2018
  38. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Thank you. Yes, there is. Exactly what you were thinking. If you create your own managers and assign them to the player, they can simply be reassigned after an update and continue to work.
     
  39. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Hey just curious, where in your demo scenes is the instantiation data being set? I'm working on implementing an ability handler class and there's just a lot of moving parts to keep track of. I'm also relatively new to scriptable objects so I've been trying to re-orient my brain to think that way cause they're definitely great in terms of optimization. Basically, the instantiation data passed in from Photon is things like loadout settings, player name, etc correct?

    Also just curious, is there a reason you went with things like weapon states and such as ints instead of enums? Everything is commented well so it's obvious what int is what but I'm just curious how come you went this route.
     
    Last edited: Sep 29, 2018
  40. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Instantiation data is set in Kit_IngameMain in void Spawn at line 913. It can also be taken over by a game mode, if necessary.

    I never really thought about going with enums instead of ints. Now that you mention it, I might change it.
     
    lo-94 likes this.
  41. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Another quick question for you :p
    In Kit_ModernWeaponScript in the CalculateWeaponUpdateOthers method (line 1944) how come you are handling both WeaponControllerOthersRuntimeData (players other than local) and the WeaponControllerRuntimeData (local player) when CalculateWeaponUpdate already handles the local player? I'm sure there's a reason, I'm still just kind of stumbling through this and looking at generated flow charts to grapple with everything haha
     
  42. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Yes, there is actually a reason. In the beginning, it was like you would expect - only Others data was handled. Then came bots, which needed to use local data everywhere, due to master client switching, so that any client may take over the bots at any time. That's why both are handled there.
     
    lo-94 likes this.
  43. emircan1596465

    emircan1596465

    Joined:
    Sep 30, 2018
    Posts:
    1
    health bar does not appear.What can I do?
     
  44. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    That is because, by default, the player uses health regeneration vitals, which do not display the health in text. To change this, go to the player prefab and under Vitals, change the module from HealthRegenerationVitals to SimpleVitals.
     
  45. Vasilkb

    Vasilkb

    Joined:
    Jun 4, 2015
    Posts:
    15
    Hello, i've tried to run the project on couple of unity versions including the latest, but when i switch to webgl and try to create new room i get the following error:

    NotImplementedException: The requested feature is not implemented.
    ExitGames.Client.Photon.SocketWebTcp.Disconnect () (at Assets/314 Arts/MarsFPSKit/Required/Photon Unity Networking/Plugins/PhotonNetwork/SocketWebTcp.cs:287)
     
  46. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    That is because in the (at the time the update was submitted) latest PUN (Classic) version, WebGL was broken. But fear not, help is coming! Kit is already updated to PUN2, which hopefully has this issue fixed, I will test it soon and report back here.
     
  47. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    The latest update, which includes the update to PUN2, has now been released on the asset store:
     
    Vasilkb and Neviah like this.
  48. iafondo

    iafondo

    Joined:
    Jan 16, 2018
    Posts:
    5
    Hi i get this error on 2018 3.0:

    Assets/314 Arts/MarsFPSKit/Unity Technologies/PostProcessing/Editor/PropertyDrawers/MinDrawer.cs(6,34): error CS0104: `MinAttribute' is an ambiguous reference between `UnityEngine.MinAttribute' and `UnityEngine.PostProcessing.MinAttribute'
     
  49. iafondo

    iafondo

    Joined:
    Jan 16, 2018
    Posts:
    5
    I fixed it by replacing
    "MinAttribute"
    to
    "UnityEngine.PostProcessing.MinAttribute"

    in MinDrawer.cs
     
    Mars314 likes this.
  50. Mars314

    Mars314

    Joined:
    Feb 21, 2017
    Posts:
    70
    Great! Sorry for the late reply, I'm sick unfortunately.