0% found this document useful (0 votes)
296 views17 pages

Tribes Networking Model

This document summarizes the TRIBES Engine Networking Model developed to support multiplayer online gaming over the internet. The key aspects of the model are: 1) Classifying data into different delivery requirement categories; 2) Using multiple stream managers to handle different data types and ensure delivery requirements are met; and 3) A connection layer that notifies the stream layer when packets are delivered or dropped without retransmitting packets.

Uploaded by

WWQQ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
296 views17 pages

Tribes Networking Model

This document summarizes the TRIBES Engine Networking Model developed to support multiplayer online gaming over the internet. The key aspects of the model are: 1) Classifying data into different delivery requirement categories; 2) Using multiple stream managers to handle different data types and ensure delivery requirements are met; and 3) A connection layer that notifies the stream layer when packets are delivered or dropped without retransmitting packets.

Uploaded by

WWQQ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

TheTRIBESEngineNetworkingModel

orHowtoMaketheInternetRockforMultiplayerGames
by
MarkFrohnmayerandTimGift
[Link]@[Link]@[Link]

Abstract
Thispaperdiscussesthenetworkingmodeldevelopedtosupporta
"realtime"[Link]
developedforTRIBESII,andwasfirstimplementedinStarsiege
TRIBES,amultiplayeronlineteamgamepublishedinDecember
'[Link]:supportfor
multipledatadeliveryrequirements,partialobjectstateupdates
andapacketdeliverynotificationprotocol.
Overview
StarsiegeTRIBESsupportstwomodesofplay:singleplayeror
[Link]
supportsupto128humanorAIcontrolledplayersinasingle
[Link]
[Link]
andisdesignedtodealwithlowbandwidth,highlatencyand
intermittentpacketloss.
Themodeldealsprimarilywiththedeliveryofdataandakey
conceptistheclassificationofdeliveryrequirements.
Alldataisclassifiedintooneofseveralrequirementcategories
andthedesignofeachcomponentinthemodelcentersaround
[Link]
follows:
1.
2.
3.

Nonguaranteeddataisdatathatisneverretransmittedif
lost.
Guaranteeddataisdatathatmustberetransmittediflost,
anddeliveredtotheclientintheorderitwassent.
MostRecentStatedataisvolatiledataofwhichonlythe
latestversionisofinterest.

4.

GuaranteedQuickestdataisdatathatneedstobedeliveredin
thequickestpossiblemanner.

Thenetworkingmodelisdividedintothreemajorcomponentsas
showninFigure1:
1.

AConnectionLayerthatdealswithnotificationanddelivery
[Link]
layeralongwithastreamclassprovidethegeneral
infrastructureonwhichtheotherlayersarebuilt.

2.

[Link]
layeremploysfivestreammanagerstodealwithevents,object
mirroring,inputmovemanagement,staticdataandstring
[Link]
differentdatadeliveryguarantees.

3.

ASimulationLayerwhichmanagesallobjectsinthe
[Link]
scopeofthisarticlebutseveralitemsarerelevant:the
advancementoftime,objectscopingandclientprediction.

ThoughStarsiegeTRIBESemploysaclientserverconnectionmodel,
[Link]
preventsthismodelfrombeingusedinpeertopeerormulti
serverarchitectures.

SimulationLayer
Ghost
Manager

Move
Manager

Datablock
Manager
EventManager

String
Manager
StreamLayer

StreamManager
ConnectionManager

ConnectionLayer

PlatformPacketModule
Figure1

PersistentObjects
Thoughpolymorphicobjectpersistenceisnotanintegralpartof
thenetworkingmodel,itisafeaturethatisusedextensively.A
largepercentageofdatatransmissionisdoneusingpersistent
objectsandthepolymorphicnatureoftheobjectsusedtohide
thetypeandcontentofthedatafromthenetworkingcode.

