12/23/2016

dota2


welcome to our first daughter to reporttoday were hanging out on the radiance sightseeing with the diverse is allabout with me to help us learn today is anteenage hello so are you called the anti mage i don't like magic and why is thatit all started long ago this year card the battle the battle has begun take methrough this what are we trying to do our goal is to destroy the diet each andwe will do so by sending are melee and ranged forces sounds like a good playerfor frontal assault with your army of creeps well actually we're going to send at the exact same time they send theirthere

you're just going to have to accept thisand move on now we want to kill creeps delivering the killing blow in order togain goal give it a try barry nights now rinse and repeat oh right we've got our bell tea bottleritems were ready to go nowhere lol party this is a team game i've decided i want to far more you takethis town portal scroll and go help the bottom lane yes thanks i'll use thispiece of paper to get over to the bottom lane what makes him think this is going tohelp the grand magus magic paper please

take me as far away from here is you cannow now now now now there now you'll come this way we have anothernice little clearing here to check out there is a lot of space to stand i wouldreally recommend staying here i think it would be a good idea it is a niceneighborhood with good schools and there will be no surprise visitsfrom anyone trying to kill you for your goal dark requested is done thank you you didunderstand this needed to be to a new report with me today is the oneand only you mir

the tasca yippies it is mr tusk whatbrings you to these defending these agents this is a terrible barrier shouldno longer make your five hundred goal we accepted to weezer turned into a giantsnowball beating everybody into tv delivery andmore cooper tejan so how do you think the competition has been so far ourchristian see that coming jus wanna go meet dazzle a mighty support healer we see dazzle placing an observer boredas a good support should very good here we see dazzled 29 creeks support shoulddoesn't look dazzle your ward spotted a

double damage room in the river yourmiddle name buddy pudge may want to bottle it then again your teammate mayscrew this up you better take it just to be sure is now in the hands of a moronto help your team as a good support should you're gonna need to build itemsin order to help your team that are just some last year as any good support wouldnot look joined the fray and helped her team if any health is low a good support would perform untilsecurity to ensure that it does pass on to your team may not know it but they'reonly going to win because of you disregard any requests by a flyingcareer as that would interrupt her farm

looks like you're heading toward awindow with your health will support your team will achieve victory hello and welcome to a new dota 2 reporti decided i'm probably not suited for combat so i'm gonna try meaning one ofthe shop's customer got this recipe so ring looks like you got any of thosesure do it looks like you don't have any space inventory just so how does thatget turned into sure what about the instruction manual look up small you are welcome to anecdote to report itslightly hectic right now as one of the

towers is under attack let's see what happens as the team triesto defend it wow to report the team is refreshed andready to go for this game i'm going to try to be the career that makes room forriddick boy already today that i change todayshow so let me get the kids that way i canstraight up by a part of life best i've read it in this guide yeah yeah yeah

jury returned my team and children areyou going to be hard windrunner you're going down and then come help us bringher to just i'm on my way she's nice to you did it come thru 800 we did it thank you so much for this stuff ofwizardry so how's this thing going but it could be worse my opponents here's the bottle you ordered so how'sthis going we'll see i looked at the beer actually

guys i know here and he should havecalled missing but he really feels bad about it and i know if you give back insome friendly advice and will let him know he should have done everyone toimprove here guys in order to win to make some changes have you guys everseen you know good people play do what they did if we're going to win this game i'mgoing to need more golden this year thank you very much about that i'll show you all the reason your sorry ass hole withthis game watch as he protects i god

damn homie should this amazing piece ofmachinery doesn't need anyone to question himself as if to say everyoneship has unlimited supply of dr rocks will not be stopped treat bags itself useful and more waysthat you can pick us do you want to last hit this kind of alt possible are youangry yes i want to destroy that pesky tower going because now you know howmuch more valuable accountable to us well i was a top tower has fallen how'sthat cold case i believe it you do it right protection ok

has been denied hello and welcome to a new reportunfortunately today i have to break some bad news to prove it yes sorry to have to tell you this butit looks as though you've been removed completely from dota 2 yeah you're doneyou're not in the game anymore you're boring and your skill set is bland justget out of here no one likes you uninstall also sober up prepared to be vanquished dyess gatheredmy eye i have farming bombed baseless boy i thought you would like tosee more i have mastered the ancient art

ok no prob so how did you paid the who who did youpay unique items in the smoke of deceit right here lovely thank you this way over there okay no scared i got to try to push report the lanes are all pushed to theteam has decided it would be an opportune time to challenge the mightyboosh on in your dreams

across the work no everyone a lot of time range and stupid but ihave come to learn that there are two things that i know to be absolutely trueone is that this is a team game to everyone is an idiot so i hope thisworks one shot you would need to perform yourindividual combat each of us will die i have complete faith 22 everybody

i know how this turns out i just doingwhatever you're doing this whole time i would recommend i just yet but seriously their numbers i you're just going tohave to accept

android games


pruett: hi, folks.so, this is building aggressivelycompatible android games. and you're allin the right spot. great.nobody got [indistinct]. hi.my name is chris. i am the ceo of a companycalled robot invader, which isa mobile game developer for androidand other mobile platforms. and actually,up until about a month ago,

i was a google employee. i workedon the android team as a developer advocatefor game developers. my role was basically to goto game developers and say, hey, you should makea cool game for android, and here,here's how to do it. i'll help you do it. if you've been to previous ios,you might have seen me or if you ever, you know,watch io sessions on youtube,

i've spoke a couple of timesabout a game that i built while at googlecalled replica island. this talk is not aboutreplica island. this talk is about games that are aggressively compatibleacross devices. but i think that replica islandfits that description and so i'm going to reference itin my talk and try to, you know, use itas a case study of how a game can runon everything.

so like i said, the topic todayis device diversity and we all knowthat there are a lot of android devicesout there, and guess what? the common factor is that on every single oneof those devices, every single oneof those devices is owned by somebody who wouldlike to play video games. and they would probablylike to pay you money to play those video games,

and that's why you should beinterested in this. replica island,i released about a year ago, it's getting close to 2 millioninstalls at this point. we're not quite there yet.but it's doing pretty well. the ratingsare pretty good. and i think that,um, part of the reason that it's beenas successful as it is is that it runson all of these phones. you know, we've gotover here on one side,

we got the g1. that's pretty muchthe minimum spec. i put the nexus sas the high end, although they arevery quickly phones that are coming outthat are faster than that. but that's the range, right?it runs on all those phones. it doesn't just run onthose phones, actually. it runs onall these phones too. i tried to get this slideto go faster,

and this is the maximum speed that keynote would allow meto show these phones to you. there's a lot of them. there's like, 160 or something,the last time i checked. and actually, that data pointis probably three months old, which is an eonin this industry. it runs onall these devices. and actually, this isnot an exhaustive list. there's quite a number ofandroid phones out there today

that replica islandworks fine on. oh, yeah. it runs on tabletsand tvs and stuff too. i didn't really plan this. i, of course, i wantedthe game to run on everything but when i wrote the game, you know,it was designed for a g1. that was the platformthat i was building it on. it just turned out that i madesome correct assumptions

and because i madethose correct assumptions, it was very easy to runon all devices and in a couple of cases,extend what i'd already written to work on all devices. so today i'll tell you aboutwhat those assumptions were and how you can replicatethat on your own games. there's also a bunch of stuffthat i did for replica island that isn't relevantany longer. for example, i spent a long timeon java optimization.

java optimizationmatters a whole lot if you are targeting a g1. it doesn't matter very muchanymore for any other device, and there's two reasonsfor that. one, java has gottena whole lot faster with different versionsof android, and number two, the phones havegotten a whole lot faster. actually, i'll saythree reasons. number three is,how many game developers

do we actually havein the room here who are writing games right now? okay. okay.that's a pretty good number. how many of youare writing them in java? how manyare using dalvik in the java languageto build your games? yeah, that's right. how many of you are usingc++ and ndk, right? okay. so, that's why java optimizationdoesn't matter any longer.

and i'm not gonnatalk about it. dalvik is really fast. if you want to do that, you can. i'll skip it in this talk. before we start talking aboutdiverse diversity, you need to understand how the android compatibilityprogram works. so, let's do anothershow of hands. how many peopleactually knew

that android hasa compatibility program? okay.that's not bad. what? 30%, maybe? yeah, android hasa compatibility program. and if you want to buildan android device that's considered compatible,you have to pay attention to it. this is an open sourceprogram. you can go check the spec out,you know, online. it's compatibility.android.com

and you can read throughthe whole spec. and any android phone that'sgonna be considered compatible has to meet that spec. it's pretty detailed too. i mean, it givesa device manufacturer areas where they can makemodifications. like, say they want to havea different sized screen. well, there's a rangeof screen sizes that you can support

