Why Rain World Has the Best AI

preview_player
Показать описание

Since we're on the topic of AI, apparently...

I wanna talk about the best AI I've ever seen in a game. Because at the end of my last video I showed a clip that really didn't do it justice. This is from Rain World, which actually has some of the most incredible AI in any game I've ever played.

And I kinda threw it under the bus.

So to make sure it gets the credit it deserves, I want to talk about how Rain World has some of the best AI in the business.

Basically I'm just going to sit and praise rain world again....

Intro 0:00
The AI 0:30
The Animation 5:16
Issues With Procedural Animation 6:40
Issues With Rain World's AI 7:23
Scavengers 8:31
Рекомендации по теме
Комментарии
Автор

The first encounter I had with scavengers was a weird one.
I was just running around with a spear in my hand, looking for food.
When 3 scavengers suddenly emerged and all ran to me, throwing rocks at me to knock me out. They then stole my spear, and ran away...
I got fucking mugged.

Deneex
Автор

Some points I really like about the AI:
If you stumble upon a scavenger post and are spotted by only one of them, it will point towards you to alert the others. The others will first look at the one that spotted you then over where they're pointing. If you've hid by then, they may just not believe the one pointing.

Also as lizards are afraid of vultures, if a lizard has seen a vulture recently and you make noise without having been seen by the lizard, it will assume it to be the vulture and hide.

EivindKvitberg
Автор

one more thing i'd like to add about scavengers, they have certain parameters in their AI that can be selected based on other factors or just random chance, which dictate them being aggressive towards you or another creature. one of these parameters is "for-fun" or something, which means that if that scavenger hasn't attacked anything in a long time and you don't have an overwhelmingly positive reputation, but they have no other reason to attack you, they may decide to do so just for shits and giggles.

timob
Автор

one thing that i find neat about the game are the vultures, particularly how if you manage to take a vulture's mask, other creatures will run away from you out of fear because you have the apex predator's face. But, if the vulture is still alive and you have its mask it'll never forgive you, and always be tracking you. Even between zones, a vulture that lost its mask will follow you

Zayjay
Автор

Hello I am from Finland and I would like to confirm that reindeer being frustratingly stupid is entirely realistic.

Digitaaliklosetti
Автор

While some of the creatures might initially appear like 3D models, they're actually stitched together partly from graphics drawn from sprite sheets layered on top of physics colliders and part procedural graphics to give the impression of being 3D animated models. I think a much greater (and much less appreciated) facet of Rain World is how rich the procedural content is, from the procedural plants (which have stuck through since the early prototypical stages) to the layers of shading applied to the tiles the world is assembled from (I bet a larger than normal number of people didn't notice this fact at all). This is further evidence of the attention to detail paid from the largest components to the smallest.

CATASTEROID
Автор

The lizards also have a befriendment system.if you kill and repeatedly give them food, they start following you and sometimes protect you from other lizards. This alliance can be short lived though as it is purely food based. If you fail to feed your lizard it will snap there teeth near you to tell you that it’s hungry. If you continue to fail it can attempt to eat you

karlfrogley
Автор

another interesting fact about scavengers is that they will actively be hostile towards your guide the Overseer, or as the community likes to call him "iggy", because of reasons regarding the game's lore. even if youve befriended scavengers, sometimes you can get mixed in the crossfire and die because a scav was trying to spear iggy.

cosmobts
Автор

Fun fact: Scavengers have a lot of stat data that varies between combat skills and persnality. There is a particular scavenger ID called by "Robbin" by the community who has the highest stats on everything, this means will always parry your spears throwing something back, will duck or jump over your spears if is disarmed, has no fear to anything, doesnt hesitate to attack, has perfect accuracy and almost no spear cooldown. There are videos where this scavenger takes down red lizards alone.

jevmenyt
Автор

A few interesting notes (taken from the code):

Rain World's graphics isn't actually directly tied to what happens in the game, instead, there is a physics system - each object is made out of some "body chunks" (which are spheres), and an AI acts by moving those chunks. These chunks, in addition to directly the creature AI's state in some cases, cause the graphics, although some things are entirely graphical and have no bearing on gameplay. There's quite a strong separation between graphics and physics because the physics runs at a fixed 40fps, while graphics runs faster and generates in-between frames by interpolation to make things smooth. There's actually so much physics that as an optimisation every physical object has a circle around its main body chunk and can only collide with other objects that have overlapping circles, presumably because otherwise checking each pair of body chunks individually was too slow; but instead of abandoning that, they did something that was equivalent but ran faster.

Fun fact: some things in the game aren't even made out of sprites. A lot of things are sprites that just get repositioned according to code, but a few things, notably including the slugcat's tail, are entirely assembled by code, which literally dynamically generates the locations of triangles.

