Forum Discussion
Anonymous
3 years agoQ&A is here. Questions are bolded.
I've been modding the game for years, and it's funny to recognize a lot of these terms from seeing them all over the code. It's actually a very neat example of how object-based programming can give you a lot of variety.
I do have one question, if you can answer it: By now (through leaks and datamining) we know the game was meant to have a multiplayer element on launch. How late in development was that scratched and did it affect the development of other features at all?
Sorry, I can't talk about that. :(
" The design is that if you never ever initiate any gay content, you will never see gay content."
Reminds me of those people complaining about seeing gay ads, only to be told "you only get gay ads because you search for gay things".
We once got a bug on The Sims Medieval where someone was freaking out because two male monks were cuddling and he swore he never did anything gay in the game. Me and the lead gameplay engineer looked at that and rolled our eyes. Sure ya didn't. (Spoiler: he did.)
I have a million questions. I got into game dev because of AI. But now that someone with legit credentials is here, I can't think of anything! I'll just sub you and maybe ask sometime in the future. Yay learning!
Feel free to ask me anything. Some questions I can't answer because of NDA, but anything about general AI I certainly can. It's been my career.
Why did EA never fixed the performance issues of Sims 3?
I'm not sure how to answer this. Because programming is hard? ;) I didn't work on The Sims 3, but I can talk about Sims games in general.
The Sims is incredibly complex and there's a balance between feature requests, bug fixes, and performance optimization. The producers and execs determine where to spend time. It's also very fluid; certain lots are WAY more expensive than others, and the player can do whatever they want. We generally optimize for typical lots. There are also different bottlenecks. Are you CPU-bound? GPU-bound? Memory-bound? And finally, certain architectural decisions preclude certain optimizations. At some point, you'd have to rewrite 500,000 lines of code to get a few frames back.
I very distinctly remember that venue AI in the Sims 3! It seems like whenever you brought a Sim out on the town, it would cause every other Sim in the city to converge on their location in a swarm (even at 3am doing things they were bad at!). Understandable from a standpoint of trying to spark interactions but it was a little eerie sometimes.
Thanks for the peek behind the curtain!
That's pretty much exactly what happened. ;) We wanted you to have "chance" encounters with people your sim knows
I'm curious about the reasoning behind the neighborhood stories AI. What weights are taken into account to determine the likelihood of events? Do things like age, location, previous friendships, jobs, the recently added compatibility scores etc. influence what people get married, for example?
Oh man, it's been like 10 years, I don't remember the specifics and I didn't write that specific code on The Sims 4 (I mostly did the motives, full autonomy, and subaction autonomy). I'm pretty sure we did weigh things like relationship, so two NPCs with a high relationship were more likely to marry. The decision making was pretty simple because we didn't want to have a performance spike.
With the thousands of hard coded rules Mark mentions in the video, how are these balanced over time? I imagine adding rule number 3517, which felt very important in a certain context, must be hard to weigh against all others?
So the rules weren't if statements in code most of the time, they were tuning values once could change. But yes, balancing all of those tuning values is incredibly complex. On the Sims 4, our lead AI designer went dark for like a week just tuning fun-based interactions for the base game.
We had a QA team that knew the game really well helping us, we had automated testing and smoke testing as well. We had unit tests to make sure we didn't directly break anything. On The Sims 4, I started up a weekly autonomy meeting where we would literally just play the game. There were a couple of engineers, the lead AI designer, the AI producer, and QA all in the room as we played. Just playing the game is so critical. I also had a secondary machine at my desk that was running the game all day every day.
Why are Sims 4 Sims constantly washing their dishes in the bathroom sink when there's a kitchen sink right there?
Probably because the bathroom sink is closer, or maybe the kitchen sink is dirty, blocked, or in use. If I recall, it was mostly based on distance.
Wow that's so cool! I practically grew playing the Sims, since the first one. I was kind of a control freak at the beginning, so I would get crazy whenever they tried to do mad stuff (or just slack as a normal human being), but I learned to get used to it with time, as I learned to let go and accept improvisation in every other aspect of my life as well. I would often think of the Sims as a metaphor for that.
I loved Medieval and also felt a huge leap on TS3 with the traits thing and the open world with the places that seemed full of life and so autonomous. I also felt that on TS4 many behaviours were addressed, making the Sims seem more sensible to the environment and context, avoiding situations that were awkward in other editions, and also giving the player more control in some aspects. Does that make any sense? I'm also curious as to how the background system of other Sims in town worked, and about architecture of the object-oriented aspect. As a developer and game dev, I'm really curious about so many things!
Also, can you tell us about situations in which designers were surprised by how the players were using features in a non-intended way?
Awesome! :D Sounds like you're a programmer, so I'll switch to something more programmer-centric for this reply. ;)
We spent a lot of time trying to get sims more aware of their environment. There were many ways this was accomplished, mostly notably with the posture graph. Imagine every posture in the game (stand at desk, sit on couch, stand at nothing, etc) with the edges representing the different transitions. Posture transitions can also be a pathfind to a location. Now say that a sim has a plate of food and wants to sit down to eat somewhere. We run a dijkstra search across that graph, with each edge weighted by various things. One of the weights is directly related to relationship with the person in any adjacent location, so you will generally prefer to sit next to (or near) someone you like.
Another big difference is that we had truly multi-state interactions. The Sims 3 & Medieval had some of this, but for The Sims 4 the interaction system was truly a multi-state HFSM, so you could be in multiple interactions a the same time. There were a lot of issues with not trying to be too greedy with AI, but it worked out extremely well.
From an OOP point of view, we had a component architecture with a loose inheritance model. There was an AutonomyComponent that had all the run-time AI state for a Sim, but the actual AI itself was run by a class called the AutonomyService. Internally there was a queue of AutonomyRequest objects, so a Sim would run AI by instantiating an AutonomyRequest and submitting it to the AutonomyService. The AI itself was time-sliced for performance reasons.
The AutonomyRequest had all possible parameters necessary to run AI. In the video, he talks about being able to include or exclude different motives. This is where that happened, so you could easily prevent a sim from doing certain things. These were typically governed by buffs. Everything used this, so the grim reaper was just running heavily constrained autonomy.
We were surprised constantly on The Sims, which was a joy. :) On The Sims Medieval, the creature caretaker would sometimes leap into the pit and fight the pit beast. I once saw a Sim take his plate of food and wash it in the toilet. When Whoo-Hoo was first implemented, none of the social norms were in place so for about a week, that was the most common interaction. On The Sims Medieval, I once heard the lead engineer yell out from his desk: "Rez, why are there 4000 horses in my inventory?" Turns out it was once of the only fun things to do. Medieval life is rough.... ;)
Also Medieval featured a story mode which was so beautiful and refreshing. Can you tell more about how that worked?
Do you mean the quest system?
My Sims 4 neighborhood is a sharply conservative place, based on the social values of my 1980s suburban childhood. When people complained that Sims 4 is "too woke", I never found that my own neighborhoods behaved that way—sure, had to edit a few gender-ambiguous premade NPCs in Create-A-Sim to bring them into line with the neighborhood's overall sharply conservative vibe (indeed, my username on the Internet has its roots in the way I play simulation games—simulated people in games in general are religious and I am their god)—but for the most part the AI wouldn't generate an interaction that violated the norms that my player control established.
Nice to see that was intentional.
One of the core values on The Sims is that we want players to play their way and tell their stories. If you want a conservative neighborhood, we don't want to stop you.
My biggest question is related to washing dishes. When there are two sinks on a lot, one in the kitchen and one in the bathroom, how come so many people find their Sims frequently deciding that the one in the bathroom is the better sink for washing the dishes when you tell them to wash all dishes on lot by interacting with a dish? Something I vaguely recall from Sims 2, definitely recall from Sims 3, and frequently read about people experiencing in Sims 4. Are there any changes to the AI systems that could be implemented without redoing the entire thing from scratch that would help prevent that, or at least make it less likely?
I answered this above, but the reason is because it's mostly based on distance. The video talks about how things are advertised from objects. The flip side of this is that there's less awareness for things like what room it's in.
How did you find this video so quickly?
I teach part-time and one of my students sent it to me.
What benefit do you get by letting the objects "advertise" their benefits vs just having the AI decide what need it wants to satisfy and then search for an appropriate object? I've seen several videos speaking highly of this solution, but the AI seems pretty straight forward to code either way.
It actually does both. Here's a really high-level overview:
1) Decide what motive(s) to solve.
2) For each object in the world, gather a list of the ones that satisfy the motive(s) I want.
3) Score every interaction on every object that solves for the motive(s).
4) Take the top scoring interactions and select one with a weighted-random.
5) Push that interaction.
So there's one AI algorithm running. I've read a lot of articles saying that the AI is in the objects and it's not. The objects have AI data on them that the algorithm consumes.
Are we living in a simulation? After this video everything looks so plausible to me
Yes. ;)
Was watching the video, honestly half expecting to see an interview with Rez and lo and behold you're in the comments! Thank you for all the fantastic gdc talks and game ai articles over the years! Between you and Dave Mark, I cannot get enough utility ai.
Thanks!! <3 I haven't been back to GDC since the pandemic, but I'm planning on going in 2024. Come find me if you go as well!
Proximity is probably weighted a bit higher than the type of sink in that case. Or in the version of Sims you played there was no distinction at all between sink types.
This is correct, there's no variation between sink types. It's mostly just distance.
I just want to say that Sims Medieval is a really good game, to me its probably my third favourite sims franchise game after sims 2 and 3. I wish that it had more dlc but mods it is I guess :(
Me too! It didn't do as well, so it was canceled after Pirates & Nobles. One of my favorite things was the faction feud AI stuff I did on Pirates & Nobles, and the Romeo & Juliet easter egg. ;)
the second comedian who created simlish who you call Jerri Lawler is actually Gerri Lawlor, who died in 2019 of non-revealed causes.
You are correct, I mispelled her name! Let me see if I can edit the comment and correct the spelling. I never had the pleasure of meeting her, but many of my colleagues were very good friends with her. She was apart of BATS improv here in San Francisco (which I'm also apart of). Stephen was just on The Mandelorean as a senator not too long ago.
Why does the AI in Sims 4 perform so poorly compared to AI 3?
Perform in what way?
So why does The Sims 4 feel so soulless and lifeless compared to the first three? There's practically no risk of serious failure states like there used to be, there's no thrill to it, it's more of a dollhouse than ever with not much "game" to compliment it.
In what way? You mean why don't Sims fail more often?
How do you guys manage feature creep in this code base ? In the video he mentioned how much work the introduction of moodlets produced up to thousands of units of work.
We had really, really good producers. We also try to introduce features that can scale significantly in either direction. For example, moodlets didn't actually take thousands and thousands of hours of work; the core system was fairly complex but then it was just all tuning. On the Sims 4, we called them buffs and they had very defined ways to changing behavior. You could multiply motive scores, add new motives, deny certain motives, and so on. This gets you a lot, especially when combined with the work of our incredible animators.
And finally, we have to cut things. The Sims 4 didn't ship with pools or toddlers, which was a HUGE decision. But we worked on it in the background and shipped them free when they were ready.
thanks for the answer. I can see some abstractions helping on the extension of code and testing, keeping the entropy low on the codebase, but still, that's a wild feature creep risk, interesting you guys managed it, and kudos to the senior team on making a good core for the other to rely on.
Yeah, it definitely wasn't easy! Feature creep is the killer of shipping a game, especially one like this.
I've been modding the game for years, and it's funny to recognize a lot of these terms from seeing them all over the code. It's actually a very neat example of how object-based programming can give you a lot of variety.
I do have one question, if you can answer it: By now (through leaks and datamining) we know the game was meant to have a multiplayer element on launch. How late in development was that scratched and did it affect the development of other features at all?
Sorry, I can't talk about that. :(
" The design is that if you never ever initiate any gay content, you will never see gay content."
Reminds me of those people complaining about seeing gay ads, only to be told "you only get gay ads because you search for gay things".
We once got a bug on The Sims Medieval where someone was freaking out because two male monks were cuddling and he swore he never did anything gay in the game. Me and the lead gameplay engineer looked at that and rolled our eyes. Sure ya didn't. (Spoiler: he did.)
I have a million questions. I got into game dev because of AI. But now that someone with legit credentials is here, I can't think of anything! I'll just sub you and maybe ask sometime in the future. Yay learning!
Feel free to ask me anything. Some questions I can't answer because of NDA, but anything about general AI I certainly can. It's been my career.
Why did EA never fixed the performance issues of Sims 3?
I'm not sure how to answer this. Because programming is hard? ;) I didn't work on The Sims 3, but I can talk about Sims games in general.
The Sims is incredibly complex and there's a balance between feature requests, bug fixes, and performance optimization. The producers and execs determine where to spend time. It's also very fluid; certain lots are WAY more expensive than others, and the player can do whatever they want. We generally optimize for typical lots. There are also different bottlenecks. Are you CPU-bound? GPU-bound? Memory-bound? And finally, certain architectural decisions preclude certain optimizations. At some point, you'd have to rewrite 500,000 lines of code to get a few frames back.
I very distinctly remember that venue AI in the Sims 3! It seems like whenever you brought a Sim out on the town, it would cause every other Sim in the city to converge on their location in a swarm (even at 3am doing things they were bad at!). Understandable from a standpoint of trying to spark interactions but it was a little eerie sometimes.
Thanks for the peek behind the curtain!
That's pretty much exactly what happened. ;) We wanted you to have "chance" encounters with people your sim knows
I'm curious about the reasoning behind the neighborhood stories AI. What weights are taken into account to determine the likelihood of events? Do things like age, location, previous friendships, jobs, the recently added compatibility scores etc. influence what people get married, for example?
Oh man, it's been like 10 years, I don't remember the specifics and I didn't write that specific code on The Sims 4 (I mostly did the motives, full autonomy, and subaction autonomy). I'm pretty sure we did weigh things like relationship, so two NPCs with a high relationship were more likely to marry. The decision making was pretty simple because we didn't want to have a performance spike.
With the thousands of hard coded rules Mark mentions in the video, how are these balanced over time? I imagine adding rule number 3517, which felt very important in a certain context, must be hard to weigh against all others?
So the rules weren't if statements in code most of the time, they were tuning values once could change. But yes, balancing all of those tuning values is incredibly complex. On the Sims 4, our lead AI designer went dark for like a week just tuning fun-based interactions for the base game.
We had a QA team that knew the game really well helping us, we had automated testing and smoke testing as well. We had unit tests to make sure we didn't directly break anything. On The Sims 4, I started up a weekly autonomy meeting where we would literally just play the game. There were a couple of engineers, the lead AI designer, the AI producer, and QA all in the room as we played. Just playing the game is so critical. I also had a secondary machine at my desk that was running the game all day every day.
Why are Sims 4 Sims constantly washing their dishes in the bathroom sink when there's a kitchen sink right there?
Probably because the bathroom sink is closer, or maybe the kitchen sink is dirty, blocked, or in use. If I recall, it was mostly based on distance.
Wow that's so cool! I practically grew playing the Sims, since the first one. I was kind of a control freak at the beginning, so I would get crazy whenever they tried to do mad stuff (or just slack as a normal human being), but I learned to get used to it with time, as I learned to let go and accept improvisation in every other aspect of my life as well. I would often think of the Sims as a metaphor for that.
I loved Medieval and also felt a huge leap on TS3 with the traits thing and the open world with the places that seemed full of life and so autonomous. I also felt that on TS4 many behaviours were addressed, making the Sims seem more sensible to the environment and context, avoiding situations that were awkward in other editions, and also giving the player more control in some aspects. Does that make any sense? I'm also curious as to how the background system of other Sims in town worked, and about architecture of the object-oriented aspect. As a developer and game dev, I'm really curious about so many things!
Also, can you tell us about situations in which designers were surprised by how the players were using features in a non-intended way?
Awesome! :D Sounds like you're a programmer, so I'll switch to something more programmer-centric for this reply. ;)
We spent a lot of time trying to get sims more aware of their environment. There were many ways this was accomplished, mostly notably with the posture graph. Imagine every posture in the game (stand at desk, sit on couch, stand at nothing, etc) with the edges representing the different transitions. Posture transitions can also be a pathfind to a location. Now say that a sim has a plate of food and wants to sit down to eat somewhere. We run a dijkstra search across that graph, with each edge weighted by various things. One of the weights is directly related to relationship with the person in any adjacent location, so you will generally prefer to sit next to (or near) someone you like.
Another big difference is that we had truly multi-state interactions. The Sims 3 & Medieval had some of this, but for The Sims 4 the interaction system was truly a multi-state HFSM, so you could be in multiple interactions a the same time. There were a lot of issues with not trying to be too greedy with AI, but it worked out extremely well.
From an OOP point of view, we had a component architecture with a loose inheritance model. There was an AutonomyComponent that had all the run-time AI state for a Sim, but the actual AI itself was run by a class called the AutonomyService. Internally there was a queue of AutonomyRequest objects, so a Sim would run AI by instantiating an AutonomyRequest and submitting it to the AutonomyService. The AI itself was time-sliced for performance reasons.
The AutonomyRequest had all possible parameters necessary to run AI. In the video, he talks about being able to include or exclude different motives. This is where that happened, so you could easily prevent a sim from doing certain things. These were typically governed by buffs. Everything used this, so the grim reaper was just running heavily constrained autonomy.
We were surprised constantly on The Sims, which was a joy. :) On The Sims Medieval, the creature caretaker would sometimes leap into the pit and fight the pit beast. I once saw a Sim take his plate of food and wash it in the toilet. When Whoo-Hoo was first implemented, none of the social norms were in place so for about a week, that was the most common interaction. On The Sims Medieval, I once heard the lead engineer yell out from his desk: "Rez, why are there 4000 horses in my inventory?" Turns out it was once of the only fun things to do. Medieval life is rough.... ;)
Also Medieval featured a story mode which was so beautiful and refreshing. Can you tell more about how that worked?
Do you mean the quest system?
My Sims 4 neighborhood is a sharply conservative place, based on the social values of my 1980s suburban childhood. When people complained that Sims 4 is "too woke", I never found that my own neighborhoods behaved that way—sure, had to edit a few gender-ambiguous premade NPCs in Create-A-Sim to bring them into line with the neighborhood's overall sharply conservative vibe (indeed, my username on the Internet has its roots in the way I play simulation games—simulated people in games in general are religious and I am their god)—but for the most part the AI wouldn't generate an interaction that violated the norms that my player control established.
Nice to see that was intentional.
One of the core values on The Sims is that we want players to play their way and tell their stories. If you want a conservative neighborhood, we don't want to stop you.
My biggest question is related to washing dishes. When there are two sinks on a lot, one in the kitchen and one in the bathroom, how come so many people find their Sims frequently deciding that the one in the bathroom is the better sink for washing the dishes when you tell them to wash all dishes on lot by interacting with a dish? Something I vaguely recall from Sims 2, definitely recall from Sims 3, and frequently read about people experiencing in Sims 4. Are there any changes to the AI systems that could be implemented without redoing the entire thing from scratch that would help prevent that, or at least make it less likely?
I answered this above, but the reason is because it's mostly based on distance. The video talks about how things are advertised from objects. The flip side of this is that there's less awareness for things like what room it's in.
How did you find this video so quickly?
I teach part-time and one of my students sent it to me.
What benefit do you get by letting the objects "advertise" their benefits vs just having the AI decide what need it wants to satisfy and then search for an appropriate object? I've seen several videos speaking highly of this solution, but the AI seems pretty straight forward to code either way.
It actually does both. Here's a really high-level overview:
1) Decide what motive(s) to solve.
2) For each object in the world, gather a list of the ones that satisfy the motive(s) I want.
3) Score every interaction on every object that solves for the motive(s).
4) Take the top scoring interactions and select one with a weighted-random.
5) Push that interaction.
So there's one AI algorithm running. I've read a lot of articles saying that the AI is in the objects and it's not. The objects have AI data on them that the algorithm consumes.
Are we living in a simulation? After this video everything looks so plausible to me
Yes. ;)
Was watching the video, honestly half expecting to see an interview with Rez and lo and behold you're in the comments! Thank you for all the fantastic gdc talks and game ai articles over the years! Between you and Dave Mark, I cannot get enough utility ai.
Thanks!! <3 I haven't been back to GDC since the pandemic, but I'm planning on going in 2024. Come find me if you go as well!
Proximity is probably weighted a bit higher than the type of sink in that case. Or in the version of Sims you played there was no distinction at all between sink types.
This is correct, there's no variation between sink types. It's mostly just distance.
I just want to say that Sims Medieval is a really good game, to me its probably my third favourite sims franchise game after sims 2 and 3. I wish that it had more dlc but mods it is I guess :(
Me too! It didn't do as well, so it was canceled after Pirates & Nobles. One of my favorite things was the faction feud AI stuff I did on Pirates & Nobles, and the Romeo & Juliet easter egg. ;)
the second comedian who created simlish who you call Jerri Lawler is actually Gerri Lawlor, who died in 2019 of non-revealed causes.
You are correct, I mispelled her name! Let me see if I can edit the comment and correct the spelling. I never had the pleasure of meeting her, but many of my colleagues were very good friends with her. She was apart of BATS improv here in San Francisco (which I'm also apart of). Stephen was just on The Mandelorean as a senator not too long ago.
Why does the AI in Sims 4 perform so poorly compared to AI 3?
Perform in what way?
So why does The Sims 4 feel so soulless and lifeless compared to the first three? There's practically no risk of serious failure states like there used to be, there's no thrill to it, it's more of a dollhouse than ever with not much "game" to compliment it.
In what way? You mean why don't Sims fail more often?
How do you guys manage feature creep in this code base ? In the video he mentioned how much work the introduction of moodlets produced up to thousands of units of work.
We had really, really good producers. We also try to introduce features that can scale significantly in either direction. For example, moodlets didn't actually take thousands and thousands of hours of work; the core system was fairly complex but then it was just all tuning. On the Sims 4, we called them buffs and they had very defined ways to changing behavior. You could multiply motive scores, add new motives, deny certain motives, and so on. This gets you a lot, especially when combined with the work of our incredible animators.
And finally, we have to cut things. The Sims 4 didn't ship with pools or toddlers, which was a HUGE decision. But we worked on it in the background and shipped them free when they were ready.
thanks for the answer. I can see some abstractions helping on the extension of code and testing, keeping the entropy low on the codebase, but still, that's a wild feature creep risk, interesting you guys managed it, and kudos to the senior team on making a good core for the other to rely on.
Yeah, it definitely wasn't easy! Feature creep is the killer of shipping a game, especially one like this.
About The Sims 4 General Discussion
Join lively discussions, share tips, and exchange experiences on Sims 4 Expansion Packs, Game Packs, Stuff Packs & Kits.33,805 PostsLatest Activity: 4 hours ago
Community Highlights
Recent Discussions
- 7 minutes ago
- 7 hours ago