Our Realtime SDK is currently in the final stages of testing for the Unreal Engine. Is this what you are looking for? Feel free to log a ticket with our support service over at https://support.gamesparks.net/ and we can answer all your questions.
UGameSparksComponent is a USceneComponent. so it have to be added as an component of another scene actor . problem is that whenever i load a new level that scene actor gets deleted . so connection between ue4 app and gamespark also gets reset.
how to prevent that?
anyway to not to delete the scene UGameSparksComponent’s parent?
You need to save your GameSparksComponent in GameInstance class. For my game what I did was I created GameSparks Component in my base game mode (from this I derive all other game modes) under constructor and inside InitGame function I save the GameSparksComponent in Game Instance class. This way, I never get lost of GameSparks connection throughout the game.
I worked around it, using only one gamemode and one player controller.
After initial login, after the player leaves the login area and begins playing i set a bool, and check on the gamemode eventbeginplay if it was already set, if yes, the gamespark disconnect/connect and loading of the login view is skipped. The menu is accessible from within the game, so once the game begins, the player can do everything anyway. I can always load a different level and hide the player from the view if required. Not sure if this yields other problems, but so far seems to work for my approach.
Game Mode doesn’t exist on clients. If you try to cast your game mode in client it will always return null. If you want data throughout the entire game (i.e: even after loading new level) you need to save your data inside Game Instance because they exist till you exit the game completely.
i have tried your code sample.
sadly in 4.11, whenever a new level was loading the UGameSparksComponent stored in UMyCustomGameInstance was getting delated. and a new one was created by new AExampleGameMode() and was stored in UMyCustomGameInstance .
and i dont want that.
may be it works differently in latest version of ue4.
no idea. how the UGameSparksComponent was getting survived on client side during joining to server.
from my knowledge ,all sceneComponent supposed to be getting collected by garbage collector.
hence no sceneComponent can survive on client side.
and sadly UGameSparksComponent is a sceneComponent .
i dediced to modify the GameSparks plugin as it’s source code available. and i hope i will be able to make it bypass garbage collection.
If you dont want GameSparksComponent getting garbage collected then you should remove UPROPERTY() from it. If you look at my code example above you can see I never added UPROPERTY() for GameSparksComponent in GameInstance class.
u have to do it by yourself. there are some open source tools for it.
the only thing in this matter GS helps is that it can provide u how many player is playing on each server. also GS can help u by providing player geographical location.