I´m a bit confused. I wasted hours and hours for researching this little understanding problem.
First of all, I have a few general questions:
The UWorld class seems to be a class which I do not have to override. Is this right? How should I implement special behavior for the worlds (which I can use again in an other world)?
Which is the class for the maps, is it Level, or World or anything else?
The Level classes are only for streaming large Worlds?
The WorldContext is also only for streaming?
Now I try to explain, what I want to do and where my problems are.
I want to create a little multiplayer game. The players have no visible actors in the World, they just exist as SpectatorPawns and can move and look around in the world. So its absolutely uninteresting where the players are. In this world, there exists some buildings, and all of this buildings have their own indoor map (or possible more than one). This maps can be entered of the players, but the other players should stay on the maps where they are.
So, here is my Problem. Where should I implement my GameLogic? I currently have a custom AGameMode object as my game logic, but as I understand it the GameMode changes when I enter a new map. Is it possible to have two or more maps open on the server?
And how do I implement a client map change in c++? I see many methods in a few classes, but they all seem to be not the right.
I’m no expert but I don’t think that a server can have two different maps running at the same time - you’ll probably need a different server for each one. Normally what you would do is setup the first world you describe with the spectators as it’s own level, and then when the player enters one of the buildings transition that player to a new world.
Thanks for this reply.
But now I am in trouble with my GameLogic. Like I explained, I build a multiplayer game, but you can also play it as a singleplayer!
The game is divided into different days, which I have to calculate on the server. So, where do I have to place my gamelogic? The Gamelogic should only be used on the server (the DayTime and other stuff should be replicated). I tried to put it into the “GameInstance” class, but this class will not be replicated…
The GameMode/GameState is also not the correct part because each World has its own and the players are able to change the world.
So, which is the common way to go here?
Use gameinstance to store data, read that data in your gamemode and set variables in gamestate that are replicated. So gameinstance stores data that gamemode passes through to gamestate which replicates to the clients?