Marker/Ping System

Implementation:

  • Works by having an APingManager class (derived from AInfo)
    • APingManager – Manages all of the pings for all of the players, by assigning 1 ping to 1 player (1:1).
  • The AGameMode class creates APingManager
  • In order to communicate to the APingManager class, any Actor that wishes to ‘ping’ a location, must implement UPingComponent.

Why This Implementation?

  • If the ‘pings’ were just handled with an UActorComponent, and any actor we want to ping implements said component, then when the APlayerController possess Pawn1 and pings, a ping will appear. If said APlayController possess Pawn2 and pings, then there would be 2 pings for 1 PlayerController on screen. I did not want this.
  • Why not have APlayerController implement the UPingComponent?
    • Well, APlayerController only exists on the Server & the owning client. So, if the APlayerController pings, then no other client will receive said ping.
  • How about APlayerState?
    • Well, while adding the UPingComponent to the APlayerState will work, since APlayerState exists on all clients as well as the server. The issue is, the NetUpdateFrequency for APlayerState is very low, thus when pinging, the ping will take a noticeable amount of time to appear.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *