Download

Help with MP setup based on Gunslinger setup...

I’m at a real loss here. I’ve been struggling with this off and on for a few months, but I can not get a proper MP game working correctly. I’ve got a list of issues that are all probably somewhat related. Hopefully someone can give me some ways to debug and at least figure out where to look for issues. Everything I’m doing is in Blueprints, no C++ knowledge here at all.

My current setup is based on these 2 tutorials which are essentially the same setup. I didn’t realize that until I was 2 hours into the second one. At least now I have a nice main menu and state transitions. :slight_smile:

Here’s a high level explanation of what I’m trying to achieve.

I want to create a card game from the cards included in the Blackjack example project. I tore that apart and got all the logic I needed working in a single player environment. When I started trying to get things working in a networked environment I started having issues. I have a custom pawn that is just a camera and 10 StaticMesh components to represent card placement. On construction, I put them in an array and when the game is initialized by clicking on the deck at the center of the table, cards are dealt (spawned) to the location of those components and the components are then destroyed. I want the server to always be placed at seat 1 and the next player to join at seat 2, etc. Once everyone is joined, I want the server to click the deck and deal cards that appear to only the players that own them and only they can interact with them. Super simple concept, think Hearthstone where I can see my cards and the back of my opponent’s cards.

To start, I’d be happy to get my server into the correct seat every time and then start to figure out how to ensure a pawn connected to him spawns each time in that seat. More general questions below…

  1. How can I debug/test this stuff? Seems I need to run in standalone or package the game, but each causes different issues. What’s the proper way to test MP?

  2. I’m doing a turn based card game so I need players to spawn in to specific spots EVERY TIME. This has not worked correctly with any method I’ve tried. Why?

  3. How would I extend this setup to 4 or more players assuming all players should spawn in at specific places every time? This uses a branch and I’ve tried various versions of switch on Int, sequence, etc. However, the base setup doesn’t seem to work so extending it doesn’t seem important at the moment.

  4. My pawn is a camera and up to 10 card components that are destroyed when the real cards are spawned. I used to have the card spawning working, but when I moved to the setup from these tutorials, it stopped working.

  5. Bonus issues, when no spawning happens and all pawns are removed from the level (none placed in the level), they still show up somehow. Where would they be coming from if the only SpawnActorFromClass nodes are not called?

  6. I have a feeling some of my issues are due to order of execution. How do I tell what is happening first in BP? I have put break points on 2 things to see which fires first, but some stuff like EventOnPostLogin seems to do stuff inside itself as well as what’s chained after it. For instance, it’s taking an input of a PlayerController, but I can’t see where/how it gets that.

  7. Perhaps related, my main menu level seems to have a started running some logic from GameMode, GameInstance, others (?) and has a pawn spawning (i can see this from PrintStrings) and other stuff going. Do I need a separate game mode for the menu before going into gameplay? Not sure that fixes anything else for me, but knowing the 'proper way to do this might help.

  8. When I package the game, when I create a session and try to load the main level (not menu), I get a travel error labeled 3. Looking at the Enum for travel errors that’s either a bad URL or a missing package.

  9. How do I know which on it is. Does 3 mean the third number starting at zero or the error labeled 3 in a list that starts with 0, so therefore the 4th one in the list?

  10. How do I fix either of those? What’s the URL for a map, I just put in the map name like I have in other projects where it works fine. If it’s a missing package, how do I check to see if it’s getting packed and then fix it if it’s not included?

  11. Once I have the players spawning in correctly, how do I control who can do things and when? I want the server (player 1) to only be able to play on his turn and only interact with his cards. Same for all players, but I can’t figure out how to tell who’s in control at any particular time. Getting player info is super confusing with PlayerControllers, PlayerStates, etc.

I know this is a lot without much detail. I’m just now sure how to go about giving details since I don’t know where the issues lie. A few screens so you can see some of the setup I’m using.

Any help would be appreciated.

AnswerHub post: Help with MP setup based on Gunslinger setup... - UE4 AnswerHub

&stc=1

&stc=1

&stc=1