Hi,
I’m trying to port our game to Unreal Engine and I’m struggling to have the character creation completed in Unreal, where I need to send some networking packets from client to server on each creation screen. This communication is not related to a specific “map”.
I understood I can use the Beacon class to do this, which allows communication between client/server outside the normal context of game map.
Unfortunately I cannot find any example of usage of this class, or similar ones which will accomplish the client/server communication for my char creation screens. Can anyone point me to an example or step up to help making one? I think this can be beneficial to many other projects.
Why not have a “character creation map” that is basically empty but for an actor that shows your character creation UI. Store the results of the UI into your database or something in your GameInstance. Once the creator is done, simply load a new map which is the main game map, then recreate the player based on the data captured in the UI “map”. So essentially make the default go into a UI map that has nothing but UI actors.
Now that I think about it, the “creation map” thing wouldn’t work because you want a character creation screen per connecting player. It would only work if everyone does the character customization at the start of the game (I’m thinking kit loadout screens like in counterstrike say).
So you’re likely going to have to specify it all via the game mode. Don’t spawn the player until the character creation has been done. So it’d essentially have a state for each connected player either “in customization screen” or “in game” and only advance you into the game (i.e. spawn character, possess character) once you had done the customization part.
Hmm, I might have to try this out for a tutorial. Seems a reasonably common use-case and I’ve not actually done it myself yet.
You got the point. I don’t want to have the “map” loaded yet, and it looks to me like a very typical use cases, so I’m surprised I cannot find examples. The answer I got in the past was to create one server only for char creation which holds a map where all player go with the char creation UI/level, then move them to another server after char creation. This seems over-complicated to me and so I wanted to find just a way to use unreal networking without “travel” happening. And I found the Beacon class, which seems to allow pure network communication. Will be very good if you could help by providing an example for this.
Unreal is a bit strange compared to other engines in that you nearly always have to be in a ‘World’ to be able to do virtually anything. (Not the case in Frostbite for example).
Unreal Tournament uses beacons, but I believe it still requires the players to be in a Map of some description to allow network communication. You could take a look at their source, or you might be able to achieve something using the TCP Socket classes and sending information directly, but I guess that depends on your use case. I haven’t used either myself I’m afraid!
1 - on the login of your gamemode (independant from map), you ask the client to pop up the Char UI customisation. And you can use classic RPC to send information back to the server
2 - you can create Beacon Server/Class to communicate between server and client, but clearly the server do not have any information about you (Playercontroller, player state etc…) you need to find a way to passe unique ID in the beacon messages and keep them on the server so once the Client Travel to the server map, you can identify id and load up its configuration. ← Not the easiest way to go in my opinion. Beacon, are more to do “lobby” like UI with server browser where you just need to know how many players are playing, which map etc…