Sign in to follow this  
Gelu

Fighting game networking.

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this