How toI run a game made with XNA on the iPhone/iTouch? - c#

How could I run a game made with XNA on the iPhone/iTouch? Which steps/tools (existing ones or imaginary...) should be used?
Note: The goal is to avoid modifying existing C# code
UPDATE :
If I understand correctly, I must be able to:
Run my XNA code on Mono (monoxna or SilverSprite, promising?)
Run Mono on iPhone (MonoTouch)

Not only is it possible but here is a video of someone doing XnaTouch on MonoTouch: First game to IPhone build with XnaTouch (XNA for IPhone)
Here is the mono article about doing it http://www.mono-project.com/MonoTouch

I don't believe there is a good answer to your question. XNA doesn't target the iPhone, so the chances of being able to effectively port an XNA game without modifying the C# source code isn't likely to happen.
Instead, I'd recommend that you take a look at the various frameworks that exist to help you craft cross-platform games. Unity often comes up in these discussions, but it isn't free.
If cross-platform isn't your goal, but free iPhone development is, then I'd recommend looking at Cocos.
Edit: The MonoTouch project may be able to assist you in the future, but doesn't help you out right now. Still, it's something to keep an eye on.
Edit: The landscape has changed a lot in the ~5 years since this question was posted. If you have an XNA project that you want to get running on iOS, then Xamarin.iOS (formerly MonoTouch) plus MonoGame is a near-perfect fit. MonoGame is missing a huge chunk of the XNA content pipeline, which means you'll either have to abandon it or have a VS2010 instance somewhere compiling your assets.

The MonoTouch project may eventually help here, since it allows you to write C# targeting the iPhone (it is statically compiled to native code).

MonoGame is a free OpenGL implementation of the XNA 4.0 Framework. It is built upon the excellent range of Mono compilers and is compatible with MonoTouch (iOS), Mono for Android (Android), MonoMac (Mac OS X), Mono for Windows and now Linux!
A list of 12 games currently using MonoGame that are on the Apple iOS App Store can be found #
http://monogame.codeplex.com/
https://github.com/mono/MonoGame/wiki/Released-Games

I believe XNA depends on Direct3D 9 (see http://msdn.microsoft.com/en-us/xna/aa937793.aspx), which may hint at the hurdles one might encounter in both porting to mono as well as having sufficient graphics horsepower on iPhone.

Everyone saying this is possible because there are CLR libraries for Mono, does not even think about the fact that XNA is a WHOLE DIFFERENT set of frameworks:
"The XNA Framework class library is a library of classes, interfaces, and value types that are included in XNA Game Studio."
As another responder noted, this is so far from happening it's not even funny. If you really want to write a game I'd check out Unity. It's commercial, but it looks utterly impressive and you can script your game logic in Javascript or (here's the funny part) C#!
Yes, instead of going through a ton of work to port a whole framework because you want to write a game in C#, why not just use a framework that lets you do that today?

From the horse's mouth:
MonoTouch + SilverSprite = XNA 2D
games on iPhone? :)
What Bill means is that it will eventually be feasible to write a 2D XNA game, then use SilverSprite to run it on Silverlight, then use MonoTouch to run it on the iPhone

This space is definitely heating up. There is now an XNA Touch project on codeplex that aims to bring the XNA API onto the iPhone/iPad platform:
http://xnatouch.codeplex.com/

'Maybe' you could just change XnaTouch's namespace to match those of existing Xna code (i.e. Microsoft.Xna.Framework.*), when developing a MonoTouch project? This could be done on a vendor fork (copy) of the XnaTouch code, easy to manage using Git, Mercurial or Piston etc.
I'm unsure as to whether the XnaTouch team would undertake such a change on its own codebase, so this is probably best done on your own, personal, code branches (interestingly, the Mono.xna project uses the original Microsoft.Xna.Framework.* namespaces, I'm unsure why XnaTouch chose not do so).
JFYI, the current XnaTouch (v1.0) follows Xna 4.0 quite faithfully. I've found a [small] few missing method calls, which I've 'implemented' to throw not implemented exceptions (?). The original-xna4-and-modified-xna-touch code does compile, now I need to implement iphone-specific gui and handling etc.
Hope this helps someone.
Cheers
Rich

