[UE4+Realtime+Chat] Use Photon without an in-level instance?
Options
Photon Realtime and Chat are working great for me so far. So there's nothing wrong in that sense.
I based my integration off of the UE4 LoadBalancing demo, where it uses a Blueprint in the level as an instance of Photon, and in my case, both Realtime and Chat simultaneously.
I'm wanting to know how I can use Photon in more of a general capacity. What I mean is for a way to use Photon without an in-level instance. This current method makes it impossible to retain a connection while going between levels in the game.
So how I can use Photon in a way that's maybe more general, and is not based on existing within a particular level as an instance?
I based my integration off of the UE4 LoadBalancing demo, where it uses a Blueprint in the level as an instance of Photon, and in my case, both Realtime and Chat simultaneously.
I'm wanting to know how I can use Photon in more of a general capacity. What I mean is for a way to use Photon without an in-level instance. This current method makes it impossible to retain a connection while going between levels in the game.
So how I can use Photon in a way that's maybe more general, and is not based on existing within a particular level as an instance?
0
Comments
-
I think the only way to make this persistant is to implement the logic in a custom GameInstance class. This class can also be used for storing values that must persist through map / server travels. I try to implement this myself already with a custom server logic and with PhotonPeer on the client side.0
-
Hi,I based my integration off of the UE4 LoadBalancing demo, where it uses a Blueprint in the level as an instance of Photon
Simplest solution would be static client which available from anywhere by single reference.0 -
Serphimera wrote:I think the only way to make this persistant is to implement the logic in a custom GameInstance class. This class can also be used for storing values that must persist through map / server travels. I try to implement this myself already with a custom server logic and with PhotonPeer on the client side.
That's a really cool idea. I suppose the Timeline elements I was using in my instanced Photon Blueprint could just be passed through a local Blueprint that can do Timelines. Plus, being able to access the game instance class that holds Photon at any time from any Blueprint is extra useful.0 -
Hi there,
hopefully it will work for you. My implementation is not yet finished as I am not a very well c++ programmer :-o. What vadim said could be a another option . I think he suggests building the "client" seperately and adding a reference to ue4, perhaps as a custom lib. So the engine can communicate with your client from everywhere.
That said I think this in combination with the GameInstance can be very helpful. Will try to implement such a client over the weekend :-)0 -
I can confirm that using Photon in the GameInstance class works just fine. Since you can't use Tick in GameInstance, and therefore can't call service() regularly, I placed a BP in each level called PhotonHelper, which uses its own Tick to call service() from the GameInstance. I made a function in GameInstance called U[project]GameInstance::callService that handles the call, and calling it perpetually through the PhotonHelper BPs works just fine.0
-
Glad to hear that you succeeded in this.0
-
Sorry for reviving this old thread but I finally managed to get the photon cpp api running in UE4 with a custom server in the backend. I had some issues (not with photon itself) with the engine in general as I'm not a experienced c++-programmer
If you are interested in my implementation you find the sources on my github repository
https://github.com/Serphimera/DragonBorn
It's work in progress but I try to document everything deeply so that one can understand my thoughts.1 -
@Serphimera: If you contribute a showcase or insight (like above), you are welcome to revive any old thread you like!
Thank you.0