Hi,
I don’t know if anyone could help. I was trying to work out the best way to create/register multiple players for a game. I haven’t got as far as getting to client server remote players, but simply as a game playing locally with for example one human player, and one or two AI players. At this point, the question stems from me wanting to pass the player start location from the level blueprint to the player controller, but I guess from here the question is going to come up a lot for me for different reasons. So the question is, what is the standard way of registering numerous players (AI or human) with GameMode, and what is the best way to set up communication between the game mode, level blueprint, and active players?
My first thought is to use a top down spawn structure, where the GameMode spawns all of the players to be in the game (e.g. 1 player, and 2 AI) using “Spawn actor/AI from class” (which one would be better to use?). GameMode will then have target references to all of the player instances, so communication between them would then be straight forward. I could use the “Get Game Mode” node for each of the players to get a reference to the game mode instance, or could create an initialise function for the players that the GameMode could call after spawning them that could pass all useful data (e.g. other players, level reference etc). Is there a standard way that most people go for when doing this, does the above sound ok, or is there a massive hole in the idea and my pc is going to chuck a cog out of the window?
As another related question, how can I get a reference to the level blueprint for the AI or player blueprints (e.g. if I want to get the player start location from the level blueprint?). And also, if I manually spawn a player controller, how will this affect the player controller that is auto-created by the engine at game start (will it be auto-added to the player index in get player controller)?
Any help would be great…
Thanks…