Game network programming synchronizing graphs -


i trying develop computer game. want game multiplayer playable. game arcade space shooter

i plan run game @ server level , send updates @ clients. problem facing object creation. let's if player shots, shots new objects. these need created.

in game have hierarchical structure , shots part of structure. tree. problem have identifying objects on clients , server.

how can make sure when client receives update update right objects?

what new object creation. in case scene graph traversed , each object updated once gets updates server. updates creates new object violates principle. how should handle them?

also, can't updates entire scene. need update specific objects visible player. should rest of objects aren't visible? happen when become visible? how can track when objects become visible player?

how can make sure when client receives update update right objects?

you can give unique id each object server creates. might want create super object class containing id , let other game object classes inherit it. or, can have map link between id , object. or, can mix them. unique id, server can have global 'nextid' int , assign new object , increase next one.

but updates creates new object violates principle.

i don't understand principle talking if worried editing scene graph (or game object list) while traversing it, can put newly created objects list , insert new ones after traversing done. start getting updated next update. (you should consider how remove object too)

what should rest of objects aren't visible? happen when become visible?

well, 1 should figure out because depends on game system. suggestion try skip updates , see problems appear , fix them.

how can track when objects become visible player?

also, several ways handle this. server can detect clients , send visible object info each client. or, each client can detect them , send request server starting update visible ones. or, mixed way.

try server-driven 1 first , see if server can perform maximum number of clients.to use client-driven one, remember each client still needs update object location regardless of visibility send request ai updates visible ones.

again, there many ways handle kind of problems , depends on game system requirements. that's why it's hard answer question without knowing game system enough. try investigate how other similar multiplayer games designed books or google. luck!


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -