Unreal Engine

All C++ based Photon SDKs are compatible with the UNREAL ENGINE off the shelf.

In detail the multiplayer SDKs you can gear up with the UNREAL ENGINE SDK are

You get all Photon SDKs from the Download page.

Get Started

Proceed as follows to integrate any of the compatible Photon multiplayer game SDKs with the UNREAL ENGINE SDK.

  1. Download the UNREAL ENGINE SDK.

  2. Download the Photon SDK for your targeted Platform: iOS, Android (NDK), Windows, Mac OS X

  3. Only UE4 'C++' projects are supported.

  4. Unpack the Photon SDK of your choice (Windows, Android or iOS) in the 'Photon' folder inside of the 'Source' folder of your UE4 project.
    Only the header files and pre-built libraries are required. You may want to add libraries for multiple different platforms.
    Sample folders layout:

  5. Modify the Photon headers to workaround an incompatibility with the UE4 headers.
    Rename FLOAT to EG_FLOAT, or apply Source\Photon\photon.patch from the reference project:

  6. Modify the Photon headers to fix an RTTI detection issue that would otherwise appear when compiling with UE4:

  7. Edit the *.Build.cs file of the UE4 project to load the libraries for a given platform and to set Photons platform defines.
    See Source/PhotonDemoParticle/PhotonDemoParticle.Build.cs in the demo that is linked below and UE4 documentation:

  8. Include the appropriate Photon API headers in project sources with some workarounds; source\photon-import.h in the reference project:

  9. Use the imported Photon API in the source code of your project.

  10. Build your UE4 project for your platform of choice.

Notes

Some hints regarding UE4 iOS builds can be found at https://answers.unrealengine.com/questions/21222/steps-for-ios-build-with-unrealremotetool.html

Ready-to-run Demo

Find a ready-to-run proof of concept for download here

  • follow steps 1 and 2 from above
  • unzip the downloaded package
  • follow step 4 from above
  • open the context menu for ./PhotonDemoParticle.uproject and choose "Generate Visual Studio project files"
  • if you have multiple different versions of unreal engine installed, choose the desired engine version and click OK
  • UE is now generating the project files. This may take a couple of seconds and UE will indicate that it has finished doing so only by letting the "Generating" message box disappear
  • open PhotonDemoParticle.sln with Visual Studio
  • choose "Win64" as solution platform
  • choose "DebugGame_Editor" as solution configuration
  • in the solution explorer navigate to Games/PhotonDemoParticle and build that project
  • Debug or Run that VS project - this will start the UE editor with PhotonDemoParticle as loaded UE project
  • in the UE Editor "World Outliner" tab navigate to "PhotonLBClient" -> "Demo" -> "App ID"
  • replace the content of that field with the App ID from your Dashboard on our Website
  • press Play

 To Document Top