1 00:00:00,180 --> 00:00:05,580 The Sims is a digital dollhouse,  filled with little computer people. 2 00:00:05,580 --> 00:00:09,060 And it's your job to keep  them alive, keep them happy, 3 00:00:09,060 --> 00:00:12,960 and keep their house furnished  with ever more expensive trinkets. 4 00:00:12,960 --> 00:00:18,420 But micromanaging the needs and desires of  an entire family can get pretty tedious. 5 00:00:18,420 --> 00:00:21,720 So the developers at Maxis soon realised that 6 00:00:21,720 --> 00:00:25,140 they'd need to give these guys  a certain amount of autonomy. 7 00:00:25,140 --> 00:00:26,040 Free will. 8 00:00:26,040 --> 00:00:31,020 The power to think for themselves, if  the player stops giving direct commands. 9 00:00:31,020 --> 00:00:32,460 Which is actually... 10 00:00:32,460 --> 00:00:38,340 a pretty complicated task! These characters  need to read as believable humans. 11 00:00:38,340 --> 00:00:42,540 And they need to be able to adapt to any  possible house you build around them, 12 00:00:42,540 --> 00:00:45,600 or any social situation they find themselves in. 13 00:00:45,600 --> 00:00:51,240 And - crucially - they can't be so smart that  the player can just sit back and do nothing. 14 00:00:51,240 --> 00:00:57,120 So how do you make a video game  AI that can do all of that? 15 00:00:57,120 --> 00:00:59,340 Well, that's what I want to explore in this video. 16 00:00:59,340 --> 00:01:05,580 I'm going to break down the clever ways that Maxis  designed autonomy in this four-game franchise - 17 00:01:05,580 --> 00:01:08,040 though with a focus on the original game, 18 00:01:08,040 --> 00:01:11,760 and - let's be honest - the  best one, which is The Sims 3. 19 00:01:11,760 --> 00:01:13,320 It's not going to get too technical, 20 00:01:13,320 --> 00:01:18,240 but there is a metric buttload of resources  in the description if you want to dive deeper. 21 00:01:18,240 --> 00:01:20,760 With that out of the way, I'm Mark Brown, 22 00:01:20,760 --> 00:01:25,080 this is Game Maker's Toolkit,  and here's how The Sims... think. 23 00:01:26,160 --> 00:01:30,780 Okay - decision making in The Sims  is all driven by a set of mental 24 00:01:30,780 --> 00:01:34,620 and physical needs - dubbed "motives", by Maxis. 25 00:01:34,620 --> 00:01:39,000 In The Sims 1 that's hunger,  hygiene, fun, energy, 26 00:01:39,000 --> 00:01:43,800 bladder, social, comfort, and room, or tidiness. 27 00:01:43,800 --> 00:01:47,520 They all go from negative 100 to positive 100, 28 00:01:47,520 --> 00:01:51,780 and if you combine them all, you get  the Sim's overall level of happiness. 29 00:01:51,780 --> 00:01:57,300 These meters are constantly ticking down -  each decaying at slightly different rates, 30 00:01:57,300 --> 00:02:00,900 and faster if the Sim is  performing a related action. 31 00:02:00,900 --> 00:02:04,260 The bladder meter drops more quickly  when the Sim is eating, for instance. 32 00:02:04,260 --> 00:02:08,700 Maxis carefully tuned all of these  rates to hopefully match a normal 33 00:02:08,700 --> 00:02:12,600 human schedule - like needing eight  hours of sleep, and three meals a day. 34 00:02:12,600 --> 00:02:17,700 So. If the player doesn't give the Sim  a command, it will decide what to do by 35 00:02:17,700 --> 00:02:22,020 itself - and that decision is driven  by a desire to fulfil these motives. 36 00:02:22,020 --> 00:02:25,860 Now you might assume that a Sim  knows how to meet its own needs: 37 00:02:25,860 --> 00:02:29,820 that a toilet will solve bladder,  that fridges and stoves solve hunger, 38 00:02:29,820 --> 00:02:32,760 and books, TVs, and pinball tables solve fun. 39 00:02:32,760 --> 00:02:36,900 But it doesn't work like that -  it's actually, the other way around. 40 00:02:36,900 --> 00:02:41,820 Instead, all of the objects in  the Sim's house contain this data, 41 00:02:41,820 --> 00:02:44,040 and will broadcast what they can offer. 42 00:02:44,040 --> 00:02:47,400 A bed will say "sleep on me to get 10 energy", 43 00:02:47,400 --> 00:02:53,340 a toilet offers plus 20 to bladder if you  use it, or plus 5 to room if you clean it. 44 00:02:53,340 --> 00:02:57,420 And other Sims will offer themselves  as a way to top up social points. 45 00:02:57,420 --> 00:03:00,060 Maxis calls these "advertisements". 46 00:03:00,060 --> 00:03:02,880 So. Whenever the Sim decides what to do, 47 00:03:02,880 --> 00:03:07,200 it quickly makes a list of every object  in the house - and what they can offer. 48 00:03:07,200 --> 00:03:12,660 The Sim can then take that advertised number  and weigh it based on its current needs. 49 00:03:12,660 --> 00:03:15,960 It does this by applying a  multiplier to the promised score, 50 00:03:15,960 --> 00:03:18,420 based on the Sim's current motive levels. 51 00:03:18,420 --> 00:03:24,180 For example, if the Sim is well-rested,  the bed's energy-boosting score is damped 52 00:03:24,180 --> 00:03:28,680 down - but if the Sim is knackered, then  that same score is boosted dramatically. 53 00:03:28,680 --> 00:03:34,080 Now, the Sim can take the list of interactions,  and their weighted scores, and rank them. 54 00:03:34,080 --> 00:03:39,360 At the top of the list is the interaction that  will give the most benefit to the Sim right now... 55 00:03:39,360 --> 00:03:42,780 and so the digital dude should do just that. 56 00:03:43,440 --> 00:03:50,160 This clever system was actually inspired by one  of designer Will Wright's previous games: SimAnt - 57 00:03:50,160 --> 00:03:55,380 a virtual ant colony where the critters would  be tempted to move by attractive pheromones. 58 00:03:55,380 --> 00:03:58,380 It's basically the same idea  - but instead of pheromones, 59 00:03:58,380 --> 00:04:02,340 its TVs, fridges, pinball machines, and bath tubs. 60 00:04:02,340 --> 00:04:05,160 However - people aren't ants. 61 00:04:05,160 --> 00:04:08,400 And so if this was implemented  exactly as I just described, 62 00:04:08,400 --> 00:04:14,220 it would lead to weird behaviours that make  Sims seem either robotic or irrational. 63 00:04:14,220 --> 00:04:18,660 So, many careful tweaks are  needed to make it work properly. 64 00:04:18,660 --> 00:04:22,200 For instance, not all needs are equal. 65 00:04:22,200 --> 00:04:26,760 If a Sim is both starving  to death and utterly bored, 66 00:04:26,760 --> 00:04:30,360 they should probably eat a  sandwich rather than binge Netflix. 67 00:04:30,360 --> 00:04:34,260 But if the fridge and TV are  both offering the same reward... 68 00:04:34,260 --> 00:04:35,940 which should The Sim pick? 69 00:04:35,940 --> 00:04:41,940 Well, more rational behaviour can be achieved  by defining unique curves for each motive. 70 00:04:41,940 --> 00:04:48,540 For hunger, we want a curve like this:  now, the fridge's score will be reduced 71 00:04:48,540 --> 00:04:54,660 to almost zero when the Sim is full, but will  be extremely high when the Sim is starving - 72 00:04:54,660 --> 00:04:57,780 making that more important than any other motive. 73 00:04:57,780 --> 00:05:03,240 Similar, smaller curves are used for the  other physiological needs like bladder, 74 00:05:03,240 --> 00:05:04,560 hygiene, and energy. 75 00:05:04,560 --> 00:05:08,640 However, less important needs like fun, social, 76 00:05:08,640 --> 00:05:12,780 and comfort actually increase  as the Sim becomes more happy. 77 00:05:12,780 --> 00:05:18,240 This was inspired by Maslow's hierarchy  of needs, which says humans will focus 78 00:05:18,240 --> 00:05:23,520 on cognitive and social tasks only when their  more basic lizard-brain needs are met. 79 00:05:23,520 --> 00:05:28,500 Plus - while peeing will satiate your  bladder, you can never have too much fun. 80 00:05:29,220 --> 00:05:32,400 We can also weigh the scores  based on other factors, too. 81 00:05:32,400 --> 00:05:36,180 For instance, each Sim has its own  personality - based on their score 82 00:05:36,180 --> 00:05:39,780 in areas like niceness, neatness, and playfulness. 83 00:05:39,780 --> 00:05:45,180 So while a pinball machine and a bookcase  might advertise the same boost to fun, 84 00:05:45,180 --> 00:05:48,660 a Sim will weigh this based  on their level of playfulness. 85 00:05:48,660 --> 00:05:52,620 Therefore, a more serious Sim  will choose to pick up a book. 86 00:05:52,620 --> 00:05:55,680 Plus, we can weigh the interaction based on its 87 00:05:55,680 --> 00:05:59,280 distance from the Sim - which will  make nearby objects more tempting. 88 00:05:59,280 --> 00:06:04,920 Finally, some interactions can override everything  - like a telephone call or a school bus. 89 00:06:04,920 --> 00:06:07,920 And other interactions can  be locked entirely - so, 90 00:06:07,920 --> 00:06:13,320 certain objects won't advertise themselves  to kids, or adults, or a visiting guest. 91 00:06:13,320 --> 00:06:17,400 All of these factors combined  give us a much more useful score, 92 00:06:17,400 --> 00:06:22,680 which has been adjusted to the different  needs, personality, and proximity of the Sim. 93 00:06:22,680 --> 00:06:27,060 And it's from these scores that  the Sim's next move is picked. 94 00:06:27,060 --> 00:06:30,420 But - perhaps most importantly of all - the 95 00:06:30,420 --> 00:06:34,200 Sim doesn't actually choose  the best option every time. 96 00:06:34,200 --> 00:06:39,360 Instead - the Sim picks one of the  top scoring interactions... at random. 97 00:06:39,360 --> 00:06:43,500 This stops the Sims from feeling  robotic and overly predictable, 98 00:06:43,500 --> 00:06:47,580 and it also means they're not able  to fulfil all their needs perfectly. 99 00:06:47,580 --> 00:06:52,020 Which, you know, actually gives  the player something to do. 100 00:06:52,800 --> 00:06:59,820 What I've just described is a special type  of AI called utility AI, or needs-based AI. 101 00:06:59,820 --> 00:07:03,720 This is a system where a character  has a predefined set of needs, 102 00:07:03,720 --> 00:07:08,760 then looks around at its current options, and  picks the one that will fulfil its needs best - 103 00:07:08,760 --> 00:07:10,980 the one with the most utility. 104 00:07:11,820 --> 00:07:15,000 And in The Sims, it means a little person can be 105 00:07:15,000 --> 00:07:18,900 dropped into any house and will  then act in a lifelike manner: 106 00:07:18,900 --> 00:07:22,260 carefully attending to its  hunger and energy when necessary, 107 00:07:22,260 --> 00:07:25,080 but socialising and having fun when not. 108 00:07:25,080 --> 00:07:29,520 Plus, by putting the information  on the objects, instead of the Sim, 109 00:07:29,520 --> 00:07:33,360 it's really easy for Maxis to add  hundreds of objects to the game - 110 00:07:33,360 --> 00:07:37,440 or make endless expansion packs -  without touching the rest of the code. 111 00:07:37,440 --> 00:07:44,100 And so for these reasons, this basic system has  been used in all four games in the franchise. 112 00:07:44,100 --> 00:07:51,120 But, Maxis wanted to take things even further when  making the ambitious third game in the series. 113 00:07:51,780 --> 00:07:57,360 Okay, so, in The Sims 1, we saw how  each Sim's personality - like their 114 00:07:57,360 --> 00:08:00,780 neatness and playfulness - would  impact their decision making. 115 00:08:00,780 --> 00:08:04,500 This would make each Sim feel somewhat distinct. 116 00:08:04,500 --> 00:08:09,240 But for The Sims 3 this idea  was expanded dramatically by 117 00:08:09,240 --> 00:08:12,360 swapping the personality meters with traits. 118 00:08:12,360 --> 00:08:17,520 Things like neat, neurotic, heavy  sleeper, and commitment issues. 119 00:08:17,520 --> 00:08:22,920 With five trait slots, and 60-odd  traits in the base game alone, 120 00:08:22,920 --> 00:08:28,380 that's about 5 million possible Sims -  effectively making every character unique. 121 00:08:28,380 --> 00:08:33,120 Now these traits have many impacts on  the Sim - like, how a clumsy Sim will 122 00:08:33,120 --> 00:08:37,440 trip themselves up while walking, and  a slob will fart and burp while idle. 123 00:08:37,440 --> 00:08:42,120 Sims also get bonus moodlets  for acting to their traits - and 124 00:08:42,120 --> 00:08:45,960 there are certain interactions that are  exclusive to Sims with certain traits: 125 00:08:45,960 --> 00:08:49,680 like how a computer whizz can  make cash through hacking. 126 00:08:49,680 --> 00:08:53,160 But these traits also impact  on the Sim's decision making. 127 00:08:53,160 --> 00:08:57,960 This time, however, instead of weighing  the scores against the Sim's personality, 128 00:08:57,960 --> 00:09:02,160 the Sims 3 actually just adds  more motives to the pile. 129 00:09:02,160 --> 00:09:07,020 So, in the code, every Sim has their  usual basic needs, like hunger, energy, 130 00:09:07,020 --> 00:09:10,920 and bladder - but also five more  motives related to their traits. 131 00:09:10,920 --> 00:09:15,900 Therefore a couch potato needs  to sit on the sofa and watch TV, 132 00:09:15,900 --> 00:09:19,080 just like how they need to pee, eat, and sleep. 133 00:09:19,080 --> 00:09:23,820 And then, in the same way that a fridge  advertises itself as a fix for hunger, 134 00:09:23,820 --> 00:09:28,620 objects can advertise themselves as a  fix for the Sim's trait-related motives. 135 00:09:28,620 --> 00:09:35,580 For instance, interactions like scare a Sim,  steal candy from a child, smash a dollhouse, 136 00:09:35,580 --> 00:09:42,000 and write a trolling comment on the computer  are all advertised to Sims with the evil trait. 137 00:09:42,000 --> 00:09:46,140 This means that Sims are encouraged  to enact their unique personalities 138 00:09:46,140 --> 00:09:50,520 autonomously - while also juggling  their standard, everyday needs. 139 00:09:51,300 --> 00:09:54,480 Now this idea - of adding additional motives to 140 00:09:54,480 --> 00:09:57,720 a Sim - can also be used to  simulate social situations. 141 00:09:57,720 --> 00:10:03,540 For instance, if a Sim enters a gym they  will temporarily be given the additional 142 00:10:03,540 --> 00:10:09,000 motive "be in gym" - which is satisfied by  objects like a workout bench or treadmill. 143 00:10:09,000 --> 00:10:11,760 When they leave, the motive is removed. 144 00:10:11,760 --> 00:10:14,520 Back at home, a Sim will be motivated to act as 145 00:10:14,520 --> 00:10:17,940 a hospitable host for as long  as they have guests around - 146 00:10:17,940 --> 00:10:22,260 meanwhile, the guests will be motivated to  act in an way that's socially acceptable. 147 00:10:22,260 --> 00:10:26,460 And in The Sims Medieval, a Sim  is given work-related motives 148 00:10:26,460 --> 00:10:29,820 while they're on the clock, and  then loses them during breaks. 149 00:10:29,820 --> 00:10:33,300 However: these motives can  also be affected by traits. 150 00:10:33,300 --> 00:10:35,760 For example, if a Sim sits down to have a picnic, 151 00:10:35,760 --> 00:10:40,800 then the Sim's friends and family are motivated  to join them - while strangers are discouraged. 152 00:10:40,800 --> 00:10:44,700 But a Sim with the "inappropriate"  trait will override this - and 153 00:10:44,700 --> 00:10:47,820 they will in fact be motivated to  sit with people they don't know. 154 00:10:47,820 --> 00:10:49,920 Just to make them feel uncomfortable. 155 00:10:49,920 --> 00:10:55,650 All of this means that Sims will act naturally and  believably in whatever location they end up in - 156 00:10:55,650 --> 00:11:00,780 but with a few Sims standing out as acting  unusually, because of their unique personality. 157 00:11:00,780 --> 00:11:04,020 And this is all done by simply tweaking the Sim's 158 00:11:04,020 --> 00:11:09,360 motivations - rather than hand-scripting a  bunch of specific rules and interactions. 159 00:11:09,900 --> 00:11:15,360 Though, that being said, sometimes  you do need more hard-coded rules. 160 00:11:15,900 --> 00:11:18,360 Take that house visit I mentioned. 161 00:11:18,360 --> 00:11:22,140 A visiting sim is indeed motivated  to act in an appropriate way. 162 00:11:22,140 --> 00:11:25,440 But what happens if they stay for too long? Or if 163 00:11:25,440 --> 00:11:28,920 the player steps in and makes  the Sim act inappropriately? 164 00:11:28,920 --> 00:11:30,540 Well, to make this work, 165 00:11:30,540 --> 00:11:35,220 the house visit is overseen by a set  of rules that dictate social norms. 166 00:11:35,220 --> 00:11:40,560 So if a Sim sleeps in the host's  bed or uses their computer, the ruleset 167 00:11:40,560 --> 00:11:45,600 will instruct the host to warn the Sim, and  then kick them out if they go even further. 168 00:11:45,600 --> 00:11:50,100 Likewise, conversations need  more hands-on authoring to 169 00:11:50,100 --> 00:11:54,900 reflect extremely specific pair-ups of  people, or super distinct social cues. 170 00:11:54,900 --> 00:12:00,960 For example, how should a Sim respond to  a joke if they are steaming mad at the 171 00:12:00,960 --> 00:12:06,180 joke teller? Or if the other Sim has  said the same joke 5 times in a row? 172 00:12:06,180 --> 00:12:12,840 This is done through a series of rules - with  an input, a set of conditions, and the output. 173 00:12:12,840 --> 00:12:15,060 So for that joke I just mentioned... 174 00:12:15,060 --> 00:12:19,140 if the listener has the 'good sense  of humour' trait, they'll laugh. 175 00:12:19,140 --> 00:12:22,440 If their long-term relationship  is sour, they'll be insulted. 176 00:12:22,440 --> 00:12:26,040 And if the Sim repeatedly tells  jokes, the listener will be bored. 177 00:12:26,040 --> 00:12:32,700 These so-called "production rules" are ranked in  order of specificity, as defined by the designer, 178 00:12:32,700 --> 00:12:36,288 and the top-scoring outcome  is used to pick the response. 179 00:12:36,360 --> 00:12:40,200 Maxis ended up writing 1000s of hand-crafted rules 180 00:12:40,200 --> 00:12:43,800 to determine the outcome of 100s  of possible conversation topics. 181 00:12:43,800 --> 00:12:48,660 But, because the rules just go in a big  stack and the most specific one is picked, 182 00:12:48,660 --> 00:12:53,580 they can't clash, break the game, cause an  infinite loop, or lead to any other issue. 183 00:12:53,580 --> 00:12:59,460 Just like with the objects, designers can  simply keep adding more and more to the pile. 184 00:12:59,460 --> 00:13:03,720 So far, I've been talking about individual Sims, 185 00:13:03,720 --> 00:13:07,920 or small social situations  like a conversation or a party. 186 00:13:07,920 --> 00:13:12,120 But what about simulating an entire  town's worth of little people? 187 00:13:12,120 --> 00:13:16,680 You see, in The Sims 3, your house  exists in an open world neighbourhood 188 00:13:16,680 --> 00:13:22,380 with dozens of other Sims, and features  homes, restaurants, a park, and so on. 189 00:13:22,380 --> 00:13:27,600 Maxis needed to invent new tools to  make all of this work - but, in truth, 190 00:13:27,600 --> 00:13:31,860 the neighbourhood actually operates in  a similar way to the Sims themselves. 191 00:13:31,860 --> 00:13:35,700 That's because the town  also has a bunch of motives, 192 00:13:35,700 --> 00:13:38,640 and will make choices that  will help it fulfil its needs. 193 00:13:38,640 --> 00:13:43,140 For instance - it ideally wants to  maintain a 50/50 gender balance. 194 00:13:43,140 --> 00:13:45,780 So when a new Sim is added to the neighbourhood, 195 00:13:45,780 --> 00:13:50,940 the probability of it being male or female  is weighted by the current needs of the city. 196 00:13:50,940 --> 00:13:55,800 It also has a desired employment  rate of about 80% - so it can force 197 00:13:55,800 --> 00:13:59,520 background Sims to get hired or fired as seen fit. 198 00:13:59,520 --> 00:14:03,840 Basically - once a day, at midnight, the  town will check its own happiness level, 199 00:14:03,840 --> 00:14:07,080 and take a few actions in  order to satisfy its needs. 200 00:14:07,080 --> 00:14:10,320 The individual lots have  motives too - for instance, 201 00:14:10,320 --> 00:14:15,540 the restaurant may wish to have roughly 8 people  eating outside, during lunch and dinner hours. 202 00:14:15,540 --> 00:14:19,020 To achieve this, the lot will temporarily give 203 00:14:19,020 --> 00:14:23,760 the "eat outside" motive to a bunch of  Sims to tempt them to the restaurant. 204 00:14:23,760 --> 00:14:27,600 It can even narrow the focus to  Sims with certain traits - like 205 00:14:27,600 --> 00:14:32,760 culinary - and discourage those  with other traits - like frugal. 206 00:14:32,760 --> 00:14:37,920 Now, these Sims that appear at the restaurant  seem like fully autonomous characters. 207 00:14:37,920 --> 00:14:40,860 They have needs, they have families, 208 00:14:40,860 --> 00:14:44,760 they may even have had a baby and  changed job since you last saw them. 209 00:14:44,760 --> 00:14:49,200 So are they are actually living out their  own little simulated lives, just off camera? 210 00:14:49,200 --> 00:14:51,120 Well, not quite. 211 00:14:51,120 --> 00:14:55,740 The background Sims are actually  simulated at a very low level of detail. 212 00:14:55,740 --> 00:14:58,140 Each day, the system looks at each Sim, 213 00:14:58,140 --> 00:15:01,770 and scores possible big life  changes that could happen to them - 214 00:15:01,770 --> 00:15:04,860 like getting a job, falling in love  with someone, or getting married. 215 00:15:04,860 --> 00:15:11,040 These are, of course, weighted using things like  traits, existing relationships, and career paths. 216 00:15:11,040 --> 00:15:15,360 Also, the designers created  charts for what a Sim's needs 217 00:15:15,360 --> 00:15:17,460 will likely look like throughout the day. 218 00:15:17,460 --> 00:15:21,900 If it's just after lunch, for instance,  they're probably not going to be very hungry. 219 00:15:21,900 --> 00:15:26,580 And so when a background Sim is  promoted into being a foreground Sim, 220 00:15:26,580 --> 00:15:28,680 because they're in proximity to the player, 221 00:15:28,680 --> 00:15:33,420 the system checks the time of day and  snaps all their motives to the chart. 222 00:15:33,420 --> 00:15:34,440 Clever stuff. 223 00:15:35,580 --> 00:15:38,280 So we've got tools to simulate characters, 224 00:15:38,280 --> 00:15:42,840 conversations, house visits,  restaurants and entire towns. 225 00:15:42,840 --> 00:15:47,880 And when you have such clever tech, it's  tempting to simulate, well, everything. 226 00:15:47,880 --> 00:15:51,120 Take, for instance, the urinal rule. 227 00:15:51,120 --> 00:15:56,160 If you pee while standing up, you know the  deal: when picking a place to take a leak, 228 00:15:56,160 --> 00:15:59,700 you should always try to maintain a  one urinal buffer from other people. 229 00:15:59,700 --> 00:16:02,400 It's like an unwritten social rule. 230 00:16:02,400 --> 00:16:05,580 So Maxis added this rule to the game, as well... 231 00:16:05,580 --> 00:16:08,760 but, before the game launched, they took it out. 232 00:16:08,760 --> 00:16:14,040 That's because when the Sim followed that  rule it was just kind of predictable and dull. 233 00:16:14,040 --> 00:16:17,100 But if Sims picked toilets at random, it would 234 00:16:17,100 --> 00:16:21,780 often lead to funny and memorable  moments of Sims acting awkwardly. 235 00:16:21,780 --> 00:16:25,800 You see, while The Sims might  have started life as a rather 236 00:16:25,800 --> 00:16:30,630 nerdy simulation game - essentially  SimCity, but at a much smaller scale - 237 00:16:30,630 --> 00:16:32,700 it quickly grew into something very different. 238 00:16:32,700 --> 00:16:36,720 In playtests for the original  game, Will Wright was surprised 239 00:16:36,720 --> 00:16:40,650 that players would tell elaborate  stories about their Sim families - 240 00:16:40,650 --> 00:16:45,360 embellishing details, reading into their  decisions, and playing up random moments. 241 00:16:45,360 --> 00:16:50,400 "It was fascinating to me how readily people  would build a story around this," Wright says. 242 00:16:50,400 --> 00:16:54,180 To support this, Maxis added a  last-minute feature to the game: 243 00:16:54,180 --> 00:16:57,000 the ability to take a screenshot, write a caption, 244 00:16:57,000 --> 00:17:02,880 and create a simple comic book which could  be uploaded to EA's website with a click. 245 00:17:02,880 --> 00:17:07,500 The feature was extremely popular,  proving that for many people... 246 00:17:07,500 --> 00:17:10,740 The Sims was an avenue for storytelling. 247 00:17:10,740 --> 00:17:16,140 And that's still true today - just search  YouTube for The Sims to see what I mean. 248 00:17:16,740 --> 00:17:22,260 But supporting storytelling is a delicate  balance: the game needs to be specific enough 249 00:17:22,260 --> 00:17:27,780 to create stories, but not so specific that  there's no room for the player's imagination. 250 00:17:27,780 --> 00:17:31,260 So the final piece of this AI puzzle... 251 00:17:31,260 --> 00:17:33,420 is knowing when to hold back. 252 00:17:33,420 --> 00:17:36,420 Knowing what NOT to simulate. 253 00:17:36,420 --> 00:17:40,860 Knowing when to make urinal choice  random, rather than scripted. 254 00:17:41,400 --> 00:17:45,480 One way to do this is to  carefully employ ambiguity. 255 00:17:45,480 --> 00:17:48,420 Basically, to leave some things unsaid, 256 00:17:48,420 --> 00:17:53,700 so players can make assumptions, and project  their own head-canon on the events on screen. 257 00:17:53,700 --> 00:17:59,520 A good example of this is the Sim's  iconic babbling dialect, known as Simlish. 258 00:17:59,520 --> 00:18:03,240 In early design documents we can see  that Maxis experimented with having 259 00:18:03,240 --> 00:18:09,720 the Sims speak real world languages like  English, Navajo, Estonian, and Ukranian - 260 00:18:09,720 --> 00:18:12,480 but due to technical and logistical reasons, 261 00:18:12,480 --> 00:18:17,400 they ended up hiring two improv comics  to just make up absolute nonsense. 262 00:18:17,400 --> 00:18:22,980 Sim: Droba droba droba. Seeka neeba huh. 263 00:18:22,980 --> 00:18:28,440 But this actually works wonders - when the  Sims babble gobbledygook at each other, 264 00:18:28,440 --> 00:18:31,680 the player can assume, fill in gaps, 265 00:18:31,680 --> 00:18:36,060 project their own imagination on the  Sims, and make the game their own. 266 00:18:36,060 --> 00:18:41,640 "If we used actual language, the game  would flatten and shrink, and everyone 267 00:18:41,640 --> 00:18:46,440 would be having the same experience",  says EA's Matt Brown - no relation. 268 00:18:46,440 --> 00:18:49,800 Ambiguity can also make Sims feels smarter than 269 00:18:49,800 --> 00:18:53,580 they actually are, and hide cases where  the simulation is doing something wrong. 270 00:18:53,580 --> 00:18:57,900 Another avenue is to always follow  the player's lead - and never use 271 00:18:57,900 --> 00:19:01,680 autonomy to go against the story  the player is trying to tell. 272 00:19:01,680 --> 00:19:06,420 That's why Sims will use free will to  relieve their bladder and fill their stomach, 273 00:19:06,420 --> 00:19:10,920 but won't autonomously quit their  job or try romancing a random Sim. 274 00:19:10,920 --> 00:19:14,520 Just like with the Nemesis  System in Shadow of War, 275 00:19:14,520 --> 00:19:20,520 Maxis took inspiration from the concept  "yes, and", from improvisational comedy - 276 00:19:20,520 --> 00:19:26,100 so the Sims try to build on the player's  actions, and try not to negate them. 277 00:19:26,100 --> 00:19:30,300 For instance, if a player makes two  Sims fall in love - the autonomous 278 00:19:30,300 --> 00:19:32,220 system shouldn't make them break up again. 279 00:19:32,220 --> 00:19:37,140 Likewise, user-created Sims enter  the world with no sexual preference. 280 00:19:37,140 --> 00:19:41,640 But if you instruct a male Sim  to, say, flirt with other dudes, 281 00:19:41,640 --> 00:19:46,020 you're suggesting that he should be bi  or gay and the game will run with that. 282 00:19:46,020 --> 00:19:50,760 The game should always try to maintain  the consistency of the player's story. 283 00:19:51,660 --> 00:19:57,540 So, The Sims has a fascinating AI system -  which allows for realistic human simulations, 284 00:19:57,540 --> 00:20:00,720 and creative player-led storytelling. 285 00:20:00,720 --> 00:20:04,320 And most of it is driven by a very simple concept. 286 00:20:04,320 --> 00:20:09,600 Characters, locations, and entire  neighbourhoods are given a bunch of 287 00:20:09,600 --> 00:20:13,980 needs - and then try to make choices  that will best fulfil those needs. 288 00:20:13,980 --> 00:20:20,400 With a little clever tuning, this leads to  characters who feel believable, social situations 289 00:20:20,400 --> 00:20:26,520 where Sims act appropriately, and entire  neighbourhoods that stay consistent and balanced. 290 00:20:26,520 --> 00:20:31,080 But this is not just useful for  running quirky goal-free life 291 00:20:31,080 --> 00:20:36,600 simulations - and we can see utility AI  being used in other types of games, too. 292 00:20:36,600 --> 00:20:43,380 For instance, in XCOM, an enemy unit will consider  every tile it can move to and score them based on 293 00:20:43,380 --> 00:20:50,580 factors like distance, flanking opportunities,  angle, cover bonus, visibility, and proximity - 294 00:20:50,580 --> 00:20:53,220 before moving to the tile with the best score. 295 00:20:53,940 --> 00:21:00,180 It can also be used in procedural generation, to  build worlds that fit predetermined requirements. 296 00:21:00,180 --> 00:21:05,820 Utility AI is a fantastic addition  to a game maker's toolkit, and its 297 00:21:05,820 --> 00:21:10,840 implementation in The Sims should serve as  wonderful inspiration to game designers. 298 00:21:10,860 --> 00:21:16,320 And now, just to melt your brain,  here's Katy Perry singing in Simlish. 299 00:21:16,320 --> 00:21:24,396 Katy Perry: [Absolute nonsense] 300 00:21:24,396 --> 00:21:32,101 Katy Perry: [Just complete gobbledegook] 301 00:21:32,101 --> 00:21:37,900 Katy Perry: [I think I'm having a stroke]