So, uh, allright, sowearealsogoingtousenumbpie, butyoushouldalreadyhavethat.
Andthenwe'regoingtousethepythonimaginglibrary, and I wanttosaythatwouldbe a pipinstallpillow.
Thisis a virtualmachine, anditshouldbeclean.
Soifthat's notwhat I want, Umwe'llfindoutsoonenough.
Butwe'llgetrobbed.
Pillowandthentousepillowyouimportcapital P I L Sothatshouldbeeverythingweneed.
Let's goaheadandinpoorinpoor, numbpieasinpeaceorusenumbpieforthearraytypesofstufffromplwe'regoingtoimportimporthowtotypeimagewithcapital I importCVtoWe'regonnaimportMattplotlibdotpipelotas p l t.
We'regoingtoimportpickleon.
That's tosaveandloadourcuetable.
Thenwe'regoingtofromMatt.
Plotlivedwillimportstylejusttomakehergraphpretty.
Andwe'lldostylethatuse g pliant, uh, andthenfinallywillimporttime.
Uh, nowwhat I'm gonnadois I'm gonnagive a playerinequalsone.
We'regonnasavefood.
Andthesearejustnumbersforlabelsandkeys.
Ratherin a dictionary.
That's it.
Soplayerandfoodandandandenemyendthreeagain.
It's justdefinitions.
Forwhatnumber?
Thesethingsrepresentin a dictionary.
Sowe'rejust a d equalsandthenwe'regonnahaveoneColinsomething.
Um, biologist, Fillitin.
Sothesewillbethecolor.
Soto 55 1 75 0 Now, I'm actuallydefiningthesecolorsin B G orformat.
Uh, eventhough I'm reallytrue.
I wasreallytryingtouseRGB.
Sosideprojectisifanybodycantellmewhyisitbegr I don't thinkit's likethe I don't know.
Maybe I'llfigureitoutaswego, butthat's thatwas a problem I haven't solvedyetanyway, to 55 0 Sotheplayer B ismostlyblue, somegreen, soit's kindoflike a liteishblue.
Um, foodis B g.
Sofullgreen.
Sothefoodisgreen, andthentheenemywillbe 00 to 55.
Sobeautyaresomaximumaresoit'llbeveryred.
Cool.
So, um, youdon't likethat, huh?
Allright.
I'm surpriseditdoesn't surprise.
Isacceptingmyspacingoverofthedictionary.
I don't thinkthat's Pepe.
Maybeitis.
Mustitmustbe, ifit's acceptingit.
Uh, okay, sonowwhatweneedisweneed a blobclassbecause, really, alloftheseblobsaregonnahave a lotofthesameattributes.
Atleastthey'regoingtoneedtobeabletomove.
They'regoingtoneed a startinglocationliketheyneedtobeinitializedrandomly.
They'regonnaneedtobeabletobemoved.
Andthenlater, basicallyourobservation.
I didn't reallywanttousebecauseyouwouldhave, like, a hugeobservationspaceifyouneededtopass.
Whatisthelocationofeverybully?
I feltlikeit.
You'd havetobe.
Theproblemwouldbemuchmorecomplex, I guessifyoupassedthesethephysicallocationofeverything.
Now, if I hadthoughtofthiswhen I wascodingthis, I wouldn't havecontinued.
I wouldhaveactuallydoneeachofsorryjustpunchedthemike, which I wouldn't havedonethat.
I wouldhavealsoaddedallofthe X onLeeandwhyonlymovementsaswellsoitcouldmoveupanddownbecausetome, I wouldnothaveexpectedquelearningtobeabletohandleforthisplate.
Like I said, I actuallymadethisenvironmentbefore.
I actuallythought I wasgonnashowyouguysthisenvironment.
Thenwe'regonnasay, ifepisodemadjaloshoweveryisequaltozero, We'regoingtosaywe'regonnaprintan F StringonnumberepisodeJustsoweknowkindofwherewewhereweare.
AndtheyweregoingtosaytheUpselllawn.
Uh, alsoSowekindofknowwhereweare.
Absoluteunwise.
Uh, thenwearegoingtolthisprint.
Onemorewe'regoingtosay, uh, shitlipsshoweveryepisodemeanAndwe'rejustgoingtodisplaythemeanepisoderewardswe'regonnasay n p dotmeanandthat's episodeunderscorerewardsnegativeshoweverycolon.
SoOh, nowthatwegottheaction, we'rereadytotaketheactionsoras a playerdotaction.
Action.
Sowetakethataction, which, um, basedontheactionpastmovesbasedonthesethingsthatwepassed, Um, Andagain, I justkindofwantedtoseparatethesecause, sometimes, like, youmightwanttomove a thing.
Maybethatthingwewantedtomovemorethanonevalueforwhateverreason, likethemovementandthentheactiontomove, I thinkshouldbeseparateforthissimpleexampleatthisstagethatwereatMaybeit's unnecessary, but I thinkit's goodmovingforwardanyway.
Sowe'regonnasayend, umandwe'regonnasavefooddotExefooddotWhyequalsinjustkindofthinkingnow I thinkactuallyin, umsoinanarray, it's actuallywhy, by X, I think, um, ratherthan x pi x y aswewouldtraditionallythinkof X Y right, Becauseyou'vegotyourdepth, thenyou'rewithbasically, So I don't thinkoftheenvironment, thoughitwould, reallyit's gonnamatter, likeit's notgonnamakeanydifferencewhetherweflipthatornot.
Becauseone, it's ahSquare.
Andtoo, we'rejusttryingtovisualizeitwouldjustbelikerotated, I think, right, So I don't thinkitactuallymatters.
Itwouldonlymatterifwewereallowinguserinput, but I actuallythinkitmakesbettersensetosaywhy X offtofixthatinthetutorialorthetextbasedversion.
Anyway, um, I thinkthat's correct.
I thinkitwouldbe.
Whythen x inanyarray, anyway, there's a food y food.
X equalsthedictionaryfood, andsothat's justourwayofgettingthecolor.
Initially, I had a reallygreatreasonforthat, but a cz, longasweonlyhaveonefooditkindofmakes.
Andthenfinally, inourepisodeepisodeepisodeloopSojustonetaboverwe'regoingtosayepisoderewardsuh, uhdotupendepisoderewardAndthenwe'regonnadecaytheEPSAlonsocapsuleontimesequals R E P s decay.
Anyway, um, yeah, that I justthinkthisisreallycool.
So I'm superhappythat I'vemadetheenvironmentand I hopeyouguysairisimpressedas I amwiththisbecauseif I made a neuralnetwork, thatwas, like, say, a continentanditlookedatthisandittriedtomaketheselearntodothis, um, itwouldtake a whileandthistrainedandlike, I don't evenknowLike, what, threeminutes?
I justthinkthat's prettycool.
I mean, I understanditisbasicstuff, but, um, I thinkit's reallycool.
So s O.
Nowwecouldtakethingsfurtherand, likewecouldmake a biggerenvironment, wecoulddomorestepsorwhateveryouwanttodioandsofeelfreetotinkerwiththeenvironment.
Um, thenextthey'retheonlyotherthing I wanttoshowyouguysissomeoftheresultsofusingmuch, muchlarger, umuh, environment.
SoSowe'redoing a 10 by 10.
Ifyoujustchangethatto a 20 by 20 you'recute.
Tablesizegoesfromabout 15 megabytesto, like 250 megabytes, justforcomparisonsake.
Andthenif I figureoutwheretheheck I promiseyou, there's somecoolvideosandphotos.
Wejusthavetogettothem.
Soletmeseewhatthisoneis.
Thisone's probablywhatwewerejustlookingat.
Yeah, um, andthen I justshowedhowtohowtogetitlive.
Howtogetmovement.
Blah, blah, blah, blah.
Nobodycareshere.
Sohere I starttoactuallytrainfor 20 by 20 space.
Sothisis a 20 by 20 withnomovement, I wanttosay, Yeah, sojustseeingcoulditactuallylearnedmuchlargerenvironment, andobviouslyitdoesprettywell.
Uh, andthen I turnedonmovementforboththeenemyinthefood.