Photon Unreal Engine SDK Demo not working

Hello!
I am trying to get the demo from Unreal Engine SDK up and running but i cant generate visual studio files. I am using Visual Studio 2015 Enterprise Edition.

This its what i've done

1. I downloaded the demo from here: https://photonengine.com/Download/PhotonDemoParticle-UE4.zip

2. I've downloaded the Unreal engine SDK for Windows version 4.1.3.0

3. Unpacked the Photon SDK in the 'Photon' folder inside of the 'Source' folder of the demo project

I have 2 version of UE (4.12.4 and 4.4.)
When I try to generate VS project using the 4.12.4 UE verion I get the folowing erro:


Running C:/Program Files (x86)/Epic Games/4.12/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project="E:/Licenta/PhotonDemoParticle-UE45/PhotonDemoParticle.uproject" -game -rocket -progress
Discovering modules, targets and source code for project...
Messages while compiling E:\Licenta\PhotonDemoParticle-UE45\Intermediate\Build\BuildRules\PhotonDemoParticleModuleRules.dll:
e:\Licenta\PhotonDemoParticle-UE45\Source\PhotonDemoParticle\PhotonDemoParticle.Build.cs(37,38) : error CS0619: 'UnrealBuildTool.RulesCompiler.GetModuleFilename(string)' is obsolete: 'GetModuleFilename is deprecated, use the ModuleDirectory property on any ModuleRules instead to get a path to your module.'
UnrealBuildTool Exception: ERROR: UnrealBuildTool encountered an error while compiling source files


When I try to use the 4.4.3 UE version I get an error cuz I don't have VS 12 or VS 13 installed

What can I do? Start using VS 13 or VS 12 or there is a demo for VS15 too. Thanks

