Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi every body
i want to write a program that use socket programming.
i write a car simulation,my project include 3 layers(UI,Business and Data layer).i have a main form that can select new game or view log file.when you select new game you can see a new form that show simple road,car,speed gauge and so on.now i want to use socket programming as 2 player can play my car simulation and race together.
means you can have your form and also see other player's car in your form.
my car simulation is very sample and 2d;
please suggest me any idea or code in c#.
thanks
Posted

1 solution

There's an example on this site.
C# Sockets and Serialization[^]

You might want to take a look at this library.
Lidgren networking library[^]


The problem with a multiplayer racing game is that things go fast. You might get desync issue or cars that warp everywhere.

Multiplayer games usually implements algorithm that will interpolate player position with the "last received state".

I hope it helps, if the example I gave you aren't what you need, just tell me, I'll try more.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900