A Project for Chronicle 4 based on L2JServer.


    Improved AI

    Share
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Improved AI

    Post  Karakan on 14th September 2015, 01:07

    DnR any chance that you can implement this to L2JLisvus ?
    This gives a huge boost to monster AI. (especially archers/mage type mobs)


    Uploaded the diff from original L2J-Kamael changeset

    http://pastebin.com/Y0bRtMfs



    Here is the changeset text :

    Attack AI update, thanks to many for commenting and testing. It's not perfect
    (perfect would be many separate AI scripts DP side and improved core support for such?)
    and will require tuning/cleaning, but it contains the following:
    - Mobs use self buffs (currently attached to random walking & onIntentionAttack)
    - New considerations for changing target if mob hasn't got hits in for last 14 seconds,
    changes to secondMostHated if it's close enough
    - Sleeps/mutes secondMostHated randomly to reduce enemy numbers. Doesn't practically
    sleep mostHated, but does it occasionally if long distance
    - Self analysis: Every npc gets a new AI type: Fighter/Mage/Balanced/Archer.
    Fighters are most common, don't spam skills and try to get close (fast) to their target.
    Mages stay far away (retail mages don't even start running to target, here they progress
    slowly but not to melee range - at least they use a lot more skills than with previous AI)
    Balanced mobs use both skills and melee attacks equally. Raid bosses are now set to be "balanced".
    Archers carry a bow and try to keep some distance to their target.
    - Target analysis (isMage, isFighter, isBalanced, isArcher, isSlower, isCanceled, ...)
    - Classifying all skills to classes like debuff/root/heal/cancel/disablers/general...
    - Different chances of doing things (casting skills or advanding closer) based on target
    and self analysis: magical targets are muted more often (people wanted fighters to be muted also...),
    if somebody is rooted mob doesn't root twice...
    - Target analysis is done every 4 seconds to switch tactique if target changes weapons (bow/other)
    - Heals friends or raid boss when they're under 60 % hp and caster is both hp,mp > 50 %. Tested that
    nurse ants now heal queen ant. Siege guards also get healing abilities.
    - Ranged chars consider if they need to take more distance (run back) if the target is
    melee & slow / rooted (the chance is even higher if geodata = 2, meaning it's not as
    likely to go through walls..)
    - Higher chance for using close range skills when close
    - Minions might resurrect their leader if they have resurrect skill
    - Adds ability for a mob to buff its clan. E.g. skill 4601.
    - Mobs use NG ss/bss. Information of shot users need to be updated to Interlude/Kamael.
    Mobs get NPCInventory, since it's possible we later learn they have limited nr of... e.g.
    potions, not just shots.
    - Siege guards should also heal castle defenders.
    - Great white shark shouldn't attack when you're not in water (doesn't stop it yet coming on land)
    - Mob try to circle the target instead of standing on top of each other. Probably needs some further work,
    now the code works like: once in 3 seconds, check if any other mob in distance of 20. If yes, change to
    a random position around the target.

    One motivation for this patch was to take out some worst stupidities the mobs did (root twice etc)
    only with little changes to current AI structures. The general code is the same, actions
    are based on random chances, but the chances are now different - they should be easy to read from
    the code (and change).


    Regards Smile
    avatar
    DnR
    Admin
    Admin

    Posts : 1027
    Join date : 2012-12-03

    Re: Improved AI

    Post  DnR on 19th September 2015, 14:37

    I'm aware of all past changes in L2J.
    I like this AI, but it's not as simple as it looks in core side.
    It requires to declare AI type to every single NPC in database.
    I don't have the time to do this yet, but i can attempt to update AI, once i'm done with Boss AIs.
    Thanks.
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Re: Improved AI

    Post  Karakan on 19th September 2015, 16:32

    It requires to declare AI type to every single NPC in database.

    You are not alone here.
    I can help you with that.
    We just need a new npc table entry. s.t. like "ai_type".

    If you can implement the core site ,i could add the database part 1 by 1.

    Thanks for your time. Smile
    avatar
    DnR
    Admin
    Admin

    Posts : 1027
    Join date : 2012-12-03

    Re: Improved AI

    Post  DnR on 12th March 2016, 15:29

    I can officially tell that this AI will be merged to the project at next revision.
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Re: Improved AI

    Post  Karakan on 12th March 2016, 16:42

    Thank You and Keep up the Good work! Smile
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Re: Improved AI

    Post  Karakan on 18th March 2016, 17:49

    Just tested the latest rev. with the AI changes.
    Here are few reports Smile


    AI - Fighter
    -------------
    Works as it should.
    Monster starts running to the attacker and starts attacking.Barely using any spells.May buff itself.



    AI - Balanced
    ---------------
    Works very good.Monster casts spells (if it has any) when the distance increases between Player-Monster.
    If in close range, it switches to normal phys. attacks.


    AI - Mage
    ----------
    This one really adds some retail gameplay feeling.^^
    Monster won't charge attacker at all. Starts casting spells, and keeps spamming them.
    Could be very annoying to Low Mdef characters Razz


    AI - Archer
    ----------
    This one seems not to be working at the moment.
    Monster won't run away from close range attackers to gain some distance. It just hold its ground and shoots.



    Regards Smile
    avatar
    DnR
    Admin
    Admin

    Posts : 1027
    Join date : 2012-12-03

    Re: Improved AI

    Post  DnR on 19th March 2016, 20:38

    I suppose it's merely disabled in fear of monsters being inside small rooms and getting lost inside walls while running.
    There is a small chance that monsters will actually run away.
    Well, we might complete AI in the future. Wink
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Re: Improved AI

    Post  Karakan on 19th March 2016, 22:40

    I'll try to find that line and increase the chance.
    With a good geodata, mob shouldnt walk thru walls so easily.

    Anyways great job by adding this to Lisvus !!! Smile

    Sponsored content

    Re: Improved AI

    Post  Sponsored content


      Current date/time is 24th November 2017, 09:26