Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7400089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:09:01+00:00 2026-05-29T04:09:01+00:00

I have been recently writing a UDP server for a 2D shooter game I

  • 0

I have been recently writing a UDP server for a 2D shooter game I am making in C# and XNA for PC, which will update and send world data, entity data, chat data .etc when required.

A question recently sprinted into mind when I was creating a way for players to change their weapons; what would happen if in the occasion the packets send to the server requesting a weapon change were lost? This question then made me think of another question; how can I make a way for the client and server to acknowledge receiving certain packets or blocks of data?

So, I came up with the following simple looking solution to tackle this problem :

  1. Server sends packet(s) which require acknowledgement.
  2. Client receives the packet(s) and sends an acknowledgement packet.
  3. Server checks whether or not the client acknowledged the data. If the client has not, resend data.

The proposed solution looks pretty good, but what would happen if in the occasion that the acknowledgement packet gets lost or if anything unintended happens to it?

Would a better solution to this problem be to create a server and client which use TCP and UDP; where TCP is used for data that needs to get there and arrive in order / in one peace, and UDP for data that needs to get there fast and can cope with loss or error?

If a TCP/UDP server and client is a better choice, what are the risks and how would I go around to implement that?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:09:02+00:00Added an answer on May 29, 2026 at 4:09 am

    You need to be using TCP if you want to ensure packets are delivered. UDP does not guarantee delivery, but TCP has this built into the protocol.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently been asked to estimate a piece of work which will provide
Recently, I have been writing many classes which have, apart from generic variant, some
I have recently been writing git hooks for my project team. I would like
Recently I have been writing parameterized queries like this: SQL = INSERT INTO myTable
Perhaps I am getting rusty (have been writing in Python recently). Why does this
I have been recently challenged with writing a Windows Service. I needed to periodically
I have been writing C code for many years, but I recently came accross
I have been writing command-line Python scripts for a while, but recently I felt
I've been recently writing simple game in C++ with SFML. Here's my question: In
I have been recently involved in handling the console logs for a server and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.