Search Unity

Third Party Photon Unity Networking

Discussion in 'Multiplayer' started by tobiass, Aug 23, 2011.

  1. ND

    ND

    Joined:
    Aug 3, 2012
    Posts:
    60
    After trying hard to use Unity built-in networking and also having so much pain, at last I ran to Photon Server.
    Now I have a simple question how would it be possible to create rooms once (in server side for instance) without joining them. I want the power user just create some rooms and let only the other join the games. Really that's the reason I use Photon at all because it's the same problem I had with pure Unity Networking.

    Thanks,
     
  2. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    The rooms don't need to be there per se as you can easily join the room if it is available, or have the client create it if it is the first.
    You can just assume the room is there?
     
  3. ND

    ND

    Joined:
    Aug 3, 2012
    Posts:
    60
    That's OK, The players can create or join the game and every thing goes very well. But I'd like to have some rooms always available even with zero players within. Is it somehow possible?
     
  4. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    You get the list of "used" rooms from the server. Before you show this, mix in your list of "always available" rooms where needed.
    If a player selects a room with 0 players in it, create the room. If that fails (cause someone else just created the same room), just join the room.
     
  5. ND

    ND

    Joined:
    Aug 3, 2012
    Posts:
    60
    Yeah actually that was what I've done and in this case I also found out the rooms' custom settings so interesting. Photon is easy to manage. Thanks.
     
  6. Allen0012

    Allen0012

    Joined:
    Sep 5, 2009
    Posts:
    93
    Why is it so poor when it gets to Photon Server Documentation? I know, most of your customers only use client side logic, not that the client SDK documentation is perfect, but it's better.
    Most of the articles under your "Documentation" webpage is sorta feel like advertizement of the product.
    Where can I find a documentation for "Adding Custom Logic" to one of the apps? Say Lite. Should I start reading the code to figure it out? Am I missing something?
     
  7. ThePhotons

    ThePhotons

    Joined:
    Aug 30, 2012
    Posts:
    8
    You are more or less right. The server is not as polished as the client side and it has a steep learning curve and requires lots of server code reading. This has several reasons (none of them is really an excuse but means as info):
    The server side of Photon is more complex and focused on getting the best performance. This requires a good understanding of what you do but we didn't expect a big audience for this part. Instead, we did a lot of proof of concept work and teaching directly with customers.
    This changed by now but we didn't catch up in terms of good tutorials, cause we're also quite busy.

    Please don't give up and instead as the hell out of my colleagues in our forum. I will kick them to answer and write up something useful :)
     
  8. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    I just uploaded new versions of PUN, the Viking Demo and Photon Angry Bots.
    There's a fix for an exception, so: Please update!

    v1.17 (27. September 2012)
    Note: this version has breaking changes! don't try to use it with clients with older PUN versions
    Updated: PUN version string to "1.17"
    Updated: client library (the dll) to v3.0.1.14. This fixes an exception and adds some better iOS 5 udp-socket fixes (see release_history.txt)
    Fixed: Player list checking when client joins. The client now first checks the local player-list with the list from server. Then calls OnJoinedRoom. (was: the other way round)
    Fixed: observing a rigidbody via a PhotonView was bugged (velocity and angular velocity were mixed up)
    Changed: PhotonNetwork.SetLevelPrefix() is now short typed. It practically never happens that you have more than 32k levels (and short saves a bit of traffic)
    Changed: Reliable delta compression now uses a different format and is a bit leaner
    Changed: The data you produce in OnPhotonSerialize is sent is now sent completely and uncompressed, if the length of it changes to previous sends. If length doesn't change, we assume the data content and order is same as last time
    Internal: OnPhotonSerialize data is trasported in a hashtable in: key 1 original, 2 compressed, 3 list of "true" null values (when using compression)
    Internal: Instead of overriding compressed data[] into Hashtable key 1, this now uses key 2 (and removes key 1). this makes it easy to decide if anything was compressed at all
    Internal: PhotonView.lastOnSerializeDataSent and .lastOnSerializeDataReceived are now object[]
    Internal: OnSerializeWrite now uses an int-array to send view ID, timestamp and level-prefix
    Added: output for ping + variance to PhotonStatsGui (in health values)
    Added: Event / callback method OnPhotonMaxCccuReached. This is called when the CCU limit for your title is reached (this means: either a Cloud subscription limit or a Photon Server license limit is reached)
    Changed: OnPhotonMaxCccuReached might be called after authentication. When it was called, PUN will automatically disconnect. The player might re-try later on.
     
  9. Allen0012

    Allen0012

    Joined:
    Sep 5, 2009
    Posts:
    93
    I might switch to SmartFox. I'm gonna be switching my Photon network interface with the SmartFox2X UDP one on the exact same game, and compare the two this weekend, performance, bandwidth and memory. I wonder why no one has ever done this.
     
  10. blaze

    blaze

    Joined:
    Dec 21, 2011
    Posts:
    211
    Try UnityPark too. Seems to be a very good solution.
    http://unitypark3d.com/
    I never used, and want to know if is good. ;)
     
  11. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
  12. Allen0012

    Allen0012

    Joined:
    Sep 5, 2009
    Posts:
    93
    I just got some interesting results on SmartFox2X after working the whole weekend plus today. I'm gonna gather up a comparison between the two solutions Photon and SmartFox2X soon posted on a new thread.
     
  13. blaze

    blaze

    Joined:
    Dec 21, 2011
    Posts:
    211
    Then, post the link here, please.
     
  14. Allen0012

    Allen0012

    Joined:
    Sep 5, 2009
    Posts:
    93
    Sure. You can't believe how amazed I am right now crunching the numbers.
     
  15. Allen0012

    Allen0012

    Joined:
    Sep 5, 2009
    Posts:
    93
  16. blaze

    blaze

    Joined:
    Dec 21, 2011
    Posts:
    211
    WOW man! Very interesting!
    Like I'm starting now my first MP experiences, I'm using Photon Cloud to learn, and I think that I will use it for my game, that will be an iOS 2D Shooter. I think that for "game-to-game" solutions, Photon Cloud is the less expensive and maybe realiable out of box solution.
    But, I'm thinking in work more hard after the this project is finished, and I will need many "server side logic". Is great to know how they perform.
    About the documentation of Photon, I was trying the "Marco Polo" tutorial yesterday, and I stopped very angry. They show only part of code, and I need to wonder how is the rest, to continue. Like I was tired, I get out and stopped.
    A tutorial is for rapid implementation, to you make it work and then see the ready code to learn. Not to need to learn more about the SDK then the tutorial shows.

    If I could ask something to an experienced person with Networking like you, I would like you test the UnityPark3D, from Much Different. It seems to be a very good solution, with many things that would help alot in an MMO game.

    Thank you very much for the comparison.
     
  17. bertelmonster2k

    bertelmonster2k

    Joined:
    Apr 3, 2009
    Posts:
    78
    Hi ali.00128,

    This thread has a completely different topic - not sure why you hijacked it:
    The topic is: "Photon Unity Networking" (aka PUN) >> Smartfox does not provide this Unity Networking layer (AFAIK).

    - PUN is API (almost fully) compatible with Unity Networking
    - Provided as Software as a Service (SaaS) via Photon Cloud
    - Can be run on-premise (or selfhosted) via Photon Server


    In terms of performance here some #s:

    i) Load test scenario: http://www.slideshare.net/bertelmonster2k/photon-load-test-1
    - 400CCU
    - 70,000 msg/s
    - 8,7 MB/s (100Mbit NIC is saturated)
    - 30% CPU

    ii) Here some real live server data (Single CPU XEON)
    - 1200 CCU, up to 60% CPU


    - 65k msg/s in&out, 6MB/s in out


    Photon performance is outstanding and the reason why top tiles like F1 Online (Codemasters) or Offensive Combat (u4ia) pick Photon.

    Chris
     
    Last edited: Oct 2, 2012
  18. Prophet6989

    Prophet6989

    Joined:
    Jul 8, 2012
    Posts:
    37
    Does it means that I can use PUN with Photon Server?

    If yes, how I can connect? For PhotonNetwork.Connect I need AppID, but where is it on selfhosted photon server? And how to communicate with server logic (Operations, OperationRespons, Events)?
     
  19. CJR-Gaming

    CJR-Gaming

    Joined:
    Oct 12, 2012
    Posts:
    63
    If you want to have a self hosted solution you need to switch it from the cloud to your own server. On the editor where it asks you for the AppID, under it is a button "Switch to own host". If you click that, the interface will change asking you for an IP and a port where you can put in the server and address. Then when you start up Photon, use the LoadBalancing Application as that will give you a master server and 2 game servers that operate the same way the cloud does.
     
  20. Azaldur

    Azaldur

    Joined:
    Jul 10, 2011
    Posts:
    52
    Does PUN runs with unity 4?
     
  21. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    Yes, it runs with Unity 4.
    As far as I know, there's not even a warning anymore.
    It does not export to Flash yet but we're looking into it. This will be a special edition most likely and it won't be out in the next few weeks yet.
     
  22. willemsenzo

    willemsenzo

    Joined:
    Nov 15, 2012
    Posts:
    585
    I don't know if this is the place for troubleshooting, but I can't find the answer I'm looking for. I'd like to use Photon with Unityscript, so I followed the guidelines and placed the Plugins folder in the root directory of my project. This is where I start getting errors and I have to put the folder back because that seems the only right option that doesn't give errors like: "PhotonNetwork.PhotonServerSettings' is inaccessible due to its protection level".

    Someone with any idea to solve this?
     
  23. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
  24. willemsenzo

    willemsenzo

    Joined:
    Nov 15, 2012
    Posts:
    585
    Thanks and I'm sorry I got really impatient because I couldn't find a sollution it was driving me mad.
     
  25. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    A heads up:
    We are working on the next iteration of Photon Unity Networking with many small and some bigger improvements. Because we're away between Christmas and New Year, the update is likely being delayed until next year.

    Let me re-iterate two minor known issues of v1.17 that might give you a headache:
    a) Level Prefix won't work in RPCs.
    To fix: http://forum.exitgames.com/viewtopic.php?f=17&t=2081&p=9745

    b) The Photon Cloud won't list any rooms, if the appId accidentally has a whitespace in.
    To fix: Check the Resources/PhotonServerSettings file with the inspector and remove any leading or trailing whitespace.
     
  26. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    May I ask if there will be support for the new features, introduced with v3.0.1.14 of Photon client (grouping, matchmaking etc) in this new iteration of PUN?
     
  27. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    You may :)
    PUN will make use of groups behind the scenes, if you use groups. It's not a miracle weapon though, as we stick with Unity's features and workflow in PUN.
    Server-side matchmaking will have 3 variants: "fill up rooms", "distribute players across rooms" and "fully random match". Those will be supported by JoinRandomRoom().
     
  28. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Great, thank you :)
     
  29. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    Has someone tried to make a "click to move" controler with photon yet ?
    When i test with one connected player in unity it works perfectly, but i add the second one in browser, it seems like the two caracters are sharing the "click destination".

    You can test with a very simplified version of my scene:

    1 - open Viking Photon Demo
    2 - put this script on your "Charprefab":
    Code (csharp):
    1.  
    2.  
    3. using UnityEngine;
    4. using System.Collections;
    5.  
    6. public class PlayerControler : MonoBehaviour {
    7.  
    8.     public Vector3 delta;
    9.     public float walkSpeed = 10.0f;
    10.  
    11.     void Update(){
    12.        
    13.         if (Input.GetMouseButtonDown(0)){
    14.        
    15.             Ray ray = (Camera.main.ScreenPointToRay(Input.mousePosition));
    16.             RaycastHit hit;
    17.            
    18.             if (Physics.Raycast(ray, out hit)){
    19.  
    20.                 delta = hit.point - transform.position;
    21.                 rigidbody.AddForce(delta.normalized * walkSpeed, ForceMode.Impulse);
    22.             }
    23.         }
    24.     }
    25. }
    26.  
    27.  
    3 - launch the game in exe + make a room.
    4 - launch the game in unity + join the room + disactivate ( in unitys clients character ) the "ThirdPersonController".
    5 - click on both windows == both characters move at each click while on the client one should.

    what am i doing wrong ?

    thx
     
  30. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    The problem will be that with another player, you create more than one script that gets input and tries to move the cam.
    Those issues can be solved by checking photonView.isMine in relevant scripts or by just enabling input handling on scripts of objects which this client instantiated.

    The Marco Polo Tutorial "Fight for Control" uses a disabled script to solve this. There is also code that uses "isMine":
    http://doc.exitgames.com/photon-cloud/Marco_Polo_Tutorial
     
  31. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    We just released v1.18 of Photon Unity Networking.

    This time, we've been refactoring a bit to make things faster and more efficient.
    When you instantiate a few resources over and over, this is much faster and memory-friendly (great for mobile games).
    We changed how PhotonViews get their IDs assigned and because of that, you should remove some outdated files and open existing scenes.

    You might want to check out the change history when you update a existing project. Some changes might affect your game (but are easy to fix when you know why).

    v1.18 (31. January 2013)
    Note: Open all scenes that have PhotonViews and just save them again.

    Changed: The script PhotonViewPrefabApply is updated into an empty file. The file is obsolete (and just included to make upgrades from older versions more smooth).
    Changed: PhotonView.cs is no longer in a folder "Extension". On import to existing projects, Unity will update the correct file but new projects have the PhotonView directly in the Plugins folder. You can move the file in Unity's project window and remove the "Extension" folder.
    Removed: PhotonViewID is no longer a distinct class but simply a integer. All relevant values are now directly in PhotonView. Remove the outdated file, if you imported this package into existing projects.

    Added: enable PhotonNetwork.automaticallySyncScene for automatic loading of the correct scenes. Simply join a room and all clients will always open the same scene as the MasterClient.
    Fixed: IENumerators are now called via their own script instance instead of the PhotonHandler monobehaviour. This fixes an issue where the IENumerators would continue running even after the script was destroyed.
    Added: Error logging in case a PhotonView (on any network instantiated object) is not being destroyed by PhotonNetwork.Destroy() or similar. GameObject.Destroy() on those items will break networking!
    Fixed: Some places where old instantiate IDs were probably used in PhotonNetwork.Destroy().
    Added: Caching for Resources used by Instantiate. PhotonNetwork.UsePrefabCache can be used to turn this off, while PrefabCache lets you access the individual Prefabs (you could remove specific ones if needed).
    Note: The new Instantiate-Resource caching should perform better on mobiles when a few prefabs are instantiated over and over.
    Removed: Callback OnReceivedRoomList(). If you implemented this method, we instead call OnReceivedRoomListUpdate() now in all cases the room list is refreshed (no matter if new or just updated). Seems easier.
    Changed: Callback OnMasterClientSwitched() is now only called when the master client actually switcheds, not when the master client value is initialized (when entering a room).
    Changed: LevelPrefix is now applied to PhotonViews (GameObjects) when they get instantiated or loaded into a scene and then they don't change again. They are sent in instantiate, too, so remote instances use the same (not the prefix someone else set).
    Note: Despite the LevelPrefix, PhotonViews with the same ViewIDs will "collide" as we store those by viewID only.
    Renamed: PhotonNetSimSettingsGui class is now called PhotonLagSimulationGui. The name often collided with "PhotonNetwork" in an IDE's auto-completition. When upgrading existing PUN versions, you can delete the old file "PhotonNetSimSettingsGui.cs"
    Changed: Internal system to allocate viewIDs. The new system is much simpler and saves performance at runtime.
    Fixed: LevelPrefix for RPCs in ExecuteRpc() is now cast correctly.
    Fixed: PhotonNetwork.countOfPlayersOnMaster was returning PhotonNetwork.countOfPlayers instead just those on master server (looking for rooms/games).
    Fixed: PhotonNetwork.Destroy for anything owned by a player who already left. This affects you only if autoCleanup is disabled by your game.
    Fixed: OfflineMode for PhotonNetwork.Disconnect() now resets the state and calls events (leaving room, disconnect) as you know it by online mode.
    Changed: If you use OfflineMode, this now ends (!) when you call PhotonNetwork.Disconnect().
    Added: NetworkView groups are now using Photon's new Interest Group feature (new server SDK v3.2 and up required). This might save some bandwidth but might also lead to inconsistant states (when ignoring essential RPCs accidentally). Check out "Using Groups in PUN" topic in the PDF.
    Added: New ErrorCode constants: MaxCcuReached and InvalidRegion.
    Added: DisconnectCause values: MaxCcuReached and InvalidRegion.
    Added: OnConnectionFail() is now also called in case of Photon Cloud MaxCcuReached (the callback OnMaxCcuReached() is still called but maybe you want to handle these similar errors in one method).
    Added: OnConnectionFail() is called in case of "Invalid Region".
    Changed: RPCs are now also called on a script that inherits the RPC implementation from a class it extends. Internally, ExecuteRPC() doesn't use BindingFlags.DeclaredOnly in type.GetMethods() anymore to achieve this.
    Internal: NetworkingPeer fields renamed: mPeerCount is now: mPlayersInRoomsCount and mMasterCount is now: mPlayersOnMasterCount.
    Internal: PhotonViewID and PhotonView both got a new property OwnerActorNr, to fix removing items owned by players who left.
    Added: Alternative random matchmaking rulesets! Instead of filling up rooms asap, you can distribute players across available games. This might make sense when there's a high maxPlayer value per room and players cooperate / can join anytime.
    Added: enum MatchmakingMode with options for random matchmaking
    Internal: ParameterCode.MatchMakingType
    Added: matchingType parameter to OpJoinRandomRoom()
    Removed: OpJoinRandomRoom(expectedGameProperties). It was exclusively used internally and obsolete.
    Changed: The converter now also replaces NetworkStateSynchronization with PUN's ViewSynchronization enum.
    Changed: Converter will now turn Network.InitializeServer into PhotonNetwork.CreateRoom (was converting to .JoinRoom).
    Updated: To new client library (Photon3Unity3D.dll) with some fixes.
    Fixed: Manual viewID allocation is now more stable. It works only for player-owned objects. Use AllocateViewID() and UnAllocateViewID accordingly. If you manually assign viewIDs, RPCs on instantiated objects will fail until you do. You need to destroy those objects, too.
    Changed: Default cap of unreliable updates per dispatch is now 40. In cases with many unreliable synchronized objects, the previous default of 20 resulted in choppy updates.
    Changed: PhotonServerSettings.asset can now be moved to any 'Resources' folder. The Photon Wizard detects if more than one exists (when opening the window) and warns you if there are more than one file.
    Internal: The PhotonHandler now uses Time.realtimeSinceStartup to check intervals for updates and sending. Each time that updates are produced, they are sent immediately (reducing local lag).
    Internal: The hidden GameObject for the PhotonHandler script should only be created once and not be saved in the scene. This is taken care of with DestroyImmediately now, for any surplus duplicates of this object.
     
    Last edited: Jan 31, 2013
  32. Uncasid

    Uncasid

    Joined:
    Oct 5, 2012
    Posts:
    193
    Photonviewid isn't in the package..
     
  33. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    Oh. Right, that's gone, too. No longer necessary as class. If needed, use the PhotonView.viewID integer.
     
  34. LightSky

    LightSky

    Joined:
    Aug 12, 2012
    Posts:
    45
    I am making a game were uses can Host/Join each-others games from a list of games. Each lobby/game will only have at most a total of 10-12 players per. One player will be hosting the match while all the other connect to that player. With "Photon free" will this be possible? or do I need to purchase the pro?

    Thanks :)
     
  35. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    With Photon free you mean the free 20 CCU limit on the PUN cloud? It has all the features that the other options have, so yes thats fully possible.
    The same counts for the free photon server license.
     
  36. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    I made a video of a compile issue with Photon that I'm having.


    Have you run into this issue before? I'm baffled.

    Thanks,

    ~Tim
     
  37. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    Just updated in the Asset Store:

    v1.19 (14. March 2013)
    Note: The Photon Cloud will separate your customers automatically by using the PhotonNetwork.versionPUN string (now being "1.19"). This version of PUN is not compatible with clients built with older PUN versions. If you host Photon yourself, you have to separate them.
    Updated: PUN Wizard for setup and help.
    Added: Editor key shortcuts. For PUN Wizard: ALT+P. To add PhotonView: ALT+V.
    Added: PUN Wizard button to select the PhotonServerSettings file in project (to have a look at the config and RPC list).
    Added: Wizard shows a note when iOS or Android Pro licenses are not available. Ignore if you don't build for those platforms.
    Added: Context menu for PhotonView Components to open the PUN Wizard.
    Added: Demo Hub scene to select the different demos.
    Added: Demo "Boxes" and "Synchronization".
    Updated: Marco Polo Tutorial. This "result" is slightly different from the online tutorial. Read it's readme for details. Also uses the current "Monster" asset from Asset Store (minus some surplus scene, geometry, etc).
    Added: PunStartup. On import this Editor script opens the Hub scene (if no scene is open) and adds all demo scenes to the build settings (if no scenes are in the list).
    Fixed: OnPhotonSerializeView was fired for playerpropertychange.
    Changed: Log entries for failed random matchmaking. It's perfectly ok that sometimes no room is available, so that is no Error.
    Changed: Instead of sending RPC names, PUN now compiles an index of RPC-methods and sends a shortcut (just a byte). RPC searching is done in-Editor. Currently a byte is used as shortcut, enabling 255 distinct RPC methods. PUN can be modified to use short or int as shortcuts (look up comments "LIMITS RPC COUNT").
    Changed: ServerSettings class is extended by the RPC-List. The PhotonServerSettings asset will be updated seamlessly if this new PUN version is imported. Copying the new class file over older ones will erease your settinsg and you might need to edit them again.
    Changed: RPC calls without parameters are now a little more compact, cause the key for parameters is skipped.
     
  38. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Wait so we can't use our iOS or Android Basic Licenses? It's not a free license, but it's not a Pro one either.
     
  39. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    Huh? No. We even added a note that you CAN'T build for iOS or Android without the respective Unity Pro licenses.
     
    Last edited: Mar 19, 2013
  40. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Well I did read that, but I also read( I believe over on Unity Answers )that it worked for some Android devices, so I just wanted to double check before I considered using the product :)
     
  41. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Now you almost got me confused:

    I think this should be: We even added a note that you CAN'T build for iOS or Android without the respective Unity Pro licenses.
     
  42. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    You're right, thanks. I edited my post above.
     
  43. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    A new update is live in the Asset Store. Details below.
    Next up, we most likely update the internal protocol once more and add features to track and analyze client issues.

    v1.20 (19 April 2013)
    Added: Features "Find Friends" and "Custom Authentication" plus (simple) demo.
    Added: PhotonNetwork.FindFriends(string[] friendsToFind) to be used with (external) friends lists. If all users set their names before connecting, they could be found using this method and it's possible to join their games/rooms.
    Added: OnUpdatedFriendList() can be implememented by your game to get a call when FindFriends() finished. Also see PhotonNetworkingMessage.OnUpdatedFriendList for info.
    Added: PhotonNetwork.Friends property which will provide the result of a FindFriends call (takes a roundtrip to the server).
    Added: FriendInfo class for the friends list (filled with names when FindFriends is called and getting updated with online status and room names when result was received).
    Internal: Authenticate now sends the playername if not null or empty. This allows tracking of players and in which room they are.
    Added: PhotonNetwork.ConnectToBestCloudServer() to connect to the region with the lowest averaged ping. PingCloudRegions MonoBehaviour is used to actually do the pinging.
    Internal: Converted all visible text to string variables in PUN Wizard class. To be translated.
    Fixed: Converter for Network.GetLastPing(player) and Network.CloseConnection(player,bool). They now get converted into their closest variants in PUN (which doesn't sync each player's ping)
    Internal: The Extension class now explicitly uses SupportClass == ExitGames.Client.Photon.SupportClass, avoiding some name clash with other libs. At the same time, that class is now the only place where the SupportClass is used.
    Internal: Renamed "utility" component DontDestroyOnLoad to TestDontDestroyOnLoad. Now filename and classname are identical again and this avoids another name clash with other projects.
    Internal: Player properties are no longer sent if the actorNumber is < 1. While in room, the actorNumber is always > 0.
    Updated: Reference doc (the PDF in this package).
    Added: PhotonNetwork.FetchServerTimestamp to have that method available
    Added: PhotonNetwork.ServerAddress to access this directly (but only as getter)
    Changed: The ServerSettings field is now public (to be able to read and show settings)
    Internal: ServerSettings file now has an enum CloudServerRegion. Used as names-list and in a few methods
    Added: PhotonNetwork.ConnectToBestCloudServer(gameVersion) to connect the region with best ping. The PingCloudRegions script automatically pings available regions once, then saves the results in the PlayerPrefs. Currently this is enabled by default.
     
  44. byteprogramming

    byteprogramming

    Joined:
    Jul 24, 2012
    Posts:
    29
    Hey , why do you keep Photon so complex compared to other middleware networking sollutions?

    I saw the angrybots photon demo. It has a lot of weird code like handlers and they all describe things that should be by the default anyway (like finding out connection state,byte calculation etc. )

    Isn't it obvious that when the room is created it should be synced? Or the tickcount system? Is there any game that doesn't want a tickcount serialization?

    This should all be by default.
     
  45. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    I think PUN is the simplest networking solution around - you're somehow confused about that )
     
  46. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    byteprogramming: Sorry for the late reply.

    We try to do a lot of things by default or in a simple way but when we think "this costs a lot of bandwidth but is not useful for all games", we disable a feature and make it optional or used by coding.

    If we just synced everything in a room, this would not work with a lot of items and players. We could sync any public value for sure but that's a lot of extra work and bandwidth and (e.g.) an animation could be sent as simple state as well. Similarly, a specific lag compensation model will work for some types of user input and movements but not for all.


    Networking is a special discipline when creating games. It has lag (everything is asynchronous), can break anytime and in parts only (1 client leaves a 4 player game, the 3 others must cope) and the "bandwidth" is a technical barrier that is hard to grasp because it does not have a minimal specification.
    Due to this, I actually tend to think that for most networked games coding is a mandatory evil.


    If you think Photon is too complex, it's certainly not because we want it to be that way. We're open for feedback and will think about easier solutions where possible. There is room to make things easier on top of Photon, as shown by Playmaker, RPG Kit 2.0 and other solutions.
     
  47. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    I don't understand the user limits. Does 20CCU mean you can only have 20 people playing multiplayer at any given time or you can only have 20 playing in a game room? Say you have a server browser and players can create their own servers in said browser. Is each limited to 20 players max per server or is 20 players per all servers the max? If it's 20 players total playing multiplayer then IMO this is beyond useless; what's the point of only having 20? The other packages aren't much better either.. Can this be used for P2P bypassing Photons servers and limitations?
     
  48. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027

    20 total at the same time is the max (concurrent connected users). 20 CCU is usefull for development or a small beta (with just 1 or 2 open games).
    100 CCU is already OK to start with as you can easily upgrade to 500, 1000 (or more) when required.

    As the webpage lists, 500 CCU is +- 100 000 Monthly Active Users. Try to count the online players at the server browser of your favourite multiplayer games, most likely those have around 1000 CCU only too. It's easy to think that this is a low number, but CCU counts up to a much higher monthly acitve users.
     
  49. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    Ah, I understand; thank you. Yes, it does seam extremely low, but I suppose in real world usage 1,000 is probably very reasonable.
     
  50. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    Ok, just took a look at Photon Server. Say I buy unlimited for $3,500. This means I can have unlimited players playing in an unlimited amount of game rooms (say a game room is 20 players); would this be correct? As it is per title this would be perfect if for example the game got more popular. I assume the server is hosted by Photon, etc.. specific details seam to be hard to find on the site and some of the wording is confusing (for example "Licenses per app and server can run a single Photon Server instance for one title." what does single photon server instance mean? no game rooms?).

    Edit: Looks like Photon server requires you to host your own server and they just provide the SDK for your server. This really needs to be more obvious instead of having to dig through documentation..
     
    Last edited: May 22, 2013