Screeps - A fun and exciting way to improve programming skills
文章推薦指數: 80 %
Screeps is a strategic MMO where you write your own AI. The language used is NodeJS-like Javascript with the lodash library included, however ...
Softwaredevelopmentisatoughjob.Everyyearthereseemtobemoreandmore"Javakillers","Javakiller-killers"andrevolutionaryparadigmshifts(UsuallyfromObject-orientedtofunctionalandbackagain).Inordertostayrelevantweneedtoputinthetimeoutsideofworktotryoutthesenewlanguages.Itcanbeverydifficulttokeepthisupwhenmostoftheselanguagessinkbackintoobscurityseveralmonthslater.IusuallymanagetoforcemyselftodoanaverageofthreeorfourhoursaweekofselfdevelopmentwhichIfeltwasprettygoodconsideringhowlongI'vebeeninthejob.
TowardstheendoftheholidaysIfoundScreeps(www.screeps.com)intheSteamsale.InthelastweekIhaveputin25hoursofselfdevelopmentandI'mstilllookingforwardtodoingmore.Screepsisagame,butitalsotricksyouintospendinghoursoncomputerscienceproblemswithoutrealizingitshouldbeconsideredwork.
SowhatisScreeps?
ScreepsisastrategicMMOwhereyouwriteyourownAI.ThelanguageusedisNodeJS-likeJavascriptwiththelodashlibraryincluded,howeveryoucanuseanylanguagewhichcompilestoJavascriptinordertowriteyourcode.Alistoftheselanguagescanbefoundathttps://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js(notmypage).Thismeansthatyoucanswitchlanguagesatwill,givingyoufullfreedomtopracticethatnewlanguageyou'relearningonrealproblems.
Manyofthenecessitieslikepath-findingareavailableintheAPIsoitdoesn'ttakeyouweeksofworktogetgoing.Youcancompletethe(free)onlinetutorialandthendivestraightintothegamewiththeAIyouhavedevelopeduptothatpoint.Theonlinetutorialisavailableathttps://screeps.com/a/#!/sim/tutorial
IfyouhaveneverdevelopedsoftwarebeforeyouwillwanttodoadayortwoofJavascriptpracticebeforestartingtoworkonthegame,thereisatutorialathttps://www.codecademy.com/learn/javascriptwhichisrecommendedontheScreepspagetogetyoustarted
Oksoit'sascriptinggame?Newlanguagesaside,howdoesitmakemeabettersoftwaredeveloperifthedifficultfunctionslikepath-findingandsearchingarealreadyimplemented?
ThebeautyofScreepsisthatyourCPUandmemoryarelimited.YoucanmakedowithveryinefficientcodetobeginwithbutasyourAIempiregrowsyoucanfindyourCPUusageincreasingexponentially.Highlevelplayersgosofarastowritetheirownpathingandsearchfunctionsbuttostartwiththere'ssomuchtodothatyou'lljustwanttogetthebasicsinplaceandimproveonitlater.
TogiveanexampleIstartedwithmyAIplacingstructuresinarandomfreesquarewithin10squaresofmycreep(minion)spawningpoint.TodayIintendtocreateabasicalgorithmtocreateefficientbuildingplacementtominimizetraveltime.
SoIneedtostartatthespawnandworkoutwardsinacircleuntilIfindafreesquarethatismorethan1squareaway.ThenIplacethestructureandcallthatmynewstartpoint.ThenIneedtoplaceanotherstructureclosetothatstructure.Buthowdoyouoptimizesothatyoudon'thavealineofstructuresmarchingawayintothedistance?Howdoyoumakesureyou'renotblockinganimportantpath?Whatifapreviouslyplacedstructureisdestroyed?
Youcanseehowcomplexevensimple(ish)problemscangetandthebottomlineisI'mexcitedtoworkonagraphproblemthatwouldhavehadmegroaningifitwereacomputerscienceassignmentbackincollege
What'sthecatch?
ThereareafewthingswhicharelessthanidealinScreepsduetothenatureofthegame
1)Nosourcemaps-Youcanminifyyourcodebutitmakesdebuggingintheconsoleverydifficult,onesolutionistoloadminifiedcodeandthenwhensomethinggoeswrongloadtheunminifiedcodeandhopethatit'snotaminificationbug
2)Nobreakpointdebugging-Not100%true,ifyouareworkingwiththesimulatorinthebrowseryoucanusedebugstatementsinyourcodebutyoucan'tdothisinthemainclientorinthemaingame.Ifyou'vebecomeaccustomedtochromeorfirefoxbreakpointdebuggingI'mafraidit'sbacktothelandofconsole.logforthemostpart.
3)Nologfilegeneration-I'msuresomepeopleseethisasabonus.Youcangenerateemailstoyourselfwhichcanbeusedforimportantthingsbutyoureallydon’twantanemailevery4seconds.
4)Themaingamerunsatabout1tickper4seconds-Thisisn'tanissueformebutsomepeoplemaywantafasterpace.Youcansetupastand-aloneserverandalterthetickrateifyouwish,thesimulatorwillletyourunquitefasttoo.
CanIuse
延伸文章資訊
- 1Screeps - A fun and exciting way to improve programming skills
Screeps is a strategic MMO where you write your own AI. The language used is NodeJS-like Javascri...
- 2Screeps: World on Steam
Screeps: World is an open source MMO RTS sandbox game for programming enthusiasts, wherein the co...
- 3Steam 社群:: Screeps: World
Screeps: World is an open source MMO RTS sandbox game for programming enthusiasts, wherein the co...
- 4screeps - 人氣推薦- 2022年2月| 露天拍賣
你想要的網路熱門推薦screeps人氣商品都在露天!買screeps立即上露天享超低折扣優惠和運費補助,新註冊會員天天享優惠,快來露天參加各種快閃優惠活動, ...
- 5Screeps 專為程序員設計經營模擬遊戲- HackMD
tags: Game --- # Screeps 專為程序員設計經營模擬遊戲## What is Screeps? * https://screeps.com/ > Screeps means ...