Announcement

Collapse
No announcement yet.

Replicating minimap by using render target / 2d scene capture.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Replicating minimap by using render target / 2d scene capture.

    Hello guys,

    I think it's my first topic here! I am excited to share my thoughts/problems with you all.

    I am creating FPS multiplayer game and I've got a problem with replicating 2D Scene Capture Component created as UMG widget. I call it from begin play in PlayerState.

    The issue is on both server and client I see the same pawn, I am expecting to get different views.

    Please see attachments below.


    #2
    Hi, are you playing in PIE (not standalone) and using the same rendertarget for both of your minimaps (client and server)?

    Comment


      #3
      Hi man,

      I am playing in PIE and standalone, no difference. Yes.

      Comment


        #4
        Ok, I'm using a minimap myself and it does the same as you describe in PIE (I assume that's because both server and client write and read from the same rendertarget).

        In standalone though it works as expected so both have their own view cause in standalone there are running two games separately instead of one game with two windows. So they both write and read from their own rendertarget there.

        So to generate the image for the minimap I use a blueprint that just contains a rendertarget and move that with the player. Also it isnot set to replicate (you said you have a problem to replicate it but it shouldn't be replicating cause you want to have one on the server and a separate one on the client).

        Comment


          #5
          Originally posted by chrudimer View Post
          Ok, I'm using a minimap myself and it does the same as you describe in PIE (I assume that's because both server and client write and read from the same rendertarget).

          In standalone though it works as expected so both have their own view cause in standalone there are running two games separately instead of one game with two windows. So they both write and read from their own rendertarget there.

          So to generate the image for the minimap I use a blueprint that just contains a rendertarget and move that with the player. Also it isnot set to replicate (you said you have a problem to replicate it but it shouldn't be replicating cause you want to have one on the server and a separate one on the client).
          Thank you so much for your effort chrudimer!

          I am going to try it right now!

          EDIT:

          The funny thing is that now:
          On Client I see server render target
          On Server I see client render target

          when I run two seperate game instances via cmd.

          I created seperate BP class which inherit from Scene capture 2d and attach it to my blueprint character. I am still doing some debugging, I will let you know if I manage to solve it.

          EDIT2:

          I have solved the problem by using IsLocalControlled() node before attaching the SceneCapture2DComponent to my character bp.

          Thank you so much chrudmier for help!
          Last edited by bigfatblunt; 01-28-2020, 07:01 AM.

          Comment


            #6
            Hello bigfatblunt ,Can u tell me the steps or take some screenshots cuz i don't know how to do it

            Comment


              #7
              Originally posted by Yazan.la View Post
              Hello bigfatblunt ,Can u tell me the steps or take some screenshots cuz i don't know how to do it
              What do you need help with exacly? Take a look on youtube videos.

              Comment

              Working...
              X