1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Mob AI

Discussion in 'Development' started by Indexfire, Apr 2, 2017.

  1. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    Im getting extremely frustrated. I have decompiled PureEntities countless times already and I simply dont understand all that code. How do i write Mob AI?
     
  2. Primus

    Primus Zombie Pigman

    Messages:
    749
    If you don't understand, then you're just not ready.
     
    jojoe77777, SOFe, jasonwynn10 and 3 others like this.
  3. kniffo80

    kniffo80 Silverfish

    Messages:
    24
    GitHub:
    kniffo80
    Decompiled? o_O
     
    Indexfire and ALLINSEO like this.
  4. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    Typed too fast
     
  5. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    There isnt a pre made method like on PC mind you
     
  6. Primus

    Primus Zombie Pigman

    Messages:
    749
    You have to create your own path-finding component and connect/integrate it into Entity::onUpdate()
     
    Indexfire likes this.
  7. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    Thanks, will try
     
  8. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    even tho genisys's implementation sucks very much you could use it as a refrence just DONT copy it as a lot of people says it's inefficient
     
    Indexfire and jasonwynn10 like this.
  9. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    how does genesys do it does it have a pre defined method like on PC or another way




    Would you be kind enough to post a link?
     
  10. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    how does it do that?
     
  11. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    ?
     
  12. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    I don't know what you mean by pre-defined method. All I can tell you is that the time paradox of causal loop does not exist here -- there always has to be someone who writes the code the first time.

    I have absolutely no experience in pathfinding, but I believe that the whole mechanism is in viewing object intersections as points and has something to do with topology. I believe that you can find some algorithms for pathfinding online, though, but it would take a lot of experience to write it into code well. If you can't find the code out from pureentities, which isn't really a big plugin, I doubt you're ready to do it, as @Primus has said. You indeed can do it, but you'll probably end up rewriting several times and keep asking yourself "why didn't I do this" "how could I have written something like that" after attempting many times; on the other hand, if you plan to copy much code, good luck.
     
  13. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    Bukkit has a Predefined Method and does it by extending a superclass from the EntityClass of the mob you want to give Custom AI then clearing the pathfinder goals of the mob and then adding your own pathfinder i cant remember how it does that exactly but its something like this:


    public class CustomWither extends EntityWither{

    bla bla bla


    this.PathfinderGoals.clear()

    this.newPathfinderGoals(ZOMBIE)


    }


    Would make a Wither attack a Zombie for example (Obv not the correct way)


    https://www.spigotmc.org/threads/tutorial-creating-custom-entities-with-pathfindergoals.18519/
     
  14. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Yes, and the predefined method in Bukkit was written by a human too. You don't put a beta radiation source next to a computer to implement pathfinding.
     
  15. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Couldn't you've told me that before? I was waiting for hours and nothing happened...
     
    jojoe77777, jasonwynn10 and Sandertv like this.
  16. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    tru dat
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.