Announcement

Collapse
No announcement yet.

Drawing 3rd person world objects/meshes in front / before 1st person arms.

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

    [PROTOTYPE] Drawing 3rd person world objects/meshes in front / before 1st person arms.

    Hi all. I would like to know how can I draw the 1st person weapon arms to appear like they are world object when viewed from my own Pawn's point of view?

    Meaning: A player can grab an enemy (for example strangle him), and his 1st person arms or mesh drawn on HUD/overlay would appear AFTER the 3rd person world object - in this case enemy player Pawn's 3rd person mesh.

    So in the end we will have something like this:

    https://www.youtube.com/watch?v=vM9vWF1j1Pg

    As you can see in the fideo, when "you" grab the enemy soldier, some of your fingers appear BEHIND him, and are not drawn. Same goes for the knife.

    One idea I am having, is somehow replacing our standard 1st person arms on the fly with a high quality 3rd person arms that are always part of an enemy's soldier 3rd person character mesh, but in normal situation hidden inside him (inside the mesh). So when we begin or scripted animation sequence, our STD 1st person arms get moved out of the scene (as in the video) and the special 1st-3rd person arms that are hidden inside the enemy player pawn's mesh are are quickly moved behind our back and from then on you see the animation playing.

    My second idea is instead of hiding these special arms in each every player character model, simply SPAWN THEM on the fly as 3rd person object and only make them visible clientside for the bNetOwner of the one who is performing the scripted sequence (the rest of the players will see him doing his standard 3rd person animation draw fine so no need to spawn these HQ special arms for them.

    My 3rd idea is: when the animation begins, we stick with our standard 1st person arms, but we somehow "transfer" the enemy player's Pawn from the "world" to our Hud/Overlay for rendering, so that it can appear in front of our standard 1st person arms or in between them.
    I have no idea how this could be achieved but I think its possible if through code we are placed on the proper distance form the enemy's Pawn before the transfer begins, so that his mesh will not suddenly move a bit to the front/back or sides.

    My 4th idea: we somehow tell the draw functions through code which is responsible for 1st person arms to simply draw them as if they would appear as a world object (only valid for our own player pawn, see why above).

    I hope you guys join the discussion and give yor own solutions + code snippets suggestions etc. etc.

    Actually I need this for Unreal engine 2.5 and 3, BUT I am pretty sure that the solution would be the practically same across UE 2.5, 3 and 4, since I doubt there is any special code introduced for this in later UE engines.

    Thanx again!

    #2
    The reason the first person arms show up like that (displaying before other third person objects) is due to the Panini mode on the arm materials. Unfortunately, Panini mode can not be changed on the material at run time (not that I know of), because it's a 'static' parameter. so, when I need to switch a mesh out of Panini mode, I switch the material out. so you have one copy of the same material (they need to be Material Instances to be able to have the Panini setting) which has Panini set, and another copy of same material which does not have Panini set. When you edit the material instance in the editor, you will see the Panini setting I am talking about, and can edit it on each material. Then, at run time, you can apply either material to the mesh to enabled/disable Panini. This method is working out great for me. Hope it helps.
    Bombing Run for UT3 Coder https://forums.epicgames.com/threads...ease-Candidate
    The Reliquary TRBP team Coder http://unrealtournament2004.filefron...tEffects;92208
    https://www.youtube.com/channel/UC0p...Q7l8s-0ug_Etgg

    Comment


      #3
      OK, hi and thanx for the information. But you haven't said if its valid for UE 2, 2.5, 3 or UE4?

      I think you are talking about UE 4?
      If so, then how can we change this "Panini" setting for the older engines? Or the drawing of 1st person skeletal mesh happens differently there?

      Comment


        #4
        I guess Panini correction wasn't needed in 2.5, since that version could simply draw FPV meshes with their own custom FOVs...

        As for takedowns in general, I believe those are made with synced animations - like, when takedown starts, both attacker and victim are losing their controls while anims playing (thus FPS hands are actually just a visible part of whole 3rd person body; while anim-synced weapon might have different meshes for fpv and tpv).
        - got sig? -

        Comment


          #5
          I cannot agree with you exo7341. Weapon Drawing's FOV has nothing to do with what I'm talking about.
          Example: In Unreal Tournament 2004, first person weapon and arms always draw on top of everything else.
          Can you change that by changing the weapon draw FOV? NO. (I have made 1st person weapon models and textures for UE 2.5 games so I know this from experience.)
          So what you are saying is I cannot understand at all.

          The second part of your comment, is similar to one of my ideas in the 1st post, although I cannot see how arms with High Poly count can be made part of 3rd person mesh? Or may be they can? and an exact LOD level/distance number can be used to make these high quality arms not draw at all if you are more than lets say 20 cm away from the character? So they are only drawn for the attacker/defender?

          But right now I am thinking the best way to achieve this is the following:

          1)For the player instigating the attack (and the player being attacked possibly), client side (only for them) a pair of arms is spawned (with the weapon too) after their 1st person arms/weapons have animated out of the scene. (as seen in the video in the 1st post).
          After their 1st person arms have animated out of the scene (they become practically invisible), the above mentioned arms + weapon are spawned for each one of them as a world object at their correct position.(Optionally they can be attached to players camera bone or other bone part of his 3rd person skeleton, if the attacker/defender are goin to move during the sequence, so they move along with the players' view.)

          2)These "3rd" person arms + weapon are actually high detail arms and objects and are spawned in such location so that they would appear to the owning client as if they were his standard 1st person arms. (see above)

          3)After they are spawned (out of the FOV of the player) they animate (move in to the players' view) in the scene - exactly as seen in the video.

          4)After they animate in the scene and become visible for the attacker (or the attacked guy), they play their animation: in our case they "grab"/hit attack the enemy using a melee weapon.
          This way they can CLIP through the enemy player and the animation appears realistic.

          After the melee state is over, these special arms animate out of the scene and are Destroyed, and the normal 1st person arms/weapon animate back into the scene and everything becomes normal again.

          I think this is the most logic explanation of the above video. You can clearly see how just before the starting and the end of the animation, the arms animate out of the scene. This is clearly made on purpose!

          As for the rest of the players not involved in this scripted sequence, nothing is spawned for them, they just see two 3rd person skeletal mesh characters fighting each other, with their standard 3rd person level of detail, as their meshes can clip through each other without a problem.

          Comment


            #6
            Yes, I think your approch makes sense @Deggenyr.

            The only other important thing I could think of is holding attacker's "fake" arms (or even whole player?) against victim's body (so no clipping could happen due to unexpected motion)...


            You're also right about weapon FOV and z order.
            I just meant that Panini correction (which is implemented via shader, and, if done wrong, it could break proper z order - like hands drawing atop of weapon, or vice versa) is the UE4's substitution for the lack of ability to have a custom FPV FOV (in other words - in 2.5 and 3.0 you could just change weapon fov, but in UE4 you can't, so there's a need for workaround - like Panini enabled shaders in case of UT4).
            - got sig? -

            Comment


              #7
              yes, my comments are for ue4, not for the other engines. not sure how the other engines deal with 1p view. each engine is it's own technology, so you may find each needs it's own solution. ue4 especially is a big departure from the other engines and lots of things are handled differently. I'm thinking the older engines don't have this 'panini' concept.
              Last edited by warhead328; 08-24-2018, 03:52 PM.
              Bombing Run for UT3 Coder https://forums.epicgames.com/threads...ease-Candidate
              The Reliquary TRBP team Coder http://unrealtournament2004.filefron...tEffects;92208
              https://www.youtube.com/channel/UC0p...Q7l8s-0ug_Etgg

              Comment


                #8
                Deggenyr,
                I forgot to mention, that actually FPV weapon/hands (in ut2004, and many other Unreal series games at least) isn't drawn above other world objects. It's a regular 3d object - and it's not clipping the level because of its small size and location close to camera (usually controlled by variables like PlayerViewScale and PlayerViewOffset). You could check this yourself by making some weapon's fpv mesh like 10 times bigger.

                https://imgur.com/a/oXFOv9V

                So, in order for your idea to work you just need those fake hands to be of particular, let's say, world scale (insead of normal fpv scale).
                Last edited by exo7341; 08-25-2018, 12:34 AM.
                - got sig? -

                Comment


                  #9
                  Exo, hello again, I was AFK for quite long. I will try this someday. I will simply try to scale up a ready weapon I have to see what will happen.

                  Comment

                  Working...
                  X