and still be consideredandroid compatible, but it goes intoa lot of detail about what you canand cannot do. and the purpose of this specis to require that peoplewho are building phones to build phones that aregonna run applications for android marketthat are written correctly. so, remember,i had mentioned, you know, all these phones back here?

well, guess what?they're all compatible. every single one of these has met the androidcompatibility spec. well, how do weenforce that? right? how does--how do you knowif a device has passed this arbitraryopen source spec? well, google providessomething called cts, which is a compatibilitytest suite. this is about20,000 plus tests

that a device manufacturercan download. it's also open source,can run on their device and get output from. and that output basically says,yes, i passed, or no, i did not. and if there were failures,it says, well, you screwed this up,and you screwed this up, and you screwed this up. and if the oem doesn't go backand correct those failures,

then there's no chance for themto access google services like android marketand gmail and maps. these services are not partof the android open source. they are given to oems on thecondition that they pass cts. so, if you don't havea compatible device, you don't have any of theseinstalled. another way to think about thatfrom a developer's perspective is that you're usingandroid market as your distribution platform,

you're guaranteed that you'reonly going to be distributing to devices that have passedgoogle's 20,000 tests that are requiredfor compatibility. so, that's the basis. that's the bedrock stuffyou need to know before thinking abouthow a single binary can be compatible withall these different devices. i'm gonna saythere's three steps to aggressive compatibility.

the first step ischeck your assumptions. i worked witha lot of developers in my role at google who hadtrouble with compatibility, and it wasn't becausethey wrote bad code and it wasn't becausethe devices were broken. it's because they originallywrote that code for some other platform, and they made a bunchof assumptions that were specificto that other platform.

and when they ported the codeover to android, they didn't changethose assumptions, and those assumptionsturned out not to be the same set of assumptions thatyou have to make on android. so, the first point here ischeck your assumptions. the second isfollow the rules. we'll talk aboutwhat these rules are in a little bit of detail. but the main message hereis there are rules

that you must maintainto be compatible, and if you break them you will crashon certain devices. and the third rule ismanage your spec. i'll get into a lot of detailabout that. but basically, you can tellandroid market what kind of requirementsyour application has. there's a secret fourth rulethat's specific to video games, and i'll talk about it later,

but i'm not gonna tell youwhat it is right now. so, let's talk aboutassumptions. there's a lot of weird hardwareout there, right? i mean, there's weird hardwareout there right now. and the thing is,android devices are coming out really,really, really fast. so you can be guaranteedthat whatever is normal today, or whatever is weird today,will be normal tomorrow and something weirderwill have shipped.

and i had that idea in mind when i was working onreplica island. i didn't knowwhat was gonna ship, but i knew that it wasn'tgonna be exactly the same as what had already shipped. and i made fourbasic assumptions that sort of future-proofed myapplication for compatibility. you have to understandthat i shipped replica island, i want to sayjust over a year ago,

and most of those phoneson that mega slide were not out yet. most of those phones shippedafter i released replica island. and without me doing anything,they are still compatible. so, i'm gonna chalk that up tothese sort of basic assumptions that i made. first assumption--there'sno standard for screen size. your screen can be any sizeand it can be any resolution. now, there are requirementsin the spec that i mentioned,

the compatibility spec, that require physical sizeand density, so there's a range that you'regonna be working within, but you can't be guaranteedthat, say, all of your devicesare gonna match 480x320. that's what the g1 is. nor can you be guaranteedthat all devices will match 800x480,or something like that. there's basicallyno standard at all.

and so you need to dealwith that. and the best wayto deal with it is to allow your graphicsto scale. if you're using opengl and if you've attended my otherio sessions in the past-- you should be-- it's very easyto scale your graphics. very often, it can come downto a gl viewport call. in my case, i actually changethe gl viewport,

and i also scale the contentof my scene a little bit to match the aspect ratioof the display. you can see here that atthe 480x320 version of the game, you can see a little bitless to the right than the 800x480 version. a more dramatic example isthe qvga versus fyvga versus the game. same game, same graphics,but what i do is i look at the sizeof the screen at runtime.

i have a fixed heightthat i want to align to that i've fixedfor game design purposes. it's basically 480 pixels tallbecause that's what the g1 had. i scale everything upto match that height and then i allow the leftand right sides of the screen to grow or stretchor stretch or contract. and for my particulargame design, that's completely acceptable. allows the game to runon any device.

if i'd been using, if i'd madea 3d game that has perspective, this would have beena lot simpler. i could just change the viewportto match the display, no problem, just a matrix,no big deal. but if i wasn't using opengl,the actual android layout system has all kinds of toolsfor scaling graphics and moving things aroundand adjusting them. but i think probably most peoplein the room here are using opengl.

key message is notthat it's hard but you have to think about itbefore you write your game. the other thingthat i did correctly but i would do better next time is i shipped one set ofresolution of graphics and i scale up. and the resolutionthat i shipped was hvga. hvga scaled up on a widevga display like a nexus one or galaxy s.

it looks okay. the space, still pretty smallso i can get away with it. when you run replica islandon a zoom, you'll see it looksa little bit pixilated and that's becausepretty low resolution art is being scaled up to apretty large resolution display. so if i were smarterwhen i built this game, what i would have done is madehigher resolution graphics and scaled downon smaller screens.

ship with, say,zoom compliant graphics and then plan to scaleeverything down, you know, when you run on a g1 orwhen you run on the nexus one. that way, scaling downalways looks good. scaling up, not so much. second major assumptionthat i made was that the g1 wasgoing to be the minimum spec. that turned out to bepretty true. there are two devicesin the world

that i know to be slowerthan the g1 for games. those are the htc tattooand htc wildfire, and those devices are slowerbecause they do not have a gpu. game still runson those devices because android providesa software renderer for opengl es1.0 which is what you useif you use the emulator. but as you know,if you use the emulator, it's a little bit slow.

so, game is playableon those devices. it's a little bit slowerthan i'd like, but you know, no big deal. for all intents and purposes,the g1 is the minimum spec. for the vast majority of devicesout there, it doesn't get any slowerthan that. i assumed that opengl, yes,was going to be the fastest way across all devicesto draw 2d content. this turned out to be true,but it's a subtle point.

it's a subtle point becausethe way to draw fast 2d graphics on a nexus one might actually beto use the cpu. that's because the nexus one cpuis really, really fast. it's in fact so fastthat it can outrun its gpu for doing 2d blitz. there are actuallya lot of devices that have really fast cpusthat you can do this on. but it's onlythe high-end devices. i say the nexus one,probably the galaxy s,

those are about the two thati've tested, the nexus s. right? there are devices out therethat have real fast cpus and can--you can renderthe same thing in software faster than you canrender in hardware. but the reason to useopengl es is that you want to becompatible with every device, not just those superfastcpu devices. and generally, the gpuis the way to go.

it is the fastest pathfor rendering 2d concept. i wrote this applicationcalled sprite method test, which is open source. you can search for it if youwant to test this stuff out. but it lets you draw thesame scene with cpu and gpu and, you know,see what the differences are. i also--this ismy fourth assumption. i assumed that all the devices were gonna kind of belike the g1.

i knew that they weregonna change and be faster and have different sizedscreens, but i assumed that they weregonna have a trackball and that they were gonnahave single touch displays like the g1 and that they mighthave a keyboard or not. you know, that was totallyfalse, as we know now, right? there's a whole lot ofdifferent phones out there. and they've got a lot ofdifferent interfaces that people are gonnaplay with.

some of them like the nexus oneactually do have a trackball. some of themhave keyboards. some of them have little dinkyd-pads on those keyboards. some have really nicemultifinger multitouch. some of them are weird, likethis device up in the top left. that has a track padon the back of the display that the xperia playof course, has real game controls,a d-pad and buttons. and then there are devices--so far only one that i know of--

like the original xperia which are problematicfor game developers because it doesn't havereally any hardware buttons except for backand menu and home. it doesn't supportmultitouch. so, where do you putyour game controls? if you have a game you can playwith a single finger, you're all right. but if you are--if you're like my game,

which is--requires at leastmotion and jump, you know, how do you deal with that? well, a solution for me was toprovide customizable controls. this is a solutioni did not come to until after i'd shipped the game'cause like i said, a lot of those devices came outafter i shipped replica island. but in all of the updatesi've made since shipping have been to add morecustomizable controls. so now if you downloadreplica island

and go into the options, you can set up how you wantto control the game with a lot of granularity. breaks down intofour major spots. there's the trackball support, which is the original versionof the controls that i wrote. there's keyboard supportwhich gives me access to things like the xperia playwithout any changes. virtual pad which are for

