A stupidly easy way to generate realistic pedestrian AI on Roblox
Original tweet Recently I saw a clip of Cyberpunk 2077's AI walking inside an area back and forth, and that got me thinking whether a similar AI system is possible on Roblox or not.
First, we will create different parts as AI walkable zone. Then, we will create some attachments to represent a spawnable position.
After that, we will search for every nearby walkable zone from the player position. We will then search for a spawnable location inside the zone, it will not spawn if it matches one of the following:
- The position has too many AI near it
- The position is too close to the player
- The position is too far from the player
The actual AI
We will walk from the current position to the opposite side of the walkable zone, and it will keep repeat itself until the panic state is enabled. What's a panic state? It's a state where the AI will play a character terrified animation and start running away within 1-3 seconds.
Unless someone is bored enough to start recording a super long road for over 15 minutes, you will not see any difference at all. It's the most stupidly easy way to create realistic AI, it might not work for your game if it's in a small area where it's visible.