Jump to content
  • Advertisement
Sign in to follow this  
Gelu

Fighting game networking.

This topic is 3716 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

Hail! I am some newbie programmer. I am developing a fighting game and I have the following questions: - Since this is a fighting game and there are only 2 clients, should I use TCP or UDP? - I want to implement a master server where all players connect to and chat or challange others to a duel. When a player challanges another, should that player be the server and a client? Is this the correct approach? - How would you do networking in a fighting game? I hope I posted correctly...

Share this post


Link to post
Share on other sites
Advertisement
I would use UDP. You can use either, depending on your preference.

When it's 1-on-1, you can make both be equal peers if you want, to reduce latency. It's only when the number of players grows that peer-to-peer starts looking bad.

The problem with fighting games is the network latency. You need to measure the latency from you to the other guy, and make sure to adjust your wind-up animations to match. If you want there to be, say, 100 milliseconds of wind-up time to react, then you should play a wind-up animation that takes (100 + transmission time) milliseconds on the sending machine, which will give the receiving client 100 ms to respond/counter.

You'll still have problems similar to "who took the cookie first" unless you move to client/server, but the problem with client/server is that the player hosting has 0 latency to the server, whereas the other player has noticeable latency. That, in turn, can be worked around with artificial delay, but then it'll actually be slower in client/server than peer-to-peer, which for a fighter will likely matter more than the bandwidth and trust issues.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!