just buttons on the screenbut requires multitouch. and tilt for devices likethe original xperia that only have single touch. and between these four, i pretty muchseem to have covered all of the devicesin the world. like i said, as far as i know,all devices out there that are compatible and haveandroid market installed you can play this game on.

the original control schemethat i came up with was designed around the idea that some displaysare gonna be single touch. so i had the trackballfor motion and i have these two mutuallyexclusive buttons on the screen for jump and attack, and that way, you never have tohave two fingers on the screen. but nowadays, you know, now we know that there'sa lot more devices out there

that have all kinds ofmultitouch points. so it's probably importantto talk a little bit about the different typesof multitouch screens that are out there. multitouch screens basicallycome in three flavors. there's single touch.right? multitouch. and then there's what i callcrappy multitouch. and crappy multitouchis what my best friend,

the nexus one, has. crappy multitouchis a multitouch display that can--that can detecttwo fingers at the same time. but when those pointersare moving, it can swap the componentsof one pointer for the other in a very specific case. and that case iswhen the two pointers cross the same horizontalor vertical axis. so the caonical problem casefor this type of display

is if you have a fingeron one side of the display and another finger onthe other side of the display and you drag them across, at that vertical linewhere they pass you may getcomponent swapping. so, your x from pointer onemay suddenly become your x from pointer two. and if you're drawing a lineon the display where those fingers are,you'll see them go like this,

which is really frustratingfor game developers because if you want to havea dual stick control scheme-- which i recommendyou not do anyway-- but if you wanted to havea dual stick control scheme, you know, that's gonna betwo fingers that are passingthe same horizontal axis, and you're gonna getcomponent swapping, and it's gonna bevery difficult to control. so you can still deal withcrappy multitouch displays.

my solution was just to get ridof all vertical motion in the fingers...you know, i have a slider that moves left and rightwith one finger and buttonson the other side. and there'sthis horizontal line that they are both on, but they never move verticallyto cross it. and so, this actually workspretty well on the nexus one. in fact, when i showed itto some colleagues

who were aware of the crappymultitouch problem, they were impressed that i was actually ableto get this to work. they thought i'd done somecomplicated heuristic, you know, to unswap my controlpoints or something. nothing like that. just made sure that there wasno vertical motion. couple of other tricksrelated to screens. the back and menu keyson a lot of devices like,

again, my friend, the nexus one,are flush with the display. and that meansif you have buttons on the right sideof the display or you're gonna usea trackball for control, it's pretty easyto slip off the track pad and hit the back or menubuttons. and that's a pretty baduser interface because usually those buttonstake you out of the game. so, for replica island,i ignore those buttons

if they happen to occurwithin 400 milliseconds of a game event. a game event is the usertouched the screen or the user touchedthe trackball. so that means if the user'stouching the screen and they slide offand they hit the back button, nothing is gonna happen, 'cause i'm gonna ignorethat back button. but if they picktheir finger up

and they put it back downon the back button, that actually takes longerthan 400 milliseconds. so the back when we read it,it'll be fine. there's no mis-clicking. you should also be awarethat these devices have really small buses,right? the memory bandwidthis not good. that means loading your textureto vram takes time, and you probably can't do itat runtime.

one solution to that is to usetexture compression. there's about four typesof texture compression in the worldout there today. there's atitc, whichis proprietary to ati devices-- snap dragon, okay,things like that, stuff that qualcomm makesmostly. there's pvrtc, which isproprietary to power vr devices like the droid. there is dxt which you'll findin video devices

like the zoom,also proprietary. there's etc1. etc1 is a non-proprietary formatthat's supported by all devices that support opengl es2.0. so it's great.you can use it. its fatal flaw isthat it doesn't support alpha. you can't havean alpha channel or do any sort of transparencywith etc1. so, some developers arereally tricky. right?

some developers have shown methat they take their colormap and they take their alpha mapand they save it as two different texturesand they put them back together in the shader. solved. okay. you know, or you canchoose to do what i did which is just not compressyour textures. i was actually able to fitthe whole game uncompressed in vram, so didn'thave to worry about it.

but if you are not like me,and you're worried about fitting into vramon all devices, you should be aware that texturecompression is device specific. now, there is a little solutionthat's better than etc1 that we'll talk aboutin a little bit. but you should know thatif you do decide to use etc1, opengl es represents a 2.0,which is what is required. it represents the vast majorityof devices out there, over--greater than 70%.

there's some question markson this slide because the parsing tool we usedto generate this data, like, totally failed. but even if we assignedopengl es1.0 to that question mark part, we could see that the vastmajority of devices are 2.0 capable. so if you want to rely onsomething like etc1, you can safely do it.

same goes foropengl extensions. extensions are a system by which the opengl speccan be extended. they're optional. some hardware's going tosupport them, some is not. there's a gl extension stringwhich contains at runtime which extensionsa current device supports, and you can query that. you should definitely do itbefore using any extensions,

otherwise you maycrash on a device that doesn't support theextensions you want to use. i used two in replica island, draw textureand vertex buffer objects. both of those are optional, and support for themseems to be universal. but i still check for themjust in case. so, let's move onto rules. we talked about assumptionsyou need to--you can make,

and those assumptionsthat you cannot make to build a compatible game. now, what are the rules? what are the borderline thingsyou should totally not do? probably, at least threeother people at google io have talked about thisbecause it ended up affecting a lot of appswhen the zoom came out. but if you didn't know, it turns out that devices havedifferent default orientations.

if you're holding a tablet, its default orientationis landscape, and if you have a phone orsomething like the galaxy tab, its default orientationis portrait. and you're like,like, why do i care, right? because when yourun your game, you're gonna justset the orientation to whatever you want,and that's what's gonna display. well, you care becauseaccelerometer data

that you getout of the hardware is relative to the defaultorientation of the device. so if you have any sort oftilt or orientation controls in your game, and your methodis just to suck those out of the hardwareand say, okay, it looks like y decreased-- that means the useris tilting left-- you're gonna besorely disappointed when you run on a device

that has a differentdefault orientation because your controlswill all be 90 degrees off. this is really easy to fixonce you know about it. in fact, nvidiahas provided a useful function to just convert between the device specificaccelerometer data and a canonical screen spaceaccelerometer version. and this is my sort ofjava language version of their function.

but if you check out theirtegra zone developer area on their website, you can find the originalc++ version. i just dropped thisinto replica island, and it solved all my problems.it was great. another rule--if you're using jni, which isthe java native interface, that's the system by which youcall from some other language, like the java language,

through dalvikinto native code. if you're using it,you need to be careful because it's a little fragile. in particular,the jnienv variable, which comes downwith every callback, you can't cache that. it changes every time,or it could potentially change every time you makethat callback. and it could changeif the callback is called

from a different thread. and just for a lot of fun,if you cache it, and if you use the wrongenvironment variable in the wrong context, you will get extremely difficultto debug crashes, and they won't be universal. they'll be things likehorrible race conditions that work on some devicesand not others. don't ever cachethis variable.

i worked with onevery well known developer who had releaseda popular android game, and it workedon all devices except for one. and the developerwas positive that that device was brokenbecause... it just didn't workon that thing. everything else worked. just the one device...didn't work on. and we debugged it together

and when we gotto the bottom of it, it turned out that he wascaching this variable and on that particular device,there's a race condition where, you know, thread one wonbefore thread two and it caused a crash.on every other device, it happened to be thread twowon before thread one. by not caching this variableany longer and just passing it throughwhen and he got a callback, problems went away.

i think this is old newsfor most people here, so i won't spendtoo long on it. but there's differentversions of android. each new version of androidintroduces new apis. if you're going to bebackwards compatible across a bunch of differentversions of android, you need to only call apisthat are available in your minimum version. so you know, you gointo androidmanifest

and you say, oh,i have min sdk s3. that means i can run onandroid 1.5 or higher. but i compiled against eight,which is android 2.2, i believe. so what happensif you want to call a function that was addedin android 2.2? well, if you just call it,it'll compile okay. but when you run on the g1or that other 1.5 device, it's gonna crash. if you use dalvik reflection--or you could even branch

on the build idor the version id-- just be careful not to callmethods that may not exist in your minimum supportedsystem version. and actually, the docsare really useful for this because they will show youexactly how-- exactly which version every functionin the android api was added. another rule. you should be frugalwith your ram use.

if you are writingto dalvik, you have a fixed size heapand you know what it's gonna be. on a minimum spec,it's gonna be 16 megabytes and on newer devices,it's much larger than that. so you can deal withthat memory stuff pretty easily. if you are allocatingfrom native code, which most of you said you are,there is no fixed size heap. you can allocate as much memoryas you'd like until the device runs outof ram, which is great, right?

