Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lemuzimi

Pages: [1]
1
Network / Need help with simple UDP game
« on: October 23, 2011, 06:57:09 pm »
Ok, so if i smooth the positions that could give me a fluid game at 60 fps for instance while my networking is only running at 10 fps, it's indeed a wise thing to do...

But what about the latency between client and server...

For instance when the client press a key, the input is sent to the server, the server update the game state and then send the new game state to the client so he could display the new position.

When using the code above I have sometime a delay between the moment the client press the key and the moment the caracter start moving....
 

Do you think using another library will reduce this latency ??

Thank you for your explications with the packet that is quite useful...but what do you mean by "using sf::Socket to serialize your data" with enet, and why and how do you use it ?

If indeed using another library like enet would reduce the latency, is it too much to ask you to show me your implementation using enet ?

Thanks again,
Mat.

2
Network / Need help with simple UDP game
« on: October 23, 2011, 04:10:11 pm »
Ok, ok, well i'm doing a project for uni, the idea is to do a multiplayer (over a network) space invaders with up to 4 players in the same game, i'm going to do it very simply, with maybe a loby before the game but that's all.

I've no preferences for the type of communications (TCD/UDP) but i've heard  UDP is the best way for games that need fast refreshing data ( 20/30 fps ) so i first started to use UDP and it's also easier ^^.

Since i want to use C++ i first started to look at boost.asio, but it was a bit too complex for me ( i'm not a network ninja... ), then I looked at many other solutions over the web and then a found SFML and your code example, which was perfect for me so i've implemented it, and i've to admit that i was a bit disappointed by the speed, still some lag at 20 fps some times ( the lag is not that big, but still a bit annoying for that kind of game, since all the logic is made on server side, the clients need to see their players moving at the exact same moment they pressed the key or else it sucks...).

I tried to play a bit with the code to find some solutions but could not do anything...and since it seems to come from asynchronism in SFML networking, i'm more than pleased to hear other solutions for implementing that...


PS : ( i'm also curious to see how do you use sf::Packet with other networking librairies... ).

Regards,
Mat.

3
Network / Need help with simple UDP game
« on: October 22, 2011, 08:03:14 pm »
I'm looking at enet now, and it sound interesting too, i'm not a network pro so maybe i should stay away from the low level...

Can we do the exact same thing with enet than your example, does it handle asynchronism ( non blocking socket ) so a client or server could listen and send packets in the same time ?

And also i there a way to send structured packet like in the sfml tutorial...

These are all my concerns, thanks a lot if you can help me and maybe share a bit of your code with me.

Regards,
Mat.

4
Network / Need help with simple UDP game
« on: October 22, 2011, 03:09:03 pm »
Hi, i also have latency issues, I would be curious to see what is your implementation with boost.asio....

Pages: [1]