Is MonoGame just XNA? - c#

So I want to learn C# and XNA but after some research is came to my attention that XNA is apparently dead, and there is an alternate library called MonoGame which uses XNA framework.
So, can I use XNA lessons/ tutorials for MonoGame or are the major differences in the way programming is done depending on what you use making XNA tutorials completely useless for MonoGame?

Almost.
MonoGame doesn't use the XNA framework, it is a re-implementation of the XNA framework. The difference is that all of the code inside MonoGame has been re-written to behave identically to the XNA framework.
You're probably wondering why someone would want to re-implement something that already exists. Well, you're correct in saying that XNA is "dead" so to speak. You can in fact still use the XNA framework if you want but it's no longer supported by Microsoft on Windows 8 or above.
However, that's not really the primary reason MonoGame came about. The real reason is that XNA only works on Microsoft platforms (e.g. Windows, XBox, Windows Phone). MonoGame's purpose is to allow existing XNA code to be easily ported to other plaforms (e.g. iOS, Android, Mac OS X, Linux, Windows 8, Windows Phone 8, PlayStation Mobile and the OUYA console)
Yes, you can use XNA lessons / tutorials for MonoGame most of the time. MonoGame's code and behaviour is intended to work exactly like the XNA framework. I say intended, because it's not perfect but it does work very well and there are plenty of games already using MonoGame to prove it.

XNA can still be used on windows 8, despite the being not supported. To do so you have to install a n additional component first. You have to download Windows live Games redistributable, then XNA, and it will work on windows 8.

A 2022 updated answer,
craftworkgames answered best:
Yes, you can use XNA lessons / tutorials for MonoGame most of the time. MonoGame's code and behaviour is intended to work exactly like the XNA framework. I say intended, because it's not perfect but it does work very well and there are plenty of games already using MonoGame to prove it.
The following how-to is an updated expansion/extension of willthiswork89's answer. I do not suggest using it, but it is worthy of a modern answer.
As long as the DirectX9 runtime libraries are installed, XNA programs continue to run as of Windows 11. Do not forget to reboot after the DX9 installation.
The XNA installer will fail to run on modern versions of Windows. Start running the installer and leave the window open at the first prompt (to allow the installer extract the files, but before it deletes them), and find the temporary files in %tmp% or %temp%, Type this in File Explorer then sort by date (the folder name is a GUID and the newest one) and manually execute(double click) each of the .MSI files found.
The templates are a different story(MS VS > 2013). I suggest downloading a complete XNA example .SLN project, and cleaning it up after the update process, to provide a starting point.
You may still have to update the project references(the names match, but the versions may be different).
Note: GamerServices is mostly, if not totally, defunct.
I suggest using MonoGame < 4.0 as a cross-platform drop-in replacement for XNA. Instead of using this answer, since Monogame is feature complete and cross-platform.
If you prefer the old .sln project style, or require .Net framework 4.5, then look to Monogame 3.7.

Related

Can Microsoft XNA run on Windows 10?