because you're notlimited to 16 megabytes. but it also means that if yourapplication needs 100 megabytes to run at its high watermarkand your user is on a phone that doesn't quite havethat much free, you may run intoan out-of-memory situation that you didn't expect. so the message here is befrugal and fail gracefully. try to fit into as littleruntime memory as possible. for reference, replica islandruns at 6 megs.

keep your applicationas small as possible. older phones, especially the g1,but some other older phones have very littleinternal flash. you should also absolutelysupport the apps to sd configurationin your android manifest because that'll let peopleto move the application to the sd card. you don't want to benon-compatible with a device just because you just don't haveenough space to install it.

if you are coding in c++, you may have consideredusing neon. neon is a special architectureinstruction set that allows the optimization of certainfloating point operations. now, neon is only supportedon devices that have rmv7 chipsets. but the trick isnot all rmv7 chipsets support neon. so if you assumed that bybuilding against rmv7

you are guaranteed neon support,you are wrong. for example, the zoomdoes not support neon. now, there is a librarythat comes with the ndk called cpu featureswhich you can use to check at runtime, whether or not this particularinstruction set is available. but do that. make sure you check. otherwise, it will crashon the device [indistinct].

and, you know, i thinkeverybody here knows this because we pounded it intotheir heads at every google io, but don't call ondocumented code. don't use private apis. you can go into the androidopen source tree and you can find a bunchof interesting-looking functions and you can find tricky waysto call them from your code, and if you do that, you guarantee that your gamewill crash at least--

if not now, then in the future,when those apis change. apis that are privateare private because they'relikely to change. they're not readyfor primetime. and if you rely upon them,you will crash. so the main message hereis lots of diversity. right? i mean,there's lots of rules. there's lots of flexibility and this is probablythe point in the lecture

where everybody in the roomis like, oh, my god. how am i gonna deal with this? this sounds horrible. like, for example, maybe you have some weirdocontrol scheme that only workson a subset of devices. right? like, maybe you requirediscreet multitouch which is the non-crappymultitouch. or more likely,maybe you just want to use

opengl es2.0because you want to write your whole graphics back endin shaders, and there's no way that's evergonna work on a device that doesn't supportopengl es2.0. what are you gonna do,right? that's the segueinto our next talk, and the segue itself is thatmarket has a solution for you and it's calledandroidmanifest.xml. so, what isandroidmanifest.xml?

i mean, everybody fills it outwhen you build your application. you put your app name in there and you describe your activitiesand stuff. and it's metadataabout your application, but what is it really? as far as market is concerned,it's your minimum spec. for example, say we say,oh, i require this feature called android.hardware.touchscreen.multitouch. and i really do require it,

'cause i put the required fieldto true. that means i cannot run-- this application is notcompatible with devices that do not supportmultitouch. and if you put thisin your manifest and you upload itto android market, android market will notdistribute it to devices that don't meetthat requirement. so, your g1 users are noteven gonna be able

to find your appin android market. it's just not there. if you use the web interface, find the app and try toinstall it to your g1, it'll say, oh, sorry. your phone is nothigh enough spec. it doesn't meet the requirementsset by this application. there's tons of stuff you canrequire in android manifest. this is why i call ita minimum spec.

there's all kinds ofrequirements you can put in here. here's a little taste. say you want toonly ship to phones that have auto focusing cameras. okay, you can do that. or say you want to shipto phones that support wi-fi. you might think that all phonessupport wi-fi, but it's probablyan optional part of the spec.

so maybe if you require it, you won't be gettinguser reports from your users who are on the crazynon-wi-fi supporting device that comes out in six months. or here's a more commonrequirement for game developers. say, you do want to use oneof those proprietary texture formatsthat i talked about. you can require it. you can say,well, you know,

i know i'm gonna cut outsome of my users but i want to usepvrtc. put this in your manifest and market will not shipyour game to a device that can't support that versionof texture compression. we talked aboutcrappy multitouch. you can cut out crappymultitouch devices. say, i'm sorry, i have mydual sticks and i like it, and i don't want to even want todeal with you nexus one users.

whatever. however manyother crappy multitouch devices might be out there. set this stuffto require it, and they will never see itat market. by the way, if you saidrequire to false here, it meansthat you want that feature but you can deal with itat runtime. you can say, oh, well,i really wanted multitouch, but since you don't have it,here's another configuration

you can use,some other way. if you set it to required,market will be real strict about how it filtersyour application. couple other examples. we talked about requiringa minimum sdk version and a maximum sdk version. you could also requirecombinations of different screen sizeand density. that's physical size,physical density,

and this isthe most common one. if you want to requireopengl es2.0, that's that one at the bottom,you just say, well, i need an openopengl es2.0 and those old deviceswon't appear. so by carefullymanaging your spec, you can effectivelycut out devices that you don't want to manage. you know, we talked abouta lot of assumptions

and a lot of ground rules, anda lot of them have to do with, well, there's a deviceover here that's this, and there's a deviceover here that's this. and if you would like to say,you know, i don't even careabout this stuff over here, i only want to focuson these guys-- androidmanifest and androidmarket will let you do that. if you think about this, this is actuallyreally powerful.

because if we look atthe low end and the high end-- what i'm gonna call the g1and the zoom are probably the goodrepresentations of those two partsof the spectrum-- that's a pretty big deltalike in terms of-- let's just talk aboutperformance. that's a pretty bigperformance delta. but let's say we requireopengl es2.0, say in our manifest.

now we have to haveopengl es2.0. now the delta isa lot smaller. now the minimum specis the droid, because that wasthe first device to ship withopengl es2.0. doesn't even matterif you use opengl. your whole thing might belike this 2d cpu game. who cares? if you say in manifest,in the manifest file,

that you require opengl es2.0,it will cut out the low end. you know, the caveatto this approach, right, is that every timeyou do this, you are cutting outsome number of users, right? the size of your user baseis getting smaller. and of course, you know, in addition to writingawesome games, we'd probably all like toalso, you know, make moneyoff of those games.

so having more usersis always a good thing. so it's in your interest to tryto be as compatible as possible. but when there'san area of diversity that's just too open for you, you can put your foot downwith manifest and require somethingin the spec. here's the specfor replica island. i don't really require anything. i work on all screen sizes.

i run on everythingandroid 1.5 and higher. now because i'm able to supportsuch a wide variety of devices, you can see thatin my install information, i have more android 1.5 users, a lot more than what's normalfor this category. i have 15%versus the standard, which is 4%. and i believe that this isbecause if you are a... user has a two-year-old device

and it's only gotandroid 1.5 on it and you go to android marketlooking for some games to play, it's a little bit slim pickings,you know. like, most developershave moved on and said, well, i'm gonna requireandroid 2.0 or i'm gonna requireandroid 1.6. but since i was able to supportthose users, that makes my app very visible, and so as a resulti have a lot of 1.5 users.

it's up to you. if you want tosupport everybody or you only want tosupport a subset, you can control thatwith androidmanifest.xml. okay, now, i want to talk aboutthe secret fourth rule. this is specific to games. this is a subtle pointthat i did not understand until after i shippedreplica island. it is true that these devicesare very different.

it's true that there's a lotof device diversity. it's also truethat you can solve it. there's dalvik reflection, there's scaling your graphics,there's, you know, using the android apisto do automatic scaling for you or adding customizable controls,things like that. those are alltechnical problems. you can solve them. you sit down,write some more code.

it'll work. much harder problemis that your users are also gonna bea very diverse group. it used to be-- you know, my backgroundbefore i went to google was writingconsole games. so, i wrote a lot of gamesfor game boy advance. game boy advance,you pretty much know who your target group is.

it's kids between the age of6 and 12. right? or if you're gonna writean xbox 360 game, you can bepretty much guaranteed that your target audienceis males between 15 and 30. all right? just by the market segment thatthe console itself controls. but on a phone, i mean,everybody's got a phone. right? what do you knowabout your user? how much do you knowabout what they want

or what kind of gamesthey want to play? you know very little. i found outthat when i added all this customizationfor controls, what surprised me about itwas that users who didn't need tocustomize their controls, because i'd alreadyprovided a solution for them, were going inand customizing them anyway. you know, i addedlike the tilt stuff in there

for the basicallythe xperia users. and i kind of thinkthat that's a difficult control scheme to use. but i had users telling methat they preferred tilt over the originaltrackball control scheme even though they hadlike an nexus one or a g1. that surprised me. the user was different,not just the device. you know,in designing replica island,

i had some idea that usersare gonna want different things. so in the game design,i tried to provide different aspectsof interestingness, different poles by whichpeople could, you know, become interestedin the game. one of those thingswas just a game play, right? some users are gonnalike crushing stuff and moving through the level and trying tofigure out the puzzle

and making itto the next level. that's the whole gamefor them. that's enough.right? so try to make that part good. another aspect ofinterestingness was a story, right? some people might not care very muchabout crushing stuff, but they want to find outwho they can trust

or who's the real bad guy?what's the secret ending? you know, art stylewas another thing. i tried to go for a retro16-bit game look even though the gameplays very differently than a retro game,because i thought that that would drawsome users in. that's what they're gonna beinterested in. and recently,i've actually added explicit difficultysettings for new users.

i had some dynamic difficultyadjustment in there before, but it turns out that the userbase is so wide here that i can makea much better game if the usertells me upfront what kind of gamethey'd like to play. some people want to puttheir pride on the line. they want a challengeand they want to feel awesome when they've completedthat challenge. and other people are like,you know what?

i'm just gonna play thisfor five minutes. i don't really wantto play the same level over and overand over again. i just want tosort of glide through. so by providing specificdifficulty levels, i was able to accessnot just more devices, but more users. one thing i didn't have to dobut you should think about is i did not provide an option

to customizethe graphics quality. if you want to customize thegraphics quality in your game and you're using opengl,it should be really easy. it's one call to thesurfaceholder.setfixedfunction. sorry.setfixedsize method. what that does isit makes your window that you're rendering to smallerthan the window of the display, and then the systemwill automatically scale it up. so the effect isyou're filling fewer pixels,

and actually fill is the partthat's slow on these devices. so you're fillingfewer pixels, but it still takes upthe whole screen. the graphicslook chunkier. i don't knowif you can tell, but on the leftis native resolution and on the right is 50%reduced and scaled back up. it does looka lot chunkier. although at 75%most users probably can't tell.

if you need to getsome speed back or you want to givethe user an option to dial downthe graphics quality because maybe they're on a phonethat is lower quality than you anticipated,you can give them an option to set this value,and that would let them play even if they havekind of a crappy phone. so the goal istarget all devices, right? that's a technical problem.you can deal with it.

i did.i kind of got lucky, but you follow the assumptionsthat we talked about today and the rulesthat we talked about today, and, you know,i think any game that's onthe android market today can be aggressivelycompatible. much harder is to understandyour user base. building a gamethat is compatible acrossa large number of people

is actuallya very difficult problem. and it's not justabout controls, and it's not justabout game content. so i urge you when buildingandroid games to think not just about thetechnical side of compatibility but also who your users are. you know,who is this market? and what do theywant to play? and give them optionsto tune the game

the way that they like. and i think if you do that,you have a lot more-- bigger chance of success. this is the endof my remarks. i sped through ita little bit 'cause we're runninga little late, but we do have timefor some questions. if you're interestedin what i'm up to next, my company is calledrobot invader.

we're at robotinvader.com. at twitter,i'm at c_pruett. and we don't haveanything to show quite yet. we're only a month old. but we will havesome pretty cool stuff. so please stay tuned. if you'd like to ask questions, please come upto one of these microphones. thank you very much.

[applause] man: you mentionedputting restrictions in the manifest to limitthe number of devices and there wasthe required true-false. it's obvious what happenswhen it's true. well, how does the marketrespond to that requirement when it's requiredto be false? are you just saying,i would like this but i can deal with it?

what's the point of just-- what's the pointof even saying that? pruett: right.so, the question is about what doesthe true-false thing do? now, i believe you saidthat the false market will not treat itas a strict filter so it will allow devices--it'll basically ignore it. but the purpose of the manifestis not just android market. right? the manifest is supposedto be all metadata

about your application. and android applications aredesigned to be self-describing. so you should be able to lookat the binary, understand what kind of devicesyou can install this on. if you set that requirementto true, i don't think you'll even be able to installlike over adb... man: right.pruett: a device--or application that doesn't meetthe requirements of that phone. so i think that if you havethe field set to false,

you're just giving android moredata about your application, whether or notit acts upon it or now, or maybe in the future,i don't know. i don't think that marketin particular does anything with itif you set it to false. but it's probably a good ideato give your... give android or marketor any of those systems as much information aboutwhat you want as possible. man: okay.pruett: over here.

man: so when you parsethe extension string-- pruett: yes.man: if you come across devices that don't supportthe extensions that you need, how do you fail gracefully? do you just tell themyou can't do it? or do you have a backup?pruett: sure. depends on the extension. but, generally,extensions are fast paths for stuffthat's in the spec already.

so, for example, draw texturejust takes a texture and blitz it, you know,access-oriented to the screen at the scalethat you specify. now, if draw textureis not available, you could fall back on a quad that's orthographicallyprojected. it's the same thing. man: is that what you do, or...pruett: that's what i do. man: yeah.pruett: yes.

or another exampleis vertex buffer objects. fast path for regularvertex buffers, right? now,there are some things like you will seethe texture compression formats that are supportedin the gl extension string. and if your texturesare all in some format that that device doesn't support,i don't know what you can do. you can try toranscode them, but i think you'repretty much up a creek.

so, that's probablywhere you want to start putting requirementsin the manifest. man:right. thanks. man: before i ask my questionto play off his a little bit, then that's assuming you'renot filtering in your manifest. pruett: that's right.man: therefore... not filtering in the market.pruett: that's right. man: and then you would wantto handle it at runtime. pruett: that's right.so when i--

one developerthat i spoke with was interested in transcodingbetween atitc and dxt because those formats areactually at a binary level pretty similar. so there might be liketricky things you could do. like, oh, i encodedall my stuff in dxt but i'm finding out, i'm actually runningon an atitc device. at runtime, i can transcodethis or something.

but probably what mostdevelopers are gonna do is not anythingthat complicated. they're either just gonnause a non-proprietary format like atc1, or they're gonna requiretheir manifest. man: okay.so, my question. say i'm really motivatedand a little bit crazy and i want to do a gameor a graphical app that's really, you know,

it's taking advantageof opengl es2.0. it's targeted at, say,tablets. it's really high end.pruett: hmm-mm. man: but i also want to appealto the lower-end devices. would i, i guess,in more general terms, would i develop two separateapps with different manifests just so that it could appearto any given user to be the same appbut only be exposed to the devicesthat are necessary?

pruett: you could.you shouldn't. yeah, i mean, you certainlyhave the ability to do that. the problemwith that approach is that then you'll havetwo apps on market. they will have two differentsets of ratings information. they'll have to haveslightly different names. and if one of your appsgets voted way up, it won't change the ratingof the other application. man: what's the right wayto do that?

pruett:the right way to do that is preferably to have a singlebinary that you can do both in. i mean, what would you changebetween the low-end version and the high-end version? well, you'd probably changethe resolution of the textures. you can do thatat runtime. if you were gonna switchbetween, say, a fixed function rendererand a shader renderer, that actually might bequite a lot of work.

but it's also you know, a classyou can swap out at runtime. the trick is...to understandthat you can control, you know, which devices get yourapplication based on the spec. but if at all possible,your ideal scenario is a single binarythat supports as wide a range of devicesas possible. man: so then the concept ofa minimum spec in the manifest gets real tricky becauseit may not so much be minimum as i can do thiswith a low-end device

but otherwise i can do thiswith a really high-end device. how do you filter? pruett: so in that case,you don't need to filter, right? if you can actually spanwhatever you're doing, if you can run on the low-enddevice and the high-end device, you don't need to tellthe manifest anything. you're available to everybody.right? that's a runtimecomputation. so what the manifest is foris for areas

where you couldn't makeany concessions at runtime. you can't just degradethe graphics quality or you know,resize the textures. like, if you havea shader based rendering engine and you don't careabout fixed function, you know, rendering engines,you can require opengl es2.0, and then those devicesjust won't get it. does that make sense?man: i think so. thank you.pruett: thank you.

man: a little bit moreof a gut question. pruett:sure. man: how do you balancethose factors when you want to makethose changes like you did for the difficulty settingsand really you know, deciding, okay, well, this marketisn't big enough. i want to includelower-end devices. what do you use?hard data? you know,do you get feedback?

pruett:yeah. man: you know, are you lookingat the competition? you know,those are the tough choices where you decide, okay, now i'm gonna spendtwo extra weeks working on this. pruett:that's a good question. in my case, the game was writtenagainst the low end. so all i had to dowas scale upwards, and that wasn't very hard.

in fact, it pretty muchworked out without me doing anything. if you have shipped something,and now you go back and decide, well, you know,i shipped something and i required opengl es2.0,but i don't really need that and boy, there'sa lot of users out there who have older phonesi'd like to support, that's a little bit trickier. google does publish informationat developer.android.com.

