[Just for fun] Some holiday experiments with dungeon exploration AI

The "creature" here works from it's own memory, being unaware of the rest of the map. The blocks (wire cubes) indicate line of sight, the red mostly-diagonal lines are a visual representation where he "thinks" there might be more areas to explore that he does not yet know. His own navigation of the map only uses parts of the dungeon he's seen before to expand (improve) paths.

This is part of a much larger project scheduled to start only in 2017 but over the holidays I couldn't help myself ;)

Comments

  • @clive very cool!

    Does it use NavMesh pathfinding? Or A*, or something else?
    Is the level static or dynamic?
    What approach did you use for the AI? State machine?

    It's never too soon to add screen shake... ;-P
  • edited
    @konman This is experimental stuff of my own, so it's "something else" not using navmesh or A* it's an algorithm I'm working on for my own purposes where AI and navigation are very closely tied.

    The level, as well as "creature personality" is procedural, at runtime.

    The AI itself is "needs based", I'll write a post on it when it's more mature. In the video you might notice little yellow diamonds, those are fake "food". For the above recording the need to explore was high but the need for food low, if they'd been at my normal levels I'm using during testing the guy would stop exploring if he's hungry and sees food and, or even "remembers" food and change direction based on needs, be it hunger, sleep, loneliness or any other factor which affects his behaviour/personality and in turn where he's heading in 3D space. It's node based, and fully 3D allowing movement per grid point in any direction one cell at a time based on generated map allowance.

    Each creature has it's own entire map in it's own "head" and if a wall is destroyed, or a door locked, they won't know until they get there and try, at which point they'll try alternate routes or even try unlock (or even bash down) a door dependent on individual creature ability.

    This is, possibly obviously, done in Unity, here's what you *could* you see if you select a character within the editor:
    image

    Here's a different example quickly, in this one I only rendered dungeon floors, for ease of viewing, I create (randomly) multiple "very hungry" creatures that are also very scared of each other. Hunger is indicated by the "creature"'s redness. "food" randomly spawns and I inject the known food location inside each creatures memory at spawn time (so they all know where all the food is). You can see they avoid each other (because I'm injecting/updating all other creature locations in each creature memory as well) ... but when hungry enough they'll become desperate enough to make a rush for it ;)

    Thanked by 1konman
  • Very cool. I like your custom inspector thingy in Unity, it's a real pain in the ass to make those!

    And your AI scenario with multiple creatures afraid of eachother but with the need to feed is really interesting. I could see quite a cool game come out of trying to escape the dungeon and not get eaten!
    Thanked by 1clive
Sign In or Register to comment.