Eachclassthatisdeclaredpersistentregistersa"class
representative"(ClassRep)objectwiththePersistmanagerandis
[Link]
[Link]
mappingassignedClassIDstoClassRepsthePersistmanagercan
[Link]
constructionbyClassIDalongwithvirtualreadandwrite
methodsprovidesbasicpolymorphicIO.
[Link]
classIDiswritten,thentheobject'svirtualwritemethodis
[Link],
constructingtheobjectusingthePersistmanager,andthen
[Link]'s
class,andthedataitreadsandwritesarehiddenfromthe
streammanagers.
ConnectionLayer
TheConnectionlayerprovidestransmissionofpacketsbetween
hostmachinesandisdividedintotwomodules,aplatformpacket
[Link]
providesbasicconnectionlessunreliablepacketdelivery,
[Link]
managerprovidesavirtualconnectionbetweentwohostsandwhile
itdoesnotprovidedeliveryguarantees,itdoesprovidepacket
deliverystatusnotifications.
Thisnotificationguaranteeisveryimportanttothe
architecture;apacketlayerthatsupportsonlyguaranteedor
nonguaranteedpacketswouldnotbesufficienttosupportthe
[Link]
deliverymodeishandledisdelegatedtoahigherlevelthe
connectionmanageronlyguaranteesthecorrectnotificationofa
sentpacket'sstatus.I.e.,ifapacketisnotifiedasdroppedit
waseitherdroppedordeliveredoutoforder(andsubsequently
dropped),andifapacketisnotifiedasdelivered,ithasbeen
delivered.
TheConnectionmanagernotifiestheStreamlayerofthestatusof
[Link]
[Link]
transmittedbytheConnectionmanager;theStreamlayer,andits
associatedmanagers,[Link]
packetsareneverretransmitted,theyarefreedimmediatelyafter
transmission.

StreamManager

Packet
Data

PacketNotifyEvent
DeliveryStatus

Packet
Data

ConnectionManager

Packet
Address
Data

Packet
Address
Data

ConnectionLayer

PlatformPacketModule
Figure2

TheConnectionmanageremploysaslidingwindowprotocolinorder
[Link],
transmissionstopsuntilanAcknowledgmentisreceived.
Acknowledgmentofpacketsisonlyusedtoadvancethewindowand
[Link]
overheadof3bytesperpacket.
Thoughnotpartoftheprotocol,animportantfeatureofthe
architectureisbitpackingprovidedbyacustombitstream
[Link],
includingread/writefunctionsfor:asinglebit,variablelength
integers,variablelengthnormalizedfloats,andHuffman
[Link],includingtheheaderandthe
slidingwindowprotocol,[Link]
packingfeaturesareusedextensivelyandvirtuallyalldatais
transmittedusingthesmallestnumberofbitspossible.
Examplesofbitpackingusingthebitstream.
Writingintothepacket:
if(stream>writeBool(updateDamage)){
//Uses1bit
stream>writeInt(mDamageState,2); //Uses2bits
if(mDamageState!=Dead)
stream>writeInt(mDamageLevel,6);
if(stream>writeBool(mRepairActive))

stream>writeInt(mRepairRate,4);
}
Thematchingreadmethod:
if(stream>readBool()){
mDamageState=stream>readInt(2);
if(mDamageState!=Dead)
mDamageLevel=stream>readInt(6);
mRepairActive=stream>readBool();
if(mRepairActive)
mRepairRate=stream>readInt(4);
}
StreamLayer
TheStreamlayeriscomprisedofaStreammanagerandtheEvent,
Ghost,Move,[Link]
managerdealswiththefrequencyofpackettransmissionaswell
[Link]
streammanagersdealwiththepackinganddeliveringofdata
[Link],
dealingprimarilywiththecompressionofstringdata,isnot
coveredinthisarticle.
TheStreammanagerallocatesandtransmitspacketstoits
[Link],eachStream
[Link]
setbytheremotehostsStreammanagerandrepresenttheamount
[Link]
dedicatedserversetthesevaluestorepresentthebandwidthof
[Link]
witha28.8modemthenitcouldsetarateof10packetsper
secondwithasizeof200toproduceabout2Kofdatapersecond.
Theclientmaychangetheseparametersontheflyinresponseto
[Link],
theserverimposesamaximumbandwidthperclientbasedonits
ownconnectionquality.
PacketsareallocatedbytheStreammanagerandfilledbythe
Move,Event,[Link]
intothestreamisgiventothemanagersinafixedorder,this
[Link]
packetsizeisexceededorallthemanagersaredone,thepacket
[Link]
3showsanexamplepacket.

