Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

[RELEASED] Massive Battle AI (Combined) Air and Tank Battles

Discussion in 'Assets and Asset Store' started by hermitmode, Sep 22, 2020.

  1. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    BUY IT HERE.

    You can also purchase these assets separately:
    Massive Tank Battle AI
    Massive Air Battle AI

    "Massive Battle AI" contains both Tank and Air Battle systems to simulate hundreds of planes, dragons, and tanks in an infinite battle.

    It is built off systems created for PC Videogame "Emu War".

    Using proprietary logic, it allows hundreds of units to enter into an infinite battle either for completely dynamic background atmosphere, or interactive battles for your game.

    It also allows quick and simple prototyping of aerial and tank battle gameplay.

    Included are multiple demo scenes including "dogfight", "dragon battle", "tank battle" and "combined battle", with Player Controlled Setup prefabs there to let you immediately jump into the action and enter the fight.

    Meshes can easily be switched changing the nature of the battle instantly.

    In depth documentation is also available which offer explanatory manuals which details the system, and easy step by step setup guides.

    You can have an aerial battle of hundreds of units up and running in less than a minute with easy prefabs ready to go, no code needed.

    For those that want to delve deeper into the system to customise it, code is included in C# that can easily be modified as you see fit.
    It can also be used as a learning resource as the logic is not abstract and easily readable.

    For further support, you can contact me directly either here or via support@hermitmode.com.au

    Minimum compatibility at the moment is for Unity 2019. I have it ported to Unity 5.4.6 but am unsure of how to actually provide this as I cannot seem to find an asset uploader that works with anything below 2017.



    tank2 copy.png air1 (1).png dragons copy.png plaanes (1).png
     
    Last edited: Sep 30, 2020
    StevenPicard and EN_Games like this.
  2. FunkyBuddha

    FunkyBuddha

    Joined:
    Aug 17, 2017
    Posts:
    75
    Will this work on mobile?
     
  3. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    Hi FunkyBuddha, at the moment I have not been able to test it on a mobile environment. I will be updating with demos that allow you to benchmark it on your system into the future, and will attempt to get some mobile tests done ASAP.
    Apologies for the lack of information in regards to that.
    Thanks
    -HM
     
    StevenPicard and Inspeinre like this.
  4. Slaimx

    Slaimx

    Joined:
    Jul 25, 2020
    Posts:
    3
    Hi there, can this do Melee? AnimatorController? Root Motion?
     
  5. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    Hi. Sorry for the delayed response.

    You can switch out tank models with humanoid characters that could be made to animate attack animations in place of tank fire but it's not set up for it at the moment.

    There is this package - EasyWaypoint AI - that is built around humanoid AI that may be better suited for your needs.

    Thank you.
     
    StevenPicard likes this.
  6. eldvbear

    eldvbear

    Joined:
    Jul 21, 2016
    Posts:
    9
    I’ve been looking for an aerial AI for my game. I have some pterosaurs and other flying beasts I would like to attack my player, but everything I’ve run into uses navmesh which doesn’t do flying AI without major scripting. Would this be able to handle attacking a ground based player from the air?
     
  7. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    Hi eldvbear. Thanks for your question.

    Yes it will work for any target game object that you place within the opposing spawners plane's list. This means that if you add ground based NPC's or player game object to the plane's list of one of the spawners, the units spawned by the opposing spawner will target it.

    To adapt the system to ground-based targets, you should change the chicken point of the flying AI to around 15, add a kinematic rigid body to the damage area of the flying units to allow it to intersect with ground colliders without destroying itself, and if you don't want allied targets to be spawned, turn the spawner holding the player object down to 0 max active so that flying units will only have the ground-based object to attack.

    I will add player prioritisation as a feature to develop next.
     
  8. khkw79

    khkw79

    Joined:
    Oct 8, 2012
    Posts:
    8

    upload_2020-11-29_23-14-3.png

    upload_2020-11-29_23-16-4.png

    WaypointGrid scale 1
    As time goes by, airplanes make strange movements. Please check it out~ thank you!
     

    Attached Files:

  9. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    Thank you for the video. Sorry for the delayed response.

    I think I know what the problem might be. The move target each unit is following is moving too slowly. I will add in a check so that it has a minimum distance before resetting. If you can try changing the "Aim Move Speed" to something higher, this may help out for now.

    Edit: Please see the post below for an updated solution.
     
    Last edited: Nov 30, 2020
  10. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    Upon further investigation, it seems Waypoint Grid scaled to 1 may be too small for its current waypoint density, which is causing planes to loop between finding new waypoints that are far enough beyond its chicken point. If you wish to keep it at 1, you may have to remove some waypoints so they are further spaced out from each other. An alternative solution is to keep the Waypoint Grid scaled around 6-10 or making the chicken point a smaller number. Please let me know if this fixes your issue.
     
  11. khkw79

    khkw79

    Joined:
    Oct 8, 2012
    Posts:
    8

    upload_2020-12-1_12-54-2.png

    waypointgrid : 16 objects chicken point : 10

    but The airplane's movement is so strange when it has little health point.
     
  12. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    Thank you again for the video. I'm going to run some tests to try and replicate these behaviours. I will update as soon as I have found a solution or understand it further. Apologies for the issues.
     
  13. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    I may have an idea of why this is happening. Are you able to comment out line 305 from planedriver.cs?

    Since this seems to happen with low health, it might be an issue with the lookaim gameobject being parented at this point. By commenting out this line, the object will not be parented, which may fix the issue since the normal low health behaviour may be broken by the low speed of your units.

    If this fixes your issue, I will update the asset with a boole that allows you to disable this behaviour in editor to start. I will then attempt to add a feature that scales the behaviour to any speed. If you are unable to please let me know and I will just update it with this boolean so you can test it. But this will obviously take a little longer.

    Thanks for your patience.
     
  14. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    855
    I could see the Air Battle AI for use with swarms of vampire bats that swoop down to attack the player. Does that sound like a good fit for that asset?
     
  15. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    Hi,

    Thank you for the question. Yes that definitely should be possible.

    The flying units will target any game object placed in the opposing spawner units list, or player priority reference in the spawning object.

    By changing the chicken point to something low and turning off the particle effect from the dragon prefab setup you would have just a damage area working that would enable damage from "bites". I will update with a demo scene showing this setup very soon to demonstrate.

    Thanks!
     
    StevenPicard likes this.
  16. khkw79

    khkw79

    Joined:
    Oct 8, 2012
    Posts:
    8

    Yes, I'll let you know after work today.
    thank you!!
     
  17. khkw79

    khkw79

    Joined:
    Oct 8, 2012
    Posts:
    8
    upload_2020-12-2_21-7-56.png

    Is this the right part?
    Even in normal health, there's a strange movement.
    Thank you so much for your care~
     
  18. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    It would be line 297 that you need to comment out (//), the one that says
    lookAim.transform.parent = transform

    Have you edited the planeDriver.cs? If you have (since the line is 305 as default) then if you could please private message your edited copy to me (not here in the thread) I will take a look at it and attempt to see what is going wrong.
    If it is bugging out even with normal health, the above fix may not do anything for you.

    No problem, it should be working and I will be here to help until I can find a solution for you!
     
  19. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    A bat demo has been added and will be available with the next update for both "Massive Air Battle AI" and "Massive Combined Battle AI". Here is a video showing the basics of the feature. Speed of the bats, their collision with ground, the deviance range etc are all editable with exisiting variables, and more features like attaching to the player character could be easily added using the exisiting foundation. Thanks!

     
    aweha and StevenPicard like this.
  20. khkw79

    khkw79

    Joined:
    Oct 8, 2012
    Posts:
    8

    upload_2020-12-3_10-19-42.png

    plane scale 0.3 waypointgrid scale 1

    I updated it yesterday and retested it, but I think there is still a problem.
    I think there's a problem at the center of the point.
     
  21. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    I think I have found a solution. I have been updating the planeDriver.cs script so I can't point you to specific line numbers to change but if you can please Ctrl + F and find
    if(waypointDistance < 50)

    and change the "50" to "chickenPoint" so that it reads

    if(waypointDistance < chickenPoint)

    instead, this may fix your issue. What I have identified as the issue is that the number used to calculate when to find a new waypoint is fixed and therefore would never be reached in instances were the waypoint grid was too small relative to the default scale. Changing this to chicken point and having chicken point be a smaller number more in line with your specific scenario has fixed this in my testing, please let me know if this also helps you.
    Please also change "chicken point" to something low, under 5 for the purpose of testing this.

    Thank you again for your patience.





    EDIT: I have just been able to reproduce the error you are showing me.
    When spawning one plane per spawner for a two plane battle, units start to retarget waypoints every frame. This is a bug that breaks the logic and I will be working to fix this ASAP. Thank you for letting me know. It seems to happen with a small amount of planes, can I ask how many planes per spawner you are using?

    I am working in AEDT so please excuse my response timing.

    Thanks!
     
    Last edited: Dec 3, 2020
  22. khkw79

    khkw79

    Joined:
    Oct 8, 2012
    Posts:
    8
    Thank you very much for your kind reply.
    I think I will use up to three planes in scene.
    And the current concept is toy war, so airplanes have to fly in small spaces.
    I'll look forward to the good result!
     
  23. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    Thanks. Please let me know if changing the line "if(waypointDistance < 50)" to "if(waypointDistance < chickenPoint)" then changing "chicken point" to something like "5" works for you. I will be updating with a boolean or public float reference that will allow this value to be changed rather than fixed if you would prefer to wait for that, should be in the next couple of days. Thanks!
     
  24. khkw79

    khkw79

    Joined:
    Oct 8, 2012
    Posts:
    8
    Wow, I just tested it and it's solved !! Thank you for your quick feedback and support !! :)
     
    hermitmode likes this.
  25. JuniorLongfellow

    JuniorLongfellow

    Joined:
    Feb 27, 2013
    Posts:
    19
    I'd like to purchase the triple AI pack, can I see a sample of the plane ai doc pdf?
     
  26. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    Hi there,

    Here's a sample of the plane AI doc PDF. Let me know if there's anything else.

    Thanks!

    sample.png
     
  27. Jadimax

    Jadimax

    Joined:
    Oct 6, 2020
    Posts:
    2
    Hello, please will you make an obstacle avoidance ai ? Is there an means to have a obstacle avoidance with waypoint ?
     
  28. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    42
    Hi vejadi, from memory at the moment there is no obstacle avoidance present beyond randomised waypoints upon collision with other units. I could however add a simplistic avoidance solution that works with forward raycasts that would redirect units to random offset vectors for a short period before reassuming target direction. This will likely impact performance in initial iterations. I will update the thread and asset if I get a working solution.
     
  29. Jadimax

    Jadimax

    Joined:
    Oct 6, 2020
    Posts:
    2
    Thank you.