Calculating Flow Fields for Rats in 'A Plague Tale' | AI and Games #73

Поділитися
Вставка
  • Опубліковано 9 чер 2024
  • The Plague Tale games are known for the swathes of rats that infest the lands, and do their best to kill the player and everyone else. In this episode, we dig into detail on how the rats actually work, and how it ties back to the Micro Machines games of the early 1990s.
    References for this episode:
    How A Plague Tale: Innocence's rat hordes were made
    www.rockpapershotgun.com/how-...
    How ‘A Plague Tale: Innocence’ Makes Diseased Rats So Terrifying
    variety.com/2018/gaming/featu...
    Making the rat-tastic sequel A Plague Tale: Requiem, Game Developer, 2022
    www.gamedeveloper.com/design/...
    Video Chapters
    [00:00] Introduction
    [01:17] We Have a Rat Problem
    [03:19] How the Rat AI Works
    [08:12] How You Balance AI Rats
    [11:02] Wait, Micro Machines???
    [13:21] Closing
    [14:29] Credits
    --
    AI and Games is a UA-cam series on research and applications of Artificial Intelligence in video games.
    Follow 'AI and Games' for educational videos and essays:
    / @aiandgames
    My second channel 'AI and Games Plus' is dedicated to bonus content, deep-dive analysis, revisiting old topics and more:
    / @aiandgamesplus
    Listen to my podcast 'Branching Factor', as I discuss game development and research with my co-hosts and guests:
    shows.acast.com/branchingfactor
    Watch Livestreams: / aiandgames
    Join our Community: discord.aiandgames.com
    Buy our Merch: store.aiandgames.com
    --
    You can support AI and Games via Patreon and UA-cam memberships, and in return, you get bonus rewards!
    / aiandgames
    www.youtube.com/@AIandGames/join
    --
    Follow 'AI and Games' on social media.
    Twitter: / aiandgames
    Mastodon: mastodon.gamedev.place/@AIand...
    TikTok: / aiandgames
    Instagram: / aiandgames
    Threads: www.threads.net/@aiandgames
    --
    If you're interested in working with us, check out the following:
    Business Enquiries: contact@aiandgames.com
    Arrange Meeting: calendly.com/aiandgames
  • Ігри