Header

StreamManagerData

Move

MoveManagerData

Packet1
Event1
Event2

EventManagerData

Event3
GhostState1

GhostManagerData

GhostState2
Figure3:ExamplePacket
WhenapacketisdeliveredtotheStreamlayerforreading,it
simplyhandsoffthepackettoeachstreammanagerinthesame
fixedorderandeachmanagerisresponsibleforreadingthedata
writtenbyitscounterpart.
TheStreammanageralsoprovidesaTransmissionRecordforeach
packetthatitconstructs(showninFigure4).Whenastream
managerstoresdataintoapacket,itstoresinformation
[Link]
ConnectionmanagerNotifyEventoccursforapacket,the
TransmissionRecordforthatpacketisprocessedbytheStream,
EventandGhostmanagers,andisusedtoprovidedelivery
[Link]
Eventsforeachpacketintheordertheyweresent,the
TransmissionRecordsarestoredinasimpleFIFO.
EventStreamManager
TheEventStreammanagerisresponsibleforprovidingguaranteed
andnonguaranteeddeliveryofeventobjectsfromonehostto
[Link]
[Link]
[Link]
TransmissionRecords.
WhentheEventmanagerisgivenapackettowriteinto,itpops
eventsoffitsoutgoingqueueandwritesthemintothestream
untileitherthepacketsizeisexceeded,thequeueisempty,or
[Link]
writtenusingthemethodsdiscussedearlier.
Onceeventsarewrittenintoastream,theyarelinkedtogether
[Link]

theStreammanagerisnotifiedofapacketsstatus,the
TransmissionRecordforthatpacketispassedtotheEvent
[Link]
deliveryofthepacketthentheeventsattachedtotherecordare
[Link]
signalsnondeliverythentheeventsassociatedwiththelost
packetaresimplypushedontotheheadoftheeventqueueforre
transmission.

Transmission
Record1
NextRecord
EventList
GhostList

Event1
NextEvent

Event2
NextEvent

TR2

TR3

Event3
NextEvent

