Jump to content

  • Log In with Google      Sign In   
  • Create Account


General Game Questions


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Demitri   Members   -  Reputation: 122

Posted 03 February 2000 - 11:23 AM

I am writing a multiplayer MUD. I''m learning Win32, Winsock and Directx as I go along, so my question may be answered simlpy, but here goes anyways.. How am I going to setup my game so that everything runs smoothly? I mean, take the client end for example, it''s going to have to send out information via winsock, directx will have to draw various stuff and do it''s thing, and windows will be handling messages.. Can this all happen without the game really bogging down? I mean.. what if it should be drawing something while it''s sending/recieving data, or maybe the users decides to click the mouse 50 times/second and the window is just recieving mouse-related messages? How would I set all this up so one thing doesn''t interfere too much with another? Thanks for any help in my confusing situation.. Sincerely, Tim Elliott

Sponsor:

#2 LordFoul   Members   -  Reputation: 122

Posted 03 February 2000 - 11:33 AM


The client should have a standard loop just like
any other game.

while( !end_of_game )
{
handle_user_input
send_network_output
handle_network_input
draw_next_frame
}

Or something like that. In a client-server model,
the handling of network input can replace (or work
along with) the point in your loop where all of
your game objects "think". If you receive a network
message while you are just starting to draw a frame,
don''t do anything with until you finish drawing the
frame and get back around to network input part of
your loop. And since you''re using DirectX, you should
use DirectInput''s buffered mode to handle mouse and
keyboard (and joystick if you need) for much more
efficient handling than windows messages.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS