Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Herr_O

Dplay problem :(

This topic is 6012 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I''m doing a small game using dplay7. When a player gets lost for some reason, maybe a crach or a full hour lag, I destroy that player on the server and send a destroy player msg to the others in the session. But here comes the problem.. When I try to send a guaranteed message from the server to all other players using DPID_ALLPLAYERS after that a player has timedout I get a few seconds delay on the server.. I think it has something to do with that dplay tries to send a guaranteed message to the previously destroyed/timedout player that does no longer exist. If I loop through the players manualy instead of using DPID_ALLPLAYERS the delay disapears I''m using DestroyPlayer(player_id); when removing the timedout player. I get a DP_OK as a result although something is quite wrong. Anyone got a solution? /Herr.O (didn''t see this forum until now, sorry for 2X post)

Share this post


Link to post
Share on other sites
Advertisement
DPID_ALLPLAYERS starts to lag when I destory a player... so, it's not so good.

I'll tryout KalvinB's suggestion.. thx!

Edited by - Herr_O on February 20, 2002 7:54:57 AM

Share this post


Link to post
Share on other sites
DirectPlay works great. ALL_PLAYERS works fine as well if you have it set up properly. There''s just never a need for it. You should code your game so that there''s rarely if any need for every player to recieve a message. It''s better just to use a for loop so you''re in control.

The biggest problem was probably not using ASYNC. By not using ASYNC the program stops until a message has been sent and if it''s guarenteed it has to wait even longer to make sure the message made it to it''s destination.

Once again using a for loop with ASYNC allows

a) control
b) the server to keep moving while DPLAY handles the messages transparently in a seperate thread.

With Winsock you have to set up the multithreading. With DPlay, it''s already there.

Ben

Share this post


Link to post
Share on other sites
hehe.. I don''t agree, I think DPlay could do with alot of improvements. Hate having to wait 1h (exaggerated) just to create a server, leaving a game etc. But now that I''ve started using DPlay I might aswell complete it, though next time (if there is a next time) I won''t be using it.

I don''t like the DPSEND_GUARANTEED thing neither It may be easy to use, but I feel a lack of control. Another thing, I can''t get through my router with DPlay (it splits my IP).. why is this? I got no problem going through it with winsock.

I belive dp can be good as a start but to make large and complicated game - then I would prefer to do my own thing.

I can go on forever, but I won''t.

thx for the replies everyone!

-----------------------------
"If I''m not careful, I''ll end up talking to myself!"

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!