Hello Unreal Community!
I am uncertain if this is the right subforum, but I could not find an explicit networking category and I assume that this is the closest thing.
I am trying to create a card game but in order to do so I am facing some restriction compared to most games that are created in Unreal because interactions in Unreal are, as far as I can tell at this point of my learning journey, mainly based around actor position and collision.
To do what I am trying to do I would require the players to exchange raw data, preferably in JSON, XML or similar data formats, at several points of the game. I can match up players and allow them to join each others game in a dedicated lobby and can then move them to the new map.
The first problem comes up when I Join a game. After Joining, before entering the game, I would like both players to axchange a list of 28 integers that define the deck they are using by card id. After leaving the lobby and entering the game map both players create their own actors and their opponents actors based on these id lists. These actors should not be replicated because I do not want my opponent to always see my cards. Which is why I opted to sharing the map but creating all gameplay objects locally for each player. Except for exchanging the data this all works and both players have their own instance of gameplay objects that they can interact with and “play” the game on their local machine.
Which leads me to the second point of my game where I would like to exchange data. Once the game starts all cards are distributed in 5 different lists. All possible actions can be described by an action source and an action target which are identified by the id of the list they reside in and the index the card has in this list. It is currently possible to execute actions for both players from nothing but these ids because both players know exactly what cards are referenced by these ids. (This already works, currently the game runs in a kind of hotseat-mode).
My issue is that, as with the id-lists in the lobby, I still need to actually exchange these action objects whenever one has been created.
The only way I can currently think of doing this is by simply creating a TCP Connection or use a similar connection type to directly connect the players which kind of robs me of the possibility of using something like steamworks (unless there’s a way to create a direct connection between two players through this which I don’t know of).
I hope that I could explain my problem in sufficient detail to allow you to at least point me in the right direction.
Thank you for your time.