开发者

Playing multiplayer games with XNA on the computer (NOT XBox)

开发者 https://www.devze.com 2023-02-26 07:00 出处:网络
I have just started programing and i have done some stuff with XNA. i created my first 3d game similar to minecraft.

I have just started programing and i have done some stuff with XNA. i created my first 3d game similar to minecraft.

开发者_JAVA技巧but its boring. so i decided to take a look at networking as there was a tutorial on the msdn. website. It turns out that the code there was only for the XBox and i started looking around the Internet to find something more useful until I cam across someone saying that XNA doesn't support what I am looking for.

I am seriously considering buying a book for XNA 4.0 (I hate looking for tutorials for hours) but before I do this, I want to know whether networking is possible between PCs. And if it is not, what should I try to learn?

Managed DirectX? C++ DirectX? or something else?


XNA provides access to the "LIVE" system - as in "Xbox LIVE" and "Games for Windows - LIVE".

On the Xbox 360 you can only go through the XNA networking system. There are no other options.

On Windows, on the other hand, you can only use LIVE if you have an agreement with Microsoft. So if that is not the case, your only option is to implement your own networking on top of what the .NET framework provides (XNA runs on the .NET framework). For networked games the classes you are interested in are in the System.Net.Sockets namespace.

Now you could just open up a socket and start sending data. But you probably want to use UDP - which has good performance but is unreliable - so you're probably best off using a library like Lidgren (or one of the others Prix mentioned) to add a reliability layer and a bunch of other nice stuff.


You mention wanting to look for books. I recommend you get this book if you decide to buy one.

I have Learning XNA 3.0 sitting next to me and it really helped teach me a great deal. The guy is great. His new copy doesn't seem THAT different, but different enough such that if you're first learning from Learning XNA 3.0, you'll get a little tripped up.

... also, you can buy it cheaper here.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号