I am using UWorld::SeamlessTravel to travel from the main menu onto a single player map. Since I want to provide the option of playing different game modes on the same map, without duplicating the same level, I am using the “?game=xx”-URL-Parameter to override the game mode. This works perfectly fine when playing in editor, or starting a standalone game. However, as soon as I package the game as Shipping build, the game mode override does not work anymore, and it defaults to the gamemode specified on the level.
Exact command I use to travel:
Is this a known Bug, and is there some workaround available? I also tried using a GameMode-Alias instead of the explicit reference, but with the same results.
You could try overriding the game mode using the SetGameMode function: UWorld::SetGameMode | Unreal Engine Documentation
However, there is also another option for how you could set something like this up. What you could do is create classes that handle the functionality of your different game modes, and then call the necessary functions inside of those classes from your game mode. This would ensure that you technically only need one game mode, but it is able to pull functionality from different classes, so instead of changing the game mode you can just call whichever functions you end up needing. In this case, your game mode would be more of a middleman, and instead of placing all of the code inside of the game mode, you would just use the middleman to communicate with different classes that contain the functionality you need.
Hope that helps. Have a great day
Thank you for your answer, Sean. What you are suggesting are merely workarounds, though. Although they might work in my case, the ?game parameter should in theory work, shouldn’t it? It would be nice, if you could verify if there actually is a bug on your end concerning the ?game parameter in shipping builds. I posted this question in the bug report section after all. Maybe the ?game parameter only doesn’t work in shipping builds if used in conjunction with the SeamlessTravel-Function?
In the mean time I will make due with one of the workarounds you suggested.
I’ve attempted to reproduce the issue you are seeing, however I was not able to get my game mode to override, even in the editor, using the code you provided. Is there something else that you are doing to get this to work properly? Could you provide some repro steps so we can get the issue on our end?
I am using the “?game”-Parameter as described in this thread: https://forums.unrealengine.com/showthread.php?84474-OpenLevel-with-options.
It is also being used in the ShooterGame example. I’m also setting the bAbsolute argument of SeamlessTravel to true, if that makes any difference. I wrapped the SeamlessTravel-call in a BlueprintCallable function, and am calling it from a UMG widget (when the player presses a button in the main menu). I could also use open level instead of seamless travel, but seamless travel is so much faster :(.
I have attempted to reproduce your issue, but I am not seeing the same behavior. In my shipping build, the game mode is being overridden as expected. Would you mind testing your Seamless Travel call on Begin Play instead of in a function?
I will test mine using a function next to see if that could be what is causing the issue, but I’d like to compare our results to make sure we are seeing the same behavior.
Thanks for your help, I managed to find the problem. It was on my end, and something (somewhat) unrelated. Since the gamemode i want to set using ?game is not explicitly referenced by any map and I only cook my assets by maps, the gamemode i want to set using ?game is not included in the shipped .pak. This also explains why it works in the editor, but not when testing in a packaged build.