about the distributionof screen sizes and also of androidinstalled versions. so you can get a sensefrom that data, you know, what the whole landscapelooks like. you can also use...there's a bunch of metrics that just got addeda couple of months ago to android market to seewho your users really are. so if you got complaintsthat like, oh, it crasheson wide vga displays

and you went and you lookedand saw that 30% of users have wide vga displays, that's probably an importantbug that you want to fix. above and beyond that,i highly recommend that you doyour own analytics. you know,actually android can-- there's an android versionof google analytics which you can plug in. it's aboutthree lines of code.

super simple. you can send whatever datayou like back and it'll aggregate youon a webpage and give you graphsand all kinds of information. and it'll tell youin excruciating detail, depending on what valuesyou send back, who your users are andwhat they're doing, you know. i worked with a developerwho tracks how long it takes for users to completeeach level.

and they found outthat everybody completes the first level, and 80% of userscomplete the second level and 10% of userscomplete the third level. okay. there's a problemwith the third level, right? doing your own analytic trackingis super useful anyway. that said, if you are talkingabout a group of users that you're notshipping to now and you don't knowhow large they are,

it's pretty hard to tell,because absent data which only aggressivelycompatible applications have, you kind of have to either takea chance and ship something and try to make itas compatible as possible and ship itand see what happens. or try to relyon third party data. you know,in addition to google, there's a flurryand there's, you know, admob and other peoplewho will publish data as well

help youmake those decisions. my suggestion would be to,you know, choose a minimum specas low down as possible, you know, try to makeyour minimum spec as old a phoneas you possibly can and then work from there. man: hey, chris.pruett: what's going on? man:everything's been pretty good for us native developersfor arm so far,

but intel announcedmaybe a month ago that they're gonna startdoing x86-android. man: so what do you recommendwe do for compatibility for you know, arm? because right now, as it stands,my native games are i'm gonna have to dosomething quickly. pruett:sure. sure. well, you know, the ndk will have to support arm.or i'm sorry--

other architectures like x86-- before you canreally do anything. if you look at the ndk, there's actually alreadysome preliminary support for x86 chain in there. and what's gonna happenwhen that support shows up or support for any otherarchitecture, say, you know, like a power pc device comes outtomorrow or something, right? the way it's gonna workis your...

if you look insideyour application that you built withthe ndk, you end up with a foldercalled libraries and in that folder,you have the output of your compilation,your libraries. and actually, you can havemultiples versions for different architectures. so, right now,you can choose to compile against both arm 5and arm 7.

and it will automaticallyload the correct one. in the future,what i would expect is that you hit the sameindicate build command and if you setyour make file up correctly, you will get a libraryfor x86 as well as for arm. now, that makes a lot ofassumptions, right? it assumes that your codeis first of all just gonna compile againstan x86 code base

and that your, you know, data is a little [indistinct]or whatever. but i think that functionallythe way it'll work is that your application-- it's already a sort ofa fat binary, right? it's already able tosupport multiple architectures, and they will just addarchitectures onto that. man:but do you think the market-- that makes perfect sense.

but do you thinkthe market is gonna have an opt inor an opt out? because the one thing i don'twant to have happen is, you know, all the newx86 devices roll out, and just we're crashingon them. pruett: right.that's actually already there. if you...one thing i didn'tmention in this talk is that market willlook at your manifest to figure out its filters,but it also draws filters

from intrinsic informationabout your application. so for example, if you targetarm v7 right now, you will not appearon arm v5 devices 'cause you said i can't supportarm v5 by nature of you compiling only againstarm v7. so, if you havea native application and some other architectureshifts, by default, you're not gonna show upon that device until you explicitlygo back and recompile

and then ship an update. did that answeryour question? man:oh, yeah. pruett: okay. are thereany other questions? if not, thank you very muchfor coming. appreciate it.

12/22/2016

cara mengubah channel


chris anderson: so, jon, this feels scary. jonathan haidt: yeah. ca: it feels like the world is in a place that we haven't seen for a long time. people don't just disagreein the way that we're familiar with, on the left-right political divide. there are much deeper differences afoot. what on earth is going on,and how did we get here? jh: this is different.

there's a much moreapocalyptic sort of feeling. survey research by pew research shows that the degree to which we feelthat the other side is not just -- we don't just dislike them;we strongly dislike them, and we think that they area threat to the nation. those numbers have been going up and up, and those are over 50 percentnow on both sides. people are scared, because it feels like this is differentthan before; it's much more intense.

whenever i lookat any sort of social puzzle, i always apply the three basicprinciples of moral psychology, and i think they'll help us here. so the first thing that youhave to always keep in mind when you're thinking about politics is that we're tribal. we evolved for tribalism. one of the simplest and greatestinsights into human social nature is the bedouin proverb:

"me against my brother; me and my brother against our cousin; me and my brother and cousinsagainst the stranger." and that tribalism allowed usto create large societies and to come togetherin order to compete with others. that brought us out of the jungleand out of small groups, but it means that we haveeternal conflict. the question you have to look at is: what aspects of our societyare making that more bitter,

and what are calming them down? ca: that's a very dark proverb. you're saying that that's actuallybaked into most people's mental wiring at some level? jh: oh, absolutely. this is justa basic aspect of human social cognition. but we can also live togetherreally peacefully, and we've invented all kindsof fun ways of, like, playing war. i mean, sports, politics -- these are all ways that we getto exercise this tribal nature

without actually hurting anyone. we're also really good at tradeand exploration and meeting new people. so you have to see our tribalismas something that goes up or down -- it's not like we're doomedto always be fighting each other, but we'll never have world peace. ca: the size of that tribecan shrink or expand. jh: right. ca: the size of what we consider "us" and what we consider "other" or "them"

can change. and some people believed that processcould continue indefinitely. jh: that's right. ca: and we were indeed expandingthe sense of tribe for a while. jh: so this is, i think, where we're getting at what's possiblythe new left-right distinction. i mean, the left-rightas we've all inherited it, comes out of the laborversus capital distinction, and the working class, and marx.

but i think what we're seeingnow, increasingly, is a divide in all the western democracies between the peoplewho want to stop at nation, the people who are more parochial -- and i don't mean that in a bad way -- people who have much moreof a sense of being rooted, they care about their town,their community and their nation. and then those who areanti-parochial and who -- whenever i get confused, i just thinkof the john lennon song "imagine."

"imagine there's no countries,nothing to kill or die for." and so these are the peoplewho want more global governance, they don't like nation states,they don't like borders. you see this all over europe as well. there's a great metaphor guy --actually, his name is shakespeare -- writing ten years ago in britain. he had a metaphor: "are we drawbridge-uppersor drawbridge-downers?" and britain is divided52-48 on that point.

and america is divided on that point, too. ca: and so, those of uswho grew up with the beatles and that sort of hippie philosophyof dreaming of a more connected world -- it felt so idealistic and "how couldanyone think badly about that?" and what you're saying is that, actually, millions of people todayfeel that that isn't just silly; it's actually dangerous and wrong,and they're scared of it. jh: i think the big issue, especiallyin europe but also here, is the issue of immigration.

and i think this is wherewe have to look very carefully at the social scienceabout diversity and immigration. once something becomes politicized, once it becomes somethingthat the left loves and the right -- then even the social scientistscan't think straight about it. now, diversity is good in a lot of ways. it clearly creates more innovation. the american economyhas grown enormously from it. diversity and immigrationdo a lot of good things.

but what the globalists,i think, don't see, what they don't want to see, is that ethnic diversitycuts social capital and trust. there's a very importantstudy by robert putnam, the author of "bowling alone," looking at social capital databases. and basically, the more peoplefeel that they are the same, the more they trust each other, the more they can havea redistributionist welfare state.

scandinavian countries are so wonderful because they have this legacyof being small, homogenous countries. and that leads toa progressive welfare state, a set of progressiveleft-leaning values, which says, "drawbridge down!the world is a great place. people in syria are suffering --we must welcome them in." and it's a beautiful thing. but if, and i was in swedenthis summer, if the discourse in swedenis fairly politically correct

and they can't talk about the downsides, you end up bringing a lot of people in. that's going to cut social capital, it makes it hard to have a welfare state and they might end up,as we have in america, with a racially divided, visiblyracially divided, society. so this is all veryuncomfortable to talk about. but i think this is the thing,especially in europe and for us, too, we need to be looking at.

ca: you're saying that people of reason, people who would considerthemselves not racists, but moral, upstanding people, have a rationale that sayshumans are just too different; that we're in danger of overloadingour sense of what humans are capable of, by mixing in people who are too different. jh: yes, but i can make itmuch more palatable by saying it's not necessarily about race. it's about culture.