Comments

  • Hi @Insane.

    We have not updated the demo to 4.12 yet.
    The current version targets 4.10 (which is already using VS2015).

    On a side note:
    It is VS2012/VC11, VS2013/VC12 and VS2015/VC14. If you say something like "VS15" you may confuse people about what you actually mean, the VS or the VC version.
  • Hi!
    I've managed to run the demo, thank you for your help. However looking through the source code I come with another questions. First of all I can't find where is the server logic. I am guessing that it's in the LoadBalancing lib file from ./lib folder, it's that true? If it's true how can I add separate server logic to what it is now. To give you an example I am trying to save some user details into a database, nothing fancy, the name, color to be able to implement some character customization.

    I've read about integrating custom logic within LoadBalancing here
    forum.photonengine.com/discussion/1809/incorporating-loadbalancing-to-custom-game-server but that guy uses Unity with C# and I am using Unreal with C++.

    To be honest I am bit lost. Thank you!
  • Hi @Insane.

    What you are currently looking at is the C++ Client SDK. It does not contain any server code at all, but just code for the client side.

    The Photon Server SDK can be found at https://www.photonengine.com/en-US/OnPremise/Download and custom server side code can be added through plugin assemblies: http://doc.photonengine.com/en-us/onpremise/current/plugins/manual.
  • Hello,

    I need to use Unreal 4.12 for my project, while I have just seen in this thread that the latest SKD implementation was 4.10.
    Could you please let me know when this will be implemented for 4.12?

    Thanks
  • Hi @Guillaume.

    By now we have updated the demo project to UE 4.12. Please re-download it.
    The SDKs will work with 4.12 just fine. There was only a minor issue with the demo project.
  • Hi @Guillaume.

    By now we have updated the demo project to UE 4.12. Please re-download it.
    The SDKs will work with 4.12 just fine. There was only a minor issue with the demo project.

    You are wrong; I've downloaded your demo and it doesn't run on 4.12.5. not at all.
    The libs scream LNK2038 everywhere.
  • Hi @BxBL.

    What are the exact error messages?
  • BxBL
    BxBL
    edited August 2016
    @Kaiserludi

    The example project, downloaded from ( https://dl.dropboxusercontent.com/u/184217/ExitGames/UE4/PhotonDemoParticle-UE45.zip )

    Has libs for VS2013, the vs12s only; I need VS14 libs, but I don't know where to find them.
    I've downloaded Windows SDK to get vs14 libs, but those also won't work with UE4, complains about revision number.
  • Hi @BxBL.

    Where did you get that link from?
    As one can tell from the "45" in the name, that's a version of the demo for UE 4.5.

    Please use https://www.photonengine.com/Download/PhotonDemoParticle-UE4.zip to download the latest version from our official download center.

    That is also the link that we provide at http://doc.photonengine.com/en/realtime/current/sdks-and-api/sdk-unreal-engine
  • BxBL
    BxBL
    edited August 2016

    Hi @BxBL.

    Where did you get that link from?
    As one can tell from the "45" in the name, that's a version of the demo for UE 4.5.

    Please use https://www.photonengine.com/Download/PhotonDemoParticle-UE4.zip to download the latest version from our official download center.

    That is also the link that we provide at http://doc.photonengine.com/en/realtime/current/sdks-and-api/sdk-unreal-engine

    It doesn't matter what I do, it simply will not compile :)
    I did all the process all over again, downloaded SDK, got project files from
    https://www.photonengine.com/Download/PhotonDemoParticle-UE4.zip
    and your sample code is still broken.
  • For Windows please use the "vc14_release_windows_md_x64" variants of the libs like .\Demos\PhotonDemoParticle-UE4\Source\PhotonDemoParticle\PhotonDemoParticle.Build.cs does.
  • Kaiserludi
    Kaiserludi admin
    edited August 2016
    Then please provide the errors that you get. Just "Still broken" without further information does not help us in figuring out how to help you.
  • BxBL
    BxBL
    edited August 2016
    I would, but seems like now I am being moderated for no reason.
    When I paste a log, the forum won't allow me to post it.

    I've managed to link the .lib files... But now the problem is cannot call "client = new LoadBalancingClient(this);"

    Cannot instantiate abstract class...
  • Cannot instantiate abstract class...


    Please have look and the output window in Visual Studio (not the Error list) - there you can sometimes find extended info about an error message of which the short version in the error list isn't really useful.
    A "Cannot instantiate abstract class" error appears when some function in that class is pure virtual and the error message tells you which function it is so that you can add an implementation.

    But now the problem is cannot call "client = new LoadBalancingClient(this);

    Is that some code from your app? I can't see any line like that in the demo code.
    I guess that this inherits from the LoadBalancing::Listener class and does not implement all pure virtual function that it has inherited from there, because some new pure virtual function got added between the version of the Client SDK that you have used previously and the one to which you have updated.


  • 1> PhotonLBClient.cpp
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(26): error C2259: 'LoadBalancingListener': cannot instantiate abstract class
    1> C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(26): note: due to following members:
    1> C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(26): note: 'void ExitGames::LoadBalancing::Listener::debugReturn(ExitGames::Common::DebugLevel::DebugLevel,const ExitGames::Common::JString &)': is abstract
    1> C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\Photon\LoadBalancing-cpp/inc/Listener.h(24): note: see declaration of 'ExitGames::LoadBalancing::Listener::debugReturn'
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(27): error C2661: 'ExitGames::LoadBalancing::Client::Client': no overloaded function takes 3 arguments
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(38): error C2661: 'ExitGames::LoadBalancing::Client::connect': no overloaded function takes 3 arguments
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(62): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1> C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1465): note: see declaration of 'vsprintf'
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(73): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1> C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1465): note: see declaration of 'vsprintf'
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(84): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1> C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1465): note: see declaration of 'vsprintf'
    1>ERROR : UBT error : Failed to produce item: C:\UNREAL\NETWORKING\Photon-Particle-Demo\Binaries\Win64\UE4Editor-PhotonDemoParticle.dll
    1> Total build time: 4.16 seconds
    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3075: The command ""C:\Program Files\Epic Games\4.12\Engine\Build\BatchFiles\Build.bat" PhotonDemoParticleEditor Win64 Development "C:\UNREAL\NETWORKING\Photon-Particle-Demo\PhotonDemoParticle.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


    Cannot go past this BeginPlay() function:

    void APhotonLBClient::BeginPlay(void)
    {
    Super::BeginPlay();
    srand(GETTIMEMS());
    listener = new LoadBalancingListener(this);
    client = new ExitGames::LoadBalancing::Client(*listener, *AppID, *appVersion);

    listener->setLBC(client);

    automove = listener->getAutomove();
    useGroups = listener->getUseGroups();

    ExitGames::Common::Hashtable ht;
    ht.put(1, 1);
    ht.put(2, 2);
    info("Connecting...");
    info("appID is set to %ls", *AppID);
    client->connect(ExitGames::LoadBalancing::AuthenticationValues(), ExitGames::Common::JString(L"UR") + GETTIMEMS(), *serverAddress);

    }


  • 1> PhotonLBClient.cpp
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(26): error C2259: 'LoadBalancingListener': cannot instantiate abstract class
    1> C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(26): note: due to following members:
    1> C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(26): note: 'void ExitGames::LoadBalancing::Listener::debugReturn(ExitGames::Common::DebugLevel::DebugLevel,const ExitGames::Common::JString &)': is abstract
    1> C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\Photon\LoadBalancing-cpp/inc/Listener.h(24): note: see declaration of 'ExitGames::LoadBalancing::Listener::debugReturn'
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(27): error C2661: 'ExitGames::LoadBalancing::Client::Client': no overloaded function takes 3 arguments
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(38): error C2661: 'ExitGames::LoadBalancing::Client::connect': no overloaded function takes 3 arguments
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(62): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1> C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1465): note: see declaration of 'vsprintf'
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(73): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1> C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1465): note: see declaration of 'vsprintf'
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(84): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1> C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1465): note: see declaration of 'vsprintf'
    1>ERROR : UBT error : Failed to produce item: C:\UNREAL\NETWORKING\Photon-Particle-Demo\Binaries\Win64\UE4Editor-PhotonDemoParticle.dll
    1> Total build time: 4.16 seconds
    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3075: The command ""C:\Program Files\Epic Games\4.12\Engine\Build\BatchFiles\Build.bat" PhotonDemoParticleEditor Win64 Development "C:\UNREAL\NETWORKING\Photon-Particle-Demo\PhotonDemoParticle.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



  • 1> PhotonLBClient.cpp
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(26): error C2259: 'LoadBalancingListener': cannot instantiate abstract class
    1> C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(26): note: due to following members:
    1> C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(26): note: 'void ExitGames::LoadBalancing::Listener::debugReturn(ExitGames::Common::DebugLevel::DebugLevel,const ExitGames::Common::JString &)': is abstract
    1> C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\Photon\LoadBalancing-cpp/inc/Listener.h(24): note: see declaration of 'ExitGames::LoadBalancing::Listener::debugReturn'
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(27): error C2661: 'ExitGames::LoadBalancing::Client::Client': no overloaded function takes 3 arguments
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(38): error C2661: 'ExitGames::LoadBalancing::Client::connect': no overloaded function takes 3 arguments
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(62): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1> C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1465): note: see declaration of 'vsprintf'
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(73): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1> C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1465): note: see declaration of 'vsprintf'
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(84): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1> C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1465): note: see declaration of 'vsprintf'
    1>ERROR : UBT error : Failed to produce item: C:\UNREAL\NETWORKING\Photon-Particle-Demo\Binaries\Win64\UE4Editor-PhotonDemoParticle.dll
    1> Total build time: 4.16 seconds
    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3075: The command ""C:\Program Files\Epic Games\4.12\Engine\Build\BatchFiles\Build.bat" PhotonDemoParticleEditor Win64 Development "C:\UNREAL\NETWORKING\Photon-Particle-Demo\PhotonDemoParticle.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


    Cannot go past this BeginPlay() function:

    void APhotonLBClient::BeginPlay(void)
    {
    Super::BeginPlay();
    srand(GETTIMEMS());
    listener = new LoadBalancingListener(this);
    client = new ExitGames::LoadBalancing::Client(*listener, *AppID, *appVersion);

    listener->setLBC(client);

    automove = listener->getAutomove();
    useGroups = listener->getUseGroups();

    ExitGames::Common::Hashtable ht;
    ht.put(1, 1);
    ht.put(2, 2);
    info("Connecting...");
    info("appID is set to %ls", *AppID);
    client->connect(ExitGames::LoadBalancing::AuthenticationValues(), ExitGames::Common::JString(L"UR") + GETTIMEMS(), *serverAddress);

    }


  • 1> PhotonLBClient.cpp
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(26): error C2259: 'LoadBalancingListener': cannot instantiate abstract class
    1> C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(26): note: due to following members:
    1> C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(26): note: 'void ExitGames::LoadBalancing::Listener::debugReturn(ExitGames::Common::DebugLevel::DebugLevel,const ExitGames::Common::JString &)': is abstract
    1> C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\Photon\LoadBalancing-cpp/inc/Listener.h(24): note: see declaration of 'ExitGames::LoadBalancing::Listener::debugReturn'
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(27): error C2661: 'ExitGames::LoadBalancing::Client::Client': no overloaded function takes 3 arguments
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(38): error C2661: 'ExitGames::LoadBalancing::Client::connect': no overloaded function takes 3 arguments
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(62): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1> C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1465): note: see declaration of 'vsprintf'
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(73): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1> C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1465): note: see declaration of 'vsprintf'
    1>C:\UNREAL\NETWORKING\Photon-Particle-Demo\Source\PhotonDemoParticle\PhotonLBClient.cpp(84): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1> C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1465): note: see declaration of 'vsprintf'
    1>ERROR : UBT error : Failed to produce item: C:\UNREAL\NETWORKING\Photon-Particle-Demo\Binaries\Win64\UE4Editor-PhotonDemoParticle.dll
    1> Total build time: 4.16 seconds
    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3075: The command ""C:\Program Files\Epic Games\4.12\Engine\Build\BatchFiles\Build.bat" PhotonDemoParticleEditor Win64 Development "C:\UNREAL\NETWORKING\Photon-Particle-Demo\PhotonDemoParticle.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  • Kaiserludi
    Kaiserludi admin
    edited August 2016
    I would, but seems like now I am being moderated for no reason.

    I have just fixed that in the admin control panel now by manually verifying your account. Our Anti-Spam tool seems to sometimes get very nervous about users that have not verified their emails yet, when they try to post anything, but pure text.
  • LoadBalancingListener is a class from the demo code, that inherits from LoadBalancing::Listener and adds implementations for the mandatory callbacks declared there. The build fails if the compiler can't find an implementation for any non-optional callback. One of those callbacks is debugReturn(). In your log it states that it can't find an implementation for virtual void ExitGames::LoadBalancing::Listener::debugReturn(ExitGames::Common::DebugLevel::DebugLevel,const ExitGames::Common::JString &)'.

    If you look into LoadbalancingListener.h/.cpp, then you will see, that the demo implements virtual void debugReturn(int debugLevel, const ExitGames::Common::JString& string);, so the type of the first parameter differs.
    However the demo uses the up to date signature of that function, while the one that the compiler can't fin is an outdated signature that was used in older SDk versions.

    Could it by any chance be that you have not yet replaced the inc folders with the ones from the latest SDK?
    If you update the .lib files, please always also update the inc folders.
  • BxBL
    BxBL
    edited August 2016
    Yes, I was with headers from the Windows SDK while trying to use libs from the demo, but wrong version.

    After downloading the correct WinSDK and using the correct includes I got it working and converted Photon source to a 'unreal plugin' for the sake of project organization.

    Please, consider changing your UE4 implementation to be module plugin based. Here's example source which you could expand from:
    http://forum.photonengine.com/discussion/8170/ue4-photon-plugin
  • Is the demo updated to work with Unreal 4.13 already?
  • juaxix said:

    Is the demo updated to work with Unreal 4.13 already?

    it works :)


    but with some bugs...
    http://pastebin.com/Dk6GFtLQ

    well, as you can see in the picture, i think we need to setup the connection parameters, so, if I adjust in the client:

    setDisconnectTimeout ( 25000 ) //25 seconds before getting kicked by the server
    setTimePingInterval ( 20000 ) //20 seconds between pings
    setSentCountAllowance ( 6 ) //6 tries before disconnect


    will the server acknowledge this config and behaviour the way I want?
    from documentation: https://doc-api.photonengine.com/en/dotnet/current/class_exit_games_1_1_client_1_1_photon_1_1_photon_peer.html :smile:
  • Hi @juaxix.

    Thank you for this info. We will have look.


    setDisconnectTimeout ( 25000 ) //25 seconds before getting kicked by the server

    This means at max 25 seconds, before the Client sees the connection as lost. The server might still see the Client as disconnected a lot earlier (default: 5-10 seconds), if you don't also adjust the server values, which is not possible on Photon public Cloud as it would not just affect your application.


    setTimePingInterval ( 20000 ) //20 seconds between pings

    That value looks way too high to me compared to the disconnectTimeout value. If your app does not send anything reliable for a while and the connection gets lost shortly after a ping got sent that means 20 seconds will pass it will take 20 more seconds until the client even expects to hear a life-sign from the server and until it even starts re-sending.


    setDisconnectTimeout ( 25000 ) //25 seconds before getting kicked by the server
    setTimePingInterval ( 20000 ) //20 seconds between pings

    What is the reason for such high values?
    I don't see anything in the screenshot or the log regarding the connection quality.
  • I have just tried the demo project in UE4.13.2 and it works like a charm. I can't reproduce the errors from your log file, nor does the log state any error at all.
  • Hello @Kaiserludi, thanks for the info, i need to enter into another task (show ads) in android so i can get back to the main activity where the photon connection is running on time before getting disconnected, if you know a way to do it, it would be great.

    Ah, I can confirm that the SDK and the demo runs perfectly with Unreal 4.14, i have coded a layer to build a plugin with blueprints to use it directly from a game
  • Hi @juaxix.

    I am not sure if I understand you correctly.
    You execute a task that is rather time consuming and are now asking me how you can make sure to return from it so that your Photon connection doesn't time out?

    Does that mean, that that task blocks execution of any other code and the main loop does not execute at all at that time? Honestly that is a terrible practice. A program should never do that. If some task takes that long that it can't be finished within one frame without a considerable frame rate drop, then you should not block the main thread until this task has finished executing, but you should either split the task into smaller sub tasks that only run for considerably less than a frame or call it asynchronously and either use polling to check if it has finished or let the class of your main loop register a callback function or a listener class that contains a callback function, which gets called by the task to inform that it has been finished.
    Never ever should a task make the main loop unresponsive by blocking it from executing for more than at max a few milliseconds, not just because of keeping connections alive, but also to stay responsive to user input and to keep the visuals smooth.
  • I'm just using an ad framework for Android and it pauses the main activity while playing a video ad...i know it's not a good practice, but it's not my design. Android...
  • I guess the by far best option in this situation is to just stop using such a terrible framework and switch to something that behaves in a saner way. Yes, seriously.

    Can't you somehow let that framework execute on another thread? Maybe it is just blocking the activity in which it is running, so not running it on the main activity might keep the main thread responsive.

    Alternatively you could just run your whole main loop on a secondary thread and just let the main activity idle, but that feels a bit like getting around a closed door by pushing once head against the wall until the wall breaks.

    If you don't mind about the input, visuals, game logic, physics, music, etc. all getting stopped and just want to keep the photon connection alive, then you could also let just the Photon Client, and all networking code that interacts with it, run in a different thread. However getting this to work may involve quite a lot of refactoring work in your code base.

    An alternative approach might be to simply NOT prevent the disconnect from happen. What is the point in pretending that the player would still be actively playing, if in fact he can't do anything for as long as the video is running, because his input can't be handled by the app and he can't see what is going on in the game?

    Actually such a full screen ad during a multiplayer match seems to be a terrible game design decision to me. As a player I would definitely delete your app the first time that I loose a match because of such a video ad.

    So my suggestion would be: just find an alternative approach to showing ads while the player plays in multiplayer mode.

    If you really want to stick to having adds during multiplayer games, then just set a playerTtl on game creating that is longer than the longest video ad that could be shown, then simply let the player disconnect and after the video has been finished, let the client reconnect and rejoin the room.