КОМЕНТАРІ • 35

  • @Ghost_Of_SAS
    @Ghost_Of_SAS 9 місяців тому +52

    I played Plague Tale on gamepass, having seen nothing about it beforehand, so I did not even know about the rats. Imagine my reaction when I saw a thousand of them swarming towards me. that final boss in the first one is still one of the most impressive things I have seen in gaming.

    • @AIandGames
      @AIandGames  9 місяців тому +5

      The fact I played those final sequences on a Steam Deck at a solid 60fps is *very* impressive.

  • @viviannavicious
    @viviannavicious 9 місяців тому +41

    It's obvious, the giant rat AI makes all of the rules to see what kind of trouble they can get into.

  • @LyingTube
    @LyingTube 9 місяців тому +12

    I confess flow fields hadn't entered my mind, I was fairly convinced the rats were handled as part of a fluid shader! 😄

  • @AlanZucconi
    @AlanZucconi 9 місяців тому +8

    2:04 reminded me *so* much of the swarm of scarabs in "Tomb Raider IV The Last Revelation"!
    Also: "optimise the rats" is such a scary sentence to say! 🤣

    • @AIandGames
      @AIandGames  9 місяців тому

      Oh yeah, I forgot about that game. I suspect it's probably using a similar concept? I dunno, it's been so long since I played old Tomb Raider... 😅

  • @dainchi.
    @dainchi. 9 місяців тому +9

    Man, I'd love to see an episode on how Supcom 2 and Planetary Annihilation do their pathfinding. I remember better Pathfinding being one of the standout features of Supcom 2, to the point where it was a main marketing bulletpoint.

  • @Speed001
    @Speed001 9 місяців тому +2

    Flow Feilds reminds me of the what i learned in fluid dynamics.
    Track a particle or a certain space-volume.

  • @Bloodlinedev
    @Bloodlinedev 9 місяців тому +1

    I've just realized that the idea behind flow field pathfinding is a bit like deferred rendering. I've use this technique before for zombies, super quick and easy to implement.

  • @marvel626
    @marvel626 8 місяців тому +2

    This channel is so cool and underrated. Love your content!

  • @Battleguild
    @Battleguild 5 місяців тому

    I would love to see an example of Flow Fields being used to simulate Pitch Black environments that adventurers would come across when traversing dungeons or underground caverns.
    I wonder if it would be less or more taxing than a traditional light/shadow system.

  • @skeleton_craftGaming
    @skeleton_craftGaming 7 місяців тому

    This is a really clever way of doing that, GPUs are basically optimized for doing calculations like interpolating between two vectors....

  • @Megasteakman
    @Megasteakman 9 місяців тому

    Thanks for this! I have been wondering about this one for a while, and its fascinating! Also, Micro Machines was such a good game, haha.

  • @zejugames5045
    @zejugames5045 9 місяців тому +2

    Amazing video, never knew about this AI approach!
    Have you been following the Road to Vostok devlogs? The dev looked into various enemy AI approaches (FSM, behavior trees, etc.) and decided on a separate approach... it sounded really interesting and thought it might be of interest to you!

    • @AIandGames
      @AIandGames  9 місяців тому +1

      I did not know about that, but I'll be sure to check it out!

  • @smokeback
    @smokeback 9 місяців тому

    Amazing ai video as always to learn from

  • @TennessseTimmy
    @TennessseTimmy 9 місяців тому +1

    Could someone clarify,
    Rat checks it's position on the grid(find grid it's on)?
    Grid has an direction assignment?
    Rat moves towards direction assignment?

  • @Random_Dragon_Furry
    @Random_Dragon_Furry 7 місяців тому

    Literally a hive mind for rats.

  • @matthewboyd8689
    @matthewboyd8689 8 місяців тому

    Is that flow field the same way days gone had a thousand zombies at once?

  • @benjarubio3251
    @benjarubio3251 9 місяців тому

    great video

  • @brookslee2227
    @brookslee2227 Місяць тому

    I''ve been wondering how they achieve the rat self collision? there is no imformation about it on the internet

  • @brandyhandy4157
    @brandyhandy4157 9 місяців тому

    Good job 🏆🙂🙏🏼

  • @timbus2
    @timbus2 9 місяців тому

    Damnit… now I want to play these games. (Including Micro Machines! 😂)

  • @retrodad9390
    @retrodad9390 9 місяців тому

    Clever....... thanks for the video

  • @DrMarlboro_1
    @DrMarlboro_1 7 місяців тому

    You should make a video about the rain world ai

  • @lauraschlieselhuber8487
    @lauraschlieselhuber8487 9 місяців тому +1

    My theory was that it relied on a particule system, but if feels like it's different than that, somehow. Like a cloud of points with simplified path finding instead of manual inputs for velocity and areas of actions. That's the only way for me to imagine it, but it's probably because i'm a graphic designer and no programmer lol.

  • @pawebernaciak1581
    @pawebernaciak1581 9 місяців тому +1

    So you can say that this is in a way particle system, rats are particles that get their velocity to move using grid as source of their velocity. Using fields it's pretty common in film FX and there are entire type of simulation doing that ie. flip simulation(water, fluid), generalized form MPM is generalization and was used for snow on frozen. It's pretty much the same process but name is different

    • @AIandGames
      @AIandGames  9 місяців тому

      Well yes and no. Particle systems typically imply the modelling of force/velocity and possibly collision, which isn't being modelled by the flow field. There's no effort to handle the velocity or acceleration of the rats by this system. The rats all operate on their own fairly simple controller to handle speed and often ignore collisions entirely. Even then the particle system doesn't have explicit knowledge of the environment, which this is designed to do on a per-scenario basis.
      As mentioned earlier in the video, the smaller schools of fish in Sea of Thieves are handled by particle systems (ran as a shader no less).

    • @pawebernaciak1581
      @pawebernaciak1581 9 місяців тому

      @@AIandGames depends on definition of particle system if we use point cloud of points that move from frame no velocity is needed. I did some detail on river for some commercial last year in pretty much exact way as you described. Difference might be you think about particle system as part of engine when I simplify it to simplest definition from papers/books as basis?
      Also fun fact in “Art of fluid animation” they describe how fluid sim works on bugs moving from cell to cell in apartment block.

  • @Ixarus6713
    @Ixarus6713 9 місяців тому +3

    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room.
    A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    And RATS make me crazy....
    Crazy? I was crazy once...
    They locked me in a room. A rubber room...
    A rubber room with RATS.
    *_A n d R A T S m a k e m e c r a z y . . . ._*

  • @user-sv9eq8ex8f
    @user-sv9eq8ex8f 8 місяців тому

    HEY!! Im only 39!!

  • @anteshell
    @anteshell 9 місяців тому

    I'm nowhere near 40 (34 d'uh), but Micro Machines was basically an essential part of my childhood.
    But about the rats, when I played both games, I was certain that the rats are implemented using some kind of particle system in a flow simulation. If you manage to isolate a couple of individual rats to a unescapable corner, they behave very much like particles losing all their intelligence breaking the immersion. While this is extraordinary feat as a whole, it really only works with masses of rats and breaks down completely on individual level breaking the immersion. Although it is arguable that my curiousness already killed the immersion beforehand when I tabled the turn and started to harass the rats myself and not fault the game for it. ;D