Scavengers have even more detail than you identified in the video. The speed and duration of the actions they take are determined by their personality: for example, the animation to indicate that the player is allowed to go through a toll advances every frame by a half plus the square root of the product of energy and agitation, divided by 20. When a scavenger sees a creature for the first time that it either attacks or is afraid of, and it has at least 20% sympathy, and the creature seen seems to be pretty close (the exact threshold is lower if the scavenger is more sympathetic), and a sufficient number of nearby pack members either don't know about the creature or are not scavengers, it will point at the creature. If any nearby pack scavengers are already pointing at something, it has a 50% chance to decide to not point. And yes, it is not a given that everyone in the pack is a scavenger, if the scavenger likes you enough then *you* are considered part of the pack. Which means that they will point at creatures in order to tell you that they are there. The duration of the point animation is also interesting: it is shortened if the scavenger is nervous (a combination of their personality nervousness value and current agitation), and lasts for longer if some of the scavengers in the pack still haven't noticed the thing being pointed at yet, with more effect the more sympathetic the scavenger is.

The general setup of the AIs is quite interesting: they don't just take predefined actions, they have a list of things that they care about and act on whichever one is most important. By far the simplest of these is rain, which increases in importance the closer the rain gets (as you'd expect) and generally causes an attempt to get to shelter, but there are all kinds of other things: friends, threats, food, aggression, injury...

Creature AIs are not omniscient. They have trackers for creatures that are maintained entirely separately from their real states, and they are only immediately aware of things that happen in the room that they're in. When they hear a noise, they don't know what it's from, so they look at each possible noise source they're aware of and look at how much it makes sense for that thing to have made noise, and if that doesn't find anything good they look at every creature they're aware of, and if that doesn't find anything good it's classed as "mysterious" - investigating mysterious noises is another thing that some creatures find important, and it's more important the more interesting the noise is. It would have been far easier to have the AIs just read out the exact game state, but they decided not to.

In general there is a huge amount going on. You're definitely right about one thing: there is so much detail in here even if almost nobody will ever notice it, just so that the game can feel like a real, unscripted world.

If anyone is curious about anything else, I've got pretty good at reading the code so I should be able to answer any questions.

pastebee
Автор

the other things I love are interesting mechanics such as rain deer bowing to other rain deer with larger antlers, or vultures hunting down other vultures who don't have masks, or baby noodleflies following you if you hatch the egg since they think you're their parent. it's the little details/mechanics like this (as well as literally everything you said in this video about scavengers and lizards) that really make it feel like the other species in the game have their own societies and just generally work in their own unique way. it's a very cool game :)
sorry if this comment was long haha

mr.occular
Автор

One time I was walking outside of a shelter, and upon seeing a Lizard I was like “ah crap”. But all of a sudden a Vulture appeared one second and picked up the lizard and swept him away to his hideaway. Somehow, this game gave me a teaching moment and a spooky cutscene at the same time, without it being scripted. This game is so amazing.

ravioliman_
Автор

Once you mention all the tiny details for the scavengers, you instantly sold me on how its the best AI already
The pure detail in communication itself is so impressive

esfdoggo
Автор

A small detail about lizards: if you injure them every circle repeatedly, the next time you see them they'll probably try to run away or play dead to catch you off guard. Also the squidcadas are pretty interesting. They hunt flies on their own and will continuously bump into you if you are considered as a threat

JustTobyi
Автор

I find it absolutely hilarious that scavengers among other personality types have one that kills the slugcat for fun, they really are identical to the player

illum
Автор

One more note with the scavengers: If your reputation with them does indeed get bad, they can send out death squads which are heavily armed with explosives, raid your shelters at the start of the cycle. A trader however has a different coding and AI from other scavengers, if you go in to a trader room they will either not have any expresions and just trade with you for whatever you give them or sometimes be scared and go to their special shelter, in other words they will not attack you right at the spot for no reason but only after you made clear that you are a threat. Stealing from trader rooms also can give you bad karma though

Hunter-wjak
Автор

Rain World has gotta be one of my top favourites, I've played this game long enough to where I can admire the AI since I can learn from the behaviors of the different creatures on each death or encounter to help increase my chances on progressing in the game. Hunter, as difficult as it is, was my personal favourite mode to play

lilaccatdraws
Автор

3:00 personally i prefer to name them "yeet lizards" over "leap lizards".
when the DLC comes out i hope they redo the raindeers to make them a bit more... "alive" and less of a glitchy taxi

proxy
Автор

The biggest thing that wasn't mentioned in this video I'd like to bring attention to is how scavengers will sometimes block your thrown spears with their own spears or rocks during combat if you throw from such a distance they can see it coming and react.

myntypaws
Автор

2:38 the alpha lizard does not always have the longest antenas, the leader is determined by the personality of the lizards, while the antenas are a randomly-generated physical features.

pyrr