system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does a company like Bethesda Game Studios program AI to be constantly changing?

Thinking about it is blowing my mind a little right now.  I understand that certain AI never move or do anything else.  I don't really understand the Radiant AI system, I guess.  Does the AI run on discrete time units?  How can a PC make that many choices that fast for the AI for it to be constantly shifting and changing?
gpt
In the case of Skyrim, the chances are that while the NPCs are meant to *appear* to go about their lives in whatever fashion they want, keep in mind that they all behave according to a set of rules.

For example, Ysolda runs a shop in Whiterun.  Now, we can be pretty sure that she'll be on somewhat of a schedule and stay at the shop most of the day, but she still has to get there.  She owns a home, so each morning she'll wake up and have a set of goals for the day.  If the first goal is to go to work, Ysolda's AI will query the pathfinder to get a route from where she is to where she needs to be.

If you decide to interupt her on the way, she'll stop and talk to you.  Obviously this interupts her path to work and switches her goals to talking to you.  After your conversation is complete, she'll switch back to the original goal of going to work, query the pathfinder for a route, and get moving.

By having a set of goals with weighted priorities, you can sort goals by what is most important and execute them.  We stopped Ysolda with a conversation, but if we had attacked a town guard nearby or if a dragon attacked, that would have had a ripple effect onto her and triggered a new priority (fight or flight) until the issue was resolved.

NPCs could also trigger changes to priority with one another.  If two characters cross paths share some sort of relationship (assigned to them on the back end), the goal may be to stop, speak with one another briefly, then carry on.  Ysolda stops and talks to her daughter when she comes by the shop.

With other characters, the set of goals might not follow a schedule, but goals may still carry some weight.  A drunk would have a higher priority of visiting a tavern and would probably be found there at any point during the day whereas the shopkeepers would be more likely to be found there after work.

So, basically, even though they appear to do anything they want and sort of live out their own lives, the do likely have discrete sets of goals to accomplish.  Not every goal might need to happen every day, but if the AI picks a goal for them and sets them on the path via some subroutine, people appear to go about their lives.