資源描述:
《數(shù)據(jù)結(jié)構(gòu)與網(wǎng)絡(luò)游戲(data structures and online games)》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、數(shù)據(jù)結(jié)構(gòu)與網(wǎng)絡(luò)游戲(Datastructuresandonlinegames)Whenitcomestotheapplicationofdatastructures,peopleoftenassociateitwithsystemsoftwaredevelopment.Forexample,inacomputeroperatingsystem,afirstcome,firstserviceschedulingapproachhelpstoimprovetheperformanceofthesystembyapplyingthequ
2、euestructuretohelpquicklyfindthefirsttasktobecompleted.Whenitcomestodatastructuresandonlinegames,itseemsirrelevant,butinfact,datastructuresareusedeverywhereinonlinegames.Ifthedatastructureandthenetworkgameisagoodcombination,canhelptoimprovethespeedofthegameprogramasev
3、eryoneknowsagoodprogramshouldincludeareasonabledatastructure,reasonableorganizationofdatatobeprocessed,andthecorrespondingdatastructureofthealgorithm.Tointegratedatastructureswithonlinegamesistoprocessdatainonlinegames,applyreasonabledatastructures,andapplyefficiental
4、gorithms.Theproblemsthatneedtobedealtwithinonlinegamesincludethedatainvolvedinthegame,theactionsofthecharactersandtherulesofthegame,andsoforth.Next,Iwilldiscusstheapplicationofdatastructureinnetworkgame.GamedataprocessingOnlinegamesincludealotofdatathatisstoredinadata
5、baseontheserver.Whentheplayerlogsintothegame,theplayergetsdataabouttheserverfromtheserver'sdatabase.Theplayer'sdataincludestheroleshechooses,thecurrentlevelofplay,thepropshehasreceived,thetasksthathavebeencompleted,thetaskstobecompleted,andsoon.Therearevariouskindsofd
6、ataandhugeamountofdata.Inordertofacilitatetheprocessing,weshouldselectthereasonabledatastructurefortemporarystorageaccordingtothetypeofdata,whichisconvenientfortheservertoprocessdataforsuccessfulplayers.Theplayer'spropswillincreaseasthelevelincreases,thetypeandquantit
7、ywillincrease.Ifyoustorethestructureinalineartable,youhavetocreatealineartablestructureforeachitem,andthentherearemultiplelineartablestobebuiltforavarietyofitems.Ifaplayerlogsinwithmultipleaccountsatthesametime,aproblemarises,anditisnotconvenientfortheservertofindoutw
8、hichaccounteachoftheitemsinvolvedinthelineartablebelongsto.Whenplayersplay,theymaygetnewpropsatanymoment.Itisalsoadifficultp