Ue4 C++ AI Behavior Essentials Part 5 | Coordinated Cover System

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ต.ค. 2024

ความคิดเห็น • 80

  • @MDacascos
    @MDacascos 2 ปีที่แล้ว +5

    excellent architecture, great code and decisions
    just thanks for what you're doing, content of such quality is way too rare

  • @arjunjain7773
    @arjunjain7773 ปีที่แล้ว

    This is very well done. Thanks for putting this out. I was pondering over how to make the AI hide at the right spot and you cleared it for me. Much appreciated!

  • @johnathe123n
    @johnathe123n 2 ปีที่แล้ว +2

    Pranjal, you are a gem.
    Not many people would go out of their way to share their knowledge, which already makes you special.
    But not only that, you share knowledge in c++ which is very rare to find.
    And to top even that up, the knowledge you share is very advanced and you make sure to explain what you do aswell as why you do it.
    I've never seen a tutorial this advanced about AI in general and let alone in c++ and you motivate me alot to try and get better at game dev.
    Thank you for being this awesome, I obviously subscribed, liked and turned on the bell and I will try to do my small part and spread the word of your channel.
    I wish you and your loved ones all the best :D

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      Thank you for such a nice comment and I am very happy to hear that these videos are helping you in some way 😊

  • @Kinos141
    @Kinos141 2 ปีที่แล้ว

    "Hi, movie recap here."
    Good video, man

  • @Unearthlywhales
    @Unearthlywhales ปีที่แล้ว

    This series has been a great journey into understanding AI, behaviour trees and C++. Exactly the thing I needed to kickstart myself into this direction and understand how to approach some of these challenges. Infinite thanks my friend!

  • @nijq
    @nijq 2 ปีที่แล้ว

    thank you for helping the Unreal community! I feel so lucky for finding your channel!!! amazing content! 🙂 TYSM! ❤

  • @ivarplays9873
    @ivarplays9873 2 ปีที่แล้ว +2

    I really enjoyed this series. Quality is amazing. Could you please make the flanker AI?.

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว +1

      I will once I have some free time and thanks for your interest in this series

    • @ivarplays9873
      @ivarplays9873 2 ปีที่แล้ว +1

      @@pranjalbhattacharjee5601 Thank you so much man. Appreciate it

  • @BardockAhmed
    @BardockAhmed 2 ปีที่แล้ว +1

    Phenomenal work. Cannot stress enough how helpful these are, will you be making more? Cheers 🍻

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      Yes I will be making more tutorials but at the moment I am busy with client projects......I will get back to doing tutorials when I have some free time

  • @ps5games821
    @ps5games821 2 ปีที่แล้ว

    Great tutorials
    Thank you
    i love you videos
    Make more please

  • @dominikwerner6608
    @dominikwerner6608 ปีที่แล้ว

    Using this as a base, I have implemented a struct to create groups within in the faction, so the defenders of a faction are not limited to engage only at one location on the map. This uses simple proximity based clustering (clusters can also be dissolved or some agents absorbed by other clusters). I found that this approach makes the AI look much more proactive, especially since agents that enter a cluster get the target of this cluster, even if it is not detected by their perception.
    Also, I have added an additional actor that is just a collider, that allows me to designate any part of a level as cover. This makes level design much easier in my case since I do not have to create many different cover blueprints.

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  ปีที่แล้ว

      That sounds great..... good job

    • @dominikwerner6608
      @dominikwerner6608 ปีที่แล้ว

      @@pranjalbhattacharjee5601 I really have to thank you again. Your series helped me to really get into UE AI from a C++ perspective

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  ปีที่แล้ว

      @@dominikwerner6608 Happy to help 😊

  • @13tisa13
    @13tisa13 2 ปีที่แล้ว

    Awesome work!

  • @thenoobdev
    @thenoobdev 2 ปีที่แล้ว

    Which AI voice software did you use to narrate this video? It sounds so human-like! =D

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว +1

      Here is a link to the website. voicemaker.in/

    • @thenoobdev
      @thenoobdev 2 ปีที่แล้ว +1

      @@pranjalbhattacharjee5601 thanks mate, as my speaking in English not so well, i only uploaded videos without voice so far 🤣 thanks!
      And forgot to mention, great efforts you're making for these amazing tutorials! Keep up the good works! This AI system looks amazing for my project 😍

  • @SD-tm7xs
    @SD-tm7xs 2 ปีที่แล้ว

    This AI is Amazing!
    Great structure!
    Is the project still available?
    It would be easier to follow
    Anyway good job!

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว +2

      Thanks.....yes it is available......I will soon be updating it to ue5 but the 4.27 version is available

    • @SD-tm7xs
      @SD-tm7xs 2 ปีที่แล้ว +1

      @@pranjalbhattacharjee5601 thank you very much!

  • @dominikwerner6608
    @dominikwerner6608 ปีที่แล้ว

    I think the formula for AngleToTarget could be simplified a bit:
    const FVector coverSpotForwardDir = CoverSpotMarker->GetComponentRotation().Vector();
    const FVector coverLookAtTargetDir = (Target->GetActorLocation() - CoverSpotMarker->GetComponentLocation()).GetSafeNormal();
    AngleToTarget = FMath::RadiansToDegrees(FMath::Acos(FVector::DotProduct(coverSpotForwardDir, coverLookAtTargetDir)));
    This way you do not need the KismethMathLibrary and it is probably a bit more performant than to calculate the look at rotation only for retrieving the vector (of course it probably does not really matter that much).
    Anyway, I really love your tutorials and hope there are more to come

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  ปีที่แล้ว +1

      I may be wrong, but I find both formulae to be more or less the same but, if possible, do some performance testing and let me know.......and more tutorials are coming but it will take some time because I am currently very busy with client projects,

    • @dominikwerner6608
      @dominikwerner6608 ปีที่แล้ว +1

      @@pranjalbhattacharjee5601 It is my assumption that it doesn't matter too much (I worked a lot on optimizations hence why I jump on things like this ^^). Don't feel pressured to create new tutorials, after all this is free content ☺

  • @DynsProduction
    @DynsProduction 2 ปีที่แล้ว

    Hey really nice work ! Is there a way to do exactly the same with blueprints ?

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว +1

      Most of the things in the project can be done in blueprints but there are some perception related stuff that are not exposed to blueprints so you will have to use some c++

  • @eladonstar2721
    @eladonstar2721 2 ปีที่แล้ว

    Simple Question : How u Make the AI Take Cover in Opposite Direction .. Altough it had collider on all four sides how the AI knows ..

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      I do some vector math to figure out the correct direction.....just watch the tutorial man I explain everything in detail

  • @mogamalchannal2432
    @mogamalchannal2432 2 ปีที่แล้ว +1

    If I download the project files I can use it in my project or not because I am not good in c++

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      Yes you can use the code and assets in your project but if you sell this project as is, give me proper credit (mention my name and provide links to my youtube channel)

  • @onemanstudio8027
    @onemanstudio8027 2 ปีที่แล้ว

    Is there a way to make this system more dynamic? For example to generate the cover instead of manually placing volumes in the level

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      Yes you can use eqs to generate points you can also write custom generators for eqs.....I have a dynamic cover generator system but it has problems....it doesn't work well for organic shapes.....so, I decided to do it this way.....also this is a tutorial for ai behavior not cover generator

    • @onemanstudio8027
      @onemanstudio8027 2 ปีที่แล้ว

      @@pranjalbhattacharjee5601 I did already write a cover generator and it behaves pretty good. But it's not really analyzing the geometrie. For analyzing the geometrie you typically need the nav mesh but I don't know how to go from there

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว +1

      @@onemanstudio8027 well....I think you need to get navmesh edges and then just treat those edge locations as cover points.....I don't remember how I did it but I had help from an article online.....I will give you the link if I can find it

  • @breakdown.studio
    @breakdown.studio 2 ปีที่แล้ว

    First : thank you for shearing your hard work and helping us you are legend and great man
    second : i have full project i made and i have a Melee AI and works very well and ShooterAI but i have problem , when the AI shot me i get damage and i die but when i shot at him he wont be damaged so how to fix this can you help me , my project on C++ , i hope you help me and save my life .
    third : can i download your project and makes some edits then release it ?
    ty again sir ♥️

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      If you release the project, give me proper credit......mention my name and TH-cam channel link.....and about your project.....hire me, you pay only if I can fix your project

  • @borkoaleksic3629
    @borkoaleksic3629 2 ปีที่แล้ว

    At around 7:03 you said "CoverFire to false" but is set to true, which is correct?
    thank you

  • @GAMEDEV_PRO
    @GAMEDEV_PRO 2 ปีที่แล้ว

    Hey,i use 4.72.2 and i get the "try rebuilding from source manually" error when i try to recompile the project.How can i solve this.

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      I will look into it and get back to you...... it's probably the "canbeseenfrom" function in the character base class. The function signature changed from 4.26 to 4.27......but as far as I remember I fixed that.....but maybe not..... 🤔

    • @GAMEDEV_PRO
      @GAMEDEV_PRO 2 ปีที่แล้ว

      @@pranjalbhattacharjee5601 thanks for your interest,i'll wait for it.

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      @@GAMEDEV_PRO I am not getting the build error.......make sure you are using 4.27.......you won't be able to build for earlier versions
      Right click on the uproject file and select switch engine version and then from the dropdown, select 4.27

  • @Asmund648
    @Asmund648 2 ปีที่แล้ว

    Can I combine this with blueprints? Or does the code need to be i C++ in order to have the same behavior?

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      No you can do it in blueprints

    • @Asmund648
      @Asmund648 2 ปีที่แล้ว +1

      @@pranjalbhattacharjee5601 Nice, thanks for your reply :)

  • @unknowndevgame2795
    @unknowndevgame2795 2 ปีที่แล้ว

    Hey 👋 👋 what assets I'll need to start the tutorial

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      You don't need any assets just download the starter project.....you will find it in the description of the first video

  • @GAMEDEV_PRO
    @GAMEDEV_PRO ปีที่แล้ว

    can you please reupload the ue4.27 version the link is broken

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  ปีที่แล้ว

      Sorry I don't have the 4.27 project anymore.....the difference between the versions is just the "can be seen from function"..... everything else is the same

  • @VishalKumar-ep2wv
    @VishalKumar-ep2wv 2 ปีที่แล้ว +1

    iam unable to open that project file in unreal5

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว +1

      Yes this is on 4.27......there is a link to a ue5 version download that one

    • @VishalKumar-ep2wv
      @VishalKumar-ep2wv 2 ปีที่แล้ว

      @@pranjalbhattacharjee5601 I was trying what you say but it says built by source
      or some thimg like that

    • @VishalKumar-ep2wv
      @VishalKumar-ep2wv 2 ปีที่แล้ว

      plizz help

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      Ok I will look into it and get back to you.....have you tried building it....??....what error does it give you....??

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      I am not getting any errors......it will take some time to build but other than that the project should be fine.....did you download it from my github...??

  • @EdGameplayer
    @EdGameplayer 5 หลายเดือนก่อน

    please, share the source file of the project

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  5 หลายเดือนก่อน

      github.com/JanakPRB/AITutorial5.0.git

    • @EdGameplayer
      @EdGameplayer 5 หลายเดือนก่อน

      @@pranjalbhattacharjee5601 Do you have the source files of the UE4.27 version?

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  5 หลายเดือนก่อน

      @@EdGameplayer Unfortunately I don't have it anymore

  • @thenoobdev
    @thenoobdev 2 ปีที่แล้ว

    Does this work on UE5? 😇

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว

      Yes it does work in ue5

    • @thenoobdev
      @thenoobdev 2 ปีที่แล้ว +2

      @@pranjalbhattacharjee5601 Thanks mate! finally home to test it out! Only one note, also for future readers of this comment:
      CharacterBase.cpp lines 45 & 60 changed to:
      if (bHitSocket== false || (IsValid(HitResult.GetActor()) && HitResult.GetActor()->IsOwnedBy(this)))
      and
      if (bHit == false || (IsValid(HitResult.GetActor()) && HitResult.GetActor()->IsOwnedBy(this)))
      as in UE5 you'll get the following error" Actor is not a member of FHitResult. "

    • @pranjalbhattacharjee5601
      @pranjalbhattacharjee5601  2 ปีที่แล้ว +1

      Thanks.....I will update the project

    • @thenoobdev
      @thenoobdev 2 ปีที่แล้ว

      @@pranjalbhattacharjee5601 anytime, happy to have made a micro addition to this amazing AI. already spent an hour here enjoying the AI battle each other 😂