I have created a game using C# and Microsoft XNA 4.0. It works on fine on Windows 8 and 8.1, but my friend tried downloading it for a computer running Windows 10 and found that it wouldn't open. It wouldn't even appear in Task Manager when opening it was attempted. The computer in question has the Microsoft XNA Framework Redistributable 4.0 installed on it, so it should be working. Is Windows 10 simply not compatible with XNA?
XNA is no longer supported on newer versions of windows, it was discontinued and isn't supported on platforms newer than Windows 7. Luckily there is an open source implementation of XNA which is essentially the exact same thing and that is currently supported on all windows versions. It's called "MonoGame", here's the link to their website:
http://www.monogame.net/
I know this is a older post but just for those looking for an option like I was today (this post is still a top hit in google) its a bit of work to get setup, but XNA will in fact run on windows 10 just fine, and there is a way to actually use Visual Studio 2017 with XNA just fine as well:
http://flatredball.com/visual-studio-2017-xna-setup/
so if you have code for XNA or like the XNA framework (Like I do, I prefer the pure c# way not c# to some other bloated bridge like Unity) for 2D games then this will be your savior.
Enjoy :)
Some updates:
On March 14, 2016, ID#Xbox announced that MonoGame is coming to Xbox One:
* https://mobile.twitter.com/ID_Xbox/status/709402975051980800
In the FB group Xbox One Indie Devs, Tom Spilman from the MonoGame team had some information to add, more info coming soon.
* https://www.facebook.com/groups/XboxOneIndieDevs/permalink/852775944827686/
Stay tuned to the Twitter account and FB group mentioned above, for new info when available.
Hope that helps!
XNA does work on Windows 10 and even Windows 11. In 2021 I released a game using XNA Framework and it works but the user will have to install XNA Redistributable 4.0 for the game to run on their system so that's not ideal.
But then I ported my game to FNA Framework which is an open-source, identical, reimplementation of XNA. My codebase required almost no changes to work under FNA so I highy recommend it to you.
FNA requires no additional library installation. The DLLs need to be in the same directory with your executable and it will work.
You can see my game here if you are curious about the subject: https://cyon4d.itch.io/cozy-days
To add on what x2kpb said, your best bet at this point is to look at MonoGame for certain platforms, and FNA for others.
XNA, in its pure form, will not work as a new Windows 10 application. The platform to bring win32 (XNA) games to Win10 is called Project Centennial
Both Xbox One and Windows 10 will support MonoGame, per this video at last year's BUILD conference.

How to get started with DirectInput from a Visual Studio 2013 C# solution on Windows 8.1?

Following a comment posted to one of my questions, I am trying to get started using DirectInput.
I am absolutely unfamiliar with it, and I don't know how to get started at all. The namespace seems to be Microsoft.DirectX.DirectInput but I cannot seem to find it anywhere in my references.
It says in several places that you just have to add it from the references in my project but I couldn't find it.
I checked for a DirectX SDK but it seems it is now part of the Windows SDK and the Windows SDK is already installed with Windows 8 so I shouldn't have to do anything?
I found a couple of alternatives, of which SharpDX sounds like a good one. I have not been able to start with this either... I have installed the SharpDx.Input nuGet package but I can't seem to use the code I can find elsewhere, like here.
new DirectInput() for instance is not recognized at all by Visual Studio.
The "Microsoft.DirectX.DirectInput" assemblies are Managed DirectX 1.1 and are deprecated. Furthermore, VS 2013 defaults to using .NET 4.x which is not supported by legacy Managed DirectX 1.1. See DirectX and .NET.
The underlying DirectInput component whether used by C# or C++ is legacy and is not recommended for use for mouse or keyboard. For Xbox One and Xbox 360 common controllers, we recommend using XINPUT. To use legacy HID devices (joysticks, PS3 controllers, some haptic controllers, etc.), you still use DirectInput. For XINPUT use on Windows 8.x, see this blog. For use from C++, you should look at DirectX Tool Kit particularly the GamePad class.

Getting started with C# on OS X

