How Pathfinding Works in Games!

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • НаукаНаука

Комментарии • 157

  • @henriklarsen8193
    @henriklarsen8193 8 лет назад +54

    Very good stuff! More detail would be welcome, I think this kind of video can be a lot longer without loss of interest!

  • @lucetubegplusstillsux2678
    @lucetubegplusstillsux2678 8 лет назад +3

    There's also the Pad/preset system that Perfect Dark, and some other Nintendo 64 games used. Where there would be hundreds of points on a map and the AI would run to the point, then move to the next one.
    The unique thing is the navigation presets would be manually programmed, so that if there was a preset running into a wall, there'd be no direct path to it, so the AI never ran off cliffs, since someone on the dev team specifically ensured they couldn't.

    • @kollerjon
      @kollerjon 8 лет назад

      +Lucetube GPlusStillSux Is that implementation similar to Half Life 2?

    • @lucetubegplusstillsux2678
      @lucetubegplusstillsux2678 8 лет назад

      Probably, I'm not quite familiar with HL2's system though

    • @seigeengine
      @seigeengine 5 лет назад

      And how is that different? It's the same idea: a graph is constructed than an algorithm searches to find a path across.

  • @mintyjodpuhrs
    @mintyjodpuhrs 9 лет назад

    Really interesting, definitely looking forward to the next one!

  • @danroamer
    @danroamer 9 лет назад

    She got my like at: "Obligatory Praise the sun", but seriously, cool stuff in the vid.

  • @Hlidskialf
    @Hlidskialf 9 лет назад +1

    Great video

  • @DivusMeta
    @DivusMeta 7 лет назад

    Dark Souls Forever! (You Died!)

  • @TottyRops
    @TottyRops 8 лет назад +17

    We learned about this in the Artificial Intelligence module of my degree. One of the assignments was to solve the Travelling Salesman Problem (TSP) using a genetic algorithm. I wrote a solution in Javascript so it can run on almost anything that has a browser. Genetic Algorithms are also used in game path finding, as they can be quite fast and pretty accurate!

    • @YEASTY_COMMIE
      @YEASTY_COMMIE 7 лет назад +2

      genetic algorithm ? you mean trying random path and keeping the best ones ?

  • @tanan1771
    @tanan1771 7 лет назад +2

    Or... just go directly to the player.
    if (botX < X) {
    botX++;
    } else {
    botX--;
    }
    if (botY < Y) {
    botY++;
    } else {
    botY--;
    }
    better?

  • @algi1
    @algi1 7 лет назад +5

    OMG, the Dragoons of StarCraft 1 waiting for each other at bridges! :O

  • @pokashine
    @pokashine 9 лет назад +10

    I came for the cat. Subscribed for the cat. And will stay for the cat.
    Oh, and videos!
    ...like this one. Good stuff!

  • @Sangheilitat117
    @Sangheilitat117 9 лет назад +5

    VaatiVidya brought me here, and I was not disappointed. This is an insightful look into an often poorly understood mechanic.

    • @TheHappieCat
      @TheHappieCat  9 лет назад

      Sangheilitat117 From where did this get linked by VaatiVidya? Or did you find it from the subreddit?

    • @Sangheilitat117
      @Sangheilitat117 9 лет назад +2

      Ah, he linked it on his tumblr actually.

    • @TheHappieCat
      @TheHappieCat  9 лет назад

      Sangheilitat117 Woah!

    • @MRabbitFrog
      @MRabbitFrog 9 лет назад

      Sangheilitat117 Was it before all the plagiarism stuff flooded or after?

    • @Sangheilitat117
      @Sangheilitat117 9 лет назад

      I honestly have no idea what you're talking about.

  • @zzzzzmmm6539
    @zzzzzmmm6539 9 лет назад +4

    that graph u drew, reminded of the Signal-Flow Graph in control theory, the only difference being what u call edges r actually called paths in SFG

    • @TheHappieCat
      @TheHappieCat  9 лет назад +5

      Rebel Raime Yeah, high-level and low-level stuff share many of the same models. It's pretty cool.

  • @winterfallgame
    @winterfallgame 8 лет назад +1

    Very disturbing: we have the same handwriting, including irregularly written e or a. That aside, this is a very nice video, as a game designer I enjoyed it very much. Very educatively put!

    • @snowy8321
      @snowy8321 8 лет назад

      LOL, compare it to Me and tekking101, he's eerily similar to me. He looks like me, acts like me, and even a bit of his life stories are like mine.

  • @kanseidorifto2430
    @kanseidorifto2430 6 лет назад

    MY TIMESKIP IS UNBEATABLE!
    MY TIMESKIP IS UNBEATABLE!
    MY TIMESKIP IS UNBEATABLE!
    MY TIMESKIP IS UNBEATABLE!
    MY TIMESKIP IS UNBEATABLE!
    MY TIMESKIP IS UNBEATABLE!
    MY TIMESKIP IS UNBEATABLE!
    MY TIMESKIP IS UNBEATABLE!
    ....."Time to make the donuts."

  • @ianmclean9382
    @ianmclean9382 7 лет назад +1

    great explanation! I adore your very real world examples for explaining different mechanisms.

  • @KilnFirelink
    @KilnFirelink 9 лет назад

    You slightly simplified the darkroot garden glitch as it is because the AI (In this case the humanoid AI meant to act like a player as most enemies in the game have different aggro and behaviour) knows you have bottleneck it so it is trying to get the jump on you as by driving to its death. If you don't break off from the enemies when running they will simple follow you inside of trying to find a way to sneak up on you so this is more a behavioural exploit than path finding after for the crystal golems they use a very simple shortest route to the player method so they only use one path finding method as like most simple enemies they only attack forward withing aggro range and cannon leave it to find away around as they would break aggro, This is beast found with the "super aggressive mod" that would stops this problem to only increasing agrro range. Ever way great video and subbed, keep up the great work.

  • @KaletheQuick
    @KaletheQuick 7 лет назад +2

    PRAISE THE SUN!
    More dark souls plz.

  • @nosh247
    @nosh247 8 лет назад +1

    wow happie cat your videos are very educational!
    Great Job explaining programming principles and how things work...i have a new perspective on some of those subjects thanks to you :D Finite State machine explanation was excellent :D

  • @glouburgorilla2401
    @glouburgorilla2401 3 года назад

    That was really helpful ; I am doing college project about pathfinding Visualizer I don't know the Topic is something just deep ;
    Thanks video just help me to understand pathfinding more effective ;

  • @Randall_Kildare
    @Randall_Kildare 8 лет назад

    would it be conceivable to program mob AI to work 'clairvoyantly' in reverse from the target destination, eliminating path selection backwards. Ideally, this would not only make MUCH smarter mobs, but allow for some very complex mechanics to be selected between confrontation & aggro.
    thoughts on this..?

  • @anonymousnearseattle2788
    @anonymousnearseattle2788 6 лет назад

    Nah, what's really happening here is that the NPCs realized their existence was pointless, so they committed suicide by jumping off the ledge. :-)

  • @89elmonster
    @89elmonster 9 лет назад

    Can you explain to me how people find glitches in games like call of duty? In multilayer maps people find the weirdest things that I wouldn't even come close to finding out. How do people do this? Do they know where the grid mesh for the AI is(For zombie mode)?

  • @algi1
    @algi1 7 лет назад

    Too easy for Dark Souls? Dark Souls is full of exploits that are legitimally accepted because of its punishing difficulty.

  • @Aikaosu
    @Aikaosu 9 лет назад +3

    Yo that cat graph was rad as shit.

    • @ReyndommVideos
      @ReyndommVideos 9 лет назад

      Krasnoya Ronin Your avatar is also rad as shit.

    • @lu-chan1745
      @lu-chan1745 7 лет назад +1

      shit is not red 😡

    • @lu-chan1745
      @lu-chan1745 7 лет назад +1

      shit is not red 😡

    • @Manas-co8wl
      @Manas-co8wl 7 лет назад +1

      shit is brown... and rad

  • @briansmith1288
    @briansmith1288 9 лет назад +1

    That was pretty interesting. It is fun to know the underlying principles. I just know a few places in the game where pathing is lethal. Much to my delight.

  • @virtualcosmos2340
    @virtualcosmos2340 7 лет назад

    i know the* algorithm but the pathfinding in starcraft 2 follow surprise me, It's so smooth and precise... how could the modules are disposed in the map? are there thousands of very little modules for everywhere or could have another system like modules inside of modules?

  • @Beatsbasteln
    @Beatsbasteln 3 года назад

    programming tutorials with cat drawings? fuck yeah!

  • @RaidenHeaven
    @RaidenHeaven 8 лет назад

    6:00 actually no. It just doesn't calculate the collusion that happens. If there was no collusion the AI would jumped down without falling off the edge. As the enemy is jumping down it steps on the characters head and then it's forced keep on walking forward.

  • @2sahn234
    @2sahn234 6 лет назад

    well Pathfinind Algorithm has been imporeved now. since then its not completlty hardcoded anyway.. it just takes a simplified version of mesh with places marked as allowable and forbidden which can dynamically be triggered or switched.and then bots are configured with set of automated queries with a different buffer, that makes them aware of possible routes it has to reach , since path distance has already be calculated, hence so itll move like there . And yes noth everytime we need it to trace the shortest path and so its upto game logic ;) to mark places as forbidden forcing system to use longest path.

  • @BruceWayne-gv9zs
    @BruceWayne-gv9zs 7 лет назад

    Ive noticed bethesda games dont have this problem despite being much larger. Ai routines must account for things like height. If you run up some stairs the enemies always run up after you, not into a wall below youm

  • @ElboxD
    @ElboxD 8 лет назад +1

    and just 14k views? You deserve way more... Thanks for making these absolutely amazing videos!

  • @jensons88
    @jensons88 9 лет назад

    Very informative. Graphics today in video games are very advanced and more realistic. In my opinion, pathfinding is still way too far complicated as compared to how a person does it.

  • @isaiaslafon9329
    @isaiaslafon9329 8 лет назад

    I find your videos, Ur so awesome. THX for doing this videos. (I'm not a native speaker, so sorry if I make some mistake in my text)

  • @sarthakshah77
    @sarthakshah77 7 лет назад

    I didn't find "Computer architecture" Playlist in your play list.

  • @henbomb9826
    @henbomb9826 6 лет назад

    The most accurate and fastest pathfinding algorithm is A* with Euclidean distance

  • @huizhou47
    @huizhou47 9 лет назад

    The devs didn't patch this, because it is useful for bad players or players that need lots of souls. They could easily have patched it so that they back away from the corners of the map.

  • @ayushman_sinhaa
    @ayushman_sinhaa 3 года назад

    Finally I learnt to pronounce Dijkstra's algorithm

  • @portnoy256
    @portnoy256 7 лет назад +1

    Snake! :)
    Thank you for the unique MGS alert sound!

  • @medimadeddineboubekeur8058
    @medimadeddineboubekeur8058 Год назад

    Thank you sm I’ve been searching for ages to this answer

  • @TechXSoftware
    @TechXSoftware 8 лет назад

    Just because your a girl and u like tech stuff doesn't mean, never mind, date me.

  • @kollerjon
    @kollerjon 8 лет назад

    That's some lazy design, From :/

  • @ZaphyrVonGenevese
    @ZaphyrVonGenevese 7 лет назад

    Awesome video. You are great! Thank you

  • @alekxsander
    @alekxsander 9 лет назад +2

    through "nodes", it became much easier to understand! thanks mis!! :)

    • @TheHappieCat
      @TheHappieCat  9 лет назад +3

      alekxsander eduardo Glad it helped! Thanks for watching!

    • @Gizego
      @Gizego 6 лет назад

      For my game, i am going to use an easier system. Its a tile mapping game so, it determines the distance to the player, it checks for obstacles and if it finds one it tries to go around it

  • @p3rcey
    @p3rcey 9 лет назад +1

    Really interesting from a development perspective

  • @CiaphasKirby
    @CiaphasKirby 9 лет назад +1

    Fascinating stuff, I would love to see more of these.

  • @AymanJundi
    @AymanJundi 8 лет назад +1

    gosh that was so neatly explained.. great channel.

  • @dailydols
    @dailydols 8 лет назад

    That Dijkstra's looks like Viterby's.

  • @moviesynopsis001
    @moviesynopsis001 5 лет назад

    You have restored my faith in women, thank you.

  • @takealook5012
    @takealook5012 7 лет назад

    Very Nice You have saved my day beautifull

  • @Personincrowd
    @Personincrowd Год назад

    Cool and informative vid. Thanks

  • @Ruftinator
    @Ruftinator 7 лет назад

    What happens when you put an NPC on a Mesh that isn't a NavMesh?

  • @shun2240
    @shun2240 7 лет назад

    hey happie cat can you do a video on total war eats so much compute power

  • @Ian-nl9yd
    @Ian-nl9yd 7 лет назад

    unless you're valve -- then it doesnt work at all

  • @ErickTG
    @ErickTG 9 лет назад

    You made the Golems look like idiots! lol Nice video! =D

  • @Noobwarriking
    @Noobwarriking 9 лет назад +1

    very cool video
    more please!

  • @ethanwasme4307
    @ethanwasme4307 8 лет назад +3

    Reminds me of gta 3 where you could get 6 stars, go onto the container ship and just watch the cop cars drive into the water, provided lots of laughs

  • @Felhek
    @Felhek 7 лет назад

    awesome channel. thank you.

  • @menosferato
    @menosferato 9 лет назад +1

    I knew about the A* algorithm, but I think it's not doable for large scale games to run it in runtime for several units at once. Great tutorial.

    • @TheHappieCat
      @TheHappieCat  9 лет назад +3

      menosferato Many games do use A*, it's Dijkstra's that would take awhile for each unit :) Thank you!

    • @luisoncpp
      @luisoncpp 8 лет назад

      A* is pretty useful even for large games, and the path finding algorithm in the graph usually is not the big challenge for the path finding AI.
      Both A* and Dijkstra can process only few of the nodes in each iteration of the gameloop.
      Bigger challenges is choose how to create the navigation map, how often recalculate the path finding in case that the target moves, what to do if the agent find an obstacle in an already planned path or how to deal with the momentum.
      A different algorithm may be required if there are a lot of agents moving at the same time (for example, the Zerg).

  • @FSF87
    @FSF87 7 лет назад

    Subway stations in GTAV (particularly Portola Drive) is a great example of this. You can stand in the tunnels, take shots at passengers on the platform with a sniper rifle, and the police gather around the street above you, allowing you to rack up kills to increase the amount of ammo you can carry without the inconvenience of getting arrested or killed, or having to outrun the police.

  • @OthmanAlikhan
    @OthmanAlikhan 7 лет назад

    Thanks for the video =)

  • @janglaser6130
    @janglaser6130 6 лет назад

    I would like to add, that dijkstra's algo can be used to precompute graph for start node A. Then, any query that starts in path node A but ends whereever you want, can use the precomputed graph. Like this, you can keep list of precomputed graphs for various start nodes. (depends on game / situations). :)

  • @emessar
    @emessar 3 года назад

    Thank you. This is one of the better videos on how pathfinding actually works. Most videos are just tutorials of how to utilize a nav mesh in game engine X. Having taken discrete math, the idea of boiling a surface down to a series of nodes makes a lot of sense. Thank you.

  • @DanielPerez-fm9vy
    @DanielPerez-fm9vy 7 лет назад

    When it comes about this topic, it's impossible not to mention StarCraft. Nice presentation, with examples and hilarious bugs from Dark Souls. That's the dream!

  • @Sirtuta1
    @Sirtuta1 8 лет назад

    could you explain why blighttown has frame rate issues?

    • @MadDeuceJuice
      @MadDeuceJuice 8 лет назад +1

      +Arthur Ferreira they crammed it with particle effects that the engine couldn't handle

  • @xiangzhang8508
    @xiangzhang8508 8 лет назад

    love your explanation.

  • @colepeterson5392
    @colepeterson5392 8 лет назад

    you should make a Dijkstra's algorithm explanation video please!!! all the ones on youtube are weird and you explain things so well! thanks.

  • @gursegugu
    @gursegugu 8 лет назад

    *very good* *hello* *im sorry* *help me*

  • @MrDrescher86
    @MrDrescher86 7 лет назад

    I have only 2 things to say. 1 your videos are amazing. I can only imagine how good they are for people without prior knowledge. 2 Dammit! I thought my idea of making simple instructional game development videos were unique 😄 guess it is good I didn't start yet

  • @moodyplus
    @moodyplus 8 лет назад

    this channel is everything

  • @xdario10
    @xdario10 9 лет назад +1

    Loved this thanks!!

  • @sagarpatel2630
    @sagarpatel2630 8 лет назад

    This is my first comment on youtube. Saw 2-3 videos of this channel, and I am in love with you 😀.

  • @Zydraxis
    @Zydraxis 8 лет назад

    you should do gameplay!

  • @Lobbogurke
    @Lobbogurke 7 лет назад

    :'D I was already in the act of grabing my mouse and twitched back at the "BUT WAIT" :'D

  • @magnusm4
    @magnusm4 4 года назад

    There's a fun video with a developer of C&C Tiberian Sun where he explains that the way they made the ai more efficient for processors was to not put allies into account and simply tell them to move if they collide. Thought of this when you said they just wait until the unit moves to continue.

  • @NikhilKumar-fj2dg
    @NikhilKumar-fj2dg 7 лет назад

    I got it!!!!
    Thanks for making things easier to understand
    #TheHappieCat
    :-)

  • @Halskitchen
    @Halskitchen 7 лет назад

    why is it the norm to "abuse" games? why is cheating seen as such a great thing? what happened?!

  • @JoSaLoFoPoT
    @JoSaLoFoPoT 9 лет назад

    That was really interesting! The cost based system reminds me of link state routing over computer networks, it's cool to see it applied here. I think I'll peruse this channel further :)

  • @TheBcoolGuy
    @TheBcoolGuy 8 лет назад +1

    I like your videos so far! You're also absolutely gorgeous! :D

    • @ashleyketchum2739
      @ashleyketchum2739 8 лет назад

      TheBcoolGuy go away shes mine.

    • @TheBcoolGuy
      @TheBcoolGuy 8 лет назад

      Ryan Noble Hahaha. She's neither of us', mate. I just wanted to tell her that. I know you know this, but whatever, man.

  • @llywyllngryffyn8053
    @llywyllngryffyn8053 8 лет назад

    Watching your videos is like reliving my CSI classes vicariously.

  • @glez5288
    @glez5288 8 лет назад

    just found this channel, its amazing! much love from Mexico

  • @imrequael
    @imrequael 8 лет назад

    you are so talented

  • @StrongJoshua
    @StrongJoshua 9 лет назад

    A* is so useful

  • @muhammedabdul-ghaffar8765
    @muhammedabdul-ghaffar8765 7 лет назад

    This is interesting.

  • @revolutionnetwork7709
    @revolutionnetwork7709 8 лет назад

    Amazing video

  • @jayp1206
    @jayp1206 9 лет назад

    I wish I had a cat

  • @rock00dom
    @rock00dom 8 лет назад

    You've explained it very well, thank you! ^^

  • @gundam7463
    @gundam7463 8 лет назад

    Legal, Cool :)

  • @MarcusNorton1024
    @MarcusNorton1024 8 лет назад

    Thanks for creating this video! It is very interesting / enlightening!

  • @bharathmettu4252
    @bharathmettu4252 6 лет назад

    You are awesome

  • @gophermaster
    @gophermaster 9 лет назад

    Super informative, thanks!

  • @repc465
    @repc465 8 лет назад

    You're sweet

  • @kim15742
    @kim15742 7 лет назад +1

    Yay, A*, that is what I will be writing a school paper about!

    • @liesdamnlies3372
      @liesdamnlies3372 7 лет назад +1

      Mein Kanal! Just stay a healthy distance away from the event horizon.

    • @kim15742
      @kim15742 7 лет назад

      ***** That means?

    • @liesdamnlies3372
      @liesdamnlies3372 7 лет назад +1

      Mein Kanal!
      Well, -10 nerd cred for you: en.wikipedia.org/wiki/Sagittarius_A*

    • @kim15742
      @kim15742 7 лет назад

      ***** Ah! Also, when you search for D*, you get you get some sort of radios :)

  • @RadCommieGamer
    @RadCommieGamer 7 лет назад

    I like your videos so much! Thank you!

  • @AxelWerner
    @AxelWerner 7 лет назад

    beep boop beep

  • @16dancechik
    @16dancechik 9 лет назад

    You're amazing! Thank you :)

  • @papachanka658
    @papachanka658 7 лет назад

    Damn right dark souls is a good game. I made it.

  • @abetry
    @abetry 8 лет назад

    Excellent

  • @seanmitchell2279
    @seanmitchell2279 7 лет назад

    Marry me

  • @andreatucci6356
    @andreatucci6356 8 лет назад

    awesome.

  • @MrChaitanaya
    @MrChaitanaya 6 лет назад

    Great vid