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
Proceed as follows to integrate any of the compatible Photon multiplayer game SDKs with the UNREAL ENGINE SDK.
Only UE4 'C++' projects are supported.
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:
Modify the Photon headers to workaround an incompatibility with the UE4 headers.
EG_FLOAT, or apply
Source\Photon\photon.patchfrom the reference project:
Modify the Photon headers to fix an RTTI detection issue that would otherwise appear when compiling with UE4:
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:
Include the appropriate Photon API headers in project sources with some workarounds; source\photon-import.h in the reference project:
Use the imported Photon API in the source code of your project.
Build your UE4 project for your platform of choice.
Some hints regarding UE4 iOS builds can be found at https://answers.unrealengine.com/questions/21222/steps-for-ios-build-with-unrealremotetool.html
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