Skip to main content
gamedev.net
🔒 Locked

Access Methods

Started by foo_mark 7 replies 400+ views
Original Post
foo_mark
foo_mark
I was wondering when making an MMORPG Client-Server Based ofcourse, which access method should be the best. Broadcasting: - Pros, Would be very accurate at every second that the server sends information to all the users. - Cons, Consumes too much bandwith, by the time you play ur first sesion, you just notice that your consumption bill went up. Polling: - Pros, Bandwith consumption very efficient. - Cons, For the client side, character animations would look very choppy.
Kylotan
Kylotan
I''m not sure you entirely know what you''re talking about...

Broadcasting is rarely an option on anything but LAN games, for reasons I''m sure someone else can elaborate on better than I could.

And not only are there alternatives to ''polling'' sockets on most platforms, but there is no reason why polling would make character animation choppy on the client side. I can''t think why an MMORPG would need to transmit animation data anyway!

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]
Fidelio_
Fidelio_
quote:
Original post by foo_mark
I was wondering when making an MMORPG Client-Server Based ofcourse, which access method should be the best.

Broadcasting:
- Pros, Would be very accurate at every second that the server sends information to all the users.

- Cons, Consumes too much bandwith, by the time you play ur first sesion, you just notice that your consumption bill went up.

Polling:
- Pros, Bandwith consumption very efficient.

- Cons, For the client side, character animations would look very choppy.


From the other replies I think you''re talking about the client.

The best way would be to divide the world into zones, know which zone a client is in. The client sends his position to the server every second when it has changed, position, look direction and movement direction. The server sends that info to other clients which are near. Asking the client where he is (polling) is probably not very efficient, it doesn''t have any advantages.

The client should do lots of things by itself. EG. when you receive a message that another player is at (10,10,2) moving to (0.3,0,0.6) with speed 2, the client should interpolate that, to make the other players and npc''s look smooth. It doesn''t matter that it''s not always accurate, since it''s not a shooter game. You correct the movement based on messages,
foo_mark
foo_mark
I was thinking the exact same thing about dividing them into different worlds.

I was thinking that the client should ask for data and receive information (data packets) from the server only what the client sees around him (horizon).

And for those of you who aren''t familiar with the networking terms, here are the definitions:

Broadcast: A technique that uses a transmitter to send signals, such as network data, through a communications medium. For wireless networks, this involves sending signals through the atmosphere, rather than over a cable.

Broadcast packet: A packet type whose destination address specifies all computers on a network or network segment.

Polling: A channel access method in which a primary device asks secondary devices in sequence whether they have data to send.
Kylotan
Kylotan
quote:
Original post by Anonymous Poster
The client definatly has to transmit his coordinates in a game, right?

And the server has to transmit that information to all the rest of the clients.

So you mean at the logic level rather than the network level... right. Well, generally this is event-based, or near enough - the client submits a request to move, the server validates it, adjusts the database, and carefully selects which users need to know about the updated position, then sends the info to them. While the client is waiting for the server to reply, the client usually moves anyway and predicts the result from the server. This gives smoother results onscreen (what you somewhat misleadingly termed ''animation''), but when the results differ, the client will probably have to ''jerk'' back into place.



[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]
foo_mark
foo_mark
Should I be expecting my bandwith consumption to go around 100 MB or 200 MB per game that I play? (Client-side)

This is what I fear when writing the networking part of the game. If I use the wrong algorithm to manage this kind of information.
Fruny
Fruny
Any sensible WAN-Internet gateways drop broadcast packets.
Applying for a multicast address may achieve what you want.


Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.