1 00:00:00,080 --> 00:00:01,670 The following content is provided 2 00:00:01,670 --> 00:00:03,810 under a Creative Commons license. 3 00:00:03,810 --> 00:00:06,540 Your support will help MIT OpenCourseWare continue 4 00:00:06,540 --> 00:00:10,140 to offer high quality educational resources for free. 5 00:00:10,140 --> 00:00:12,680 To make a donation, or to view additional materials 6 00:00:12,680 --> 00:00:16,590 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:16,590 --> 00:00:17,305 at ocw.mit.edu. 8 00:00:29,040 --> 00:00:32,556 PROFESSOR: Are you guys excited about Battlecode? 9 00:00:32,556 --> 00:00:34,880 I'm so excited to see this many-- Yeah! 10 00:00:34,880 --> 00:00:38,245 Yeah, let's hear a hurray-- no, no a yeah. 11 00:00:38,245 --> 00:00:39,370 Are you excited? 12 00:00:39,370 --> 00:00:40,730 AUDIENCE: Yeah! 13 00:00:40,730 --> 00:00:43,350 PROFESSOR: All right, that was a strong yeah. 14 00:00:43,350 --> 00:00:44,590 I actually mean that. 15 00:00:44,590 --> 00:00:47,716 I have a strange thing where when I say something 16 00:00:47,716 --> 00:00:52,389 it often comes out like I meant the opposite of what I said, 17 00:00:52,389 --> 00:00:53,430 like I didn't believe it. 18 00:00:53,430 --> 00:00:56,420 Like that time that Drew Houston-- from Dropbox, 19 00:00:56,420 --> 00:00:58,610 he's the Dropbox CEO-- do you guys remember this? 20 00:01:01,200 --> 00:01:04,390 He was giving his sponsor talk at the finals of Battlecode 21 00:01:04,390 --> 00:01:07,952 last year and he was just wrapping up, 22 00:01:07,952 --> 00:01:09,410 and everybody was applauding, and I 23 00:01:09,410 --> 00:01:12,740 came to the podium I was like, thanks, thanks Drew. 24 00:01:12,740 --> 00:01:16,110 That was really good. 25 00:01:16,110 --> 00:01:18,640 That made me want to work at Dropbox. 26 00:01:18,640 --> 00:01:21,340 If I didn't have a job already I would. 27 00:01:21,340 --> 00:01:22,840 And nobody believed me, they thought 28 00:01:22,840 --> 00:01:24,930 I was just being facetious. 29 00:01:24,930 --> 00:01:27,924 So, now he hates me. 30 00:01:27,924 --> 00:01:29,390 That's too bad. 31 00:01:29,390 --> 00:01:30,640 That happens to me. 32 00:01:30,640 --> 00:01:34,790 OK, let's get started soon. 33 00:01:34,790 --> 00:01:38,710 So you're all here because you're 34 00:01:38,710 --> 00:01:40,600 interested in Battlecode. 35 00:01:40,600 --> 00:01:43,000 These lectures are optional. 36 00:01:43,000 --> 00:01:47,820 They're geared at beginner to mid-level coders, 37 00:01:47,820 --> 00:01:49,950 but they'll be relevant even if you've 38 00:01:49,950 --> 00:01:52,930 had coding experience in a million languages. 39 00:01:52,930 --> 00:01:54,490 Because we're going to be talking 40 00:01:54,490 --> 00:01:58,000 a lot of the time about Battlecode, the game itself. 41 00:01:58,000 --> 00:02:01,380 And it could just be a way to keep yourself up 42 00:02:01,380 --> 00:02:04,260 to date on the latest metagame, for example. 43 00:02:04,260 --> 00:02:06,870 So we're going to go over the specs today. 44 00:02:06,870 --> 00:02:09,150 I'm going to introduce the competition. 45 00:02:09,150 --> 00:02:10,979 And then after lecture today, we'll 46 00:02:10,979 --> 00:02:14,934 be having a lab, during which we'll help you set up. 47 00:02:14,934 --> 00:02:17,100 So I see a lot of you brought your computers, that's 48 00:02:17,100 --> 00:02:18,500 fantastic. 49 00:02:18,500 --> 00:02:21,300 And that's also great because it means if you get bored, 50 00:02:21,300 --> 00:02:24,050 you can just watch YouTube videos. 51 00:02:24,050 --> 00:02:27,800 Yeah, so make sure to bring your ear plugs so that you don't 52 00:02:27,800 --> 00:02:30,060 bother the guy next to you, because he's already 53 00:02:30,060 --> 00:02:32,080 heard Gangnam Style. 54 00:02:32,080 --> 00:02:36,120 All right so be respectful of those guys. 55 00:02:36,120 --> 00:02:38,520 So here's our introduction. 56 00:02:38,520 --> 00:02:46,390 My name is Maxwell Mann, I'll be your lecturer for the next 10 57 00:02:46,390 --> 00:02:47,390 days. 58 00:02:47,390 --> 00:02:50,570 It actually is minus 4 days because of various things. 59 00:02:50,570 --> 00:02:52,670 So it's like the next two weeks, you 60 00:02:52,670 --> 00:02:55,510 can come here at this time-- or slightly earlier, 61 00:02:55,510 --> 00:02:58,600 so you can hear a lousy joke --you can come here, 62 00:02:58,600 --> 00:03:01,050 and you can hear me talk about the game, 63 00:03:01,050 --> 00:03:03,340 and hear what the devs think about what 64 00:03:03,340 --> 00:03:04,840 you might need to know. 65 00:03:04,840 --> 00:03:08,190 And then you can eat food at 6:00 PM, when 66 00:03:08,190 --> 00:03:10,650 we have massive quantities of food coming, 67 00:03:10,650 --> 00:03:13,040 and then from 6:00 to 7:00, you have the option 68 00:03:13,040 --> 00:03:18,150 of staying for the lab session, which has been described, 69 00:03:18,150 --> 00:03:22,120 in anticipation, as a social utopia. 70 00:03:22,120 --> 00:03:24,800 And I really believe that it could be one, 71 00:03:24,800 --> 00:03:29,520 because everybody here has, sort of, some similar interests. 72 00:03:29,520 --> 00:03:33,300 So to introduce us, we developers, 73 00:03:33,300 --> 00:03:37,300 are students, or alums, who have worked 74 00:03:37,300 --> 00:03:39,650 on developing Battlecode. 75 00:03:39,650 --> 00:03:41,000 I'm Max. 76 00:03:41,000 --> 00:03:44,010 Sitting here in the front is Aaron Epstein 77 00:03:44,010 --> 00:03:46,930 and Steven Valdez. 78 00:03:46,930 --> 00:03:50,440 You'll be using them for help, all the time, if you need it, 79 00:03:50,440 --> 00:03:52,950 or just to bother them because you feel like it. 80 00:03:52,950 --> 00:03:54,840 They're here for no other reason, 81 00:03:54,840 --> 00:03:57,850 and to maintain the code base and these kinds of things. 82 00:03:57,850 --> 00:04:02,200 The website is battlecode.org and we have a forum there, 83 00:04:02,200 --> 00:04:04,030 where you could also go to get help. 84 00:04:04,030 --> 00:04:06,230 And I also, particularly, would like 85 00:04:06,230 --> 00:04:09,840 to direct your attention to the IRC channel. 86 00:04:09,840 --> 00:04:15,280 It's #battlecode on Freenode. 87 00:04:15,280 --> 00:04:17,930 So I don't know if you know what that is, 88 00:04:17,930 --> 00:04:20,200 but it's basically a way that you 89 00:04:20,200 --> 00:04:23,620 can talk to us on a real time chat. 90 00:04:23,620 --> 00:04:28,100 So you can do that at pretty much any hour of the day, 91 00:04:28,100 --> 00:04:29,690 because the way we're setting it up 92 00:04:29,690 --> 00:04:32,807 this year is we'll all be available, pretty 93 00:04:32,807 --> 00:04:33,640 much the whole time. 94 00:04:33,640 --> 00:04:36,750 OK, make sure that if you are an MIT student, 95 00:04:36,750 --> 00:04:38,250 and you want credit for this class-- 96 00:04:38,250 --> 00:04:40,920 it's a six credit class --you just 97 00:04:40,920 --> 00:04:44,780 have to sign up on WebSIS for 6.S187. 98 00:04:44,780 --> 00:04:47,170 How many people have signed up on WebSIS already? 99 00:04:47,170 --> 00:04:50,050 All right, that's like everybody. 100 00:04:50,050 --> 00:04:52,260 Let's talk about the goals of the competition. 101 00:04:52,260 --> 00:04:53,690 What is a game? 102 00:04:53,690 --> 00:04:54,690 What are we doing? 103 00:04:54,690 --> 00:04:57,280 I'm sure a lot of you are thinking all right, well, here 104 00:04:57,280 --> 00:04:58,840 we go. 105 00:04:58,840 --> 00:05:00,330 I've got finals tomorrow but I have 106 00:05:00,330 --> 00:05:02,510 to decide what IAP classes to take. 107 00:05:02,510 --> 00:05:06,106 Gosh, this is a terrible combination of deadlines. 108 00:05:06,106 --> 00:05:07,480 Then you thought, should I take-- 109 00:05:07,480 --> 00:05:09,390 should I to do battle code? 110 00:05:09,390 --> 00:05:13,170 Should I do one of these other things, like web programming, 111 00:05:13,170 --> 00:05:14,080 or game programming? 112 00:05:14,080 --> 00:05:18,190 What is the operating systems whatshumadoosits? 113 00:05:18,190 --> 00:05:19,410 Should I do this or that? 114 00:05:19,410 --> 00:05:22,150 And you're probably thinking to yourself, what is fun? 115 00:05:22,150 --> 00:05:23,230 What is valuable for me? 116 00:05:23,230 --> 00:05:24,630 What am I going to learn? 117 00:05:24,630 --> 00:05:27,600 And we ask ourselves the same question. 118 00:05:27,600 --> 00:05:29,890 A couple months before then was, what 119 00:05:29,890 --> 00:05:32,470 do we want the Battlecode competition to be like? 120 00:05:32,470 --> 00:05:34,860 And what we ended up deciding, was 121 00:05:34,860 --> 00:05:38,480 that the game needs to be fun and it 122 00:05:38,480 --> 00:05:43,290 needs to contain classic battle code areas of challenge 123 00:05:43,290 --> 00:05:45,570 in artificial intelligence. 124 00:05:45,570 --> 00:05:48,130 So this is a game that is a cross-- we've always 125 00:05:48,130 --> 00:05:49,880 said in the past that it is not StarCraft 126 00:05:49,880 --> 00:05:52,870 --but it is a cross between a real-time strategy 127 00:05:52,870 --> 00:05:57,000 game and an AI programming competition. 128 00:05:57,000 --> 00:06:00,250 So what we wanted was the game to be easy to learn, 129 00:06:00,250 --> 00:06:01,540 but hard to master. 130 00:06:01,540 --> 00:06:03,710 So what you'll see when I describe the game specs-- 131 00:06:03,710 --> 00:06:08,730 and I'm going into it just momentarily --when I describe 132 00:06:08,730 --> 00:06:12,540 game specs you'll see ways to play the game, and then 133 00:06:12,540 --> 00:06:14,250 ways to excel at the game. 134 00:06:14,250 --> 00:06:17,820 So it's like you've got this infinite ramp, that you 135 00:06:17,820 --> 00:06:21,360 can run wild on, of how much effort you 136 00:06:21,360 --> 00:06:23,990 want to put into developing the best player. 137 00:06:23,990 --> 00:06:26,060 Or better yet, because what is the best? 138 00:06:26,060 --> 00:06:27,160 It's comparative. 139 00:06:27,160 --> 00:06:28,690 That's comparing to somebody else. 140 00:06:28,690 --> 00:06:29,780 But that's kind of irrelevant. 141 00:06:29,780 --> 00:06:30,988 What you want is to have fun. 142 00:06:30,988 --> 00:06:34,435 Anyway, you know that. 143 00:06:34,435 --> 00:06:35,060 So there we go. 144 00:06:35,060 --> 00:06:38,290 Our idea was to not have sort of skill caps 145 00:06:38,290 --> 00:06:41,060 and limiting factors, like maps that are just 146 00:06:41,060 --> 00:06:43,420 covered in maze so you can't do anything 147 00:06:43,420 --> 00:06:44,850 unless you can get past that maze. 148 00:06:44,850 --> 00:06:47,120 Like, OK, you didn't pass the test, 149 00:06:47,120 --> 00:06:49,280 I hope you enjoy your starting area. 150 00:06:49,280 --> 00:06:49,870 No, no. 151 00:06:49,870 --> 00:06:51,550 So not that. 152 00:06:51,550 --> 00:06:53,550 So let me show the game. 153 00:06:53,550 --> 00:06:56,830 How many of you have seen Battlecode before? 154 00:06:56,830 --> 00:06:58,140 A show of hands. 155 00:06:58,140 --> 00:07:00,400 So that's a good number, but it's not everybody. 156 00:07:00,400 --> 00:07:02,860 So I'm going to show you a game. 157 00:07:02,860 --> 00:07:06,080 So this is when you've made your code 158 00:07:06,080 --> 00:07:07,555 and you've put it into the client, 159 00:07:07,555 --> 00:07:09,180 you can run a game like this, and we'll 160 00:07:09,180 --> 00:07:10,756 go over how to do that. 161 00:07:10,756 --> 00:07:12,380 And I'll just hit play here, and you'll 162 00:07:12,380 --> 00:07:14,870 see the red team in the upper left, 163 00:07:14,870 --> 00:07:17,580 and the blue team in the bottom right, 164 00:07:17,580 --> 00:07:21,030 playing a game of Battlecode for this year. 165 00:07:21,030 --> 00:07:24,750 The player on the upper left, in red, 166 00:07:24,750 --> 00:07:28,170 is placing mines, and capturing bases. 167 00:07:28,170 --> 00:07:31,520 His soldiers are moving around and fighting with one another. 168 00:07:31,520 --> 00:07:33,250 Fighting the enemy, hopefully. 169 00:07:33,250 --> 00:07:35,560 And the blue player, here at the bottom right, 170 00:07:35,560 --> 00:07:37,380 is just sort of shooting his guys off 171 00:07:37,380 --> 00:07:40,120 to die at the enemy army. 172 00:07:40,120 --> 00:07:43,490 On the left you'll see indicators 173 00:07:43,490 --> 00:07:47,600 of various game constants and values that are changing. 174 00:07:47,600 --> 00:07:49,290 If I pause this for a second, you 175 00:07:49,290 --> 00:07:51,190 can see by clicking on any robot, 176 00:07:51,190 --> 00:07:56,030 you can see his ID number, what robot type it is. 177 00:07:56,030 --> 00:07:57,700 You can see his hit point level, which 178 00:07:57,700 --> 00:08:00,720 we have characteristically had a very difficult to remember 179 00:08:00,720 --> 00:08:01,257 name for. 180 00:08:01,257 --> 00:08:03,840 We always have different names for their energy and their head 181 00:08:03,840 --> 00:08:08,070 points this year it's going to be, "energon," for hit points. 182 00:08:08,070 --> 00:08:12,230 I think this flux number is actually no longer relevant, 183 00:08:12,230 --> 00:08:13,538 and you can ignore it. 184 00:08:13,538 --> 00:08:15,510 [AUDIENCE LAUGHTER] 185 00:08:15,510 --> 00:08:17,290 PROFESSOR: See, we worked so hard 186 00:08:17,290 --> 00:08:19,500 on making this polished and perfect, 187 00:08:19,500 --> 00:08:21,639 that we weren't finished until-- actually we're 188 00:08:21,639 --> 00:08:23,930 not finished yet, they're still fussing with something. 189 00:08:23,930 --> 00:08:25,660 [AUDIENCE LAUGHTER] 190 00:08:25,660 --> 00:08:27,710 PROFESSOR: The bytecodes used is going 191 00:08:27,710 --> 00:08:30,490 to be a key factor that you're going to look at so that you 192 00:08:30,490 --> 00:08:33,159 can determine how much computational energy 193 00:08:33,159 --> 00:08:34,679 those robots are spending. 194 00:08:34,679 --> 00:08:37,179 This year, there's a very big impact 195 00:08:37,179 --> 00:08:39,919 on the efficiency of your code, and the performance 196 00:08:39,919 --> 00:08:40,840 of your player. 197 00:08:40,840 --> 00:08:44,560 If you have efficient code, you could have twice as many robots 198 00:08:44,560 --> 00:08:47,210 on the field then you can sustain 199 00:08:47,210 --> 00:08:48,710 if your code is inefficient. 200 00:08:48,710 --> 00:08:52,980 Because the actual computational cost 201 00:08:52,980 --> 00:08:55,600 is recorded, and is then implemented 202 00:08:55,600 --> 00:08:58,620 into the upkeep of each unit. 203 00:08:58,620 --> 00:09:01,250 Finally, you'll see the location of the unit, and three 204 00:09:01,250 --> 00:09:03,850 indicator strings that you can use for debugging and control 205 00:09:03,850 --> 00:09:05,440 purposes. 206 00:09:05,440 --> 00:09:08,630 So what we'll do today is talk about what kinds of things 207 00:09:08,630 --> 00:09:13,550 are on this map, and how that's different and amazingly great, 208 00:09:13,550 --> 00:09:18,180 and how this year's new gameplay will be even more fun than it 209 00:09:18,180 --> 00:09:19,430 ever has been. 210 00:09:19,430 --> 00:09:22,040 And I can say that with some confidence, 211 00:09:22,040 --> 00:09:24,710 because it's quite different and demonstrably better. 212 00:09:24,710 --> 00:09:26,120 Yes. 213 00:09:26,120 --> 00:09:30,710 So what we think of as skill areas, areas 214 00:09:30,710 --> 00:09:32,570 that make a fun game for Battlecode, 215 00:09:32,570 --> 00:09:36,285 are, navigation-- but not that you so much require 216 00:09:36,285 --> 00:09:38,480 it --see, in this example, they didn't really 217 00:09:38,480 --> 00:09:43,350 need any complex maze solving algorithms. 218 00:09:43,350 --> 00:09:46,470 What they were just doing, is there are these neutral mines 219 00:09:46,470 --> 00:09:48,784 that are here, and you could either walk around 220 00:09:48,784 --> 00:09:50,450 the neutral minefield, or you could just 221 00:09:50,450 --> 00:09:51,908 clear yourself right on through it. 222 00:09:51,908 --> 00:09:54,120 So there's navigation, but you don't necessarily 223 00:09:54,120 --> 00:09:54,750 have to do it. 224 00:09:54,750 --> 00:09:56,470 [AUDIENCE LAUGHTER] 225 00:09:56,470 --> 00:09:57,900 PROFESSOR: There's group pathing-- 226 00:09:57,900 --> 00:10:00,812 and that's a good point because, you know, 227 00:10:00,812 --> 00:10:05,240 OK, anybody can take one unit and after enough time, 228 00:10:05,240 --> 00:10:07,810 figure out how to implement any of the existing pathing 229 00:10:07,810 --> 00:10:08,440 algorithms. 230 00:10:08,440 --> 00:10:10,550 But let's say you've got multiple units. 231 00:10:10,550 --> 00:10:12,550 They start to get in one another's way. 232 00:10:12,550 --> 00:10:15,910 Let me give an example that's very concrete, 233 00:10:15,910 --> 00:10:18,220 and that hits really close to home, for me. 234 00:10:18,220 --> 00:10:20,960 I did this all the time-- I've done Battlecode, 235 00:10:20,960 --> 00:10:23,980 I guess, like four years now. 236 00:10:23,980 --> 00:10:26,900 And so what I'd always have is, I'm here, 237 00:10:26,900 --> 00:10:33,430 and I want to go to ice cream-- something desirable 238 00:10:33,430 --> 00:10:35,310 --and I'm trying to get past this wall. 239 00:10:35,310 --> 00:10:38,760 So I go here, but then all my friends take up all this space 240 00:10:38,760 --> 00:10:40,470 because they're going the same way. 241 00:10:40,470 --> 00:10:43,014 And then I'm trying to turn around, and go back, 242 00:10:43,014 --> 00:10:44,930 and they're trying to go this way because they 243 00:10:44,930 --> 00:10:46,990 think it's closer to the ice cream. 244 00:10:46,990 --> 00:10:49,890 And we just end up here all day, and then the enemy 245 00:10:49,890 --> 00:10:52,020 comes by and shoots us. 246 00:10:52,020 --> 00:10:54,370 And then we've got holes in ourselves, 247 00:10:54,370 --> 00:10:56,460 how are we going to maintain that stomach 248 00:10:56,460 --> 00:10:58,650 area to keep the ice cream in? 249 00:10:58,650 --> 00:11:00,980 It's just not going to work. 250 00:11:00,980 --> 00:11:04,340 So we like navigation, we like group pathing. 251 00:11:04,340 --> 00:11:05,390 We like messaging. 252 00:11:05,390 --> 00:11:08,190 This year, the messaging system is totally new. 253 00:11:08,190 --> 00:11:10,304 In the past, what you'd need is-- 254 00:11:10,304 --> 00:11:11,720 I'm going to go back to the screen 255 00:11:11,720 --> 00:11:14,840 here --is your robot would only be 256 00:11:14,840 --> 00:11:18,230 able to see a certain area around himself. 257 00:11:18,230 --> 00:11:19,900 And so every other robot would not 258 00:11:19,900 --> 00:11:23,440 know what's going on, on the whole map, except by messaging. 259 00:11:23,440 --> 00:11:26,630 But even then, they would have to receive messages 260 00:11:26,630 --> 00:11:28,622 that are broadcast within a certain range. 261 00:11:28,622 --> 00:11:30,830 So you end up having to make these chains where you'd 262 00:11:30,830 --> 00:11:32,960 say, all right, I've got, let's see, 263 00:11:32,960 --> 00:11:37,430 Joe, and James, and Jalopy. 264 00:11:37,430 --> 00:11:41,080 They're all in line, and these three robots are in line, 265 00:11:41,080 --> 00:11:44,430 and they each have some broadcast radius. 266 00:11:44,430 --> 00:11:47,370 And so maybe I can, sort of, set up a relay chain, 267 00:11:47,370 --> 00:11:49,100 and they're broadcasting back. 268 00:11:49,100 --> 00:11:51,640 And that was how you used to communicate information 269 00:11:51,640 --> 00:11:52,960 about where the enemy is. 270 00:11:52,960 --> 00:11:56,810 So here's the ice cream, here, and here's me. 271 00:11:56,810 --> 00:12:00,100 And I would have to hear it from these four guys. 272 00:12:00,100 --> 00:12:03,027 But that would end up being a lot of work 273 00:12:03,027 --> 00:12:03,860 for me to implement. 274 00:12:03,860 --> 00:12:07,360 And we like that, we think that's really cool. 275 00:12:07,360 --> 00:12:09,140 But at the same time it ended up meaning 276 00:12:09,140 --> 00:12:12,150 that if the ice cream were an enemy, 277 00:12:12,150 --> 00:12:14,710 and I needed to scout that the enemy were coming 278 00:12:14,710 --> 00:12:18,874 with some rush, that what would often happen 279 00:12:18,874 --> 00:12:20,790 is that there wouldn't be a chain established. 280 00:12:20,790 --> 00:12:22,860 Because this kind of stuff's kind of hard do. 281 00:12:22,860 --> 00:12:25,807 So this guy would see the enemy right here-- and here's me, 282 00:12:25,807 --> 00:12:27,640 back here, I'm just minding my own business. 283 00:12:27,640 --> 00:12:30,700 Maybe I'm building a staircase, which we did in one year. 284 00:12:30,700 --> 00:12:35,440 Or some other very useful expenditure of effort and time. 285 00:12:35,440 --> 00:12:38,030 So this guy sees the enemy and I don't know about it, 286 00:12:38,030 --> 00:12:40,810 I can't prepare until he comes back. 287 00:12:40,810 --> 00:12:43,590 OK, so then he comes back to within broadcast range-- 288 00:12:43,590 --> 00:12:45,850 he's here --but by then the enemy is right there. 289 00:12:45,850 --> 00:12:47,390 I can't do anything. 290 00:12:47,390 --> 00:12:49,550 So what we've done this year, is we've 291 00:12:49,550 --> 00:12:53,630 said all right, realistically we've got these radios, right? 292 00:12:53,630 --> 00:12:58,050 Let's communicate, on these radios, across the whole map. 293 00:12:58,050 --> 00:13:02,260 So now your radio messages can be heard across the whole map. 294 00:13:02,260 --> 00:13:05,242 But, instead of being messages, like they used to be-- 295 00:13:05,242 --> 00:13:06,950 and these messages were kind of annoying, 296 00:13:06,950 --> 00:13:09,790 they were these constructs that you had to assemble. 297 00:13:09,790 --> 00:13:11,920 You'd say, oh, I'm making a new message 298 00:13:11,920 --> 00:13:13,770 and I'm applying these parts to it. 299 00:13:13,770 --> 00:13:15,860 And not every message has every type of part. 300 00:13:15,860 --> 00:13:17,904 And not every part as every type of message. 301 00:13:17,904 --> 00:13:19,320 And every time I receive a message 302 00:13:19,320 --> 00:13:21,460 I can receive an infinity of messages. 303 00:13:21,460 --> 00:13:24,550 And then my robot explodes because he's 304 00:13:24,550 --> 00:13:26,260 being overloaded with messages. 305 00:13:26,260 --> 00:13:29,020 That's like spam, happens a lot, it happens to me. 306 00:13:31,654 --> 00:13:33,570 So what we get instead, is we said, all right, 307 00:13:33,570 --> 00:13:35,580 we've got a uniform message channel. 308 00:13:35,580 --> 00:13:38,320 We've got 10,000 channels. 309 00:13:38,320 --> 00:13:40,370 And any robot can post an integer 310 00:13:40,370 --> 00:13:43,240 to any one of those channels, at any time. 311 00:13:43,240 --> 00:13:47,120 So then my robot could be posting-- maybe my code 312 00:13:47,120 --> 00:13:49,530 is using frequency 567. 313 00:13:49,530 --> 00:13:52,330 And I'll be communicating on that frequency specifically 314 00:13:52,330 --> 00:13:54,312 where I'm going, or what direction I'm going, 315 00:13:54,312 --> 00:13:55,270 or something like that. 316 00:13:55,270 --> 00:13:57,220 And everybody on my team can see it. 317 00:13:57,220 --> 00:14:00,330 So that's a really useful sort of centralizing feature. 318 00:14:00,330 --> 00:14:01,900 So if the enemy is coming, I can just 319 00:14:01,900 --> 00:14:06,760 look on integer number 567, and if the enemy is coming, maybe 320 00:14:06,760 --> 00:14:09,510 that's a flag, maybe I make that, I 321 00:14:09,510 --> 00:14:11,890 guess, 666 because that's really bad. 322 00:14:11,890 --> 00:14:12,500 Right? 323 00:14:12,500 --> 00:14:15,990 So I make that my token for enemy is coming, and then bing, 324 00:14:15,990 --> 00:14:19,100 everybody can start preparing for the enemy coming. 325 00:14:19,100 --> 00:14:21,660 But there's more, I mean, let's say 326 00:14:21,660 --> 00:14:22,910 you're going to metagame them. 327 00:14:22,910 --> 00:14:27,150 You're going to think about what could happen from a high level. 328 00:14:27,150 --> 00:14:29,940 Like when would the enemy just invade? 329 00:14:29,940 --> 00:14:31,740 When would they attack me? 330 00:14:31,740 --> 00:14:34,580 I mean, I don't have to see them coming to know that they will. 331 00:14:34,580 --> 00:14:37,350 For example, maybe the map is really small. 332 00:14:37,350 --> 00:14:40,790 So this year, you can tell how big the map is. 333 00:14:40,790 --> 00:14:44,410 I mean, how does it make sense-- this happened again and again 334 00:14:44,410 --> 00:14:46,680 in previous years --how does it make sense 335 00:14:46,680 --> 00:14:50,600 to have a game, where players are expected to operate 336 00:14:50,600 --> 00:14:53,590 intelligently, in the absence of information. 337 00:14:53,590 --> 00:14:58,520 OK, I understand that sometimes a little bit of uncertainty 338 00:14:58,520 --> 00:14:59,190 can be great. 339 00:14:59,190 --> 00:15:01,290 Like how great poker be if everybody 340 00:15:01,290 --> 00:15:03,830 knows what everybody else's hand is? 341 00:15:03,830 --> 00:15:05,690 That would be really lousy, right? 342 00:15:05,690 --> 00:15:08,490 But here, we just had almost no information, 343 00:15:08,490 --> 00:15:11,080 so you'd have build-order losses. 344 00:15:11,080 --> 00:15:14,770 This is sort of a big problem, in my eyes, with StarCraft. 345 00:15:14,770 --> 00:15:18,300 Which is that you'd start with a strategy that 346 00:15:18,300 --> 00:15:22,360 could lose before you have any information on how to fix that. 347 00:15:22,360 --> 00:15:25,580 So at least in StarCraft you know how big the map is. 348 00:15:25,580 --> 00:15:29,400 So here we're giving them the following centralized 349 00:15:29,400 --> 00:15:30,300 information. 350 00:15:30,300 --> 00:15:31,800 So here's what I'll do. 351 00:15:31,800 --> 00:15:35,030 I'm going to list out the centralized information 352 00:15:35,030 --> 00:15:38,230 that you can use, that you didn't really used 353 00:15:38,230 --> 00:15:39,820 to have access to. 354 00:15:46,110 --> 00:15:49,714 Now you might ask, all right I'm not going to memorize this, 355 00:15:49,714 --> 00:15:51,380 and I'm not taking notes-- even though I 356 00:15:51,380 --> 00:15:56,840 did bring a thingamabober, which is a computer, or a notebook. 357 00:15:56,840 --> 00:15:59,040 You might say, I'm not going to memorize this, 358 00:15:59,040 --> 00:16:01,460 I'm not interested, I'm here to have fun. 359 00:16:01,460 --> 00:16:04,430 Well look here, you can look in the Java docs 360 00:16:04,430 --> 00:16:06,820 and you can see all of the robot abilities. 361 00:16:06,820 --> 00:16:09,029 They're listed in this giant list here, 362 00:16:09,029 --> 00:16:10,570 and you'll have time to peruse those. 363 00:16:10,570 --> 00:16:12,510 And we'll sort of go over them over the course 364 00:16:12,510 --> 00:16:14,180 of the few lectures. 365 00:16:14,180 --> 00:16:16,220 But having them sort of in a condensed form 366 00:16:16,220 --> 00:16:18,400 or organized into topics, like what 367 00:16:18,400 --> 00:16:19,900 is centralized information? 368 00:16:19,900 --> 00:16:22,630 You know, what information can I use? 369 00:16:22,630 --> 00:16:26,110 Ends up probably being a bit of a convenience. 370 00:16:26,110 --> 00:16:29,760 So I have a couple of convenient organizations of data. 371 00:16:29,760 --> 00:16:31,750 And that's really all I'm here for is just-- 372 00:16:31,750 --> 00:16:34,720 you can get all this information in our documentation, 373 00:16:34,720 --> 00:16:38,930 which we'll supply you when we help you set up the game. 374 00:16:38,930 --> 00:16:42,240 And/or you can sort of hear it from me, where I've got it 375 00:16:42,240 --> 00:16:45,220 sort of organized into a slightly different way. 376 00:16:45,220 --> 00:16:49,550 The centralized info that you get 377 00:16:49,550 --> 00:16:55,510 includes, you can sense the positions of all allied robots. 378 00:16:55,510 --> 00:16:59,150 So there's a function, and again, we have very good naming 379 00:16:59,150 --> 00:17:01,800 conventions so that all of the names that we pick 380 00:17:01,800 --> 00:17:04,560 let you know exactly what we're referring to. 381 00:17:04,560 --> 00:17:09,510 And for this function we call it-- it's a method called, 382 00:17:09,510 --> 00:17:16,700 "Sense Nearby Game Objects." 383 00:17:16,700 --> 00:17:20,359 And that's great because it can detect game objects 384 00:17:20,359 --> 00:17:25,579 across the map, anywhere, they don't have to be nearby. 385 00:17:25,579 --> 00:17:27,390 So that that's really nice. 386 00:17:27,390 --> 00:17:30,590 And it senses these things, which of course, you 387 00:17:30,590 --> 00:17:31,740 would want to sense. 388 00:17:31,740 --> 00:17:34,440 They're objects! 389 00:17:34,440 --> 00:17:37,880 You know, I was playing chess the other day with my friend 390 00:17:37,880 --> 00:17:39,890 Rick, and I said to him, you know 391 00:17:39,890 --> 00:17:45,520 what I could use more of is game objects. 392 00:17:45,520 --> 00:17:48,690 I can sense all of your game objects. 393 00:17:48,690 --> 00:17:49,600 And he didn't get it. 394 00:17:49,600 --> 00:17:51,430 [AUDIENCE LAUGHTER] 395 00:17:51,430 --> 00:17:54,860 PROFESSOR: So Sense Nearby Game Objects 396 00:17:54,860 --> 00:17:56,900 is an overloaded function, which means 397 00:17:56,900 --> 00:17:59,930 that you can call it with multiple arguments. 398 00:17:59,930 --> 00:18:01,880 And that really does help you. 399 00:18:01,880 --> 00:18:04,710 So the point is, this is a global function, 400 00:18:04,710 --> 00:18:10,440 because you can see any game object if that game object is 401 00:18:10,440 --> 00:18:11,320 of a certain type. 402 00:18:11,320 --> 00:18:15,390 So all of your allied robots you can see. 403 00:18:15,390 --> 00:18:20,130 Let's go back to our example, let's say that I am back here, 404 00:18:20,130 --> 00:18:23,460 that's me, over here at the bottom. 405 00:18:23,460 --> 00:18:26,440 And this guy up at the top, I can 406 00:18:26,440 --> 00:18:28,280 see where he is back from here. 407 00:18:28,280 --> 00:18:31,690 But my sight range is actually only here. 408 00:18:31,690 --> 00:18:37,010 So I've got different detection abilities. 409 00:18:37,010 --> 00:18:41,320 Allied robots, allied mines, and neutral mines, 410 00:18:41,320 --> 00:18:44,800 are all visible no matter where you are, 411 00:18:44,800 --> 00:18:49,491 but enemy robots are only visible within your sight 412 00:18:49,491 --> 00:18:49,990 radius. 413 00:18:53,500 --> 00:18:56,260 But it's within any allied robot site radius. 414 00:18:56,260 --> 00:18:59,930 It's harder to explain than it is to think about. 415 00:18:59,930 --> 00:19:03,430 In this picture, this robot can see these guys, 416 00:19:03,430 --> 00:19:05,080 because he's really close. 417 00:19:05,080 --> 00:19:09,010 But this guy can also see them, because this robot is nearby. 418 00:19:09,010 --> 00:19:11,750 Right, that's pretty straightforward. 419 00:19:11,750 --> 00:19:15,070 One person was nodding but he was also yawning, 420 00:19:15,070 --> 00:19:16,760 so he may have been nodding off. 421 00:19:16,760 --> 00:19:18,350 No, I'm only joking. 422 00:19:18,350 --> 00:19:19,760 Yeah, zing! 423 00:19:19,760 --> 00:19:22,860 [AUDIENCE LAUGHTER] 424 00:19:22,860 --> 00:19:25,970 PROFESSOR: Sense Nearby Game Objects 425 00:19:25,970 --> 00:19:28,410 is a kind of useful thing to be able to do, 426 00:19:28,410 --> 00:19:30,430 but it's not always obvious how to use it. 427 00:19:30,430 --> 00:19:32,570 So, later on, I'll be talking about how 428 00:19:32,570 --> 00:19:35,310 one of the inputs to this is what type of game 429 00:19:35,310 --> 00:19:36,876 object you want. 430 00:19:36,876 --> 00:19:39,000 I still haven't-- I've been saying game object over 431 00:19:39,000 --> 00:19:41,860 and over, but none of you care about game objects. 432 00:19:41,860 --> 00:19:44,190 You care about enemy robots, I want 433 00:19:44,190 --> 00:19:45,990 to shoot at the enemy robots. 434 00:19:45,990 --> 00:19:50,080 So you would end up writing, oh, I want a robot please. 435 00:19:50,080 --> 00:19:55,560 So you tell it, give me game objects of type Robot.class. 436 00:19:55,560 --> 00:19:57,140 And you would say, all right, this 437 00:19:57,140 --> 00:19:58,620 is getting kind of confusing. 438 00:19:58,620 --> 00:20:00,400 I'm feeling a little bit overwhelmed. 439 00:20:00,400 --> 00:20:05,350 Well don't you worry about it, because here in the Java Docs, 440 00:20:05,350 --> 00:20:09,650 under package-- and you might notice that this is the Java 441 00:20:09,650 --> 00:20:13,100 docs version 7, for Java version 7. 442 00:20:13,100 --> 00:20:15,020 It's real sleek. 443 00:20:15,020 --> 00:20:19,090 We're distributing this at absolutely no cost. 444 00:20:19,090 --> 00:20:19,590 Yeah. 445 00:20:22,240 --> 00:20:24,120 Let's see here, oh, look! 446 00:20:24,120 --> 00:20:25,060 It's game object. 447 00:20:25,060 --> 00:20:26,650 There it is. 448 00:20:26,650 --> 00:20:31,150 And oh, look, subinterfaces include encampments and robots. 449 00:20:31,150 --> 00:20:33,180 Well that's great, that answers my question. 450 00:20:33,180 --> 00:20:37,910 So now I know that I can put Robot.class or Encampment.class 451 00:20:37,910 --> 00:20:40,880 and it will give me that type of game object. 452 00:20:40,880 --> 00:20:41,780 Yeah. 453 00:20:41,780 --> 00:20:42,300 Yeah! 454 00:20:42,300 --> 00:20:43,507 All right. 455 00:20:43,507 --> 00:20:49,980 [LAUGHS] 456 00:20:49,980 --> 00:20:53,130 So that's a piece of centralized information. 457 00:20:53,130 --> 00:20:55,130 Another piece of centralized info-- 458 00:20:55,130 --> 00:20:57,675 so we've talked about how it's allied robots. 459 00:21:02,720 --> 00:21:04,960 There's allied mines. 460 00:21:04,960 --> 00:21:09,350 I'll talk about the mines and how you can lay them and defuse 461 00:21:09,350 --> 00:21:14,930 them, and how you get these things onto the game board. 462 00:21:14,930 --> 00:21:17,430 Allied robots, allied mines. 463 00:21:17,430 --> 00:21:22,980 You've got the radio system, which is entirely global. 464 00:21:22,980 --> 00:21:25,680 And that means that you can disrupt somebody else's radio 465 00:21:25,680 --> 00:21:26,590 program. 466 00:21:26,590 --> 00:21:30,150 I have a hunch that there are several people out there who 467 00:21:30,150 --> 00:21:35,260 would broadcast random numbers to my favorite channel, 567, 468 00:21:35,260 --> 00:21:37,330 and it would just totally ruin my player. 469 00:21:37,330 --> 00:21:39,420 I wouldn't be able to work at all. 470 00:21:39,420 --> 00:21:43,030 Now, in order to limit this sort of-- there's sort 471 00:21:43,030 --> 00:21:45,510 of a back and forth between sending messages 472 00:21:45,510 --> 00:21:48,190 that you want to send, receiving the messages 473 00:21:48,190 --> 00:21:51,250 with a certain amount of, sort of, redundancy in there, 474 00:21:51,250 --> 00:21:54,010 so you can be safe against message jamming, 475 00:21:54,010 --> 00:21:55,720 versus actual jamming itself. 476 00:21:55,720 --> 00:22:00,440 How do we assess the balance of these competing objectives? 477 00:22:00,440 --> 00:22:03,720 Well we've got a cost associated with everything. 478 00:22:03,720 --> 00:22:05,640 There's no free lunch. 479 00:22:05,640 --> 00:22:08,230 Except dinner for Battlecode. 480 00:22:08,230 --> 00:22:11,400 And that is actually free. 481 00:22:11,400 --> 00:22:14,200 We ordered so much pizza for today. 482 00:22:14,200 --> 00:22:19,540 Now I'm sure not many of you ordered that much pizza before. 483 00:22:19,540 --> 00:22:21,720 But let me tell you that I expected 484 00:22:21,720 --> 00:22:24,820 that-- there's like 120 people here in the room, 485 00:22:24,820 --> 00:22:27,100 and we thought how much pizza does everybody eat? 486 00:22:27,100 --> 00:22:31,990 Well unfortunately Battlecode is a male dominated class. 487 00:22:31,990 --> 00:22:34,670 So we'll have slightly more pizza consumption 488 00:22:34,670 --> 00:22:35,790 than otherwise. 489 00:22:35,790 --> 00:22:37,010 Is that sexist? 490 00:22:37,010 --> 00:22:37,540 And so-- 491 00:22:37,540 --> 00:22:39,250 [AUDIENCE LAUGHTER] 492 00:22:39,250 --> 00:22:41,410 PROFESSOR: So we decided to get 50 pizzas. 493 00:22:41,410 --> 00:22:43,290 And we were like, well what's awesome pizza? 494 00:22:43,290 --> 00:22:45,920 We like Bertucci's. 495 00:22:45,920 --> 00:22:48,241 You guys don't like Bertucci's. 496 00:22:48,241 --> 00:22:48,740 Yeah! 497 00:22:48,740 --> 00:22:50,760 He likes Bertucci's. 498 00:22:50,760 --> 00:22:53,340 Yeah, so that was like $20 a pizza. 499 00:22:53,340 --> 00:22:55,150 So it was like $1000 for pizza. 500 00:22:55,150 --> 00:22:57,110 [AUDIENCE LAUGHTER] 501 00:22:57,110 --> 00:22:58,090 PROFESSOR: My goodness. 502 00:22:58,090 --> 00:23:01,050 Well anyway, it's going to be really good. 503 00:23:01,050 --> 00:23:02,760 And it's coming in like a half an hour. 504 00:23:02,760 --> 00:23:05,135 That's fantastic-- I've totally lost my train of thought. 505 00:23:05,135 --> 00:23:06,474 [AUDIENCE LAUGHTER] 506 00:23:06,474 --> 00:23:07,390 PROFESSOR: Right I was 507 00:23:07,390 --> 00:23:07,930 AUDIENCE: --message him. 508 00:23:07,930 --> 00:23:08,596 PROFESSOR: Yeah. 509 00:23:08,596 --> 00:23:13,330 I was saying that there's no free lunch, and as such, 510 00:23:13,330 --> 00:23:15,160 we have a bytecode cost. 511 00:23:15,160 --> 00:23:18,360 Now, I think in the past it's not been that obvious to me 512 00:23:18,360 --> 00:23:22,240 what the cost of doing a certain computation is. 513 00:23:22,240 --> 00:23:23,480 Can I jam the enemy? 514 00:23:23,480 --> 00:23:27,350 Is that really going to work, or am I going to run out of money? 515 00:23:27,350 --> 00:23:29,180 Is a question you could ask. 516 00:23:29,180 --> 00:23:32,800 So here, in the-- let's see here, 517 00:23:32,800 --> 00:23:38,159 I have a place where I have installed Battlecode. 518 00:23:38,159 --> 00:23:39,700 And you're going to do something just 519 00:23:39,700 --> 00:23:42,642 like this, where you'll have that Battlecode-- that's OK, 520 00:23:42,642 --> 00:23:43,850 he had to go to the bathroom. 521 00:23:43,850 --> 00:23:44,766 Don't worry about him. 522 00:23:44,766 --> 00:23:48,574 [AUDIENCE LAUGHTER] 523 00:23:48,574 --> 00:23:50,490 PROFESSOR: Well it's a reasonable supposition, 524 00:23:50,490 --> 00:23:52,500 he is human, isn't he? 525 00:23:52,500 --> 00:23:55,630 All right, and so here, in the Battlecode directory 526 00:23:55,630 --> 00:23:57,550 where I've installed Battlecode, there's 527 00:23:57,550 --> 00:24:00,800 going to be a text file that's called method costs. 528 00:24:00,800 --> 00:24:01,890 Bingo. 529 00:24:01,890 --> 00:24:03,700 All right now it looks disorganized 530 00:24:03,700 --> 00:24:06,090 because everything-- the strings are different lengths. 531 00:24:06,090 --> 00:24:10,150 But each string represents a function that you can use. 532 00:24:10,150 --> 00:24:13,530 Like for example attack square. 533 00:24:13,530 --> 00:24:15,029 Or maybe broadcast a message. 534 00:24:15,029 --> 00:24:16,820 Ah, that was the one we were interested in. 535 00:24:16,820 --> 00:24:18,510 OK, let's look at that. 536 00:24:18,510 --> 00:24:21,151 Broadcast costs 25 bytecodes. 537 00:24:21,151 --> 00:24:23,400 All right, let's do a little bit of math-- arithmetic, 538 00:24:23,400 --> 00:24:25,690 it's not math, is it? 539 00:24:25,690 --> 00:24:27,880 25 bytecodes, all right? 540 00:24:27,880 --> 00:24:31,960 There are 10,000 strings, which I wrote and erased. 541 00:24:31,960 --> 00:24:34,070 10,000 places to write a message to. 542 00:24:34,070 --> 00:24:37,210 There are 25 bytecodes to broadcast a message. 543 00:24:37,210 --> 00:24:41,600 OK, so that means that I can broadcast 400 messages. 544 00:24:41,600 --> 00:24:42,260 Is that right? 545 00:24:42,260 --> 00:24:48,430 Is that this number divided by that number equals that number? 546 00:24:48,430 --> 00:24:52,090 Is that-- Yeah, yeah. 547 00:24:52,090 --> 00:24:54,275 Yeah, let's go with it. 548 00:24:54,275 --> 00:24:55,790 Yeah, let's go with that. 549 00:24:55,790 --> 00:24:58,670 So you have 400. 550 00:24:58,670 --> 00:25:02,800 No, but maybe you have more of your robots jamming signals. 551 00:25:02,800 --> 00:25:04,410 OK, how many robots can you have? 552 00:25:04,410 --> 00:25:07,340 All right, let's do that computation. 553 00:25:07,340 --> 00:25:11,680 I'm pretending that I'm you, and that I'm just like-- OK 554 00:25:11,680 --> 00:25:13,910 I'm not doing a very good impersonation. 555 00:25:13,910 --> 00:25:14,950 I recognize that. 556 00:25:14,950 --> 00:25:16,980 You'd be much faster at this. 557 00:25:16,980 --> 00:25:20,530 So you would want to find out how many robots you 558 00:25:20,530 --> 00:25:22,310 can sustain. 559 00:25:22,310 --> 00:25:25,410 Can I get somebody to suggest one way to figure out 560 00:25:25,410 --> 00:25:26,010 that number? 561 00:25:28,400 --> 00:25:28,900 Yes! 562 00:25:28,900 --> 00:25:29,930 You, you, you. 563 00:25:29,930 --> 00:25:34,690 Ah yes you could make a player and just spawn robots 564 00:25:34,690 --> 00:25:36,280 until they start dying. 565 00:25:36,280 --> 00:25:38,460 Let's say you wanted to do it in a different way. 566 00:25:38,460 --> 00:25:41,520 [AUDIENCE LAUGHTER] 567 00:25:41,520 --> 00:25:45,130 PROFESSOR: I have the example here. 568 00:25:45,130 --> 00:25:47,170 What is It? 569 00:25:47,170 --> 00:25:48,550 Game constants, there we are. 570 00:25:48,550 --> 00:25:50,870 So here I'm looking at the Java docs, 571 00:25:50,870 --> 00:25:52,350 and I can click on game constants. 572 00:25:59,180 --> 00:26:01,000 I'm looking at a different version of it 573 00:26:01,000 --> 00:26:03,340 that didn't actually show the game constants in the game 574 00:26:03,340 --> 00:26:04,950 constants page. 575 00:26:04,950 --> 00:26:06,820 But that's because we are well organized. 576 00:26:06,820 --> 00:26:10,420 And this is to show that we're indomitable, indefatigable, 577 00:26:10,420 --> 00:26:11,810 as it were. 578 00:26:11,810 --> 00:26:15,270 These constant values indicate, here, 579 00:26:15,270 --> 00:26:19,970 that your headquarters is capable of producing 580 00:26:19,970 --> 00:26:21,870 quite a few resources. 581 00:26:21,870 --> 00:26:26,730 This shows that it produces 50 resources per turn. 582 00:26:26,730 --> 00:26:29,510 This resource production enables you 583 00:26:29,510 --> 00:26:31,290 to have an upkeep of robots. 584 00:26:31,290 --> 00:26:34,420 So in the past, we've had names like flux, and so on. 585 00:26:34,420 --> 00:26:37,500 This year, the name for it is power. 586 00:26:37,500 --> 00:26:39,760 That's tough though because we have time as well. 587 00:26:39,760 --> 00:26:42,320 And as you well know power times time is energy. 588 00:26:42,320 --> 00:26:44,930 And so now we have energon and energy, 589 00:26:44,930 --> 00:26:47,630 which is a multiple or a calculated quantity from power. 590 00:26:47,630 --> 00:26:49,270 But don't you worry too much about it. 591 00:26:49,270 --> 00:26:50,680 It's just a number. 592 00:26:50,680 --> 00:26:56,900 And the usage of this resource, or power, by robots, 593 00:26:56,900 --> 00:27:01,390 is displayed in unit upkeep. 594 00:27:01,390 --> 00:27:03,066 Which here, is written incorrectly. 595 00:27:03,066 --> 00:27:04,440 I'm going to be bring up the most 596 00:27:04,440 --> 00:27:07,820 recent version of this document. 597 00:27:07,820 --> 00:27:10,589 What's nice is that you guys will get one version, 598 00:27:10,589 --> 00:27:12,630 and then you'll have one version on your computer 599 00:27:12,630 --> 00:27:15,810 and not, like, 16. 600 00:27:15,810 --> 00:27:17,670 And your one version will be up to date. 601 00:27:17,670 --> 00:27:19,810 And when you want to update it, the client 602 00:27:19,810 --> 00:27:22,890 will automatically tell you that it needs updating. 603 00:27:22,890 --> 00:27:25,080 So you'll just have the one version, 604 00:27:25,080 --> 00:27:28,800 and you won't have disaster area. 605 00:27:28,800 --> 00:27:30,040 Yeah, constant value. 606 00:27:30,040 --> 00:27:33,300 So this is the more recently updated one. 607 00:27:33,300 --> 00:27:35,400 And you can see here the unit power upkeep is one. 608 00:27:35,400 --> 00:27:36,275 All right, fantastic. 609 00:27:36,275 --> 00:27:39,970 We're ready to do a computation. 610 00:27:39,970 --> 00:27:44,110 So I'm going to put here 40 divided 611 00:27:44,110 --> 00:27:46,975 by-- so this is the amount of energy, 612 00:27:46,975 --> 00:27:48,600 or the amount of power, that's produced 613 00:27:48,600 --> 00:27:51,080 per turn by your headquarters divided 614 00:27:51,080 --> 00:27:54,100 by the usage of that power. 615 00:27:54,100 --> 00:27:57,000 Now you're going to say, all right, I'm bored. 616 00:27:57,000 --> 00:28:00,300 I can do this in my head. 617 00:28:00,300 --> 00:28:04,320 Well maybe you can but some of us can't, all right? 618 00:28:04,320 --> 00:28:07,120 No, so that would be the number. 619 00:28:07,120 --> 00:28:10,680 But that would say that the number of robots you get 620 00:28:10,680 --> 00:28:12,790 is independent of how much work they're doing. 621 00:28:12,790 --> 00:28:14,320 And that doesn't make any sense. 622 00:28:14,320 --> 00:28:16,140 You should get to have more robots 623 00:28:16,140 --> 00:28:18,730 if you're doing less computation. 624 00:28:18,730 --> 00:28:22,380 So here you can see, there is a cost. 625 00:28:22,380 --> 00:28:26,460 Power cost per bytecode, which is here. 626 00:28:26,460 --> 00:28:29,110 And it's 10 to the minus 4. 627 00:28:29,110 --> 00:28:35,650 So let's say that I'm using-- 10 to the minus 4 628 00:28:35,650 --> 00:28:37,120 times the number bytecodes. 629 00:28:37,120 --> 00:28:42,470 Well, if I'm using zero byte codes, then I get 40. 630 00:28:42,470 --> 00:28:44,786 Because that would be 1 plus 0. 631 00:28:44,786 --> 00:28:46,255 And 40 over one is 40. 632 00:28:46,255 --> 00:28:49,080 OK and if I were using 10,000, which 633 00:28:49,080 --> 00:28:51,170 is also known as 10 to the 4. 634 00:28:51,170 --> 00:28:54,060 Then I would get 20. 635 00:28:54,060 --> 00:28:56,040 Wow, what a big difference. 636 00:28:56,040 --> 00:28:59,040 So that tells you that if you want to go ahead and spam 637 00:28:59,040 --> 00:29:02,060 the message system-- let's say you're spamming, 638 00:29:02,060 --> 00:29:05,090 so you're using all of your bytecodes possible, 639 00:29:05,090 --> 00:29:07,760 and you have 20 robots. 640 00:29:07,760 --> 00:29:12,270 So 20 robots are spamming 400 message integers per turn. 641 00:29:12,270 --> 00:29:16,620 So you're doing nothing but spamming the messages. 642 00:29:16,620 --> 00:29:24,630 And you're getting eight, zero, zero, ze-- Oh, ahh, ahh. 643 00:29:24,630 --> 00:29:26,430 Oh, it's not even enough. 644 00:29:26,430 --> 00:29:29,040 It's not enough. 645 00:29:29,040 --> 00:29:32,080 Well, so that shows that you could jam the enemy. 646 00:29:32,080 --> 00:29:36,100 And maybe you should, if you've got nothing better to do, 647 00:29:36,100 --> 00:29:39,520 if you derive a personal satisfaction from it. 648 00:29:39,520 --> 00:29:40,690 But this is worth saying. 649 00:29:40,690 --> 00:29:44,090 These kinds of calculations are important for strategy. 650 00:29:44,090 --> 00:29:47,890 But don't make them totally fixed in stone. 651 00:29:47,890 --> 00:29:50,600 Because we change the game, we tweak 652 00:29:50,600 --> 00:29:52,130 it a little bit for balance. 653 00:29:52,130 --> 00:29:56,070 So if it ends up being that 10,000 is just so much radio 654 00:29:56,070 --> 00:29:58,570 space that we just would rather not have it, 655 00:29:58,570 --> 00:30:00,590 then it could just get knocked down to 1000. 656 00:30:00,590 --> 00:30:03,240 And then all of a sudden your player, which 657 00:30:03,240 --> 00:30:06,010 depends on this or that messaging construct, 658 00:30:06,010 --> 00:30:08,370 may have to be somewhat rethought. 659 00:30:08,370 --> 00:30:13,620 So this is a good time to talk about the organization 660 00:30:13,620 --> 00:30:15,720 of the competition. 661 00:30:15,720 --> 00:30:16,830 Is it? 662 00:30:16,830 --> 00:30:19,870 I think it is. 663 00:30:19,870 --> 00:30:23,011 Let's go to the Battlecode website. 664 00:30:23,011 --> 00:30:24,260 And let me show you something. 665 00:30:24,260 --> 00:30:26,051 I don't know I knew that you could do this. 666 00:30:26,051 --> 00:30:29,770 But previous years we've had like a list. 667 00:30:29,770 --> 00:30:31,990 And it'll be in text form, and it'll 668 00:30:31,990 --> 00:30:36,830 say on this date we have this competition, and this one. 669 00:30:36,830 --> 00:30:39,090 And then you have to open up a window of this. 670 00:30:39,090 --> 00:30:41,900 And then every single one of you opens up 671 00:30:41,900 --> 00:30:45,210 another window with Gmail or Google Calendar. 672 00:30:45,210 --> 00:30:48,510 And then you like manually enter in the-- do you not do that? 673 00:30:48,510 --> 00:30:51,390 Who has to do that whenever you have a competition, 674 00:30:51,390 --> 00:30:52,830 you want to know when things are? 675 00:30:52,830 --> 00:30:54,670 Yeah, yeah there's like two people who 676 00:30:54,670 --> 00:30:57,140 also have to do that. 677 00:30:57,140 --> 00:31:01,160 So I figured, in light of saving those two people some effort, 678 00:31:01,160 --> 00:31:02,490 we made this Google Calendar. 679 00:31:02,490 --> 00:31:04,900 And you could see, here's today's classroom session, 680 00:31:04,900 --> 00:31:07,690 here in 1-190 from 5:00 to 6:00 PM. 681 00:31:07,690 --> 00:31:09,510 And it's got the lab written there. 682 00:31:09,510 --> 00:31:14,380 So the specs and software are released, as of 37 minutes ago, 683 00:31:14,380 --> 00:31:15,886 roughly speaking. 684 00:31:15,886 --> 00:31:17,260 And what we'll do, after this, is 685 00:31:17,260 --> 00:31:18,700 we'll talk about how to set it up. 686 00:31:18,700 --> 00:31:20,800 So there you go, specs and software are released. 687 00:31:20,800 --> 00:31:24,000 The sprint tournament is on the 14th. 688 00:31:24,000 --> 00:31:27,150 And what that means is you can submit a player for that, 689 00:31:27,150 --> 00:31:32,170 and you can be entered for a relatively small prize pool. 690 00:31:32,170 --> 00:31:33,810 Relatively small, the actual prize 691 00:31:33,810 --> 00:31:36,450 pool for the finals is I think $50,000. 692 00:31:36,450 --> 00:31:38,487 So relatively small is just some fraction 693 00:31:38,487 --> 00:31:40,070 of that which is still non-negligible. 694 00:31:43,630 --> 00:31:46,420 Anyway, so that's going to be really exciting because that 695 00:31:46,420 --> 00:31:48,620 will give you the opportunity to test your code out 696 00:31:48,620 --> 00:31:50,770 to see what other players are doing, because to 697 00:31:50,770 --> 00:31:53,460 some extent winning is going to be 698 00:31:53,460 --> 00:31:55,980 related to what other people do. 699 00:31:55,980 --> 00:31:57,570 But more importantly, having fun is 700 00:31:57,570 --> 00:31:59,417 related to what other people do, and talking 701 00:31:59,417 --> 00:32:00,250 to the other people. 702 00:32:00,250 --> 00:32:04,000 Like this social utopia of mine, the idea of this lab, 703 00:32:04,000 --> 00:32:07,660 is totally new-- as well as the Google Calendar 704 00:32:07,660 --> 00:32:12,140 --to try to make things more easy and fun and together, 705 00:32:12,140 --> 00:32:14,520 among us as Battlecoders. 706 00:32:14,520 --> 00:32:16,840 Because we do all share that common link. 707 00:32:16,840 --> 00:32:17,450 Yes. 708 00:32:17,450 --> 00:32:20,590 So the point is that if you didn't 709 00:32:20,590 --> 00:32:22,170 know you could do this, what you do 710 00:32:22,170 --> 00:32:26,750 is you go to-- if you want to add this to your own calendar, 711 00:32:26,750 --> 00:32:30,600 there's like a button where you can go and do that. 712 00:32:30,600 --> 00:32:33,490 I think the button isn't available because-- Yeah, 713 00:32:33,490 --> 00:32:34,242 there. 714 00:32:34,242 --> 00:32:35,357 There? 715 00:32:35,357 --> 00:32:35,940 At the bottom. 716 00:32:35,940 --> 00:32:36,870 At the bottom? 717 00:32:36,870 --> 00:32:37,784 Yeah, there you go. 718 00:32:37,784 --> 00:32:39,200 And then you just add it right in, 719 00:32:39,200 --> 00:32:42,110 so I've already got it here, in my personal calendar. 720 00:32:42,110 --> 00:32:44,100 And there you go, so you can see that I'm 721 00:32:44,100 --> 00:32:45,870 having lunch on the 24th. 722 00:32:45,870 --> 00:32:49,050 And OK, so you get the idea. 723 00:32:49,050 --> 00:32:51,710 So the sprint tournament is-- the submission deadline, 724 00:32:51,710 --> 00:32:53,210 you can see here, is on the 14th. 725 00:32:53,210 --> 00:32:57,087 On the 16th, on that Wednesday, in class, 726 00:32:57,087 --> 00:32:59,420 we'll show some of the games from the sprint tournament. 727 00:32:59,420 --> 00:33:00,961 I don't think we'll show all of them. 728 00:33:00,961 --> 00:33:03,800 See because what used to happen, is we would show all the games. 729 00:33:03,800 --> 00:33:06,120 And there's like 100 teams. 730 00:33:06,120 --> 00:33:10,130 And that ends up being a relatively large size 731 00:33:10,130 --> 00:33:13,280 round-robin bracket with, I think, double elimination. 732 00:33:13,280 --> 00:33:14,400 So it's a ton of games. 733 00:33:14,400 --> 00:33:16,250 I think it generally takes like five hours. 734 00:33:16,250 --> 00:33:18,630 But it ends up bumping up to six, seven, or eight hours 735 00:33:18,630 --> 00:33:21,230 because we end up showing up there, 736 00:33:21,230 --> 00:33:24,130 and the tournament code that sets it all up doesn't work. 737 00:33:24,130 --> 00:33:25,536 And so it takes forever. 738 00:33:25,536 --> 00:33:26,910 So we're going to do this year is 739 00:33:26,910 --> 00:33:28,360 we'll just sort to distill it down, 740 00:33:28,360 --> 00:33:29,818 we'll have something simple to show 741 00:33:29,818 --> 00:33:32,570 that's fantastic and exciting on the Wednesday. 742 00:33:32,570 --> 00:33:35,950 And in the future, when we have our later-- our seating 743 00:33:35,950 --> 00:33:38,696 tournament, which is sort of the same kind of thing, 744 00:33:38,696 --> 00:33:41,320 but it's more important, because it determines your positioning 745 00:33:41,320 --> 00:33:42,500 for the final tournament. 746 00:33:42,500 --> 00:33:44,724 When we have this seating tournament, 747 00:33:44,724 --> 00:33:46,640 we're going to live stream it on the internet, 748 00:33:46,640 --> 00:33:48,306 so that you don't even have to-- I mean, 749 00:33:48,306 --> 00:33:51,260 you guys all trekked out here in the dead of night 750 00:33:51,260 --> 00:33:56,930 and 5:00 or 6:00 PM in the freezing cold. 751 00:33:56,930 --> 00:34:01,040 I mean there could be people out there dying because they tried 752 00:34:01,040 --> 00:34:03,270 to make it here and they didn't make it. 753 00:34:03,270 --> 00:34:07,700 That would be horrible, that's not something to laugh at. 754 00:34:07,700 --> 00:34:09,150 So you came all the way out here, 755 00:34:09,150 --> 00:34:12,659 but we don't want to make you have to do that much work. 756 00:34:12,659 --> 00:34:14,070 Because we want you to have fun. 757 00:34:14,070 --> 00:34:14,736 So there you go. 758 00:34:14,736 --> 00:34:16,761 We've got a calendar to save you that effort. 759 00:34:16,761 --> 00:34:18,969 We have lab sessions to save you the effort of trying 760 00:34:18,969 --> 00:34:22,270 to make friends, and we'll have live streams 761 00:34:22,270 --> 00:34:25,909 in the future, which will make that much better. 762 00:34:25,909 --> 00:34:28,580 So as you can see here, it says the seating tournament 763 00:34:28,580 --> 00:34:30,710 submission deadline is on the 21st. 764 00:34:30,710 --> 00:34:32,800 And the seating tournament will be on the 22nd. 765 00:34:32,800 --> 00:34:36,719 So what that does, is it gets you your position in the finals 766 00:34:36,719 --> 00:34:37,554 tournament. 767 00:34:37,554 --> 00:34:39,720 The finals submission deadline is different, though. 768 00:34:39,720 --> 00:34:41,830 So you can continually update your player. 769 00:34:41,830 --> 00:34:44,440 My point is that you only have three weeks. 770 00:34:44,440 --> 00:34:45,900 It's the 7th today. 771 00:34:45,900 --> 00:34:48,190 And the finals submission deadline is the 28th. 772 00:34:48,190 --> 00:34:50,340 You have three weeks to make an amazing player. 773 00:34:50,340 --> 00:34:52,170 And each week, you'll have the chance 774 00:34:52,170 --> 00:34:54,489 to-- you could upload your player at any time, 775 00:34:54,489 --> 00:34:57,730 you can do scrimmage matches with other players at any time. 776 00:34:57,730 --> 00:35:01,980 And then finally, you'll be able to submit to the finals. 777 00:35:01,980 --> 00:35:05,400 I mean, I don't think it's worth getting too hyped up 778 00:35:05,400 --> 00:35:11,029 about this final thing because after all, in my experience, 779 00:35:11,029 --> 00:35:13,570 game changes at the last minute screw you over at the finals, 780 00:35:13,570 --> 00:35:15,630 and ends up being a crap shoot. 781 00:35:15,630 --> 00:35:17,610 No, no, I exaggerate. 782 00:35:17,610 --> 00:35:21,220 But the point is, the fun should be had as you go. 783 00:35:21,220 --> 00:35:24,930 And I am here to help with that. 784 00:35:24,930 --> 00:35:27,660 So what you need-- so just one more 785 00:35:27,660 --> 00:35:29,680 thing about this administration is 786 00:35:29,680 --> 00:35:36,350 that I think that it's required that you upload a resume, 787 00:35:36,350 --> 00:35:40,892 and that you be an MIT student if you want to earn-- no, 788 00:35:40,892 --> 00:35:41,600 that's not right. 789 00:35:41,600 --> 00:35:44,440 We have international competitors, this year. 790 00:35:44,440 --> 00:35:47,790 We have sort of a thing going on with the University of Sussex. 791 00:35:47,790 --> 00:35:49,659 If you have friends at other universities, 792 00:35:49,659 --> 00:35:50,950 they can feel free to join you. 793 00:35:50,950 --> 00:35:52,880 And they don't have to be MIT students 794 00:35:52,880 --> 00:35:55,010 to either play or win money. 795 00:35:55,010 --> 00:36:00,630 And if they're in Honolulu, or Alaska, 796 00:36:00,630 --> 00:36:03,350 we'll fly them in here for the finals 797 00:36:03,350 --> 00:36:06,900 because we expect the finalists to show up at this dinner 798 00:36:06,900 --> 00:36:08,110 that we have at the Hyatt. 799 00:36:08,110 --> 00:36:11,980 We have this fantastically lavish dinner. 800 00:36:11,980 --> 00:36:17,587 I think we paid like $5,000 for it. 801 00:36:17,587 --> 00:36:19,170 Aaron, could you come up here and show 802 00:36:19,170 --> 00:36:21,350 what the sponsors are by just turning 803 00:36:21,350 --> 00:36:22,890 your back to the audience? 804 00:36:22,890 --> 00:36:25,125 No, actually there's a button here, I can do that. 805 00:36:25,125 --> 00:36:26,700 AUDIENCE: [INAUDIBLE] 806 00:36:26,700 --> 00:36:27,510 PROFESSOR: Yeah, that's a good point. 807 00:36:27,510 --> 00:36:28,740 OK, so here are our sponsors. 808 00:36:28,740 --> 00:36:32,350 We have these fancy company reps show up at this dinner. 809 00:36:32,350 --> 00:36:34,050 So if you're among the finalists, 810 00:36:34,050 --> 00:36:36,740 then you show up at the fancy reps dinner 811 00:36:36,740 --> 00:36:38,700 and they offer you jobs and stuff. 812 00:36:38,700 --> 00:36:41,240 It's apparently very nice, I've never been. 813 00:36:41,240 --> 00:36:43,660 AUDIENCE: [AUDIENCE LAUGHTER] 814 00:36:43,660 --> 00:36:45,370 Yeah, that's because I was busy. 815 00:36:45,370 --> 00:36:46,410 Yeah, that's why. 816 00:36:46,410 --> 00:36:47,190 Yeah, that's why. 817 00:36:47,190 --> 00:36:47,700 That's why. 818 00:36:47,700 --> 00:36:48,730 No. 819 00:36:48,730 --> 00:36:50,810 So these are some of the sponsors. 820 00:36:50,810 --> 00:36:54,009 Our main sponsors and some other ones. 821 00:36:54,009 --> 00:36:56,550 And you'll get a chance to meet them, as well, at the finals. 822 00:36:56,550 --> 00:37:00,300 So you don't have to be the best of the best by whatever stupid 823 00:37:00,300 --> 00:37:01,600 metric we come up with. 824 00:37:01,600 --> 00:37:03,730 What you have to be is-- anybody who 825 00:37:03,730 --> 00:37:08,380 does Battlecode is an attractive person to these employers who 826 00:37:08,380 --> 00:37:10,900 will meet you and give you business cards. 827 00:37:10,900 --> 00:37:14,080 And it'll be a good time for everyone. 828 00:37:14,080 --> 00:37:18,890 And so in that note you have, once again, 829 00:37:18,890 --> 00:37:23,630 on the calendar page, the finals are on the 2nd of February. 830 00:37:23,630 --> 00:37:27,300 So that'll be when that happens and it'll be in 26-100. 831 00:37:27,300 --> 00:37:29,680 It'll be a blast, and you should be looking forward 832 00:37:29,680 --> 00:37:31,780 to that very much. 833 00:37:31,780 --> 00:37:33,980 I feel like I've just been droning on, 834 00:37:33,980 --> 00:37:36,620 ranting about what I don't like about StarCraft. 835 00:37:36,620 --> 00:37:39,850 And I haven't talked enough about the things that 836 00:37:39,850 --> 00:37:42,800 are related to gameplay this year. 837 00:37:42,800 --> 00:37:48,115 This year, you have these robots. 838 00:37:48,115 --> 00:37:53,140 It's astounding to me, that I-- Oh, is that why it didn't work? 839 00:37:53,140 --> 00:37:56,300 Because I was using this one instead of this one, 840 00:37:56,300 --> 00:37:59,650 and I meant to use this main client? 841 00:37:59,650 --> 00:38:01,260 Yeah, that's the one. 842 00:38:01,260 --> 00:38:02,990 OK, yeah. 843 00:38:02,990 --> 00:38:05,710 This was the point I was trying to make earlier. 844 00:38:05,710 --> 00:38:08,250 Where I was going to take compute time bot, 845 00:38:08,250 --> 00:38:11,320 playing against compute time bot, on this map. 846 00:38:14,660 --> 00:38:16,710 This is sort of how to do it, but it'll 847 00:38:16,710 --> 00:38:18,580 be done a little bit differently. 848 00:38:18,580 --> 00:38:23,550 And so the goal here is to see how many robots can be built. 849 00:38:23,550 --> 00:38:25,110 But this guy-- Ah! 850 00:38:25,110 --> 00:38:27,830 I think team A and B got switched. 851 00:38:27,830 --> 00:38:31,780 So what I'll do is I'll just briefly switch around the code. 852 00:38:31,780 --> 00:38:36,470 So this is sort of the structure of a robot controller. 853 00:38:36,470 --> 00:38:40,210 What happens is this code is run on each robot on your team, 854 00:38:40,210 --> 00:38:41,810 and that's what plays the game. 855 00:38:41,810 --> 00:38:43,900 I'm sure most of you know that already. 856 00:38:43,900 --> 00:38:46,630 And so what I'll do is I'll just check that the team is B. 857 00:38:46,630 --> 00:38:51,340 So I can switch the team, hit Save, run it again. 858 00:38:54,465 --> 00:38:55,840 Well it doesn't work as well as I 859 00:38:55,840 --> 00:38:57,548 was expecting because these guys are just 860 00:38:57,548 --> 00:39:00,500 dying when they go through the minefield. 861 00:39:00,500 --> 00:39:01,430 That's interesting. 862 00:39:01,430 --> 00:39:03,100 [AUDIENCE LAUGHTER] 863 00:39:03,100 --> 00:39:06,310 PROFESSOR: You know, you can make your own maps in this. 864 00:39:06,310 --> 00:39:08,580 This is a really good example of debugging. 865 00:39:08,580 --> 00:39:11,355 And you can say that I did this on purpose. 866 00:39:11,355 --> 00:39:13,480 Although if you have a strict adherence to honesty, 867 00:39:13,480 --> 00:39:15,790 you might not. 868 00:39:15,790 --> 00:39:19,050 So the maps are located where? 869 00:39:19,050 --> 00:39:20,870 You're looking at what, here? 870 00:39:20,870 --> 00:39:24,790 So you'll have a directory where you can see your maps. 871 00:39:24,790 --> 00:39:26,990 And you'll be also able to see them here. 872 00:39:26,990 --> 00:39:28,110 So here's simple. 873 00:39:28,110 --> 00:39:30,380 And what if I want to edit this map. 874 00:39:30,380 --> 00:39:31,460 Can I do that? 875 00:39:31,460 --> 00:39:33,220 Can I just double click it? 876 00:39:33,220 --> 00:39:36,370 It's an XML document. 877 00:39:36,370 --> 00:39:37,330 Oh, look. 878 00:39:37,330 --> 00:39:39,780 Is it? 879 00:39:39,780 --> 00:39:41,290 Oh, data, OK. 880 00:39:41,290 --> 00:39:42,830 Here's some data. 881 00:39:42,830 --> 00:39:44,552 I'm beginning to get to the part-- see, 882 00:39:44,552 --> 00:39:46,260 this would be really easy if I could just 883 00:39:46,260 --> 00:39:48,167 do edit with notepad. 884 00:39:48,167 --> 00:39:49,500 AUDIENCE: --source at the bottom 885 00:39:49,500 --> 00:39:51,770 PROFESSOR: Source! 886 00:39:51,770 --> 00:39:52,640 No. 887 00:39:52,640 --> 00:39:55,640 AUDIENCE: [INAUDIBLE] 888 00:39:55,640 --> 00:39:56,502 PROFESSOR: Tab. 889 00:39:56,502 --> 00:39:57,624 AUDIENCE: No, down. 890 00:39:57,624 --> 00:39:58,290 PROFESSOR: Down? 891 00:39:58,290 --> 00:39:58,789 Down. 892 00:39:58,789 --> 00:40:00,550 AUDIENCE: Where design is. 893 00:40:00,550 --> 00:40:01,180 PROFESSOR: Oh! 894 00:40:01,180 --> 00:40:01,984 Bingo. 895 00:40:01,984 --> 00:40:02,484 All right! 896 00:40:02,484 --> 00:40:03,720 Yeah, thank you. 897 00:40:03,720 --> 00:40:05,800 So then, you can see that I can make 898 00:40:05,800 --> 00:40:08,100 my own maps using these codes. 899 00:40:08,100 --> 00:40:10,750 So the character "3" indicates a neutral mine. 900 00:40:10,750 --> 00:40:13,600 So I can just do like a find replace, were I'll replace "3" 901 00:40:13,600 --> 00:40:15,610 with ".", which is an open terrain. 902 00:40:15,610 --> 00:40:17,307 I'll just do replace all. 903 00:40:17,307 --> 00:40:18,890 And then I'll just make sure to change 904 00:40:18,890 --> 00:40:22,374 this one or else the whole map would be mines. 905 00:40:22,374 --> 00:40:24,540 I'm sure two of you thought that I wouldn't do that, 906 00:40:24,540 --> 00:40:29,660 but I assure you that I'm operating at full capacity. 907 00:40:29,660 --> 00:40:33,320 All right, so this is an example where you can see I've 908 00:40:33,320 --> 00:40:34,720 just built bunch of robots. 909 00:40:34,720 --> 00:40:36,830 And you can see that this is my power. 910 00:40:36,830 --> 00:40:39,690 Your power stored in a reserve bank. 911 00:40:39,690 --> 00:40:42,422 And what I'm going to do is suddenly at round 1,000, 912 00:40:42,422 --> 00:40:43,880 I'm going to start computing a lot. 913 00:40:43,880 --> 00:40:45,546 So right now you can see that this robot 914 00:40:45,546 --> 00:40:47,250 is using 38 bytecodes. 915 00:40:47,250 --> 00:40:47,990 Not very many. 916 00:40:50,980 --> 00:40:52,940 If you're amazing at counting you'll 917 00:40:52,940 --> 00:40:54,390 see that there are about 40 here. 918 00:40:54,390 --> 00:40:56,630 And the new robots-- oh, boom! 919 00:40:56,630 --> 00:40:57,730 Look at that. 920 00:40:57,730 --> 00:41:01,320 The new robots died because they don't have enough-- these guys 921 00:41:01,320 --> 00:41:05,710 don't have enough compute-- they don't have enough power to run. 922 00:41:05,710 --> 00:41:08,390 So they lose hit points until they're dead. 923 00:41:08,390 --> 00:41:10,850 And then if they all start using code, 924 00:41:10,850 --> 00:41:13,240 boom, when we cut down to half the number. 925 00:41:13,240 --> 00:41:15,080 And so you could see quite visually 926 00:41:15,080 --> 00:41:19,360 the effect of using 10,000 bytecodes versus using 927 00:41:19,360 --> 00:41:22,280 no bytecodes at all. 928 00:41:22,280 --> 00:41:24,160 So from here, down to there. 929 00:41:24,160 --> 00:41:25,910 Bang. 930 00:41:25,910 --> 00:41:31,580 This power quantity can be affected by various things. 931 00:41:31,580 --> 00:41:36,430 So there are some equations that I could show for what that is. 932 00:41:36,430 --> 00:41:39,590 But maybe I've just gone a bit far field here 933 00:41:39,590 --> 00:41:41,580 because I've been talking about some details. 934 00:41:41,580 --> 00:41:44,010 Here's the general overview, right? 935 00:41:44,010 --> 00:41:46,800 You don't really need too many of the specifics, 936 00:41:46,800 --> 00:41:49,257 because all you've got to do is find the enemy. 937 00:41:49,257 --> 00:41:50,840 And there's a function that does that. 938 00:41:50,840 --> 00:41:53,590 Oh, look at that, I'll just add that to the global list. 939 00:41:53,590 --> 00:42:00,820 There's, "Sense Enemy Headquarters," bingo. 940 00:42:00,820 --> 00:42:01,760 Done. 941 00:42:01,760 --> 00:42:04,530 If you were interested in a little bit of masochism, 942 00:42:04,530 --> 00:42:07,190 coding masochism, and just doing something the hard way, 943 00:42:07,190 --> 00:42:07,960 you could do that. 944 00:42:07,960 --> 00:42:10,120 Because what we've also provided, 945 00:42:10,120 --> 00:42:12,070 is the dimensions of the map, and you 946 00:42:12,070 --> 00:42:14,800 know that the upper left corner of the map is 0,0. 947 00:42:14,800 --> 00:42:16,985 So with a symmetry operation you could say, 948 00:42:16,985 --> 00:42:18,650 my headquarters is here. 949 00:42:18,650 --> 00:42:19,970 The map size is this. 950 00:42:19,970 --> 00:42:21,400 My location is here. 951 00:42:21,400 --> 00:42:24,020 Therefore, the enemy must be at this other location. 952 00:42:24,020 --> 00:42:27,772 So more than one way to skin a cat, as the case may be. 953 00:42:27,772 --> 00:42:29,730 So you locate the enemy, and all you have to do 954 00:42:29,730 --> 00:42:30,710 is walk up to him. 955 00:42:30,710 --> 00:42:34,070 Because this year attacking happens automatically 956 00:42:34,070 --> 00:42:35,080 for soldiers. 957 00:42:35,080 --> 00:42:39,270 So right now there isn't any fighting going on. 958 00:42:39,270 --> 00:42:41,660 But I'll show an example that will 959 00:42:41,660 --> 00:42:44,500 show that all they've got to do is go near one another, 960 00:42:44,500 --> 00:42:49,450 and then their attack power is distributed 961 00:42:49,450 --> 00:42:52,680 among all of the robots they can see. 962 00:42:52,680 --> 00:42:55,460 So this is some old code that we were 963 00:42:55,460 --> 00:42:57,570 writing when we were testing the game. 964 00:42:57,570 --> 00:42:59,230 And what you'll find is that when 965 00:42:59,230 --> 00:43:01,370 robots come close to one another, 966 00:43:01,370 --> 00:43:06,334 they make these circles that indicate their attack range. 967 00:43:06,334 --> 00:43:08,750 So they're attacking-- this guy is distributing his attack 968 00:43:08,750 --> 00:43:10,620 among this one and that one. 969 00:43:10,620 --> 00:43:13,910 Similarly, this one is distributing among these three. 970 00:43:13,910 --> 00:43:16,720 So his attack power in this version of the game 971 00:43:16,720 --> 00:43:17,560 was different. 972 00:43:17,560 --> 00:43:20,450 But right now I believe the attack power is six. 973 00:43:20,450 --> 00:43:24,700 So he would be dealing two damage to each of these. 974 00:43:24,700 --> 00:43:27,150 What you also see in this picture, which 975 00:43:27,150 --> 00:43:30,270 I believe is quite instructive, is the shield robots. 976 00:43:34,090 --> 00:43:40,110 Yeah, any robot that's standing next to this shields robot 977 00:43:40,110 --> 00:43:42,900 will be given this additional shields parameter. 978 00:43:42,900 --> 00:43:45,347 And so you can see it here in the user interface. 979 00:43:45,347 --> 00:43:46,930 There's a green bar indicating health, 980 00:43:46,930 --> 00:43:48,940 and a blue bar indicating shields. 981 00:43:48,940 --> 00:43:51,050 In the latest implementation of Battlecode, 982 00:43:51,050 --> 00:43:53,150 shields serve as a protection only 983 00:43:53,150 --> 00:43:57,500 against a certain type of encampment that can be built. 984 00:43:57,500 --> 00:44:02,700 So is these encampments work in the following way. 985 00:44:02,700 --> 00:44:07,680 You start with just a headquarters, 986 00:44:07,680 --> 00:44:09,150 and that produces these soldiers. 987 00:44:09,150 --> 00:44:12,470 So you can produce a soldier at any tile around you, 988 00:44:12,470 --> 00:44:15,190 if that tile is unoccupied. 989 00:44:15,190 --> 00:44:19,770 That soldier can then be used to construct an encampment. 990 00:44:19,770 --> 00:44:23,840 And he can construct any of a number of types of encampment. 991 00:44:23,840 --> 00:44:27,260 So I've made this nice, handy, useful Battlecode data sheet. 992 00:44:27,260 --> 00:44:28,770 People from last year might remember 993 00:44:28,770 --> 00:44:31,720 that I made sort of a handy unit sheet at that time. 994 00:44:31,720 --> 00:44:35,990 But this year it's 100% more accurate than last year's. 995 00:44:35,990 --> 00:44:37,480 That's right. 996 00:44:37,480 --> 00:44:39,040 We've checked and double checked, 997 00:44:39,040 --> 00:44:40,650 but this is the latest version. 998 00:44:40,650 --> 00:44:44,400 So you can see here all of the different types of units. 999 00:44:44,400 --> 00:44:47,520 And there's a Boolean for whether it is an encampment, 1000 00:44:47,520 --> 00:44:50,990 in terms of just a description. 1001 00:44:50,990 --> 00:44:53,865 Although, you know, that's kind of not a fantastic description. 1002 00:44:56,440 --> 00:44:58,170 Because all of these units-- you know, 1003 00:44:58,170 --> 00:45:00,040 because we like to be straightforward. 1004 00:45:00,040 --> 00:45:02,660 It's a realistic preparation for your life 1005 00:45:02,660 --> 00:45:07,090 as a professional coder, that the database and documentation 1006 00:45:07,090 --> 00:45:09,960 you receive will contain information opposite to the way 1007 00:45:09,960 --> 00:45:11,412 that things are run. 1008 00:45:11,412 --> 00:45:13,870 So you can see here that they're all listed-- some of these 1009 00:45:13,870 --> 00:45:16,300 are listed as encampments. 1010 00:45:16,300 --> 00:45:18,540 But in fact they are all robots. 1011 00:45:18,540 --> 00:45:20,830 Yes, I believe that's correct. 1012 00:45:20,830 --> 00:45:23,460 They are all robots. 1013 00:45:23,460 --> 00:45:26,310 So the headquarters is what you start with. 1014 00:45:26,310 --> 00:45:31,110 It generates 40 power turn, and it can spawn these soldiers. 1015 00:45:31,110 --> 00:45:33,579 It takes 10 turns to spawn a soldier. 1016 00:45:33,579 --> 00:45:36,120 Or it can research upgrades, and I'll talk about the upgrades 1017 00:45:36,120 --> 00:45:38,560 below, in just a minute. 1018 00:45:38,560 --> 00:45:41,510 The soldier has an upkeep of 1 to 2 power per turn, 1019 00:45:41,510 --> 00:45:43,240 depending on byte code usage. 1020 00:45:43,240 --> 00:45:45,280 It automatically distributes its attack power 1021 00:45:45,280 --> 00:45:47,830 among adjacent enemy units. 1022 00:45:47,830 --> 00:45:50,220 And it has the capability of laying 1023 00:45:50,220 --> 00:45:54,410 mines, which take 25 turns to lay a mine. 1024 00:45:54,410 --> 00:45:57,380 Defusing mines, which take 5 turns, and capturing 1025 00:45:57,380 --> 00:45:58,797 encampments, which takes 50 turns. 1026 00:45:58,797 --> 00:46:00,255 Now you might ask, all right, where 1027 00:46:00,255 --> 00:46:01,430 am I getting these numbers? 1028 00:46:01,430 --> 00:46:03,400 I'm assembling this sort of convenient 1029 00:46:03,400 --> 00:46:05,050 diagram but what if the specs change? 1030 00:46:05,050 --> 00:46:06,675 You know, where do I get these numbers? 1031 00:46:06,675 --> 00:46:09,740 Well they're all under game constants under robot type 1032 00:46:09,740 --> 00:46:11,730 enum, or the upgrade enum, and you'll 1033 00:46:11,730 --> 00:46:13,470 find them all the Java docs. 1034 00:46:13,470 --> 00:46:15,250 Alternatively, you could all always 1035 00:46:15,250 --> 00:46:18,080 ask us where they are by going on our IRC chat, 1036 00:46:18,080 --> 00:46:21,780 or talking to one of us in person. 1037 00:46:21,780 --> 00:46:24,620 So you can see here they're laying mines, defusing mines, 1038 00:46:24,620 --> 00:46:25,950 capturing encampments. 1039 00:46:25,950 --> 00:46:29,340 And in the act of capturing one of these encampments, which 1040 00:46:29,340 --> 00:46:33,870 is a pre-existing location on the map, these black circles. 1041 00:46:33,870 --> 00:46:37,600 In the act of capturing one of those-- 1042 00:46:37,600 --> 00:46:39,970 there's nothing magical about it. 1043 00:46:39,970 --> 00:46:43,020 Because here, among the robot controller methods, 1044 00:46:43,020 --> 00:46:45,690 you'll find capture encampment. 1045 00:46:45,690 --> 00:46:47,900 And what you'll do is you'll specify what type 1046 00:46:47,900 --> 00:46:49,600 of enchantment you want it to be. 1047 00:46:49,600 --> 00:46:51,459 And you might ask, what types are there? 1048 00:46:51,459 --> 00:46:53,250 Well, you could either look at handy chart, 1049 00:46:53,250 --> 00:46:55,430 or you could click here, under robot type. 1050 00:46:55,430 --> 00:46:58,130 And this enum robot type will show you the types 1051 00:46:58,130 --> 00:46:59,590 that you can build. 1052 00:46:59,590 --> 00:47:03,000 You can build artillery, generator, medbay, shields, 1053 00:47:03,000 --> 00:47:04,130 and supplier. 1054 00:47:04,130 --> 00:47:06,990 The headquarters and soldier are different. 1055 00:47:06,990 --> 00:47:09,224 They're not built from encampments. 1056 00:47:09,224 --> 00:47:11,640 I don't know if that's written anywhere, but I've said it, 1057 00:47:11,640 --> 00:47:13,720 so now you know it. 1058 00:47:13,720 --> 00:47:16,490 Yeah. 1059 00:47:16,490 --> 00:47:20,020 So that's how you're going to be able to build these units, that 1060 00:47:20,020 --> 00:47:20,800 are shown here. 1061 00:47:20,800 --> 00:47:26,460 So the medbay heals adjacent robots, 2 hit points per turn. 1062 00:47:26,460 --> 00:47:30,240 You can see that's their quote, "attack power," because attack 1063 00:47:30,240 --> 00:47:31,840 is a lot like healing. 1064 00:47:31,840 --> 00:47:35,560 You know, modern surgery, you can use scalpel and such. 1065 00:47:35,560 --> 00:47:37,359 These are also considered weapons. 1066 00:47:37,359 --> 00:47:39,400 I'm sure you couldn't bring a scalpel on a plane. 1067 00:47:39,400 --> 00:47:43,150 So attack is a really good word for healing-- a healing unit. 1068 00:47:43,150 --> 00:47:49,398 And if you don't believe me talk to any medicine man you know. 1069 00:47:49,398 --> 00:47:53,530 Shields will give all adjacent robots 1070 00:47:53,530 --> 00:47:54,880 5 shield points per turn. 1071 00:47:54,880 --> 00:47:56,930 So if you cluster 8 units around them, 1072 00:47:56,930 --> 00:48:00,090 then that'll go ahead and give 40 shield points distributed 1073 00:48:00,090 --> 00:48:04,820 among them, to the extent that 5 times 8 is 40. 1074 00:48:04,820 --> 00:48:08,170 The shields only protect you from artillery, though. 1075 00:48:08,170 --> 00:48:12,920 They don't protect you against other soldiers. 1076 00:48:12,920 --> 00:48:14,540 Now, these robots that are shielded 1077 00:48:14,540 --> 00:48:17,810 will lose 1 shield point per turn, as it wears off. 1078 00:48:17,810 --> 00:48:20,610 But there's no cap on the amount of shields they can have. 1079 00:48:20,610 --> 00:48:23,847 So they can have, I think, 10 to the 8th shields. 1080 00:48:23,847 --> 00:48:26,305 Which is like a lot more than their total hit points of 40. 1081 00:48:28,850 --> 00:48:29,350 Right? 1082 00:48:29,350 --> 00:48:33,090 So that's effectively infinite. 1083 00:48:33,090 --> 00:48:37,610 The artillery is the one unit that can shoot at a far range. 1084 00:48:37,610 --> 00:48:39,740 It could shoot at a range of 63. 1085 00:48:39,740 --> 00:48:42,680 Now we always talk about squared ranges, 1086 00:48:42,680 --> 00:48:44,950 because that makes it easier to do comparisons 1087 00:48:44,950 --> 00:48:48,610 without having to take a square root. 1088 00:48:48,610 --> 00:48:50,590 Although I guess if we did give you ranges, 1089 00:48:50,590 --> 00:48:52,690 and not squared ranges, you could just square it and then 1090 00:48:52,690 --> 00:48:54,898 compare it to the range that you had just calculated. 1091 00:48:57,500 --> 00:48:59,670 this way works really well. 1092 00:48:59,670 --> 00:49:03,210 So what I can do is I can demonstrate for you what that 1093 00:49:03,210 --> 00:49:06,100 looks like by opening up-- oh my goodness, 1094 00:49:06,100 --> 00:49:07,250 I'm almost out of time. 1095 00:49:07,250 --> 00:49:11,810 I can open up this stockpiling-- no, that's not right. 1096 00:49:11,810 --> 00:49:16,980 I made it in the map maker program, down here. 1097 00:49:16,980 --> 00:49:21,700 Yeah, so this shows you what 63 looks like. 1098 00:49:21,700 --> 00:49:24,957 So if you're here in the middle, you can see all of these tiles 1099 00:49:24,957 --> 00:49:26,415 but you can't see the ones outside. 1100 00:49:28,990 --> 00:49:31,500 But its site range is only 14. 1101 00:49:31,500 --> 00:49:35,220 Every robot has a site range of 14, As you can see here, 1102 00:49:35,220 --> 00:49:36,970 in this document. 1103 00:49:36,970 --> 00:49:41,180 So the attack range is 63, the site range is 14. 1104 00:49:41,180 --> 00:49:43,670 So, this is one of those cases where 1105 00:49:43,670 --> 00:49:48,480 you'd need scouting units that would know what to shoot at. 1106 00:49:48,480 --> 00:49:51,510 And it's really helpful that you have this global information. 1107 00:49:51,510 --> 00:49:54,340 Because you don't need to post to radio 1108 00:49:54,340 --> 00:49:57,760 to tell the artillery what to shoot at. 1109 00:49:57,760 --> 00:50:00,210 Because he can already see all of the unit 1110 00:50:00,210 --> 00:50:01,750 that your allies can see. 1111 00:50:01,750 --> 00:50:03,990 He can't necessarily see the enemies, 1112 00:50:03,990 --> 00:50:06,510 unless your guys are nearby. 1113 00:50:06,510 --> 00:50:09,590 So, yes, the artillery does 40 damage to the target 1114 00:50:09,590 --> 00:50:13,690 that it specifies, and 20 splash damage to adjacent tiles. 1115 00:50:13,690 --> 00:50:15,240 And that does include friendly fire, 1116 00:50:15,240 --> 00:50:18,420 so you've got to be careful about where you shoot. 1117 00:50:18,420 --> 00:50:21,230 The generator generates 10 resources per turn. 1118 00:50:21,230 --> 00:50:23,460 And that resource is power. 1119 00:50:23,460 --> 00:50:25,790 So that's added on to your headquarter power. 1120 00:50:25,790 --> 00:50:27,390 So if you build a bunch of generators, 1121 00:50:27,390 --> 00:50:30,250 you can support more soldiers. 1122 00:50:30,250 --> 00:50:32,010 And finally, the supplier will reduce 1123 00:50:32,010 --> 00:50:34,350 the build time for soldiers by 5%. 1124 00:50:34,350 --> 00:50:35,820 And that's multiplicative. 1125 00:50:35,820 --> 00:50:38,680 So if you have two suppliers, then it's 1126 00:50:38,680 --> 00:50:45,470 0.95 squared times 10 turns. 1127 00:50:45,470 --> 00:50:47,830 This year, we give you the opportunity 1128 00:50:47,830 --> 00:50:51,180 of building upgrades as well, researching upgrades 1129 00:50:51,180 --> 00:50:52,800 at your headquarters. 1130 00:50:52,800 --> 00:50:55,170 So your headquarters is your central unit, 1131 00:50:55,170 --> 00:50:58,020 the goal is to defeat the enemy headquarters. 1132 00:50:58,020 --> 00:51:00,560 To do that, you could just walk your robots on over 1133 00:51:00,560 --> 00:51:01,600 and kill them dead. 1134 00:51:01,600 --> 00:51:05,380 It's not required that you research upgrades 1135 00:51:05,380 --> 00:51:06,520 and built encampments. 1136 00:51:06,520 --> 00:51:07,936 And that's one of the ways that we 1137 00:51:07,936 --> 00:51:10,480 make the competition somewhat easier to enter, 1138 00:51:10,480 --> 00:51:13,310 easier to get something that works. 1139 00:51:13,310 --> 00:51:15,220 But if you want to research upgrades, 1140 00:51:15,220 --> 00:51:17,440 to make a strategy that's tailored 1141 00:51:17,440 --> 00:51:20,240 around a certain approach, then you can get these. 1142 00:51:20,240 --> 00:51:23,320 The future upgrade reduces your energy decay 1143 00:51:23,320 --> 00:51:27,860 because the way that you hold power, 1144 00:51:27,860 --> 00:51:30,060 is that you can't just mass it up indefinitely. 1145 00:51:30,060 --> 00:51:33,190 You get a power income from your headquarters, 1146 00:51:33,190 --> 00:51:37,590 and you spend power to upkeep your soldiers. 1147 00:51:37,590 --> 00:51:40,140 But we don't want that-- if you have no soldiers 1148 00:51:40,140 --> 00:51:42,030 and you're just getting income, we 1149 00:51:42,030 --> 00:51:43,790 don't want that to go up indefinitely. 1150 00:51:43,790 --> 00:51:46,010 So every turn that gets multiplied 1151 00:51:46,010 --> 00:51:49,260 by a number that reduces it. 1152 00:51:49,260 --> 00:51:53,510 So the energy decay, or the loss is 20%. 1153 00:51:53,510 --> 00:51:56,520 But if you research fusion, the loss is only 1%. 1154 00:51:56,520 --> 00:51:58,680 So then you might think of stockpiling energy 1155 00:51:58,680 --> 00:52:00,740 and then spending it all at once to get a larger 1156 00:52:00,740 --> 00:52:04,150 burst of robots, which couldn't be sustained for a long time. 1157 00:52:04,150 --> 00:52:08,530 But then again, you only have to win one second. 1158 00:52:08,530 --> 00:52:12,240 Finally, the-- OK, so then there's more upgrades. 1159 00:52:12,240 --> 00:52:15,320 Vision upgrade extends your squared vision from 10 to 32. 1160 00:52:15,320 --> 00:52:18,050 This should say 14, but as you know everything 1161 00:52:18,050 --> 00:52:20,960 is always up to date 100 percent of the time. 1162 00:52:20,960 --> 00:52:23,490 So here's a demonstration of what that would look like. 1163 00:52:23,490 --> 00:52:26,380 Here's 10 and here's 32. 1164 00:52:26,380 --> 00:52:28,570 Boom, what a big difference. 1165 00:52:28,570 --> 00:52:30,110 That's quite a lot more vision. 1166 00:52:30,110 --> 00:52:33,770 That's important because you can defuse any mine 1167 00:52:33,770 --> 00:52:37,160 within your site range if you have the diffusion ability. 1168 00:52:37,160 --> 00:52:40,290 Which is not to be confused with chemical diffusion, which 1169 00:52:40,290 --> 00:52:41,810 is something else. 1170 00:52:41,810 --> 00:52:43,590 Yes, this is for defusing things, 1171 00:52:43,590 --> 00:52:45,512 and it is spelled correctly. 1172 00:52:45,512 --> 00:52:48,484 [AUDIENCE LAUGHTER] 1173 00:52:48,484 --> 00:52:50,900 PROFESSOR: So yeah, that extends your mine defusing range. 1174 00:52:50,900 --> 00:52:52,820 That's pretty important, but keep in mind 1175 00:52:52,820 --> 00:52:57,420 that you can still only defuse one at a time. 1176 00:52:57,420 --> 00:53:00,729 So you have to select which one you're going to defuse. 1177 00:53:00,729 --> 00:53:01,770 And then you defuse that. 1178 00:53:01,770 --> 00:53:03,640 Now, it's important to note that you 1179 00:53:03,640 --> 00:53:06,780 can see where-- I've said that you see your allied mines. 1180 00:53:06,780 --> 00:53:12,130 I haven't said that you can see your neutral mines as well. 1181 00:53:12,130 --> 00:53:15,680 But you don't see enemy mines until one of your robots 1182 00:53:15,680 --> 00:53:17,350 has stepped on it. 1183 00:53:17,350 --> 00:53:21,990 So that means that you can't-- I don't think you can defuse 1184 00:53:21,990 --> 00:53:23,520 something you can't see. 1185 00:53:23,520 --> 00:53:27,630 But actually I don't know, I'll have to check with that. 1186 00:53:27,630 --> 00:53:29,420 Because it may be that you could just spam 1187 00:53:29,420 --> 00:53:32,620 defuse on terrain that you don't know. 1188 00:53:32,620 --> 00:53:36,370 And that might actually defuse things that you can't see. 1189 00:53:36,370 --> 00:53:39,930 At the same time, that's not a fantastic strategy, 1190 00:53:39,930 --> 00:53:41,870 because defused takes 5 turns. 1191 00:53:41,870 --> 00:53:44,410 And during those 5 turns you cannot attack. 1192 00:53:44,410 --> 00:53:47,440 So that leaves you-- or can you attack? 1193 00:53:47,440 --> 00:53:48,875 I'm thinking maybe you can attack. 1194 00:53:48,875 --> 00:53:49,666 [AUDIENCE LAUGHTER] 1195 00:53:49,666 --> 00:53:52,165 PROFESSOR: You know what, you can't-- it's a very vulnerable 1196 00:53:52,165 --> 00:53:54,260 position, to be defusing something. 1197 00:53:54,260 --> 00:53:56,231 Because you're concentrating on something else. 1198 00:53:56,231 --> 00:53:57,980 How do you going to perform as effectively 1199 00:53:57,980 --> 00:54:00,280 on a different task? 1200 00:54:00,280 --> 00:54:01,950 Pickaxe is the tool that you really 1201 00:54:01,950 --> 00:54:04,050 need if you want to lay a ton of mines. 1202 00:54:04,050 --> 00:54:07,760 Because instead of laying just one mine, where your robot is-- 1203 00:54:07,760 --> 00:54:09,354 I guess I'm going to have to come up 1204 00:54:09,354 --> 00:54:11,314 with a system for describing robot-- 1205 00:54:11,314 --> 00:54:12,480 that's sort of like a robot. 1206 00:54:12,480 --> 00:54:14,630 Maybe it's a Chinese character. 1207 00:54:14,630 --> 00:54:16,240 So that's a robot, and ordinarily he 1208 00:54:16,240 --> 00:54:18,740 would lay a mine here, but if you have pickaxe, 1209 00:54:18,740 --> 00:54:22,300 he will lay mines in all of these positions 1210 00:54:22,300 --> 00:54:25,110 for the same cost of laying just one mine. 1211 00:54:25,110 --> 00:54:26,250 Pretty useful to have. 1212 00:54:28,770 --> 00:54:30,130 And it takes the same amount. 1213 00:54:30,130 --> 00:54:33,090 So laying a mine cost 25 rounds, defusing 1214 00:54:33,090 --> 00:54:35,219 a mine costs five rounds. 1215 00:54:35,219 --> 00:54:36,260 So you could do the math. 1216 00:54:36,260 --> 00:54:38,210 If you have pickaxe, you could lay them 1217 00:54:38,210 --> 00:54:40,530 as fast as the other team can defuse them, 1218 00:54:40,530 --> 00:54:44,210 provided you can get into an open space where you can do it. 1219 00:54:44,210 --> 00:54:48,040 Realistically they might be able to encroach, and get you 1220 00:54:48,040 --> 00:54:49,630 during that time. 1221 00:54:49,630 --> 00:54:52,160 And why do you want to lay mines? 1222 00:54:52,160 --> 00:54:53,950 Doesn't that slow the game down? 1223 00:54:53,950 --> 00:54:55,800 Doesn't that mean that things will just 1224 00:54:55,800 --> 00:54:58,640 move to slowly, make it a boring thing to watch? 1225 00:54:58,640 --> 00:55:01,270 I would say no, because during that time 1226 00:55:01,270 --> 00:55:04,190 you could be researching the nuclear missile. 1227 00:55:04,190 --> 00:55:05,500 That's right. 1228 00:55:05,500 --> 00:55:07,200 That's right, we knew that it would 1229 00:55:07,200 --> 00:55:12,830 be interesting to watch players build nuclear missiles. 1230 00:55:12,830 --> 00:55:14,670 If you research that, you win immediately. 1231 00:55:14,670 --> 00:55:15,540 So-- 1232 00:55:15,540 --> 00:55:17,400 [AUDIENCE LAUGHTER] 1233 00:55:17,400 --> 00:55:19,000 That's yet another fun way to win, 1234 00:55:19,000 --> 00:55:22,950 and I'm going to show you an example of somebody attempting 1235 00:55:22,950 --> 00:55:24,020 to win that way. 1236 00:55:27,230 --> 00:55:29,380 This will only take as much time as it took me 1237 00:55:29,380 --> 00:55:31,510 the last time I tried to do it. 1238 00:55:31,510 --> 00:55:34,360 It's under-- golly, you won't have nearly-- oh, it's right 1239 00:55:34,360 --> 00:55:35,380 here. 1240 00:55:35,380 --> 00:55:38,960 It must be so hard to watch me, because it's like, oh man, 1241 00:55:38,960 --> 00:55:40,830 he's looking right at it. 1242 00:55:40,830 --> 00:55:43,580 Let's see, so let's put do nothing bot-- 1243 00:55:43,580 --> 00:55:47,980 because that's a decent match for the nuke bot. 1244 00:55:47,980 --> 00:55:48,680 Where is he? 1245 00:55:48,680 --> 00:55:49,305 Is he not here? 1246 00:55:49,305 --> 00:55:50,390 AUDIENCE: No, he's in the middle. 1247 00:55:50,390 --> 00:55:51,050 PROFESSOR: He's in the middle. 1248 00:55:51,050 --> 00:55:52,258 Oh, I'm looking right at him. 1249 00:55:52,258 --> 00:55:53,010 All right. 1250 00:55:53,010 --> 00:55:57,080 All right, well it's by no means a foregone conclusion 1251 00:55:57,080 --> 00:56:00,070 who wins this match. 1252 00:56:00,070 --> 00:56:01,910 This is an old version of the code where 1253 00:56:01,910 --> 00:56:05,670 nuking took 1,000 turns instead of 400 turns. 1254 00:56:05,670 --> 00:56:08,670 But that's not to say that the red team will necessarily 1255 00:56:08,670 --> 00:56:11,120 win on turn 1,000. 1256 00:56:11,120 --> 00:56:12,150 Oh wait. 1257 00:56:12,150 --> 00:56:14,130 It could only take 400 turns wait a minute. 1258 00:56:14,130 --> 00:56:16,550 Oh, that's 1,000 and this was-- OK yeah, hey! 1259 00:56:16,550 --> 00:56:17,650 It happened. 1260 00:56:17,650 --> 00:56:18,860 There you go. 1261 00:56:18,860 --> 00:56:21,260 So yeah, the nuclear missile has-- I mean, 1262 00:56:21,260 --> 00:56:23,986 it's not a very impressive graphic. 1263 00:56:23,986 --> 00:56:27,904 [AUDIENCE LAUGHTER] 1264 00:56:27,904 --> 00:56:29,570 PROFESSOR: It's technically the same one 1265 00:56:29,570 --> 00:56:31,370 we use for every other explosion. 1266 00:56:31,370 --> 00:56:33,710 [AUDIENCE LAUGHTER] 1267 00:56:33,710 --> 00:56:37,710 PROFESSOR: But I think what we'll do is for the finals, 1268 00:56:37,710 --> 00:56:40,510 we've got a new match visualizer. 1269 00:56:40,510 --> 00:56:42,160 So this was an old version of the code, 1270 00:56:42,160 --> 00:56:44,618 because of course I wouldn't show you something up to date. 1271 00:56:44,618 --> 00:56:46,935 That would be that help you instead of hinder you. 1272 00:56:46,935 --> 00:56:49,490 And what we're trying to do is train you to be amazing. 1273 00:56:49,490 --> 00:56:51,961 And it's working, I swear. 1274 00:56:51,961 --> 00:56:54,210 So what I'll do is I'll show this version of it, which 1275 00:56:54,210 --> 00:56:56,327 is great, because it shows the thing researching. 1276 00:56:56,327 --> 00:56:58,160 All right, well later versions of the client 1277 00:56:58,160 --> 00:56:59,535 that you're going to receive will 1278 00:56:59,535 --> 00:57:02,360 show what things are researching in the client window. 1279 00:57:02,360 --> 00:57:05,914 And I think it really would not be in an excessive-- 1280 00:57:05,914 --> 00:57:07,580 the pizza should be arriving any moment, 1281 00:57:07,580 --> 00:57:09,413 so I know that the gurgling of your stomachs 1282 00:57:09,413 --> 00:57:14,780 is totally reasonable and will be resolved imminently. 1283 00:57:14,780 --> 00:57:18,610 If I run this version, then I think-- let's see, 1284 00:57:18,610 --> 00:57:21,574 is there-- so let's put do nothing against the nuke guy. 1285 00:57:21,574 --> 00:57:22,740 Is the nuke guy still there? 1286 00:57:22,740 --> 00:57:24,060 He is, OK. 1287 00:57:24,060 --> 00:57:26,360 So this version of the map viewer shows 1288 00:57:26,360 --> 00:57:27,830 researches that are going on. 1289 00:57:27,830 --> 00:57:28,330 Yeah. 1290 00:57:28,330 --> 00:57:31,870 And you can see he's researching pickaxe, diffusion, sight 1291 00:57:31,870 --> 00:57:34,770 range, the fusion thing that reduces 1292 00:57:34,770 --> 00:57:35,960 the amount of energy loss. 1293 00:57:35,960 --> 00:57:37,710 He's researching everything. 1294 00:57:37,710 --> 00:57:39,870 And whereas the other do nothing guy-- you know, 1295 00:57:39,870 --> 00:57:42,740 you could describe him as a pacifist. 1296 00:57:45,945 --> 00:57:48,820 The philosophy that he is developing, 1297 00:57:48,820 --> 00:57:53,220 using three bytecodes per round, may change the world. 1298 00:57:53,220 --> 00:58:00,290 So I see no reason to hate on his choice of vocation. 1299 00:58:00,290 --> 00:58:02,820 I would definitely not-- yeah, no, definitely. 1300 00:58:02,820 --> 00:58:03,340 OK. 1301 00:58:03,340 --> 00:58:05,800 So you can see here that nuke is researching. 1302 00:58:05,800 --> 00:58:08,540 So in a tournament scenario we could all 1303 00:58:08,540 --> 00:58:11,252 start getting excited and going ohhhhh! 1304 00:58:11,252 --> 00:58:12,210 What's going to happen? 1305 00:58:12,210 --> 00:58:13,510 Is it going to be close? 1306 00:58:13,510 --> 00:58:14,957 And that sort of thing. 1307 00:58:14,957 --> 00:58:16,540 I mean of course at the end it's going 1308 00:58:16,540 --> 00:58:18,290 to be a bit of an anti-climax because it's 1309 00:58:18,290 --> 00:58:20,390 going to show a little puff ball, 1310 00:58:20,390 --> 00:58:23,640 like somebody made popcorn on one tile. 1311 00:58:23,640 --> 00:58:27,020 But we'll be able to overcome that because we can just 1312 00:58:27,020 --> 00:58:30,115 switch to YouTube and show a clip 1313 00:58:30,115 --> 00:58:33,640 of some giant nuclear test. 1314 00:58:33,640 --> 00:58:36,020 All right, that's all I have for you now. 1315 00:58:36,020 --> 00:58:38,850 I mean to say that we're going to show 1316 00:58:38,850 --> 00:58:40,130 you a whole bunch of things. 1317 00:58:40,130 --> 00:58:42,680 You can get up and go, I know a lot of you 1318 00:58:42,680 --> 00:58:47,460 have appointments with very attractive young women and men. 1319 00:58:47,460 --> 00:58:48,700 And that's totally OK. 1320 00:58:48,700 --> 00:58:52,760 But I recommend that you stick around, eat some pizza, 1321 00:58:52,760 --> 00:58:54,770 hear about how to set up Battlecode. 1322 00:58:54,770 --> 00:59:02,030 And know that we will have our developer testing code up. 1323 00:59:02,030 --> 00:59:05,550 The team name, here on the Battlecode website. 1324 00:59:05,550 --> 00:59:07,900 You can see here, team list. 1325 00:59:07,900 --> 00:59:12,164 We just made a team that you can use to test your code against. 1326 00:59:12,164 --> 00:59:13,455 That's down here at the bottom. 1327 00:59:20,370 --> 00:59:21,850 It's test, somewhere. 1328 00:59:21,850 --> 00:59:23,300 Yeah, Teh Devs Test, there you go. 1329 00:59:23,300 --> 00:59:26,307 Did you guys make this many teams in the last 2 seconds? 1330 00:59:26,307 --> 00:59:26,890 You must have. 1331 00:59:26,890 --> 00:59:29,110 You know, it's important to multitask. 1332 00:59:29,110 --> 00:59:32,490 Yeah, so you can upload your player 1333 00:59:32,490 --> 00:59:35,860 and test it against Teh Devs test player. 1334 00:59:35,860 --> 00:59:37,460 And that'll be available all the time, 1335 00:59:37,460 --> 00:59:40,060 and that's probably sort of your first step 1336 00:59:40,060 --> 00:59:42,060 on your road to success. 1337 00:59:42,060 --> 00:59:45,370 Thank you very much for coming, and if you have any questions 1338 00:59:45,370 --> 00:59:49,110 you can come to us after. 1339 00:59:49,110 --> 00:59:50,660 [APPLAUSE]