Figure4:Transmissionqueueincludingrecordwith
events
Whenthemanagerisgivenapacketstreamtoread,itunpacksand
[Link],
itisaddedtoanorderedqueueusedtoprovideordered
[Link]
(fornonguaranteedevents)orastheorderedqueueisadvanced.
SinceneitherthetransmittingnorthereceivingEventmanagers
storedeliverystatusinformationintothepacketstream,this
protocolimposesverylittleoverheadabovethatalreadyimposed
bytheConnectionmanager,normally3bitsperpacketand1bit
perevent.Ifapacketisdroppedanadditional714bitsper
packetmaybewritten.
Inpacking,deliveringandguaranteeingEventobjects,theEvent
managerprovidesafundamentalserviceusedbymanyother
[Link],
unpackedandprocessedusingvirtualfunctionsandthePersist
manager,theEventmanageritselfhasnoknowledgeofthetypeor
contentsoftheseevents.
Anexampleofasimpleevent:
classSignal:publicEvent{
enum{

SignalBits=4,
};
U8signal;
public:
Signal(U8s){
guaranteed=true;
signal=s;
}
voidpackData(Bitstream*stream){
stream>writeInt(signal,SignalBits);
}
voidunpackData(Bitsream*stream){
signal=stream>readInt(SignalBits);
}
voidprocess(NetConnection*ps){
printf("Recievedsignal%dfromhost%s",
signal,ps>getObjectName());
}
};
GhostStreamManager
TheGhostmanagerprovidestwokeyfunctions:the"ghosting"of
objectsfromonehosttoanother,andthetransferringofstate
[Link]
isacopyofanobjectpersistedandtransmittedtoaremote
[Link](and
thusperremotehost),butmaybeghostedbyseveralGhost
managersatonce(todifferentclients,forexample).Ghostsare
createdusingaformofguaranteeddeliveryalsousedtosupport
[Link]
dataisconsideredvolatileandtransferredusinga"MostRecent
State"algorithm.
Sinceghostinganobjectinvolvesnetworkoverhead,theghost
managerdoesnotghostallobjectsinthesimulation,butinstead
hasaconceptof"scope."Objectsmaycomeinandoutofscope
foramanagerforanumberofdifferentreasons(thisprocessis
managedintheSimulationlayer).Whenanobjectcomesinto
scope,itsghostistransferredtotheremotehost;whenan
[Link]
isinscope,statedataistransferredbetweentheobjectandits
ghostandisupdatedataratebasedonitspriorityandstate
[Link]"ghostalways"
objects,whicharealwaysinscope.
Whenanewobjectcomesintoscope,theobjectistaggedwitha
[Link]
isassignedfromalimitedrangeandisusedbythelocalmanager
[Link]
managermaintainsadictionary,whichtranslatesGhostIDsinto
[Link]
anobjecttoitsghost,itsGhostIDisembeddedinthestreamso
[Link]

RecordsStateMaskrepresentsstatedatathatanobjectis
interestedintransferringandistheheartofthe"MostRecent
State"[Link]
dependantsetofrelateddata,orstate,thatwillbe
[Link]
onestatebit,changesinrotationasanother,andpossiblya
changeinanimationstateasathird.(TRIBESsimulationobjects
typicallyhaveupwardsof20stateflags.)Eachstateistracked
andtransferredindependentlyoftheothers,providingthe
abilitytoperformpartialupdatesofanobjectstotalstate.
Whentheghostmanagerisgivenapackettofillbythestream
manager,[Link],itbuildsan
updatelistwhichincludeseveryobjectwithastatuschangeor
[Link]
change,[Link]
transferringordeletingofghostsfromtheremotehost;an
object'spriorityisavalueassignedbytheSimulationlayeras
[Link],theupdatelististraversed
inorderwritingtheGhostID,statusandobjectstate
informationintothepacketuntilthepacketisfilledorthe
[Link],
atransmissionstructureisconstructedcontainingthestatus
[Link]
totheTransmissionRecordforthepacketasshowninFigure5.
TheStateMaskbitsintheTransmissionstructurerepresentthe
statedatawrittenintothestreambytheobject.

Transmission
Record1
NextRecord
EventList
GhostList
TR2

Object1GTR1
NextRecord
StateMask[111]
NextObjectTR

Object2GTR2
NextRecord
StateMask[101]
NextObjectTR

Object1GTR3
NextRecord
StateMask[010]
NextObjectTR

TR3

Figure5:Transmissionqueueincludingghosttransmissionrecordsfor
objects1&2

Whenaghostmanagerreceivesapacket,itreadseachsetof
[Link]
ghost,thePersistmanageriscalledtoconstructtheobjectand
[Link]
statuschangeisadeletionrequest,theghostobjectisobtained

