Announcement

Collapse
No announcement yet.

Sharing True First Person Blueprint project with networking (uses UE 4.3 Preview)

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

    Sharing True First Person Blueprint project with networking (uses UE 4.3 Preview)

    Hey everyone!

    I had about a week of time till today to mess around with the awesome Unreal 4 engine and really wanted to do a True First Person networked project. Since this was the first project in Unreal 4 for me, it was quite a learning experience. What I mostly learned, though is that blueprints, even though they are quite powerful, are also relatively limited when it comes to modifying the basic character class.
    Also this is far from being anything fancy as: 1) I'm not a programmer, so everything was made in blueprints, 2) I'm not good a good Blueprint "programmer", so I don't think everything is as optimal as it could be, 3) I used the content from the Third Person and First Person examples, so there's nothing new as far as content is concerned.

    Ok so this was made exclusively using blueprints. The list of things I wanted to do was:
    • have networking enabled
    • have some sort of projectile shooting that can affect physics
    • have a true first person view, without the head model getting in the way and not having to remodel the character
    • solve the clipping issue when it comes to the camera in true fps, when the camera is able to look inside the world


    So what you shouldn't expect this to have:
    • a reanimated character with a gun in his hands
    • new animations added
    • a perfectly solved camera clipping system(this is very hard to do, because Epic disabled adding additional components that could affect character movement the same way the ROOT Capsule does(ie. stops the character from going through stuff))
    • anything apart from a basic starting point that this blueprint project can give



    So I had some problems when trying to set up networked physics, because I started from the First Person blueprint example, which was not made for physics and networking in mind.
    The next thing was getting the projectile replicated and it spawning an emitter on hit, which I kind of hacked my way through.
    I solved the head model getting in the way by scaling the head and neck bones to 0 in the Animation Blueprint for the character, and then using the same mesh duplicated, one using the AnimBP with the Head off(for client) and one using the AnimBP with the head on(for everyone else).
    I solved(as best as I could) the camera clipping issue, by not allowing the player to get too close to the objects that are the same height as the camera is. Because as of yet you're not allowed to add custom components that could affect players movement(the same way the Root Capsule does), I had to do it some other way. I shoot 4 rays, forward, right, left and back to check if the player is close to any walls or other objects that the camera could clip through. After that, the normals of the objects are taken into consideration and the direction of walking is changed using the normals of the objects hit. There are a couple of problems with this approach: 1) It's kind of jagged, probably because it isn't constant, such as the OnHit events from collisions, and so the movement can be corrected only so many times per second. 2) I haven't yet solved the issue if you jump towards the wall, because you can still land next to it. I'd have to implement the same system that checks if you're near a wall while you're jumping and then changes your velocity accordingly, so that you don't land near the wall(be able to see clipping). 3) There's still a 90 degree gap between these 4 rays, so you can sneak next to thin objects. This could be corrected with using more rays, though.

    Alright, so here it is, free for everyone to use and abuse and no need for credit. If you have any questions, I'd be glad to answer them and also I'll try to update this as much as I can in the future. Also maybe post a vid, so that you don't have to download a random file before you even see how it's all working.


    Link to the zipped project: https://drive.google.com/file/d/0B-U...it?usp=sharing
    I also hope that just putting the project into a ZIP file is all is needed? I don't really know how to share projects.
    Attached Files

    #2
    Great! Thanks for sharing.

    Comment


      #3
      thank! great project!

      Comment


        #4
        really apreciate it!!, thanks!!

        Comment


          #5
          Whats steps did you take to get the first person working with networking? Thanks

          Comment

          Working...
          X