there's wonderful work by a politicalscientist named karen stenner, who shows that when people have a sense that we are all united,we're all the same, there are many people who havea predisposition to authoritarianism. those people aren't particularly racist when they feel as throughthere's not a threat to our social and moral order. but if you prime them experimentally by thinking we're coming apart,people are getting more different,

then they get more racist, homophobic,they want to kick out the deviants. so it's in part that you getan authoritarian reaction. the left, following throughthe lennonist line -- the john lennon line -- does things that createan authoritarian reaction. we're certainly seeing thatin america with the alt-right. we saw it in britain,we've seen it all over europe. but the more positive part of that is that i think the localists,or the nationalists, are actually right --

that, if you emphasizeour cultural similarity, then race doesn't actuallymatter very much. so an assimilationistapproach to immigration removes a lot of these problems. and if you value havinga generous welfare state, you've got to emphasizethat we're all the same. ca: ok, so rising immigrationand fears about that are one of the causesof the current divide. what are other causes?

jh: the next principle of moral psychology is that intuitions come first,strategic reasoning second. you've probably heardthe term "motivated reasoning" or "confirmation bias." there's some really interesting work on how our high intelligenceand our verbal abilities might have evolvednot to help us find out the truth, but to help us manipulate each other,defend our reputation ... we're really, really goodat justifying ourselves.

and when you bringgroup interests into account, so it's not just me,it's my team versus your team, whereas if you're evaluating evidencethat your side is wrong, we just can't accept that. so this is why you can't wina political argument. if you're debating something, you can't persuade the personwith reasons and evidence, because that's notthe way reasoning works. so now, give us the internet,give us google:

"i heard that barack obamawas born in kenya. let me google that -- oh my god!10 million hits! look, he was!" ca: so this has come as an unpleasantsurprise to a lot of people. social media has often been framedby techno-optimists as this great connecting forcethat would bring people together. and there have been someunexpected counter-effects to that. that's why i'm very enamoredof yin-yang views of human nature and left-right -- that each side is rightabout certain things,

but then it goes blind to other things. and so the left generally believesthat human nature is good: bring people together, knock downthe walls and all will be well. the right -- social conservatives,not libertarians -- social conservatives generallybelieve people can be greedy and sexual and selfish, and we need regulation,and we need restrictions. so, yeah, if you knock down all the walls, allow people to communicateall over the world,

you get a lot of porn and a lot of racism. ca: so help us understand. these principles of human naturehave been with us forever. what's changed that's deepenedthis feeling of division? jh: you have to see six to tendifferent threads all coming together. i'll just list a couple of them. so in america, one of the big --actually, america and europe -- one of the biggest ones is world war ii. there's interesting researchfrom joe henrich and others

that says if your country was at war, especially when you were young, then we test you 30 years laterin a commons dilemma or a prisoner's dilemma, you're more cooperative. because of our tribal nature, if you're -- my parents were teenagersduring world war ii, and they would go outlooking for scraps of aluminum to help the war effort.

i mean, everybody pulled together. and so then these people go on, they rise up through businessand government, they take leadership positions. they're really goodat compromise and cooperation. they all retire by the '90s. so we're left with baby boomersby the end of the '90s. and their youth was spent fightingeach other within each country, in 1968 and afterwards.

the loss of the world war ii generation,"the greatest generation," is huge. so that's one. another, in america,is the purification of the two parties. there used to be liberal republicansand conservative democrats. so america had a mid-20th centurythat was really bipartisan. but because of a variety of factorsthat started things moving, by the 90's, we had a purifiedliberal party and conservative party. so now, the people in either partyreally are different,

and we really don't wantour children to marry them, which, in the '60s,didn't matter very much. so, the purification of the parties. third is the internet and, as i said, it's just the most amazing stimulantfor post-hoc reasoning and demonization. ca: the tone of what's happeningon the internet now is quite troubling. i just did a quick searchon twitter about the election and saw two tweets next to each other. one, against a picture of racist graffiti:

"this is disgusting! ugliness in this country,brought to us by #trump." and then the next one is: "crooked hillarydedication page. disgusting!" so this idea of "disgust"is troubling to me. because you can have an argumentor a disagreement about something, you can get angry at someone. disgust, i've heard you say,takes things to a much deeper level. jh: that's right. disgust is different.

anger -- you know, i have kids. they fight 10 times a day, and they love each other 30 times a day. you just go back and forth:you get angry, you're not angry; you're angry, you're not angry. but disgust is different. disgust paints the personas subhuman, monstrous, deformed, morally deformed. disgust is like indelible ink.

there's research from john gottmanon marital therapy. if you look at the faces -- if oneof the couple shows disgust or contempt, that's a predictor that they're goingto get divorced soon, whereas if they show anger,that doesn't predict anything, because if you deal with anger well,it actually is good. so this election is different. donald trump personallyuses the word "disgust" a lot. he's very germ-sensitive,so disgust does matter a lot -- more for him, that's somethingunique to him --

but as we demonize each other more, and again, throughthe manichaean worldview, the idea that the worldis a battle between good and evil as this has been ramping up, we're more likely not just to saythey're wrong or i don't like them, but we say they're evil, they're satanic, they're disgusting, they're revolting. and then we want nothing to do with them. and that's why i think we're seeing it,for example, on campus now.

we're seeing more the urgeto keep people off campus, silence them, keep them away. i'm afraid that this wholegeneration of young people, if their introduction to politicsinvolves a lot of disgust, they're not going to want to be involvedin politics as they get older. ca: so how do we deal with that? disgust. how do you defuse disgust? jh: you can't do it with reasons. i think ...

i studied disgust for many years,and i think about emotions a lot. and i think that the oppositeof disgust is actually love. love is all about, like ... disgust is closing off, borders. love is about dissolving walls. so personal relationships, i think, are probably the mostpowerful means we have. you can be disgusted by a group of people, but then you meet a particular person

and you genuinely discoverthat they're lovely. and then gradually that chips awayor changes your category as well. the tragedy is, americans used to bemuch more mixed up in the their towns by left-right or politics. and now that it's becomethis great moral divide, there's a lot of evidencethat we're moving to be near people who are like us politically. it's harder to find somebodywho's on the other side. so they're over there, they're far away.

it's harder to get to know them. ca: what would you say to someoneor say to americans, people generally, about what we should understandabout each other that might help us rethink for a minute this "disgust" instinct? jh: yes. a really importantthing to keep in mind -- there's research by politicalscientist alan abramowitz,

showing that american democracyis increasingly governed by what's called "negative partisanship." that means you think,ok there's a candidate, you like the candidate,you vote for the candidate. but with the rise of negative advertising and social mediaand all sorts of other trends, increasingly, the way elections are done is that each side tries to makethe other side so horrible, so awful, that you'll vote for my guy by default.

and so as we more and more voteagainst the other side and not for our side, you have to keep in mindthat if people are on the left, they think, "well, i used to thinkthat republicans were bad, but now donald trump proves it. and now every republican,i can paint with all the things that i think about trump." and that's not necessarily true. they're generally not very happywith their candidate.

this is the most negative partisanshipelection in american history. so you have to first separateyour feelings about the candidate from your feelings about the peoplewho are given a choice. and then you have to realize that, because we all livein a separate moral world -- the metaphor i use in the bookis that we're all trapped in "the matrix," or each moral community is a matrix,a consensual hallucination. and so if you're within the blue matrix, everything's completely compellingthat the other side --

they're troglodytes, they're racists,they're the worst people in the world, and you have all the factsto back that up. but somebody in the next house from yours is living in a different moral matrix. they live in a different video game, and they see a completelydifferent set of facts. and each one seesdifferent threats to the country. and what i've foundfrom being in the middle and trying to understand both sidesis: both sides are right.

there are a lot of threatsto this country, and each side is constitutionallyincapable of seeing them all. ca: so, are you sayingthat we almost need a new type of empathy? empathy is traditionally framed as: "oh, i feel your pain.i can put myself in your shoes." and we apply it to the poor,the needy, the suffering. we don't usually apply itto people who we feel as other, or we're disgusted by. jh: no. that's right.

ca: what would it look liketo build that type of empathy? jh: actually, i think ... empathy is a very, veryhot topic in psychology, and it's a very popular wordon the left in particular. empathy is a good thing, and empathyfor the preferred classes of victims. so it's important to empathize with the groups that we on the leftthink are so important. that's easy to do,because you get points for that. but empathy really should get you pointsif you do it when it's hard to do.

and, i think ... you know, we had a long 50-year periodof dealing with our race problems and legal discrimination, and that was our top priorityfor a long time and it still is important. but i think this year, i'm hoping it will make people see that we have an existentialthreat on our hands. our left-right divide, i believe,