[Link],
[Link]
obtainedfromtheIDdictionaryanditsunpackmethodiscalled
[Link]
usedbythesourceobjecttopackdataisnottransmittedtothe
[Link]
intothebitstream.
Theguaranteeofobjectstateinformationhappensasfollows;
StateMaskbitsrepresentstatechanges,soifanobject's
positionchanges,itsetsits"positionstate"bitintheState
[Link],the
[Link]
bitnowrepresentsstatedatathattheGhostmanagerneedsto
transfertotheobject'[Link]
packet,objectswithanonzeroStateMasksareaskedtowrite
intothepacketstreamgiventhecurrentmaskforthatGhost
[Link]"positionstate",theobject
[Link]
representswhichstateswerewrittenintothepacket,andthe
maskisstoredinatransmissionstructurewhichislinkedtothe
[Link],theStateMaskis
[Link],thentheStateMask
foreachobjectwhichhaddatainthatpacketisupdatedto
[Link]
subsequentlysentpacketcontainedthesamestatebitforthat
[Link],ifalater
packethasalreadybeensentwithalaterversionofthatstate,
thenthisrequirementhasbeenmetandnootheractiontakes
place.
InFigure5,ifthepacketforTransmissionRecord1islostthen
bits[101]forobject1and2areconsideredlost;whereasbit
[010]forobject1isnot,becauseGTR3,alaterupdate,has
[Link]'sStateMask,
thenthatstatewillgetretransmittedatthenextopportunity.
Statuschanges,suchasobjectconstructionanddeletion,are
handledinasimilarfashion.
Exampleofstatemasks:
Anobject'spositionchangesanditsetsitsPositionState
[Link]'s
stateandcallstheobjectspackmethodwiththestate
[Link]
itspositionandwritesitscurrentpositionintothe
[Link]
containingthePositionStatebitinthenotification
structureforthatpacketandtheStateMaskisthen
cleared.
Firstpossibility:thepacketisdeliveredandthestate
[Link]'sposition
hasnotchangedsincethepacketwassentandtheState
Maskisstill0sonofurtheractiontakesplace.

Secondpossibility:thepacketisnotdeliveredandinthe
meantimetheobject'[Link]
[Link]
newPositionStatedatafortheobject,thePositionState
[Link]
samepositionwillgetresentthenexttimetheobjectis
packed.
Thirdpossibility:thepacketisnotdelivered,butinthe
meantime,theobject'[Link]
notificationofnondelivery,anotherpacketwasalready
[Link],themanager
knowsthatPositionStatedatahasalreadybeen
[Link]
possiblebecausetheGhostmanageronlyguaranteesthatthe
latestversionofthestatedataistransferredandnotany
[Link],
thisisexactlythebehaviorwewanttheposition
informationcontainedinthelostpacketisstaleandwe
don'[Link]
notifiedaslost,wealsodon'twanttoretransmitthe
currentposition,asithasn'tchangedsincethesecond
packetwassent.
Fourthpossibility:thepacketisnotdelivered,andinthe
meantime,theobject'[Link]
positionchangewasrecentandnosecondpackethasbeen
[Link]
PositionStatedatafortheobject,theobject'sPosition
[Link]
havealreadysetthebititself,sothiswillnotchange
[Link]
itwillwriteitscurrentposition,notthepositionsent
[Link],the
positiondatalostinthedroppedpacketisneverresent.
LiketheConnectionmanager,Event,andotherstreammanagers,a
serverwillhaveaGhostmanagerforeachclientconnectedtoit.
IfthereareseveralGhostmanagersghostinganobject,the
[Link]
willhaveadifferentGhostIDandStateMaskforthatobject
[Link]
anobjectsetsoneofitsstatebits,itupdatestheStateMask
foreveryGhostmanagercurrentlyghostingitandeachmanager
tracksandupdatesstateinformationindependently.
Thisprocessoftrackingstatemasksandguaranteeingthe
deliveryofstateinformationbetweenobjectandtheirghostsis
[Link]
almostexclusivelyonthismechanismtotransferinformation.