For starters you would need a CLR implementation on the iPhone, which doesn't exist at the moment, but it seems someone is trying: MonoTouch.

A friend of mine is developing an architecture port of XNA 4.0 for the iOS platform. It's of course written in Objective-C, but it has the feel of XNA. He has published the source under LGPL at http://code.google.com/p/xni/.

Xna is not officially supported on iPhone; however, you could use ExEn (http://exen.codeplex.com/) or MonoGame (http://monogame.codeplex.com/) to port your Xna games. A bonus for using either of these is that they support Mono for Android.

If you're looking for a free cross-platform sort of thing, you could check out phonegap. I don't have any experience with it but it looks cool.
http://phonegap.com/

Related

What's the deal with Monogame, SharpDX, and XNA?

I've been doing research on good tools to create games with, and I came across Monogame, Sharpx, and XNA. I have some questions regarding each:
When I create a new windows project (which advertises that it uses DirectX 12), the code template looks like this:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
I understand Monogame is a re-implementation of XNA, but where is the "re" part? This code shows Monogame using Microsoft's XNA, and doesn't even hint at the usage of DirectX 12.
SharpDX has an advantage of using WinRT (so i've heard), but what exactly does that mean to me? I know that SharpDX is a layer that sits on top of DirectX to allow it to be used in C#, and naturally should use WinRT. What excuse does Monogame have not to use WinRT?
I feel I'm confused at something and want clarity. Keep in mind that I'm a total noob at this stuff, anything helps!
MonoGame is indeed a reimplementation of XNA. It uses Microsoft.Xna.Framework.* namespaces to preserve source code compatibility with XNA projects. MonoGame does not currently support DirectX 12 - the desktop version has DirectX 11 and OpenGL backends.
It provides simple, cross-platform classes for common game tasks (loading content, rendering, sound playback, etc.) and a pipeline for building runtime-optimized content files. MonoGame is really powerful for most projects and great for quick development, though not a fully featured game engine like Unity. Since it is modelled after XNA (discontinued a few years ago), most XNA samples/tutorials work just fine.
SharpDX is a low-level wrapper of DirectX types. You should go with it only if you want to get your hands dirty with low-level plumbing, which doesn't appear to be the case.
The DirectX implementation of MonoGame (used for classic Windows, UWP, and Windows 8 apps) internally uses SharpDX for communicating with DirectX. When it comes to WinRT, it is just an implementation detail of "modern" Windows app platform.
Wikipedia has a few pages on the history of XNA. In short it is no longer supported. MonoGame extends it. SlimDX and SharpDX use their own DirectX wrappers and are basically copies of each other. Going by a recent post SlimDX future
It will not be continued. I do not know MonoGame but am strong in SharpDX and it provides current support for DirectX 12. If you also want to use OpenGL, you could try ANX but I do not know it. The SharpDX guy also wrote a Collada class which is on GitHub and there is an Assimp class that is compatible. None of the above have an integrated physics system but PhysX for .Net works fine with SharpDX.
In summary if you only need Direct X for C# then SharpDX would be the most straight forward choice. If you think you might expand to other platforms, you might want to check out MonoGame or ANX but I can't vouch for either. None of the above mentioned are complete Game Engines (such as Unity or UE4) they simply allow the use of features such as DirectX that are not natively supported by Visual Studio C#.

Which Graphics Framework for Windows 8? MonoGame? OpenGL and Xaml/DirectX Mixing?

I would like to develop a game for windows 8, but since Xna isn't supported, i don't really know, if it is good to use something like MonoGame - because i think, it doesn't make any sense to use MonoDevelop with OpenGL while the UI Frontend runs with DirectX. But my searches and on "apptivate.ms", they still force the developers to use MonoDevelop - but why would a corporation like Microsoft even do this?
And i don't like to build my game in C++ with DirectX, because in my case, it's not a big game, and my favorite language (also, my language at work) is C#..
Btw., it would not be a big deal for me to write this game with OpenGL or C++, because I've got a lot of experience in these two for the past four years, but in this case, i like to have a "fast" and "save" solution like C# and a Graphics Framework.
So... maybe someone has the answer to these qustions:
Should i use MonoGame with Xaml / C# and don't worry about the mix of DirectX and OpenGL?
Or is there even another DirectX/Game Framework which i can use?
Or maybe, i'm totally wrong, and Xaml doesn't need DirectX? Or i can force MonoGame to use DirectX?
Or, another point - would something like "System.Drawing" fast enough for a spaceshooter with some nice shading effects (I think, for my case, i need shading and something like bloom, blurring etc.)? Maybe, Microsoft added a new 2D drawing library? (But i think its still gdi+ )
Your question is ambiguous if you are referring to Windows 8 Metro (aka Modern) or Windows 8 Desktop, but I assume it's the Metro version.
If you want to develop a game in C# for Win8 Metro without using a commercial solution, you can use:
SharpDX which is a low level DirectX API for .NET or the up-coming SharpDX.Toolkit (check latest news on the website) which is a high level framework around Direct3D11 (with a XNA like API, but with full Direct3D11 support). SharpDX is the only C# wrapper covering the whole DirectX API that is certified to work under Windows 8.
MonoGame which is using SharpDX for its Metro backend. I haven't heard that you need to use MonoDevelop for it, as it is working with an existing XNA project and VS 2012 should work just fine.
ANX which is also using SharpDX for its Metro backend.
Concerning the previous answer, If Win8 Modern is assumed, you can't use OpenTK, as OpenGL is not a certified API for the Microsoft App Store and SlimDX is not compatible with Windows 8 Metro.
There is an OpenGL to DirectX wrapper in the works that allows use of OpenGL in Windows 8 Modern applications. It's not complete yet but it may be sufficient if you want cross-platform compatibility and are willing to target only the subset of OpenGL that is implemented (or are willing to implement the rest yourself and hopefully contribute back.)
https://gl2dx.codeplex.com
Update: gl2dx seems to be dead as of November 2013, but there is a similar project, ANGLE, which implements most (if not all) of the OpenGL ES 2.0 spec and the EGL spec on top of either DirectX 9 or 11. This is the method by which Firefox and Google Chrome do WebGL on Windows.
http://code.google.com/p/angleproject/
If you want to use OpenGL and c#:
http://www.opentk.com/
For DirectX and c#:
http://www.slimdx.org/
or
http://sharpdx.org/
GDI+ is out bounds of Metro/Modern UI apps, if you're interested there some companies that look to make replacement apis like this one: http://www.moderncomponents.com/products/DrawingLibrary/, it's still in it's early stages, but looks good and may help you to create some simple games.

iOS games development

I have just finished studying C with some website, and I covered most of the basic-intermediate things.
Now I want to develop iPod\iPad apps, using Objective-C as I understood it's the best option.
But from reading many guides, I still haven't came across one sure answer - Can you develop iOS applications using Objective-C on a PC, Windows? I know you have to pay these 99$ to be allowed to develop and to be given access Apple classes, but it's okay with me.
If you can not do it on windows, what will be the next best option? I know you can create iOS games using Unity and C#, I have it installed but I still didn't find out how to create an iOS project. And I couldn't find a simple guide for iPod apps with unity, that would be nice, too.
If the best option is not unity, what will it be? I have intermediate-high knowledge in .NET (Thats the way it seems in the forums I'm usually at... here I am a simple beginner) and I know C# syntax the best, but I know VB too. And C, and a bit C++.
Thanks :)
the short answer is no. but there are ways around it if you don't want to put the app in the marketplace
You can code Objective-C in Windows, however you will not be able to compile. http://kdevelop.org/, http://code.google.com/p/objectiveclipse/ and http://www.bloodshed.net/devcpp.html Dev-C++ are compatible with Objective-C, for example. I haven't had any experience with them, however.
XCode is still the best for this task, and I'm not sure if you would call this being able to "develop iOS applications on Windows", but I tend to code quite a bit in Notepad / GEdit anyway, so the answer is "kind of". You'll need a Mac to go anywhere further than coding though, like being able to debug.
The Unity iOS development does not come with the free version of Unity. Instead, you would have to purchase a separate license (in addition to the $99 that Apple will charge you to become a developer, I believe.) I myself have never used Unity to develop iOS games, so I don't know how well the process works.
Ideally, however, iOS development really is meant to be done on a Mac. XCode is the primary IDE used for iOS development and it is Mac-only.
Another option is to generate iOS game with Flex 4.5, which allows you to write and test code on windows and you can package it for iOS. But you have to learn ActionScript and MXML for it.
From Adobe's Website
Flash Builder 4.5 includes full support for building ActionScript® applications for Apple iOS. Flex support is planned to be available later in 2011
You can check out
Corono -- http://www.anscamobile.com/corona/
Unity -- http://unity3d.com/
Cocoa2d -- http://www.cocos2d-iphone.org/
Depending on what you are looking, all of them has nice docs that you can go through about their capabilities.

Is Mono for OSX viable for learning C#?

I need to learn C#. All of my computers are Macs running the latest version of OS X. I do not want to use Windows, but I will if I must.
That being said, as a new programmer, can I learn C# efficiently with this Mono platform on OS X?
Edit I'm looking to learn C# to gain programming knowledge and start indie game development. After a reasonable understanding is achieved I will then look at some gaming frameworks/platforms and or a more OS specific language.
In a word: Yes.
First of all, thanks Jonathan Pobst for updating What Is Mono page. With that said, Mono supports all versions of C# at present, that is 1.0 to 4.0.
Since your plan is to learn the language first before looking into other things, such as frameworks and tools, you should be fine with Mono. Once you start getting into platform-specific development (i.e., Windows GUI), then you might want to consider switching over to a Windows machine.
http://mono-project.com/What_is_Mono
http://en.wikipedia.org/wiki/C_Sharp_(programming_language)#Versions
If you are going to be developing for Windows, then using a Windows machine is your best bet. If you are simply trying to learn the language, Mono should be fine.
You should be able to, but just keep in mind that while most of the example code will work, some may not on the Mono framework as the implementation is not 100% compatible with .NET Framework. Also, of course some things like WPF aren't be supported by Mono.
I have used Monodevelop on Linux and it mostly works but because I also develop on Windows with VS2010, I am put off by using the inferior Monodevelop but as a newbie it shouldn't matter to you much.
Yes that should be fine seeing as MonoMac has come out. http://www.mono-project.com/MonoMac
If your wanting to use it for games with OpenGL, download this repo and look at the openGL stuff to get started. Then go to places like NeHe to learn more about GL ect..
You will need to download & install git to pull the repo:: http://git-scm.com/download
MonoMac Samples:: https://github.com/mono/monomac/tree/master/samples/
NeHe:: http://nehe.gamedev.net/
Code Sampler:: http://www.codesampler.com/
Depends.
To just learn the C# language and CLR core libraries which are not graphics related, C# / MonoDevelop is okay.
To learn graphics programming, game programming for OS X, I suggest you first learn Objective-C, Cocoa and then MonoDevelop/MonoMac. The reason is that the Cocoa API's are designed around the Objective-C language which has fundamental differences to C#. Using Cocoa via C# is easy to begin with, but quickly makes little sense unless you understand Cocoa patterns & Objective-C.

Lightweight 3D Graphics Engine .NET (Compact and Full Framework)

I am creating a GUI for a machine that runs remote (WinXP) or on the machine itself (Windows CE 6.0).
Right now I've created a fast visualisation (read: very simple) of the machine itself. The goal is to make a bit more complex visualisation of the machine and for that I would need a lightweight 3d engine.
The engine should run on both full and compact .net framework (I am prepared to do some porting :).
What I mean with lightweigt is that it doesn't need shading, lighting, advanced camera's. The Idea is that the whole scene is shown in Isometric perspective.
So what I was wondering is that anyone knows a good engine (open source?) or has some helpfull resources you could share with me.
Did you try Irrlicht.
Recently Irrlicht has acquired official .NET bindings, allowing users to develop in .Net languages such as VB.NET, C# and Boo.
There is also Ogre 3D and also Axiom Engine
It is a good question. I have looked as well, and not seen anything. It would be great to see some easy to access great visual effects for mobile, to somewhat compete with other platforms that are getting better looking.
Sometimes with Windows Mobile I feel like I am in the Windows 3.1 days!
TrueEngine 3d sdk may also be of interest to you.
There is also SlimDX

Categories