I got a multiplayer LAN network game working great, but then when I added splitscreen for each client (including the listen server), then it started acting really weird. It would still spawn the pawns and possess them on the Server, but on the client, it doesn’t possess them anymore, AND it changes the client’s playercontroller IDs to -1 to match their IDs on the Server. I wonder if it’s trying to possess with a null playercontroller because of it getting shunted around as a side effect like that. No way to tell because I know I’m not telling it to change its ID.
I have solved this by removing an RPC loop, and by converting the Tank preferences setup for the tank pawn’s Possess event to use Player State : Player ID to match players to their respective controllers across machines (since there is no matching them up any other way, as I sadly discovered through many hours of trial and error).
could you elaborate on that? i’m trying to accomplish this as well
The problem was that I had the mistaken notion that Player Controller IDs were the same thing as Player IDs. They’re not.
Player Controller IDs are 0, 1, 2, 3 for local splitscreen players (or just 0 if one player on that machine), and -1 for players on another machine.
Player IDs that you get from PlayerState object are unique and are the same across all connected machines. I had to loop through all the Players in the GameState : PlayerArray and find the one with the same Player ID as the one I sent via RPC in order to find the right one. There’s probably a better way to do that than looping through them all but that’s how I got it to work.
good information! i will remember that… games need to have split screen online pvp… good ol days
Hey mightyenigma, thanks a lot for this info. Would you bother sharing screenshots of the blueprint? I am blocked on this network splitcreen feature for some time now and still cant find a way out.