x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How Can I Mark AI when using Scanning Vision?

Hi! As I mention in the question above. For example, assassin's creed series. They have this eagle vision thing and then they mark the enemy with it. How I can mark the AIs like they did. It also turns red when the AI detects the player and yellow when AI searching for the player. Is there any tutorial out there that anyone can recommend it to me?

Thank you.

Product Version: UE 4.20
Tags:
more ▼

asked Aug 08 '18 at 01:35 AM in Blueprint Scripting

avatar image

56legion
6 2 6

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

To add a 2D marker always facing the camera, you can use a billboard (just look for tutorials about that).

I suggest you put a billboard component in your NPCs blueprint, just above their head, and set it visible or not depending on your game logic. Once you've done that, it's up to you to make it blink, change, transparent, etc...

Hope this helps :)

more ▼

answered Aug 28 '18 at 11:50 PM

avatar image

CraftyWeazel
59 5 6 11

avatar image 56legion Aug 29 '18 at 05:29 AM

That's Brilliant!!!! But, how can I decide when to be visible? I mean, I want it only visible when the player use scanned vision only and when the AI is within a specific radius only from the player location.

Please reply.. That's such great way to do it

avatar image CraftyWeazel Aug 29 '18 at 12:37 PM

You have several ways to do it, and you should chose depending on what you intend your game to be in the end. Here is one way:

In your NPCs blueprint, you can have an event which is triggered whenever the player uses its scan vision, and another triggered when it stops to use it. Otherwise, you can have a reference to the player in an actor variable in every NPC and check on EventTick if the scan vision is being used currently (with a simple boolean check). Another way to do so is to have a function in your NPCs blueprint that you call thanks to a NPCs register in your Level blueprint, but that's not easier.

Either way, if the scan vision is used, you should use the blueprint node SetHidden (or something like that, I can't remember) on the billboard component. You can also use some other nodes to change the texture of the billboard.

I recommand the following for your visibility update:

In the Player blueprint, manage all the logic of scan vision and make it so it displays or hide the markers above NPC's head, but don't bother about the image/color/size of the marker for now.

In the NPCs blueprint, on EventTick (and only when scan vision is used if you want to save some performance), check the nearest Player actor and if it's in a certain range. Then, use a Line Trace or Sphere Trace (look for tutorials, there are plenty) from the NPC to the player in order to check if there's a wall hiding the player or something like that. If the trace doesn't hit anything but the player, then it means the player is fully visible by the NPC.

Then, if you want to add Assassin's Creed like behaviour, you would have to make the NPC logic more complicated, with a memory of player's actions, and update it whenever the player is jumping, running, hitting some allies or foes...

avatar image CraftyWeazel Aug 29 '18 at 10:30 PM

Maybe you will like to see this, in order to make a detective scan vision. I made it so the player can light some parts of the scene, but you can use the same principles for activating a FP-view vision. https://forums.unrealengine.com/development-discussion/rendering/1411106-solved-holographic-projector-held-by-player-should-reveal-hidden-text

avatar image 56legion Sep 25 '18 at 01:51 PM

Hey. Can I ask you a different question? I've found that only you really help me out a lot on this answerhub! So, https://answers.unrealengine.com/questions/831230/view.html Here. I've spent months working on this project, but I have this weird bug. Would you mind to give it a try to fix? I will provide all the files if you agree on. Please help me out, I've wasted too much time to find people who can help me, but none give me any reply. Reply to this message, if you agree to help me out. Thank you in advance.

avatar image CraftyWeazel Dec 13 '18 at 11:30 PM

Hi, sorry but your new problem doesn't seem to be in my skills area :/ I've been only using some parts of unreal, and that's not the ones you're using there. I truly hope you will find help quick, don't hesitate to try on the forum too!

avatar image CraftyWeazel Dec 13 '18 at 11:31 PM

And by the way, if you think you've got your answers here, please mind marking one of our answers as "answer to the question" in order to mark the thread as solved (and increase our SCORES ! ahah)

(comments are locked)
10|2000 characters needed characters left

I would try using Material parameters (with Dynamic Material Instances if the same material can be on characters who are enemies and those who are not or if their enemy-ness can change).

The UI changing depending on AI behaviors can be driven like any other change to the UI - you just have to get the variables from the AI controller.

Sorry I am not offering specific step by step examples right now, but I think if you have learned the basics of both Material parameters and AI controllers, then you will figure out how to do this. How much do you know how to do in the following? If not enough, there are tutorials everywhere for each:

  1. Unreal's UMG system for User Interface: Animation, Binding functions and variables, etc.

  2. AI controllers, Behavior Trees, Blackboard, and how to retrieve values from them to affect other actors and objects outside the AI controller and pawn.

  3. Materials, Material parameters, and Dynamic Material Instances.

I know it seems like a lot, but this is what anyone will have to do to accomplish what you're looking for, unless there's a marketplace plugin or asset that already does it for you.

So which of those do you know how to do and which do you need further instruction for?

more ▼

answered Aug 28 '18 at 03:57 PM

avatar image

mightyenigma
3.7k 18 18 15

avatar image 56legion Aug 29 '18 at 12:00 AM

Hey mightyenigma! First of all, thank you for answering my question. Okay, let's see.. UMG system is the best thing that I've known compare to those two, Material is the next one and follow by the AI controller is the last one, since I'm quite new to this AI thingy. But, I know how blackboard, behaviour tree and the AI controller works and NAV Mesh.

It's ok if you're not offering the step by step example, but would you mind to share some tutorial videos or documentation, that help me with this problem?

And how can I enable the boolean expression on AI controller variable, when the AI collides with the vision of the player? And this vision of the player can only mark the AI with the other vision (Detective vision/ Eagle Vision /Scan vision)..

As I said, it will be good if you have some tutorial videos or maybe some other dude's tutorial that you can find on the internet. Documentation also might work. I really need this thing to work, otherwise my game will be impossible to win.

avatar image mightyenigma Sep 25 '18 at 05:52 PM

Hmm I don't know any tutorials, sorry, except the recent Toon/Cel shader tutorial Epic put out, maybe. And you could modify it to act the way you need and use Parameters that your Material Dynamic Instance can change based on if they're enemy or friendly, etc. so they show up as a different color outline or shading, etc.

I think maybe you could have a Post Process Volume that you enable/disable when the player activates or deactivates their Eagle Vision, and the post process could apply not only the marker material but also change how the whole world looks, just like Eagle Vision.

avatar image 56legion Sep 26 '18 at 12:52 AM

Hey, don't worry about it, I think I'll figure it out later. But, the most important thing that I need to know now is this.. https://answers.unrealengine.com/questions/831230/view.html
Mind take a look? I've been working on it for months, and the last couple of days, this problem happens. I've been asking a lot of people throughout forums, emails, youtube but none help me out. Please take a look, if you know how to fix it. Then. I will send you the whole project file. I've been wasting too much time on doing nothing, because of this bug! So annoying!

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question