This has been frustrating me for two weeks, now. My project utilizes the Steam OSS, and I have session hosting/searching/joining working, but I’m totally stuck on trying to manage objects after that point.
Here’s my project architecture, thus far:
- To aid in the centralization of code, ALL of my maps have an
EventManager
actor blueprint added to them… tasked with distinguishing which map we are in, creating & storing widget blueprint references, and displaying the correct ones based upon the current map. There are also a number of RPC events here to aid in the process of UI updates, though I’m not sure this is good practice. - Game launches into
EntryMap
, withEntryGM
being the default game mode. This game mode displays the main menu, which includes options to join or host a game. Choosing Join tells theEventManager
to start searching for sessions. Choosing Host fires off an event inEventManager
, which creates a session and (upon successful creation) opens theLobbyMap
withlisten
as a parameter. -
LobbyMap
hasLobbyGM
as the default game mode, as well asLobbyGS
(GameState),LobbyPS
(PlayerState) andLobbyPC
(PlayerController). This game mode displays a Lobby widget, which is supposed to allow players to join a match, set match settings, chat with each other, state they’re ready to play, etc…
This is where I’m stuck. I obviously need to know when a player joins/leaves the lobby, and then update the UI accordingly, BUT… Who owns which PCs? Who should create what (and within which classes)? How should lobby data be replicated, which RPCs should be used (and where) to keep the UI synchronized across the server and all clients? I’ve tried using UniqueNetId
to distinguish who is who, but I can’t find the proper place to gather this information. I keep juggling my implementations around, running into NULL objects, playerstates, widget references, etc on either the client, server, or both.
Someone please point me in the right direction… I’ve read so much documentation and code examples, but still feel like I’m at square one.