Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.NET Real Time Game

I want to develop a game in real time. updated for all users on a picture every second. But I have no idea how to do, Is there something similar, i can use the sample code? I'll use C# and Asp.NET

Note: Sorry for my bad english.

like image 699
user1164168 Avatar asked Jan 23 '12 01:01

user1164168


3 Answers

Try using SignalR, from what I can tell from your question, this would work well for doing game updates.

https://github.com/SignalR/SignalR

https://github.com/SignalR/SignalR/wiki/Getting-Started

like image 122
Keith Nicholas Avatar answered Oct 09 '22 17:10

Keith Nicholas


If latency really matters then you should be looking at a WebSocket solution and not one introduces the overhead of requiring HTTP Requests. WebSockets support bi-directional communication between a client and server over a single connection which keeps latency to an absolute minimum. Other HTTP-based solutions, including EventSource, mean that data coming from the server to the client can be sent with low latency but messages from the server to the client have to be made by establishing a new HTTP request which introduces latency.

So, this means that ASP.NET is not a good choice for a truly realtime game at the moment.

What are the alternatives?

If you want to stay in the .NET world then I'd consider looking at XSockets or SuperWebSocket.

If you would consider other technology solutions then I've compiled a list of realtime web technology solutions. Again, when making a choice I'd favour solutions that have WebSocket support.

If you want to keep close to the Microsoft stack you could look at socket.io on Windows Azure. See Running Socket.io on Windows Azure Web and Worker Roles

If you would consider Node and a hosted service then the Pusher Pipe might be of interest for you.

like image 37
leggetter Avatar answered Oct 09 '22 15:10

leggetter


From version 1.0 beta, the version just recently published on Nuget there is some changes regarding the XSockets Server (named XSocketsMaxiServr in prior version) , now its called XSockets.DevelopmentServer.Console.exe , and can be found in the XSockets\DevelopmentServer folder or the project where you install.

By just opening it from the "command prompt" the server starts, registers the WebSocketHandlers of yours. The examples that will be added during install, is located under XSockets\Examples.

We will update the documentation in just a few days, and i also know that Ulf , a team-member of XSockets just recently publised a new guide/video that can be found here:

http://xsockets.net/videos

The movie is called "XSockets.NET 1.0 RC1 - getting started" and im sure that i will be helpfull for you.

If you need any assistance don't hesitate to contact us, we will assist you as much as possible! You will find the correct contact information at the XSockets WebSite.

Kind regards, Magnus Thor, Team XSockets.NET

like image 30
Magnus Thor Avatar answered Oct 09 '22 16:10

Magnus Thor