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

I have just started programing and i have done some stuff with XNA. i created my first 3d game similar to minecraft.
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.

Related

Enterprise Framework - UWP Vs. Web

Broad, sweeping question here...
Assume you have built an enterprise level framework with some rich client in the .Net (Microsoft) sphere, with a WCF back end. Now, imagine that that enterprise framework's UI technology is being deprecated in favour of UWP.
The choices for a front end replacement basically are: UWP, Web (HTML), or some other rich client technology.
How would you go about the decision making process?
I personally lean toward a rich client where the user base is a captive user base. I mean, where the users' IT department is happy to install the necessary runtime environment on the machines, etc. This is usually not a problem with Microsoft technologies, and this won't be a problem in about 10 years when organizations roll out Windows 10.
But, people are telling me these days that web has come a long way. People are telling me that JavaScript frameworks are becoming very sophisticated, and that low level JavaScript for basic data binding and the like is mostly unnecessary.
I have really been turned off by web solutions like ASP in the past, but I do understand that technology has moved forward, and I do understand that Microsoft have been working on ASP.Net v Next which might actually be good?
The question is not so much what would you opt for? But, what factors would you take in to account to decide which platform to go for?
Opnion based answer here...
In a decision to adopt a particular tech for any project lies in many factors. I can cite two majors for your particular scenario.
1 - Client adoption. It's easy for the customers to use/install it? They need to pay some sort of license? Can it run in all platforms/devices the customer already own?
2 - Market adoption. It's easy for you co-workers to adopt it? It's hard to find/hire experienced/hardened developers? We need to pay some kind of license? Can I trust it ill be a long lived technology?
The answer to your question can be HTML.
Not only it is already got a lot of momentum in market, it ill take years to change it even if today someone (big like MS or Google) put some new (better) stuff on the table.
Also if someone on MS marketing dep say next week Universal Windows Platform or WinRT must die it ill die (like Silverlight). So Im not adopting some new technology just because some big player told me to do it.
Yes web has come a long way indeed. You can do a lot of amazing things just with JS+HTML+CSS those days. Also the right usage/architecture of it ill allow you to put your app running in PCs, Tablets and Mobiles (at a minimum cost to port between devices) and capable in running in anything can access internet.
I suggest you to catch up and learn a lot about webservices, Json, JS libraries like JQuery, Sammy and some nice stuff like Knockout, SPA, Angular, Node, etc.
Edit, answer to comments
To not start a chatty comment I'll respond here. Yes your questions and comments brings interesting questions. To let it readable for posterity both of us can edit answer and question to organize it.
Silverlight. How not love it? In special after strugling with flash. It's a shame MS pulled the plug (die in hell MS CEOs). When MS let it to die I was planning a big web app SL was my first choice. Why I changed my mind? Well 2 years to develop that app and at the end how much browser ill get along supporting it? The SL community is great, the tool is great but browsers can just say, Hey tomorrow there's no guarantee it keep working.
.Net and MS platforms. I'm a .Net developer. I adopted it since beta, first to work with winforms (in a previous life I was a proud Delphi developer). After a while started to work with web. I also worked in classical ASP (bad times) and loved .Net ASP from start.
You can run .Net apps in almost any PC in the planet today. Not exactly true for all mobiles/gadgets. For browsers pure HTML+JS+CSS ill to better because it's lightweight (done right). Also we can move a lot of thing to client side and just let it hit the server only when necessary. .Net apps can do that, sure, but ill never be light as a tailored HTML+JS+CSS.
In fact I believe you can do anything with .Net and you can do amazing things if you got a few good developers in your team. But depending on the project it ill do better (and cheaper) in HTML or PHP or Ruby or Java, etc.
In fact at a previous shop, with both PHP and .Net teams we found (after 1 year study, metrics, lots of projects) small projects are better done in PHP, larger ones in .Net (if I remember a medium project can be 4k to 6k men/hours).
The point here is. You really must read a lot about HTML, CSS, JS, SPA, Angular, etc. Bringing to live a big and shinning web app is challenging today not because what we can do (we can do anything) but how we can do. DDD, MVC, MVVM. Testing framework, etc. Man Node is the future (the concept at least).
Web developing really changed in the last years and with it the clients and users expectations. Today no one ill wait for more than 2 secs for a page to load. Everybody wants usability to be at the top of the table from project scratch. You app must be responsive, etc. (not using Dilbertian management buzz words here for the sake of it. Just stating usability is that important today).
And don't forget everyone wants it to be beatifull (from a graphical designer point of view) even if it's a dull B2B supposed to be used only by cave mens.
Even if you stick to a classical .Net app learn about the (many) options, that can bring a new wider perspective.
I have decided to answer this question here because we've had a lot more time to investigate and look at different options. The original question turned out to be a bit of a furphy. Pure UWP and Web are not the only options. There is also a Xamarin Forms as an option which includes UWP, Android, and iOS. As a personal preference, I am leaning toward using Xamarin Forms as a client instead of any other development platform because it supports three OSs out of the box: Windows 10, iOS, and Android.
I believe the answer to the question is: you should only develop a web app if you need to. Does your user base consist of people who will mostly prefer a browser over apps? Are your potential users likely to want to avoid downloading an app? Is your app very simple, and you want people to be able to dive in very quickly? Are you able to get away without access to things like the camera, location and push notifications? If you can answer yes to these things, then I think you should go for HTML 5/JavaScript. If however, your user base is comfortable downloading apps, and you think that your app will require a UI more sophisticated than most browser apps, I'd recommend looking at Xamarin Forms as the preferred option. We've had very good success with Xamarin Forms so far, and the UWP version of our Xamarin Forms app has turned out just as good as our first stab at a UWP app.
Note: I should give Web Assembly (http://webassembly.org/) an honorable mention here. This technology is being considered in all the big tech organisations like Microsoft, Apple, and Google. One day, it may make deployment of native apps in a browser great again.

XNA Game in ASP.Net web site

I was wondering, though I have got quite a few articles in this regard and all of them are for previous versions of XNA or not what I need, is it possible to embed an xna game in a asp.net website???
Means like there are several websites (game portals) having several games of may b flash or java. But is it possible to embed your xna game in a web site, and play it on web. May be using Silverlight so that User playing online do not have to updates its DirectX drivers or stuff.
I am a beginner in Game Development.
Any Help will be appreciated.
Thanks in advance.
No, unfortunately Silverlight and XNA are two very different things. XNA is for creating games that will be playable on PC, Xbox and soon Windows Phone 7 devices with very complex graphics and visual effects.
Silverlight is a bit like flash, offers a possibility to create an application that will run in a website environment. It's still possible to make games in Silverlight, but you won't be able to use all the things offered by XNA in graphics.
This is possible with silvesprite As Gimly stated you must transform it to silverlight, this is actually possible (not overly difficult) you will lose some features, but it is possible.

Tools and practices for small group collaboration?

I will be starting a senior design project in a week with 2 or 3 other engineers. We are electrical engineers but we will need to do some coding for our project.
Right now, I think using Google Code + Visual Studio + AnkhSVN is a good solution on the code side. We also need to:
Maintain design documents
Have a smooth way of communicating
Would you recommend anything in particular beyond a central network storage, and e-mail?
Edit: We are not going to set up or configure anything. I would rather just pay for cheap (
Yes, a good wiki such as Atlassian's Confluence.
Wikipedia has a great list of Collaborative Software. I think a decent content management system would be essential for maintaining design documents (especially over plain network storage).
You might try Basecamp , the basic plan is enough for you already.

Any experiences with Websphere Integration Developer (WID)?

My company (a large organization) is developing a "road-map" for evolving their rather old, tangled confederation of systems to an SOA model. A few people are pushing hard for using Websphere Integration Developer and Websphere Process Server as the defacto platform for developing future applications...because they feel IBM is a stable vendor, the tools are made for the enterprise, they drank the "business agility" BPEL kool-aid, etc.
Does anyone have positive or negative thoughts on this platform? Do the GUI tools help eliminate monotonous/redundant coding...or just obscure things and make things harder to maintain? Basically, do the benefits justify the complexity?
My experience with the IBM Java tool set is pure pain. Days to install lots of different versions of different components all incompatible with each other, discover a bug in component A get told to update to see if it fixes, updating component A breaks component B and C, get told to update these etc.
I find Eclipse with out the IBM extensions far more stable and quicker and provides more features (as its stable versions are a couple releases ahead of WID/RAD).
I would advise against going the IBM way for development tools. As for process server I have less experience but the people in my team using it seemed to enjoy it as much as I enjoyed WID. not a lot.
So far I havent been impressed by any tools with the "SOA" and/or "BPM" labels on them. My "roadmap" would be very very iterative to see some results with the archetecture as fast as possible while trying to grab some of the easy fruits. That way you gain your feel for what works for you and your people.
I would never let any vendor push me anywhere in the "scuplturing" of the architecture.
I agree with other users complaining about WID. The only reason we are using WID is that a decision was made a while back to use IBM products across the board by our sales department.
That's right, our sales department made the decision to use IBM products.
Development has been painful and frustrating. We have lots of stability problems with Process Server, sometimes it doesn't want to start or shutdown properly. Yeah you can easily draw processes in the IDE, but most any toolset provides that functionality these days. It is nothing special or unique to WID or IBM. IBM is a few iterations behind mainstream.
There are plenty of open source implementations out there that offer great support. Checkout JBoss or RedHat, they are pretty good. If that doesn't float your boat, you can always use Apache tools.
Walter
Developers don't choose WID, WMB, or WPS. Managers do, because IBM is a "stable vendor".
Look at JBoss, or K.I.S.S.
WID/WPS is actually pretty simple. The original intention was for analysts and business people to "compose" services (DO NOT LET THEM DO THIS!) so the UI is simple and easy.
Most of the work will be in defineing and implementing the back end services which depending on the platform will mostly involve wrapping existing code in SOA service.
The most important thing to bear in mind is that SOAP is technoligy and SOA is an architecture and a state of mind.
There is a zen to a succesful SOA implementation. Its all about "business services", if you have a service that you cannot describe to a business user in less than six words you have done it wrong! Ideally the service name alone should be enough to describe the functionality of the service.
If you end up with a service called "MyApp.GetContactData" described as "get name, addresses tel fax etc." then you are there. If You have a service called MyAppGetFaxNoFromOldSys" described as "Retrieve current-fax-nmbr from telephony table in legacy system" you are doomed!
Incidently most of the Websphere tooling for WS* is pretty nice. But I would recommend the very wonderful SAOPUI tool from http://www.eviware.com which is very good for compsing/reading WSDL based messages and also function as a useful test client or server.
Do the GUI tools help eliminate monotonous/redundant coding...or just obscure things and make things harder to maintain? Basically, do the benefits justify the complexity?
As a Developer, I find the tools at varying levels of being bug free. 6.0.1 was a pain, 6.2 is so much better. But once you develop with the tool, there is minimal effort to maintain it. I develop in hours what java developers take days to do. It is also easy to maintain as changes can be made very quickly. I cannot answer your question from the perspective of an architect or a Manager but i would agree with comments of some others here.

Alternatives to Live/GamerServices for XNA projects?

Using the GamerServices component for XNA to access Xbox/GfW Live for networking purposes requires developers and players each to have a US$100/year subscription to Microsoft's Creators Club. That's not much of an issue for Xbox360 XNA projects as you need the subscription anyway to be able to put your game on the 360.
But for PC games using XNA, requiring developers and players to put that much up each year is pretty crazy just for the access to a player's gamer card. Are there any solutions for XNA games that provide similar benefits to GamerServices? Or are developers pretty much restricted to building their own networking functionality if they don't want to subject their players (and themselves) to that $100/head hit?
Perhaps you could try Lidgren
Please note that games for windows live is now free:
http://www.engadget.com/2008/07/22/games-for-windows-live-now-free/
Since using the Live APIs is your only option on xbox and zune, it makes it a pretty compelling option since your only issue was the cost on windows :-) Especially considering the fact that once game studio 3.0 launches, you'll be able to sell your games on xbox live's new community games section
Edit, upon further investigation, it turns out that the games for windows live stuff is kind of half-baked. The gamerservices library doesn't seem to be included in the redistributable bits. So unless you want to break the EULA, your player would have to install gamestudio. That being said, I do still believe that it's free nonetheless, if not inconvenient.
Well, you can use sockets, obviously, and using sockets you can create a seperate, dedicated server app, which you can't do with Live (as far as I know). You could also try SteamWorks; I haven't heard of anyone trying that, however.

Resources