MoveStreamManager
TheMovemanagerguarantees"soonestpossible"deliveryofclient
inputmovestotheserverand"soonestpossible"deliveryof
[Link]
deliveryofmovesandalsotosynchronizemoveprocessingbetween
[Link]
thatmovesareonlysentfroma"client"connectiontoa"server"
connectionandControlObjectstatedatafromserverobjectto
clientghost.
Inputmovesareusedtocontrolsimulationobjectssuchas
vehicles,cameras,[Link]
byanInputManager,whichcollectsamoveevery32milliseconds.
Movesconsistofx,yandztranslations,yaw,pitchandroll
[Link]
deliveredtoobjectsbytheMovemanagerandarethesolemeansof
usercontrolledobjectmovement.
TheMovemanager,similartotheEventandGhostmanagers,writes
informationintoeverypacketstreamallocatedbytheStream
[Link],itmakesnouseofthe
TransmissionRecordortheConnectionmanager'snotification
[Link],theMovemanagerprovides"soonestpossible"
deliveryofmovestotheserverbywritingmovesintoeverypacket
[Link]
[Link]
lastmovereceived,whichtheclientusestoadvanceasliding
[Link],the
clientsimulationishalteduntiltheserveradvancesthewindow.
If3packetsaredroppedinarowthenanymovesuniquetothose
packetsarelost.
InStarsiegeTRIBES,everymoveinthecurrentwindowwas
transmittedineverypacketguaranteeing100%deliveryofall
moves,butthiswassometimesthecauseofanegativefeedback
[Link]
bywideningtheslidingwindowandcausingmoremovestobe
[Link]
packetsizecouldexceedtheconnection'sbandwidth,causingmore
[Link]
guaranteeddelivery,theclientrespondsbetterwhenlargenumbers
[Link]
servercontrolobjecttogetoutofsyncwhichmayproducea
momentarywarpingfortheclient.
TheControlObjectforaclientistheobjectthatreceivesthe
[Link]
[Link]
Objectshavetwomajorrequirementsthatdifferentiatethemfrom
[Link]
[Link]
movesgeneratedbytheplayerandboth,giventhesamestarting
state,[Link]
controlobjectmustbeabletotransferitscurrentstateon

[Link],andthuscantransfer
informationusingtheghostStateMask,theMovemanagerprovides
aseparate"Soonestpossible"deliveryofaControlObject'sstate
[Link]
[Link]
informationsenttoaghostisnormallylimitedtothatneededto
rendertheobject,[Link]
Objectstateinformationmustincludeeverythingneededto
deterministicallyprocessinputmoves."Soonestpossible"
deliveryofthiscontrolstateinformationisachievedbyhaving
theControlObjectwriteitscurrentstateintoeverypacketsent
[Link]
deterministicmoveprocessingisusedtokeeptheControlObject
anditsghostsynchronized,andtoallowtheclienttopredictthe
motionofthecontrolobjectaheadofserverupdates.
DeliveringmovesandControlObjectstateupdatesassoonas
possiblealongwithclientpredictionofmoveprocessingallows
smoothandimmediateresponsetoplayerinput,whileproviding
fullvalidationofallplayermovesbytheserver.
DatablockStreamManager
TheDatablockmanagerprovides"lateststate"deliveryof
[Link]
whichcontainrelativelystaticdataandthemanagerguarantees
[Link]
theGhostmanager,theDatablockmanagerisasymmetric,and
[Link]
commonuseofdatablocksistotransmitinitializationor
referencedataforghosts.
Datablocksarecopiedtotheclientinastreamofguaranteed
[Link]
updatedduringthenormalcourseofasession,butonlyatfixed
timessuchaswhenfirstconnectingtoaserverorduringamap
[Link]
[Link]
currentvalueofthiskey,afterwhichthekeyisincremented.
Themanagerkeepsthehighestkeyvaluetransmittedtoitsremote
[Link]"lateststate",ifa
Datablockismodifiedseveraltimesbetweenupdates,this
[Link],sincethechangesto
datablocksarelowinfrequency,theGhostmanagersoverheadof
partialstateupdatesisnotnecessaryachangeddatablockis
retransmittedinitsentirety.
UnliketheotherConnectionstreammanagers,theDatablock
managerdoesnotwriteinto,orreadfromthepacketbitstream
[Link]
fromthescriptinglanguageandinvolveloopingthroughallthe
existingdatablocksandtransmittingeverydatablockwitha
modifiedkeygreaterthanmanager'[Link]
datablocksisperformedbysendingguaranteedDatablockEvents