is by far the most importantdivide we face. we still have issues about raceand gender and lgbt, but this is the urgent needof the next 50 years, and things aren't goingto get better on their own. so we're going to need to doa lot of institutional reforms, and we could talk about that, but that's like a whole long,wonky conversation. but i think it starts with peoplerealizing that this is a turning point. and yes, we need a new kind of empathy.

we need to realize: this is what our country needs, and this is what you needif you don't want to -- raise your hand if you wantto spend the next four years as angry and worried as you've beenfor the last year -- raise your hand. so if you want to escape from this, read buddha, read jesus,read marcus aurelius. they have all kinds of great advicefor how to drop the fear, reframe things,

stop seeing other people as your enemy. there's a lot of guidance in ancientwisdom for this kind of empathy. ca: here's my last question: personally, what canpeople do to help heal? jh: yeah, it's very hard to just decideto overcome your deepest prejudices. and there's research showing that political prejudices are deeperand stronger than race prejudices in the country now. so i think you have to make an effort --that's the main thing.

make an effort to actually meet somebody. everybody has a cousin, a brother-in-law, somebody who's on the other side. so, after this election -- wait a week or two, because it's probably going to feelawful for one of you -- but wait a couple weeks, and thenreach out and say you want to talk. and before you do it, read dale carnegie, "how to winfriends and influence people" --

(laughter) i'm totally serious. you'll learn techniquesif you start by acknowledging, if you start by saying, "you know, we don't agree on a lot, but one thing i really respectabout you, uncle bob," or "... about you conservatives, is ... " and you can find something. if you start with someappreciation, it's like magic.

this is one of the mainthings i've learned that i take into my human relationships. i still make lots of stupid mistakes, but i'm incredibly goodat apologizing now, and at acknowledging whatsomebody was right about. and if you do that, then the conversation goes really well,and it's actually really fun. ca: jon, it's absolutely fascinatingspeaking with you. it really does feel likethe ground that we're on

is a ground populated by deep questionsof morality and human nature. your wisdom couldn't be more relevant. thank you so much for sharingthis time with us. jh: thanks, chris. jh: thanks, everyone. (applause)

cara membuat antena


it's a trap. it's a trap house, guys. damn. okay, so here's what happened. i was called by resort world singapore... and also universal studio... to see something new. something big is coming. are you curious about the hype?

so, follow me to singapore, okay? here i am. finally in singapore again. so happy. i used to come here often. but, now, i never... because i have to work all the time. that's me. okay, hi. yes. how are you? good? / good morning. good.

i don't even know where i'm staying at, but it feels good. and i'm really curious how later... in universal studio will be. and then, there will be a lot of attractions also. i heard there are 'swimming with dolphin' and stuff, so... don't close the video. keep on watching until the end, alright? here we are. we're arrived. thank you so much.

have a good day. / thank you so much. alright. thank you. she was shy. she was laughing all the time. okay, now i've gotten my room. i'll get in. i want to see how the room is. i've never stayed here before. at resort world. this is my first time. i'm sure it's gonna be exciting.

i love the room. now's still morning, 10 am. later at 11, i think around 11... or 12, i will be greeted by resort world team. now, it's my free time. but, kevin's free time is for sleeping, because i'm tired. but later, i'll show you singapore for sure.

i won't make vlog of me sleeping only. so, don't worry, okay? i'll go to sleep. we'll continue later after i'm awake. so, i'm in singapore to come for... universal studio's halloween horror night. and i was just given a package. i thought this 'first aid kit' is kit for game or something. but, apparently... there are cookies in shape of fingers,

bread in shape of brain. there are jellies in shape of eyes. and here is spider web. let's try them. oh, this is... muffin. this is so good. i'm ready... for dinner.

so, i'm invited to have dinner in a restaurant called osia. osia is a famous steak restaurant at resort world singapore. why is it famous? not only because of its delicious food, but also because it got an award which was michelin star. michelin star, for a restaurant, is like... oscar award for an actor. something like that. if a restaurant gets michelin star, it means...

it's a qualified world class restaurant. so, it's not like any restaurant. there are only a few of restaurants in the world... which can achieve michelin star. and i meet... wil from philippines. / what's up guys? i love it. so, this is the restaurant? that's it? yes, this is it. / alright.

and then, haley from philippines. / hi. nice to meet you guys. it's so good. thank you very much. hope to see your video. alright. i've finished my dinner. so happy, i met wil dasovich, haley dasovich. there was marlo also. so happy to meet friends from philippines. tomorrow, i'll still collaborate with them.

we'll get crazy at universal studio, with them also. so, now i'll go to sleep because tomorrow's call is early. at... 9 am, i have to standby. now, it's still... 9.30 singapore time. but, since yesterday, i haven't gotten enough sleep. so, i'll go to sleep right now. i'll see you guys... tomorrow.

let's jump in to tomorrow. good morning. / hi. good morning. hey, my indonesian youtuber friend. filipino youtuber. / how's it going? what's up? good morning. wait, how do you say 'good morning' in bahasa? 'selamat pagi.' it's kinda like 'salamat po', right? okay.

so, i'm going back to my room to take my gears and lenses. then, we'll go to aquarium. wanna see singapore's aquarium? this is it. so, behind me is... the biggest aquarium... it was the biggest in the world, but there's a new winner now. how big is this? it's 36 metres long by..

8.3 metres high. alright. that's really big. i really like... coming to an aquarium like this. i can stay here all day long. just feeling blue. it feels so calm here. finished.

this is the end of the aquarium. so cool. there are a lot of fish. and... there, i miss these kind of things. i hope there would be places like this in jakarta, because this is so good. i'm really satisfied with this aquarium. so many fish. there are really a lot of fish.

and for the fish tanks, there are 49, if i'm not mistaken. so, there are a lot of it. now, i'll get ready, because the halloween celebration is starting soon. so, don't close the video... because this is the main thing. it's the main thing of this vlog, but, there are still many hyped things, so...

keep watching. here is the awaited time. let's see what's gonna happen. because there are 5 haunted houses, and 2 scare zones. it's all out. this is the biggest number of haunted houses ever made by universal studio. crazy. my indonesian youtuber friend. it's for the fifth or sixth time you say that.

kevin. okay, now we're going into the haunted house. it's night already. and so cool. this will be scary. and there will be parade also. and there are 5 haunted houses. i say this numerous times because... i heard we would need 2 hours to finish all the haunted houses. hey, what are we doing right now?

we are now... going into the haunted house. okay? / exactly. that's exactly what we're doing. okay, we'll enter the haunted house. we'll see how scary they are. join me. okay, we'll enter the first haunted house. this haunted house has witches. / witches. i'm actually nervous. / same. me too. i don't like being surprised, that's the thing.

lucky i come here with the others. a good thing that she's pretty. shit. i don't like this. / crazy, man. very cool. really well-prepared. i even hurt myself. it bleeds, because i screamed and bumped into something. crazy, right? so good.

this one is like a canteen, but haunted. asking for money, damn. asking for money to me, i'll never give them. go out. we're going to the third one. / yes. the name's 'bodies of work'? / yes. i don't know what that is. what's that? so, there's a murder, mutilation. murder, mutilation.

then, there will be a lot of human bodies in pieces. / maybe. crazy, this is so scary. we're like being chased, damn. this one's crazy, right? that was the best one so far. yeah, so far, the best. like we're stepping up to next level. it's like getting scarier, right? / yeah, oh my god. behind me is the suicide forest.

so, in a place in south asia, there's an infamous forest where a lot of people had suicide. it becomes one of the attractions here. so cool. is that a person or what? / no, it's a doll. she's pretty. really. (wrong focus) here, even though it's very crowded, it still feels scary, right bro? / yes, right.

cool. right now we're going to old changi hospital. people said that this was the scariest one, right? the scariest one. blood and gory hospital? how can it get any better than that? i'm going out. holy moly. the last one's crazy.

alright. and that's it for kevin vlog this time. thank you so much for you who are watching. that was a very cool experience. and don't forget, if you want to... get inspirations from wil's channel, you can check his channel out here. and thank you so much for universal studio and resort world singapore... who sponsored this trip. i'll see you guys in the next video.

stay strong.

11/03/2011

Foto Salaman Tinju Khas Presiden AS Obama

Ternyata Obama punya cara yang unik dalam berjabat tangan. Bukan salaman resmi pada umumnya tapi salaman tinju layaknya dalam pergaulan anak muda sehari-hari. Mungkin foto-foto berikut ini menunjukkan bahwa presiden AS itu memang orang yang berjiwa muda dan mudah bergaul di kalangannya.