Announcement

Collapse
No announcement yet.

Metal Gear Solid - Soliton Radar - Alpha/Opacity Mask on HUD?

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

    Metal Gear Solid - Soliton Radar - Alpha/Opacity Mask on HUD?

    UPDATE



    Item Inventory - Game Pauses animations happen and Items are revealed (No functionality)
    Radar - Fully Dynamic and Updating W/ Better clipping/culling (Still don't have a method for the View Cones)
    Life Bar - A life bar connected to the players Life Points and renders accordingly
    Enemies - Detect player Inside their view cone (ALERT) , Just outside their viewcone (Caution - Not sure if this is in MGS1 will have to check)

    ------------------------------------------------------------------

    Original Message

    Hey,

    So I spent a few hours making a quick MGS style Radar system, its built using specific pieces, and is probably easily achieved a multitude of ways.

    Currently mine is all drawn and designed in the HUD class, it is heavily based on this existing system, so this should give you an idea of what i'm working with.
    http://shootertutorial.com/2015/11/1...nd-play-radar/

    I would really like to add some sort of Alpha/Opacity Mask around the edge of the radar as to stop the objects inside it rendering outside of it, the reason this happens is because the "Drawn Shape" begins drawing at the origin point, which I designed to be the corners of the walls/doors, but because of this on the EAST and SOUTH edges of the Radar it overdraws before deleting, and equally on the NORTH and WEST edges it culls very quickly.



    Would it be possible to frame this radar with an Opacity/Alpha mask as to allow it the more natural fade out, and allow the culling to happen off screen?

    Or would this require me moving it to something like the Widget system?



    Thanks all help and ideas are apprecaited!!!
    Last edited by Nemecys; 02-02-2016, 06:43 PM.

    #2
    If that is just material. Create mask texture: in 3x3 square texture make all black but middle box (ie paint white 1 middle square out of 9 total).
    Then make your radar uvs texture tile 3 times each direction so you get 9 tiles of same map texture.
    then multiply your mask and that tiled radar texture. (you can also use linear interpolate instead of multiply for bit more control).

    Last is scaling it all up 3 times on hud.

    Ps. I think its not material, you are using hud primitives to paint this directly on hud.
    I do not think it can be easily done for that.
    We really could use some primitives drawing on textures.
    Last edited by Nawrot; 02-02-2016, 07:45 AM.

    Comment


      #3
      Ahh thanks for the idea,

      Yeah this is all using the basic Primitives, I believe if i wanted to do it properly I would have to draw a texture and pan it, but I liked the idea of being able to have the radar draw in real time depending on the changes to the map.

      The next best thing I can do is frame it awkwardly with some boxes to overlap it or perhaps a frame, however I feel the frame will have to be FAR too thick.


      Would this be possible as a widget perhaps?

      Comment


        #4
        Widgets are worse for this. More complicated, and have less tools (no drawing primitives i think).

        What you need is drawing those primitives directly to texture, which requires C++ and is not that simple.

        Comment


          #5
          **** that's a shame, I guess i could use these tools to design a level then draw the map without the doors and other dynamic objects and only have those drawn on the map instead.

          Its more for fun and I want to see how close I can get without investing months of my time, I will have a play around but It may be a combination of frames and fakery.

          if you have any more great ideas Nawrot, please drop by and let me know

          Thanks for the help so far

          Comment


            #6
            As a quick and dirty fix, you can maybe "cheat" the framing by adding the other hud elements (health, ammo, etc.) around where you want to place the frame to help cover up the graphical glitches. I understand its not the "best" solution (learning to do it proper with code probably is), but it could work if you're pressed for time or something.
            Need another dev on your UE4 project? Send me a shoutout and I'll lend a hand

            Comment


              #7
              Slightly improved Radar this time round, decided to draw the frame of the radar as a PNG then overlay it to help with the culling, an in this specific example I halved the width of the walls, and in turn their HUD representatives.

              This makes the culling less noticeable, but the method seems to work well overall.

              These "Walls" could be used as invisible collision and Radar info and have proper textured walls overlay onto them, they just work as HUD information and basic functionality.

              @6ixpool - Coincidentally the method you provided was the method I just tried, I just had no idea you posted it :P, I realised i already used a material for the view cones so I may as well use a frame to help hide it.

              Unfortunately as you can see it doesn't exactly work for the view cones, for the sake of usabiltiy/functionality they need to be drawn ASAP so they player is aware of the direction, its just a shame they overdraw....

              I suppose I could just render the View cones smaller, hmm I will tinker some more and update if people are interested.

              Last edited by Nemecys; 02-02-2016, 04:06 PM. Reason: YT Video URL's don't work if they are short

              Comment


                #8
                I have no actual experience with hud creation in ue4 so whatever info you can provide solving this problem would be a great learning resource for me! (Its also why the only advice i can give on how to potentially "fix" this is practical rather than programmatic xD)

                Since the radar cone is teal, increasing its alpha and adding a light colored frame around the radar could help at least make the overdraw harder to see.
                Need another dev on your UE4 project? Send me a shoutout and I'll lend a hand

                Comment


                  #9
                  Ahh no way, Well good guess, it was right!!

                  Because the cone changes based on the enemies state that wouldn't be viable. Also i'm trying to recreate the game as like for like as possible, as it stands the radar frame is a bit thick for my liking, but a bit of tweaking and clever work might help me there.

                  In terms of the fix:

                  Walls were currently 4m wide, so I halved that to 2m, and in turn halved the pixel W/H of the rectangle I drew to reflect that change.
                  So now i have double the walls in the map, which isn't that bad, but not ideal...

                  However, This meant the rectangles drawn on the radar were now not as long, and because they draw from the CENTRE POINT DOWN (OR to the RIGHT) (This was because the pivot point it stores is the objects 0,0,0 its Blueprint for example, so to counter this I make sure the CORNER of my walls sits on 0,0,0) that there was less shape to hang OVER the Frame we overlayed.

                  So now the walls usually get deleted JUST on the edge of the frame, meaning that its all done behind the black border rather than on the visible radar.

                  The cones however are drawn from a texture so once their PIVOT POINT appears (the enemy dot) it also draws the cone, which in turn often ends up being drawn off the intended Radar space.
                  Last edited by Nemecys; 02-02-2016, 08:26 PM.

                  Comment


                    #10
                    Not sure if this will be helpful or not, but in line with how you fixed the wall, you can maybe use a "half vision cone" that gets drawn only when the enemy dot goes into certain regions of the radar like near the border (local 'x,y' > or < cutoffValue).
                    Need another dev on your UE4 project? Send me a shoutout and I'll lend a hand

                    Comment


                      #11
                      You could definitely do like 6ixpool said, but with a overlay border. just design a border texture to draw on top of of it, essentially masking out the edge glitches. Something subtle like this :
                      Just found it in a google search, you could design a more metal gear themed one without destroying anything.

                      Your radar looks fantastic btw.

                      Comment


                        #12
                        Oops, my page wasn't refreshed...
                        Did not see all of the responses..

                        Comment


                          #13
                          I just had idea, but its quite complicated one: (or may be less complicated than your approach).

                          make second camera (way above level, for eg 9000 units), and render to texture from it. It needs to be further than your player camera will ever see into distance.
                          For scaling you can use field of view for that camera and its distance to map.

                          Then You create LOD settings for all pawns (everything that is moving in map).
                          Change nothing for when they are close to camera, but set their meshes to dots with unlit bright material for when they around 9000 units from camera.
                          This way you player camera will see pawns as character meshes, will your map camera will see dots.
                          For viewcone do same, but for close camera make it tiny box that would hide inside player character, and for far overvie camera make it view cone.
                          You can even attach it to some of head bones, so it will turn with head movement.


                          Also because you render to texture, and you will get that as texture you can make masks in any shape then mask it all in material shader.

                          Comment


                            #14
                            Originally posted by DeepFriedCircuits View Post
                            Oops, my page wasn't refreshed...
                            Did not see all of the responses..
                            Aha dw about it Your response was helpful and i appreciated the examples, it took me a while to remember that was an option

                            Originally posted by Nawrot View Post
                            I just had idea, but its quite complicated one: (or may be less complicated than your approach).

                            make second camera (way above level, for eg 9000 units), and render to texture from it. It needs to be further than your player camera will ever see into distance.
                            For scaling you can use field of view for that camera and its distance to map.

                            Then You create LOD settings for all pawns (everything that is moving in map).
                            Change nothing for when they are close to camera, but set their meshes to dots with unlit bright material for when they around 9000 units from camera.
                            This way you player camera will see pawns as character meshes, will your map camera will see dots.
                            For viewcone do same, but for close camera make it tiny box that would hide inside player character, and for far overvie camera make it view cone.
                            You can even attach it to some of head bones, so it will turn with head movement.


                            Also because you render to texture, and you will get that as texture you can make masks in any shape then mask it all in material shader.
                            That is an idea i was toying with before, I mean it would involve totalling scrapping my current Radar but it would fix a majority of issues, I also fear that it would possibly cause issues if i ever wanted to recreate a sniper scene or anything else that would require long range rendering.

                            Definitely a viable option though, I will keep toying with it and see where I get.

                            This is more of a fun exercise for me than anything else.

                            Thank you all for your comments

                            Comment

                            Working...
                            X