[Link]
objecttotransmit,andthedatablockispackedaspartofthe
event.
Asanexample,theVehicleclasshasanassociatedVehicleData
[Link]
propertyattributessuchasshape,maximumspeed,maximum
acceleration,suspensionpropertiesforwheels,[Link]
Vehicleobjectisconstructed,itisassignedaninstanceofthe
[Link]
Datablockrepresentsadifferentsetofattributesdescribinga
differenttypeofvehiclesuchasatank,scout,transport,etc.
TheVehicleclassitselfrepresentstheinstanceofthatvehicle
typeinthesimulationandprovidesallthecodeanddynamic
attributesnecessarytosimulatethevehicle.

VehicleDataDatablock
Instancewithstatic
vehicleattributes
Server

VehicleDataDatablock
Copyofstaticvehicle
attributes
Client

VehicleClassObject
Datablock
Dynamicvehicle
attributes

VehicleClassGhost
Datablock
Dynamicvehicle
attributes

Figure5:VehicleDatablockrelationshipmirroredonclient

Theadvantageofthisseparationofstaticattributedataand
instancedataisthatDatablocksarenormallyonlytransmittedto
[Link]
ghostedtotheclient(aprocessthatcanhappenoften)itsends
onlyitsdatablock'sIDalongwithotherdynamicdatarelevantto
[Link],whilestill
providingtheflexibilityofdefiningstaticattributedataon
theserver.AsshowninFigure5,theclientwillmirrorthe
samerelationshipofVehicleinstancetoVehicleDatadatablock.
Sincedatablocksareonlytransferredattimeswhenthe
simulationiseffectivelystopped,morebandwidthisavailable
anddatablockscancontainmoreinformationthanwouldnormally
[Link]
extraoverheadtothebitstreamduringthenormalcourseof
simulation.

SimulationLayer
TheSimulationlayerperformsanumberoffunctionsofwhichonly
afewarerelevanttoadiscussionofthenetworkingmodel.
Thesearetheadvancementoftime,scopingfortheGhostmanager,
andclientsideprediction.
Advancementofsimulationtimeiscenteredontheprocessingof
moves.Movesaregatheredevery32milliseconds,andthe
simulationisadvancedin32millisecondincrementswithamove
[Link]
areadvancedinthesamemannerandifaMovemanagerisnot
controllinganobject,thenitispassedNULLmoves.
Thoughclientobjectsareadvancedinfixedincrements,the
[Link]
presentasmoothview,especiallyonamachinewithahighframe
rate,timeisalwaysadvancedtothebeginningofthenext
interval,andghostobjectsmaintainbackwardsinterpolation
informationwhichisusedto"tween"framesbetweenticks.
Objectsontheserverareneverrenderedsotheydonothaveto
performthisfunction.
Simulationobjectsmustbescopedandprioritizedfortheghost
[Link]
[Link]
sense,thismeansallobjectsthatarepotentiallyvisibletoa
clientfromthatclient'[Link]
scopingisperformedusingaspatialdatabasemaintainedbythe
[Link],the
objectitselfdeterminesitsownprioritybasedoninformation
suchascurrentghoststatemask,distancefromthescoping
object,projectedradius(usingthescopingobjectsview
frustrumparameters),relativevelocity,animationstateand
interestmodifiers(projectilesthataremovingtowardsthe
clientaremoreinterestingthanvehicles,vehiclesaremore
interestingthanitems,etc.).
Therearetwoformsofclientsidepredictioninthismodel.
FirstistheControlObjectmovepredictionperformedbytheMove
[Link]
foundationforcontrollingandpredictingobjectssuchas
players,vehicles,[Link]
performedbynoncontrolledghostobjectssuchasprojectiles,
items,[Link]
objectsthemselvesandnosupportingstructureisprovided.
AnexampleofapredictionstrategyisthatprovidedbytheItem
class,[Link]
entirelybythephysicsoftheenvironmentanddoesnotprocess
[Link]
[Link]
dynamicobjectishitontheserver,thenitsghoststatemaskis
[Link]