I'd like to create a few simple C# applications and command line utilities to learn more about C#, affordably. Initially, I tried using Microsoft's free Studio Express in a Windows 8 virtual machine; however, it quickly reported that it could only create apps for the Microsoft app store and failed to build the simplest examples of an XML file transformer.
I also found Mono or rather MonoDevelop. I'm still reading about it. It seems that the SDK is entangled with the MonoDevelop IDE, and the MonoDevelop installer is actually the Xamarin Studio installer. Xamarin is a subscription based IDE and inexpensive versions of it appear to be constrained. Perhaps I need to continue studying; however, I thought I'd ask if anyone has experience getting started with C# on OS X.
Ideally, I'd like the simplest setup. I prefer using command line compilers, simple code editors, and build scripts. Are there Windows and OS X command line compilers for C# applications? Are there framework libraries that can easily be included that work on both OS X and Windows?
First, Mono is not an SDK, but a runtime. The specific point of Mono is to be able to, for the most part, run the same IL on other platforms as what runs on .NET for Windows. This means that, barring the slight hiccups in implementation, you could copy a program, run it via "mono program.exe" (via the console) on OS X, and get the same output (I have tested this with Console applications, at least - UI starts to get a little hairier).
In terms of library, the Mono libraries try to mirror the .NET ones so exactly, that the code you write for one is almost completely compatible with the other.
"MonoDevelop" and "Xamarin Studio" are the same thing, simply having applied a name change after a certain version. They are the most well known tools for building in the .NET language family on a non-Windows system (the only tools I even know of), and tend to mirror the shortcuts of Visual Studio well (at least on windows.) Unlike Mono itself, these are an IDE, and do not constrain you any more than VS constrains you into .NET.
The constraints you'll find with free Xamarin apply mostly to their mobile platforms (iOS, Android) and do not affect working with desktop (ie Windows and OS X) applications.
I've settled on using a Windows 8 virtual machine and Visual Studio Express for Windows Desktop as Dan J recommended. For usage similar to mine, simple desktop and command line apps, be careful not to select and install the "V.S.E. for Windows" version.

Can I use xcode to program in c#?

I develop almost entirely in c#, but own a mac computer. I have windows running in parallels desktop to work with Visual Studio. I wanted to develop in c# for mac os and downloaded monodevelop, which is great except for its GUI designer I completely hate it and don't know how people can even use it. I mean, after how easy it was to create GUI applications with the Visual Studio designer I feel so weird to work with it.
I investigated about it and found out that apple's interface builder could solve that problem for me. However, the only way to get it now apparently is downloading xcode, since apple doesn't distribute it as a stand-alone app now. (That's what I think)
I knew that Xcode doesn't support c#, but I read about some plugins with which you can add those functionalities.
Can you tell me if its possible to add this compatibility to xcode? Or if you know alternatives to monodevelop that have a GUI designer that is more similar to VS.
As of version 2.8, MonoDevelop support using XCode with both MonoTouch (for iOS) and MonoMac. Here is the link to the release documentation.
Yes, you have to download XCode and, if I recall correctly, there may be a nominal charge for it, but the minimal cost (if any) will be worth the improved productivity.
Having said that, using XCode's interface builder takes a LOT of getting used to for someone coming from the VS world.

Develop smart applications for Windows 7

I'm looking to create a very -tiny- application(s) in Windows 7. I'm looking for a programming language like C# and a simple framework that
Makes the application very light weight
Doesn't require any libraries or modules (only the *.exe and works on a newly installed Win7)
The IDE (Or the compiler) let me easily implement windows 7 features (like the menu, the graphics...)
The point: I want to create a small application (light weight so it can be easily transported), that focus mainly on Windows 7 graphic design and features.
I don't know if such IDE exists but also asking how will you solve it, mean if you have to create a tiny application (gadget like) how will you proceed?
Lightweight and regarding dependencies: Well, since you want kind of C#, you have the .NET Framework. That's not exactly lightweight, unless you're sure that the target system has it available. Be sure to check which .NET version comes preinstalled with Seven. Addendum: Now that 7 is out, it seems it comes preinstalled with .NET 3.5 SP1 (full framework, not client profile). That's a good thing.
Have a look at the Windows API Code Pack for Windows 7 for access to Windows 7 features. Like tvanfosson, I'd also stick with Visual Studio and .NET.
Personally, I'd stick with Visual Studio. You might want to get a utility like NuGenUnify, which makes it easy to use ILMerge to combine any extra libraries into the main exe if you want to distribute as a single file.
So far I haven't seen any other IDE that beats Visual Studio for windows app development. Especially soon after a Windows release. I'd be surprised if I am proved to be wrong.

Categories