[ENet-discuss] Reliable packets and data sending approaches

Philip Bennefall philip at pbsoundscape.net
Mon Oct 26 16:30:27 PDT 2009


Thank you for your answer. So if I understand you correctly regarding the second point, you recommend sending events such as shooting, jumping etc as reliable packets and then the player state unreliably a few times a second just in case? My original idea was to have it shooting off the player state constantly as unreliable packets since it is so small, and it ensures that you always have the most recent information as no reliability checks have to be performed.

Let us assume that I want a higher number of packets per second such as 60 or 70, is it fine to set it to that and then let ENet take care of limiting the packets if there's too much loss occuring? Because obviously if a user fires a bullet we want the other user to hear that almost instantaneously, not 60 milliseconds later if avoidable.

Kind regards,

Philip Bennefall
  ----- Original Message ----- 
  From: Nuno Silva 
  To: Discussion of the ENet library 
  Sent: Monday, October 26, 2009 11:27 PM
  Subject: Re: [ENet-discuss] Reliable packets and data sending approaches


  Regarding the first part, AFAIK, ENet sends, a sequence number, so a packet with the same sequence number would be dropped once one of them has been acknowledged by the peer. So there's no danger in sending the same packet twice. Just remember, ENet does that for you.

  Regarding the second part, you should use both event-based notifying and unreliable player movement packets. You should receive and send packets only a few times per second unless they're events though, like in the Source Engine's networking, where they send packets 20 times per second regarding user input. 20 times per second should be a good starting point for you to experiment on.

  Good luck,
  Nuno Silva.


  On Mon, Oct 26, 2009 at 8:31 PM, Philip Bennefall <philip at pbsoundscape.net> wrote:

    Hi Lee and others,

    I have a quick question regarding reliable packets. Say that user 1 sends a message to user 2 on channel 0, and it gets through on the first attempt. Does user 2 see the packet immediately or does ENet wait until the package has been acknowledged? And what happens if user 1 doesn't receive the acknowledgement and then sends the packet again eventually, and this packet also arrives, might user 2 be given the same packet twice?

    Also I am wondering about the best way of sending data. I am making a fast paced action game with two players, where speed is of the utmost importance. Is it best to send individual events when they occur, or continuously send the entire player state unreliably? If the latter, how often should I send it? I was thinking at least 40 times a second, as the state isn't larger than some 60 or 70 bytes. Do you have any recommendations?

    Thank you!

    Kind regards,

    Philip Bennefall
    P.S. I am using the latest snapshot.

    _______________________________________________
    ENet-discuss mailing list
    ENet-discuss at cubik.org
    http://lists.cubik.org/mailman/listinfo/enet-discuss






------------------------------------------------------------------------------


  _______________________________________________
  ENet-discuss mailing list
  ENet-discuss at cubik.org
  http://lists.cubik.org/mailman/listinfo/enet-discuss



------------------------------------------------------------------------------



  No virus found in this incoming message.
  Checked by AVG - www.avg.com 
  Version: 8.5.423 / Virus Database: 270.14.32/2459 - Release Date: 10/25/09 19:57:00
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20091027/07c4d9c9/attachment-0001.htm>


More information about the ENet-discuss mailing list