What is player controller and auto posses?

I have read that player controller is a class which gives input to pawn but it was also written that input facility can also be added directly into pawn class.I have few question
1)so what is the use of player controller?
2) can my game run without any player controller?
3)what is auto posses?( read in forum that only that pawn will move which is auto possessed but i didn’t understood the concept)
4)what is default player controller?
5)how many player controller can i have in a level?

I am a noob and recently started learning ue4. so if any of my questions is invalid then sorry for that.please clarify my concept of player controller.
thanks

  1. Player controllers accept input and represent a connection in network multiplayer.
    You always have a playercontroller but it is not always in possession of a pawn.

Thanks but please answers rest of the question as well

  1. The game can run but without a player controller there is no viewport so your screen will be black.
  2. Auto possess makes it so that when the Pawn begins play, the assigned autopossess player controller will be taken off of its current or default pawn and possess that pawn instead, without having to call the possess function of a playercontroller in blueprint.
  3. Default player controller is the type of playercontroller (you can create and program new ones specific to your game) that you start out with for a given Game Mode when the Level begins, and is set in that Game Mode blueprint’s defaults.
  4. I think the limit is 32 or 64 networked players without modifying source code, but only 4 players for split screen mode locally.

Yes you can handle input directly in the Pawn class or anywhere else, if you want. if that inout was not handled and consumed by the player controller that possesses the pawn first, and it only gets to the player controller if UMG widgets didnt get it first. And if a pawn doesnt handle it then the level blueprint can.

There are many reasons to put the input logic in a playercontroller for example if you want to switch pawn classes in the middle of gameplay. The playercontroller can posses the new pawn and destroy the old one, and pass commands to it for movement, attack etc using the same input mappings and logic as for the old pawn, but the new pawn could decide to handle it differently.

For the pawn to know which player’s input it is getting it needs to be possessed by a playercontroller.
But you can handle the input in the Pawn or the controller.

Another reason for controllers is so that the player doesnt get destroyed out of the game when their pawn dies. That way they can still exist to press the redrawn button for example and get a new pawn, or bring up a menu to load the game to the point before they died. If the player itself is gone then nobody can issue those commands or even see the screen.

That means pawns cannot Handel input if they are not attached to a controller?

Actually I think they might be able to, but only if the player controller that the player has doesn’t handle it first. Plus, if you have multiple pawns, how do they know which one of them should be responding?

There is probably a way to get pawns to detect inputs outside of the playercontrollers that are causing those inputs. Player 0 always has the keyboard and mouse so anything coming from those peripherals is probably being caused by player 0 in the first place no matter which object handles it.

But like I said if you can see anything on your screen you are probably in a playercontroller, possessing a pawn that has a camera in it. That pawn might be a DefaultPawn class (like the one used to fly around levels in the editor) or a Spectator Pawn. You can look at your default Game Mode in your project settings to find out.

Lots of things can handle inputs without being possessed by a playercontroller. It’s just that it’s a playercontroller that is sending out those input signals in the first place. When a playercontroller possesses a pawn, then those inputs get routed to that pawn, anything that’s not handled and consumed by the playercontroller first.

ok,but if I don’t have any player controller .Then will my pawn will move and if I have 2 pawns and 1 controller then Can i control those 2 with same controller and if as you are saying player controller sends the input at the first place then it means without any player controller in the level no input will be processed?