-
|
|
Opinion - ease of porting XNA to other platforms?
|
Just a question/discussion - How easy/hard do you all think it would be to translate an XNA project to another platform? Say, the Mac?
I know, I know, we would have to make our own vector classes, and matrix classes, change all graphics to OpenGL or something like that. Oh yeah, and we'd have to potentially change all the C# to another language, and move off of .NET..... (Would we?)
But I was just wondering - how hard do you guys think it could get? Does it depend on the project? Could a universal wrapper be made for the purpose?
Just a thought.
Soli Deo Gloria - To God alone be the Glory
|
|
-
|
|
Re: Opinion - ease of porting XNA to other platforms?
|
Well, it would be very hard. As in "complete-rewrite" hard
Regards, Louis Ingenthron Fortis Venaliter Lead Developer of FV Productions
|
|
-
|
|
Re: Opinion - ease of porting XNA to other platforms?
|
FortisVenaliter Productions:Well, it would be very hard. As in "complete-rewrite" hard
+1
Game hobbyist hell-bent on coding a diabolical Matrix
|
|
-
-
- (14748)
-
premium membership
Team XNA
-
Posts
9,342
|
Re: Opinion - ease of porting XNA to other platforms?
|
The key is to only reproduce that which you are using. You can definitely use .NET on the Mac. The Mono project works surprisingly well when I used it. There aren't many good IDEs for C# on the Mac, but it works really well. I'd suggest looking into the Tao libraries such as Tao.OpenGL. My personal setup was using C# with Mono, Tao.OpenGL, and SDL.NET which worked pretty well for getting something up and running.
I'd say you're primarily looking at rewriting the graphics code and probably the content loading and management stuff since you wouldn't get the content pipeline stuff anymore. Most of the logic will work as is, and if you implement some vector or matrix structs that look and behave like those in the XNA Framework you can probably reuse a good chunk of your codebase.
|
|
-
|
|
Re: Opinion - ease of porting XNA to other platforms?
|
If it's a 2D game, another option would be SilverSprite, which seems to be coming along nicely. Not exactly a native port but, hopefully, once it matures xna games should be able to take advantage of the Silverlight v3's Out-Of-Browser support on the Mac.
XAGE - Xna Adventure Game Engine
|
|
-
-
- (807)
-
premium membership
MVP
-
Posts
1,205
|
Re: Opinion - ease of porting XNA to other platforms?
|
If you're serious about supporting multiple platforms, you may want to consider writing an abstraction layer between your game and the underlying libraries. This is a very common approach when working on cross-platform games in any language and there is plenty of literature out there on designing such systems.
Briefly, the idea is to design a high-level interface between the different system-level components of your game. For your renderer, you will want to design an interface that supports all of the functionality you need while not being specific for any single platform/API. Then, for each platform, you implement this interface for the platform library, e.g. XNA on Xbox, XNA/SlimDX/etc. on Windows, Tao on OS X/Linux, etc. The same would need to be done for all components that interact with a system-dependent library.
Microsoft DirectX/XNA MVP
|
|
-
-
- (1668)
-
premium membership
-
Posts
879
|
Re: Opinion - ease of porting XNA to other platforms?
|
Sparkworker:Just a question/discussion - How easy/hard do you all think it would be to translate an XNA project to another platform? Say, the Mac?
I know, I know, we would have to make our own vector classes, and matrix classes, change all graphics to OpenGL or something like that. Oh yeah, and we'd have to potentially change all the C# to another language, and move off of .NET..... (Would we?)
But I was just wondering - how hard do you guys think it could get? Does it depend on the project? Could a universal wrapper be made for the purpose?
Just a thought.
I prototyped a metaball algorithm in XNA and then ported that to the iPhone. It's sort of okay..ish.. C++ and C# are alike in many ways, .net library and stl are almost compatible, but you will have to go over every line and make changes.
|
|
-
-
- (0)
-
premium membership
-
Posts
70
|
Re: Opinion - ease of porting XNA to other platforms?
|
I'm going the other way--porting Flash a Flash game to XNA. Actionscript and C# are very close together, so for the most part it's pretty easy (other than re-writing interface code and doing controller support). If you're doing a 2D game, Flash is about as cross-platform as it gets--from reading the sales figure threads, Flash games are also more profitable than CGs at the moment. You can always use something like Zinc to package an executable for mac/linux if you don't want to release it as a Flash game (again, assuming it's a 2D game).
|
|
-
-
- (2741)
-
premium membership
-
Posts
752
|
Re: Opinion - ease of porting XNA to other platforms?
|
Even closer than actionscript is java. I have nabbed java code dropped it in and seriously few changes to make it work. You can find many libraries etc for java which are similar to the XNA stuff.
Henry My wife says most of my posts should finish with "Get off my lawn" smokinskull.comMy Twitter
|
|
-
-
- (564)
-
premium membership
-
Posts
210
|
Re: Opinion - ease of porting XNA to other platforms?
|
has anyone tried something like winelib?
|
|
-
-
- (8307)
-
premium membership
MVP
-
Posts
6,143
|
Re: Opinion - ease of porting XNA to other platforms?
|
For some games, most of the time is spent building the art, and tuning the actual gameplay (coming up with the right balance values, etc).
For those games, the port wouldn't be that hard, because you'd re-write the entire thing in Java in a fairly mechanical way -- read the source code, write the port.
Most of the input art would port over easily, except for Effect files, which would have to be translated to GLSL.
If you're using the content pipeline, you'd have to re-implement the bits that you use yourself, too.
However, this is one of those things where, "if you need to ask..."
Jon Watte, Direct3D MVP Tweets, occasionallykW X-port 3ds Max .X exporter kW Animation source code
|
|
-
-
- (966)
-
premium membership
-
Posts
265
|
Re: Opinion - ease of porting XNA to other platforms?
|
I'm currently in the process of porting our XNA game System Override to both Android (Java) and Iphone (Objective C) and it has been fairly smooth. The art assets generally scale down well, and most of the logic ports across fine in any language. That said needing to work in OpenGL ES with only the fixed function pipeline and not access to shaders has been a bit of a pain. Networking wise things become extreamly differnt as well, and challanging if you aren't familar with writing your own low level UPD or TCP based networking code, lobbies, reliability layers, and so forth.
|
|
|