clientghostreceivesanupdatefromtheserver,itinterpolates
itscurrentpositionsmoothlytotheserver'supdatedposition
[Link]
thevehicleandplayerclasses,whichhavetodealwith
predictingmovementfromotherclients.
Summary
Byclassifyingdataaccordingtoitsdeliveryrequirementsand
organizingthestreammanagerstoefficientlymeetthose
requirements,theTribesIInetworkingmodelattemptstomake
[Link]
objectscopingandprioritizationofpartialobjectstate
updates,theTRIBESIIengineallowssmoothvisualizationof
largevirtualenvironmentsoverlowbandwidthconnections,even
whenasubstantialnumberofobjectsarevisibletoaclient.
Thoughthemodelprovidesasolidfoundationfornetworktraffic,
itisnotsufficienttosimplyprovideafastreliableconnection
betweenhosts;therewillalwaysbebandwidthandlatencyissues
[Link]:choicesmade
whendecidingwhichobjectbehaviorshouldbemanagedbythe
serverandwhichbytheclients,whichobjectstateinformation
totransfer,howtoorganizeobjectpartialstates,howto
prioritizeobjectstatechangesrelativetoeachother,which
compressionalgorithmtouse,andhowtoperformclientside
[Link]
effectonperceivednetworkperformance.
ThismodelwasfirstimplementedinStarsiegeTRIBES,which
[Link]
IIhasthefollowingimprovements:
1. ReorganizationandsimplificationoftheConnectionandStream
layers.
2. BetterpacketheadercompressionfortheConnectionmanagers
notificationprotocol.
3. Areductioninthenumberoftimesmovesareretransmittedto
avoidnegativefeedbackloopsduetoincreasedpacketsize.
4. Betterdatacompressionbyindividualobjects.
5. TheadditionoftheStringmanager,whichprovideshighorder
compressionforrepeatedlytransmittedcharacterstrings(not
discussedinthisarticle).
Severalmodificationstothemodelhavebeenconsidered,and
thoughtheywillnotbeimplementedforTRIBESII,areworth
[Link]:
1. [Link]
arecurrentlyproducedataconstantratedictatedbythe
[Link]
producedassoonasdataisavailablefortransmissionordata
priorityreachesagiventhreshold.
2. [Link]

Connectionmanagersarecurrentlyprocessedatthesametime
[Link]
couldbechangedtosupportaprimarysimulationthreadwitha
[Link]
ConnectionandStreammanagerswithlowerlatency
communicationwiththeirremotehostaswellasprovidebetter
supportformultiprocessorhardware.
3. Theadditionofnewstreammanagers,includingamultiplexing
[Link]
simplerapproach.
4. [Link]
[Link]
couldbemodifiedtoadjustitsperclientbandwidthbasedon
thenumberofconnectedclients.
5. Determineamethodofautomaticallyandeffectively
calculatingtheavailablebandwidthonaconnection.
Bandwidthsettingsarecurrentlysetmanuallybyaclient.
Acknowledgments
ThoughseveraloftheideaspresentedhereareuniquetoTRIBES,
othershavebeenassimilatedfromothersourcesovercountless
yearsofreadingandtheauthors,beingtoolazytoresearch
theirsources,wouldliketothankeveryoneinonesentence.

You might also like