Windows Phone 7 to iPhone development (backwards I know) - c#

I've been doing a lot of Windows Phone 7 games development and have started looking into porting my apps and games to iPhone and possibly Android at a later date.
From my understanding solutions such as MonoTouch are not worth the effort, so should I stear clear of such things?
I'm well versed in C++ coding and would like to do that on the iPhone if I can't use C# effectively, especially for performance critical situations which games have a lot of. I don't underestimate the power of C#, just C# on iPhone (and I think that's a fair thing to be afraid of).
Would there be any good reading material I should get into before building up code for iPhone? I'm already downloading x-code but don't know what to do beyond that, I odn't even know how to wrap C++ around objective-c but I feel that would be the best compromise given my situation.
I guess a broader question is how would I handle multiplatform programming? My currnet idea is to build three seperate development frameworks which share the same design principles as each other so porting apps between platforms is straight forward (but would still require re-writing code every time).
Is that a smart way to do it or am I just crazy?

C# on the iPhone not only works fine, but it works brilliantly. It is compiled AOT that is "Ahead of Time" (normally .NET code is compiled JIT - "Just in Time") down to machine code just like a normal compiler would produce. It's absolutely fast enough for game development and about 100 times easier to use.
I have two XNA games working on iOS and my own crowd-funded iOS port of XNA, which is also coming soon to Android (ExEn). So I can definately confirm that C# on iOS is fine for game development.
Now if you're doing a 3D game, I'd be looking into Unity. The cross-platform XNA solutions are all 2D-only - for the moment anyway. The other option is using OpenGL directly with the bindings in MonoTouch.
Basically you should do everything you possibly can to avoid having to write your game more than once. To that end, C# is an excellent choice.

You don' have to wrap c++ around objective-c. c++ compiles just fine on the iPhone. You can easily develop all your code for multiplatform games in c++. What I don't know is how c++ compiles on wp7, but that's another issue :)

From my understanding solutions such as MonoTouch are not worth the effort
I've just voted to close this on the grounds of it being subjective and argumentative...
... but while it's still open ...
In my experience, MonoTouch offers an excellent solution:
if you want to leverage a single code base and existing skills
if you want to take advantage of CLR memory management
if you can cope with the increased download size
if you don't need to link with existing Obj-C libraries (you can link to these in MT, but in my experience it's not always a straight-forward process to do so)
if you can budget for the MonoTouch license fee
For XNA in MonoTouch, see http://monogame.codeplex.com/ (latest now on GitHub)
For general iphone getting started advice, try: https://stackoverflow.com/questions/332039/getting-started-with-iphone-development

Related

is there any chance that Microsoft Release .Net framework versions for MacOS & Linux as in windows outside UWP?

I'm currently involved in project for making a 3D CAM software specific to the hardware that our company makes, but here comes the problem.
the decision was to use qt & C++ to do the job as the software is required to be cross-platform. i.e. works on linux MacOS & Windows. but of corse this lead us to suffer in many painful ways, And as much as Qt is powerful it lacks a decent designer or in other words it's designer is no match for The Visual studio Designer or Microsoft Blend. plus also I've used WPF for the GUI Design & it was incredible. while when it comes to QtQuick the WPF Alternative in Qt, it's syntax is very simple and much easier than XAML but it's designer is the worst thing on earth. can you imagine that I prefer writing QML than using the designer? its very miserable.
plus when it comes to developing Apps using such a language as C++, it's like hell compared to using Such a language as C#.
of corse C++ is the most powerful language on earth and it's the industry standard and it's used to develop softwares for controlling nuclear rockets bla bla bla..., But even of this is true, who Needs such Power to just develop an application that just Opens 3D Files & Converts them into G-Code to be Executed on another machine?
I've been using C# for about 8 or 9 years now & believe me, it can almost do anything with almost the same performance of C++ apps, but with much less effort & in a more straightforward way in much less time.
so here's my question.
- why wouldn't Microsoft Implement their .Net framework on Linux & Mac to save us from this Suffering?
- also, When would developers be able to Write C# or VB On Any machine & compile the same Code AnyWhere?
isn't this why .Net was designed in the first place?
Also I think it's time to end-up the Qt legacy, they've been dominating the Cross-Platform Development With their false claims that they are the best, but actually they are just being used because they are the best of the worse.
I couldn't post such Suggestion to Microsoft, But I'm sure they do See our Posts on such Platforms as stack overflow, so I'd ask everyone who agrees with me to Put his comment below to Deliver our voice to Microsoft.

MonoTouch v. Objective-C for new iPhone devs

I'm working with a small startup with the goal of creating an iPhone application. The programmers on our team all know both C and Java, but we've got no ObjC/C#/iPhone experience -- we'll be learning something no matter what. All the questions I've seen on this subject have been from the perspective of a C# programmer getting into iOS, so I don't have any information on the relative merits of learning one or the other.
So, what I want to know is the relative merits of C# and Objective-C for new programmers, with respect to these things:
Performance
Ease of use
Ease of learning
Reliability (i.e., will a new iOS version break a MonoTouch app?)
Also, would writing in MonoTouch have any benefits for cross-platform development with Android?
If the goal of your startup is to create an iPhone app, then obviously you should learn the language iOS applications are built with, Objective-C. Your team already has experience with C, so it should be very easy to get started. The Big Nerd Ranch books will get you up and running in a week or two (I'm not associated with Big Nerd Ranch, I just think they're awesome).
I don't understand why you bring up MonoTouch, considering your team doesn't have C#/.NET experience. There are tons of other frameworks like MonoTouch, including Titanium SDK (JavaScript), RubyMotion (Ruby), and so forth. All of these are great, but as I see it are primarily for those with experience with their respective languages. They allow you to write iOS applications using a language you're more familiar with, but have the following drawbacks:
Performance can be just as good, but usually a little (sometimes a lot) worse than an application written in Objective-C.
Resources for learning are not as plentiful as those for iOS SDK/Objective-C. There are tons of people who want to make iOS apps, and of those people some use these frameworks, and they are diluted amongst them. Only a small fraction of the resources available for iOS development will be devoted to any given framework.
These frameworks are based on the iOS SDK/Objective-C, so naturally development is always a step behind. If Apple rolls out radically new APIs in the next version of the iOS SDK, you'll have to wait for these frameworks to adapt (applications written in Objective-C might break, too, but it'll be easier to deal with based on point #2).
Most of these frameworks require a familiarity with the iOS SDK. You will still need to know that an application calls the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method on launch, but in addition you will need to remember how to translate that into the appropriate method for MonoTouch: public override bool FinishedLaunching (UIApplication app, NSDictionary options). The iOS SDK is massive, and most iOS developers rely on Apple's documentation for insight. So you will be looking at the API docs, written for Objective-C, and translating methods into the framework of your choice.
The Objective-C ecosystem is constantly evolving, with cool new projects like CocoaPods, bwoken, etc. These are primarily developed with Objective-C and Xcode in mind. Configuring them to work with your framework of choice will almost invariably cause you extra time and work.
The above points have generally kept me from delving too much into any of these other frameworks. They're all very cool, but their primary merit in adoption seems to be facilitating development for people with deep skill sets outside of Objective-C, or allowing cross-platform development for small teams lacking the resources to invest in Android and iOS (and Windows Phone) programmers. Hopefully the benefits outweigh the above costs for adopters.
Also, would writing in MonoTouch have any benefits for cross-platform development with Android?
I suppose it would. Indeed, the MonoTouch homepage touts that as a primary advantage of using the framework. I'm not so sure about view/controller classes, since those seem like they would be tied into UIKit, but the logic encapsulated in your models should be fairly easy to port.
Long story short, I think you and your team should stick with Objective-C for iOS development.
If you're just building an iPhone app, then by all means choose Objective C. But if you want a mobile app — which may include android, windows phone, windows rt, blackberry, webos, or other options — you might want to take a close look at a few of the alternative platforms, of which MonoTouch is one prominent option.
Objective C is a strict superset of C, so if you understand the performance characteristics of compiled C code on ARM, you can just use that C subset with which you are familiar, except for the iOS UI.
There seem to exist reports that experienced C programmers start getting up to speed with writing iOS apps in Objective C in on the order of 2 weeks. But, of course, learning extensive frameworks and APIs in an ongoing learning process, whatever the language.
For performance, the answer is Objective-C, all the way.
That said, take a look at doing this with HTML5. If you stick to accelerated transforms, HTML5 performance for an application front end is surprisingly good. It's also pretty easy to move your HTML5 app to Android.
The simple answer is Objective-C. It's not too hard to learn. If you're solid on C and solid on OOP, you'll be fine.

Android game development in C#

I want to know, is there any way to develop games for Android-based mobiles (and maybe iPhone) in C#? Yep, i know about "MonoDroid/Mono for Android", but well... it's not free. Java is great but Dalvik performance is far worse than Mono. And it lacks of some features that are very useful for game development such as operator overloading. Furthermore, there is OpenTK framework which is simply amazing.
So, is it possible to get running .NET/Mono on Android for free? Or am I sentenced to Java?
You would have to be able install unmanaged code on the device. I would recommend using Java, because I can foresee deployment being difficult with mono. Google might not let you sell your app on their marketplace with large quantities of unmanaged code. It would also tie you down to Android phones sporting a particular brand of processor, not much of a problem as all of the phones I can think of use ARM processors but there are some exceptions.
You could try http://www.mono-project.com/Mono:ARM if you are sure about this.
Operator overloading is simply syntactic sugar. I'm sure you are capable of writing applications without it. And Java can't be without its own suitable frameworks surely.
Android is overflowing with java and its most likely easier not to try and fight it.
If you don't want to use Java then you should use the NDK and C/C++; especially for games. An additional upside to that is if you think ahead a bit you can have a large chunck of code that works on Android and iPhone.
I am not normally a fan of offering something outside the limits of what you've set, but you should take this advice to heart:
If you are serious about Game Development I would invest time in learning Unity3D. The non Pro version is free and does not expire. They have iPhone and Android kits that allow you to deploy your game on both of those platforms. Yes they do cost money, but start calculating how much your time is worth.
If you are doing this as an exercise to learn how Game Engines work then that is awesome and you should pursue it. If you are more focused on developing an actual game, look into one of the existing kits. Unity3d is by far the easiest and cheapest kit for all the features it has.

C# on Linux - Anyone got an opinion based on experience using mono?

Is it worthwhile learning C# if you are a Linux user? There is Mono but it seems destined to always be behind the curve with the constant threat of MS action if they start to lose money.
Currently I am leaning more towards Java as its is fully GPLed and there are no major threats of software patents. It already has a big oss community behind it and has a solid reputation on the server whereas C# still needs to prove itself there.
The big advantage for C# programmers is that they are cheaper than Java developers. I also wonder exactly how portable C# code is though. Can one simply take a C# app written to target Mono and run it on windows?
I've written a number of C# command-line programs, specifically to run as distributed simulation engines, that were targeted for Ubuntu. They work perfectly there or on Windows.
It's hard to say what the future holds, but C# is a powerful language and I think it's worth learning even just for our personal growth. I despise Windows myself but have been writing C# for a while (for Windows mostly) since it pays the bills.
Novell uses Mono extensively for their Linux applications and I think that their relationship with Microsoft adds some weight to the idea that .NET for Linux will stick around.
Here's a list of some of the companies using Mono.
"on the server whereas C# still needs
to proof itself there"
You do know MySpace is built ontop of ASP.NET, right? Millions of hits a day running off a C# backend.
Sorry for the flame-bait, but I've personally had more portability success with mono, than java. Not a blanket statement, just my experience.
This question has already been asked and answered many times on SO.
Is Mono ready for prime time?
Why Use Mono?
Given your scenario, me personally I would learn Java, as you will find the transition into C# further down the line, quite smooth. Also having Java under your belt is a very good thing. I would say Java is much more portable than C# although you have the option of using the Compact Framework, which will be quicker to bootstrap with your program.
I work for a company that uses both Java and C#. I prefer C# because I think Visual Studio blows away Eclipse, and I just like the language better. However, I think you might do better learning Java in your case. You have more flexibility both for your project and career-wise. You can learn C# anytime.
C# is a nice language, and I find it much easier to work with than C/C++, especially for GTK applications.
I also think that learning C# would be a much better investment than learning Java. I'm saying this for no other reason than my personal taste, but I also honestly and objectively believe that C# will have a better future than Java.
As for running Mono apps on Windows, you can usually do this without a hassle, but if it's a GUI application, you will either have to create a Windows version that uses Winforms, or your users will have to install GTK for Windows. Either way, your applications will have a much better look and feel than Java applications on both platforms.
Finally, I don't think M$ will take legal action against Mono anytime soon.
It works very nice. IMHO you should use Mono from the development site (www.go-mono.com) rather than version provided with your distribution.
Also you could try dry-running it with VMWare machine that is also avaliable on the official site.

Viability of C#/.NET as the new standard game dev platform?

For a long time now C++ has been the dominate game development language. Many AAA quality 3D engines are available to fit any budget.
My question is, with the rise of XNA, has C# and the .NET framework been positioned well enough to take over as the new standard game development platform? Obviously the inherent cross-platform nature of the XNA framework (Windows, Xbox, Zune) has its benefits, but are those benefits good enough to entice large game dev studios to switch gears?
Personally, i am torn between using C#/XNA for a new project, and using Java via jMonkeyEngine. I have a great desire to have my game be portable to multiple platforms, and the only languages i know well enough to accomplish this are C# and Java. i would love to see an implementation of the XNA codebase that is powered by OpenGL and would run on Mono, but i think that is merely wishful thinking at this point.
I am curious to hear what others have experienced while building 3D games in something other than C++.
I think C++ will go out of fashion in the next 10 years just the same way as assembly did. I'm a professional game programmer for more the 15 years. In early 90's lot of people said that C is not efficient enough for games. In the late 90's same people said that C is OK but C++ is just way too slow for performance critical applications such as games. Now C++ is the standard high performance language and people argue that other languages would be too slow. In the meantime today's games use script languages like Lua, Python or Unrealscript for game logic which are ten times slower than C# or Java.
C++ is much faster when you do math in your game. Doing linear algebra is painfully slow in C# or Java. However, this is only a part (10 - 25%) of the game. When it comes to the game logic bottleneck is memory access so using an other language does not reduce the performance significantly. The tool side of the game, which use to be the 50-80% of the code, really does not require any C++. It happily runs in C# which is fast enough for almost any tool.
One also should not forget that C++ is derived from C, which is made in the early 70's. So C++ is obsolete in many ways. The most annoying thing is probably the pre-processor which kills transparency and causes insanely long compile times. An average state of art C++ game engine compiles in 30-60 minutes. In such time you could compile every C# and Java project ever made by humans. Lack of self reflection and dynamic code creation is also a drawback. It often costs a lot of development time to overcome on these shortcomings.
Nevertheless C++ development costs a lot it would cost even more for a game studio to risk a failure by switching to a new technology which is not yet proven in game development. It is also an important factor that majority of experienced game programmers use only C/C++ and they do not have experience with other languages which would definitely increase the risk of switching. Because of these, you probably will not see game studios in the next couple of years switching to C#. However, it is likely that a Microsoft owned studio will make a big hit with a C# game in the next 5 years which will convince other studios that it is feasible to make AAA titles in C# and then you will see more and more studios switching to C#.
For now, my advice is:
If you want to make an AAA multi-platform title you have no other choice than C++ for the runtime part of the game. Consider using C# for the tool side. It's a little bit tricky to efficiently connect managed and unmanaged code but on long run it worth the effort you spend on it.
If you do a hobby project or a B title where performance is less important than development cost/time then forget C++ and just use C# for everything and spend some extra time to optimize the math.
The large gaming studios will probably not adopt XNA any time soon. Some indies are using it, but definitely has the potential to eventually be very successful and leave C++ behind.
XNA provides many classes that you can use in game development, but many others often choose to use a fully fledged games engine. Although XNA is rather good for beginner's to cut their teeth on if you are new to programming games.
C# is a good language to use for games development. Games development produces applications that require sound, advanced graphics, AI, Physics, etc. All that requires a powerful and fairly quick language environment. While most of the top tier PC and console games are written in C++, C# has a road map that will likely leave C++ behind. The coming changes in C++0x will no doubt reinvigorate C++ for a little while but C# looks poised to overtake it.
If you really want to be a games developer I would urge you to at least learn C++ and write your own game engine. Using a pre-made game engine is easy and you can code something that is 'okay' but you will run into many limitations that you won't be able to code around. You will effectively be confined to the capabilities of the game engine (unless you have access to the source, which you could then modify to your liking).
Learn C++ and preferably OpenGL :)
Once you know OpenGL you can learn DirectX pretty easily.
C# is a piece of cake once you know C++.
While some time ago XNA Professional was announced, Microsoft now seems to focus on the Express edition (though it lost the "Express" in the name), and that seems to be aimed at the hobbyist market rather than the commercial market. Among other things, this largely benefits the XBox 360 community, because they now allow hobbyist developers to develop their games for Windows and XBox 360 and then to sell their games on the XBox network, and that is a good thing.
I'd really love to see XNA gaining momentum in the professional world, but this won't happen unless it's available for the other major gaming platforms (PS3 and Wii). The problem is not only the XNA framework / API, it's the language / framework requirement, so you can't even write the game in C# and then use XNA on Microsoft platforms and OpenGL on other platforms.
The performance profile of XNA is also aimed at the hobbyist market rather than commercial, though the performance seems to be quite good and there are impressive demos out in the wild.
Edit:
If your question is actually "should I use XNA now for my project with a budget much less than a million", my answer is definitely yes. Go try it out, it's free. And it's powerful.
I worked at a place called Newfire in the late 90's. Before funding ran dry, we had an engine that could render an immersive world that was 10,000 square km with a resolution of 10 cm. You could get a huge number of players in at once and persistently deform the landscape. This engine ran at frame rate on a P200 with a Voodoo 2 card.
Most of the engine was written in carefully tuned C++. All the game code was written in C or C++ or Java. I also had prototype code that could define object behaviors using a push down automata that could do very decent AI. It took nearly no CPU time. The execution of game logic was dwarfed by rendering.
At one point, I had a demo of Conway's Game of Life running in Java using our software renderer. The cells were cubes laid in a plane which appeared or disappeared and changed color as they aged more generations. While the game was running with a fixed generation rate of 4 generations per second, the 3D display was running at 20+ FPS, again on a P200 with the software renderer.
So the answer is not definitely C++. The answer, like any problem domain, is the language that works the best within that domain. C++ works well in that domain for the rendering engine, but for the actual game logic and rules, lots of languages work well. Python is great. C# is great. Java is great.
As a poster mentioned, XNA is currently limited to Microsoft platforms but you can still use C#, .NET and any .NET programming languages to develop games in a cross-platform way.
The Mono runtime does provide a cross-platform engine that can be used to run your C# (or .NET code) under a variety of desktop platforms (Windows, MacOS, Linux) as well as gaming consoles (Wii supported by Novell, PS3 coming soon and Xbox360 "on your own").
There is also a commercial gaming platform called Unity3D that has done wonders using Mono. They are a game IDE that surpasses XNA as a game development environment: physics, graphics, lights, models, collisions are handled all in native C++ code while all of the gaming logic (AI, camera control, views and so on) are handled by managed code written typically in C# or UnityScript (a strongly typed Javascript implementation that gives you the best of both world: the Javascript syntax, but strong types that improve performance).
I am not a game developer (unless you count the Reversi game I wrote in Atari 6502 assembly language in ~1982), but I do have a lot of experience writing commercial application software in Assembly -> C -> Objective-C (anybody remember the Next Cube?) -> C++ -> Java and now C#.
I cannot compare the game libraries but I do have some thoughts on C++ versus C#.
IMO, the argument for C++ over C# due to performance is not as simple as some would have you believe. The software I work on is performance critical. We compete with products compiled to native code (presumably written in C / C++ / Assembly) and we win on performance to the point that our competitors even use our software over their own for certain applications.
How can that be if C++ is faster than C#? In my experience, the answer is the fact that for any complex system, the architecture and algorithms are more important than the language (assuming that the potential performance is in the same ballpark - which it certainly is with C++ and C#). Even though I was a full time C++ developer for more years than I have used C#, I am much more productive in C# than C++. This means that I can spend more time refactoring and perfecting my architecture and algorithms than I could previously.
Now, sometimes I have to admit that I am tempted to rewrite the core engine of my application in C++ because I know that I could get it to run faster and use less memory. So far I have resisted the urge because I believe that the drop in productivity would mean that it is only a matter of time before my C++ codebase is slower than where I would be if I had stayed with C#.
I believe it is only a matter of time before game development transitions to C# and / or Java and / or some other language which is more productive than C++. Having used Java for several years and now C# for several years I would bet on C# - but that's just a guess.
If I were getting started in game development today I would definitely bet on Silverlight and / or WPF. WPF is built on Direct3D. Microsoft has already announced that Silverlight 3 will support hardware assisted 3D rendering. Silverlight runs on various browsers and the Mac. With Moonlight it runs on Linux. It has been announced for some phone platforms. Thanks to the fact that Silverlight is essentially a lightweight version of WPF (it was initially introduced as "WPF/E" where the "E" means Everywhere) you can target both without a great deal of extra effort. You can have a lightweight version (free or supported by advertising) of your game using Silverlight in the browser and the real deal for serious gamers which uses WPF and runs on Windows.
Better yet, be the person to create an excellent gaming library which allows for easy targeting of both WPF and Silverlight 3 (or Silverlight 2 if you don't need hardware assisted 3D rendering).
While I have seen no official announcement, it is hard to believe that the next generation of XBox will not support Silverlight. Of course, I would not look for it on Sony or Nintendo gaming systems.
I think that there is a kind of BS elitism that happens when people talk about XNA or java game frameworks or pygame or whatever. Yes, professional game houses will use C++ for a long, long time. But Atmospherian is asking about something for his own project, so I'm going to assume that he's an amateur (if he were the CEO of Epic or something I doubt he'd be posting on SO)
Anyway, just because you couldn't code FarCry in it doesn't mean that it's a worthless framework. Major-studio level games require millions of dollars and dozens of people, but XNA/Java/pygame/etc have allowed amateurs to do some pretty awesome stuff. Amateur games and major-studio games are two different beasts and call for two different sets of tools.
To answer your questions, Atmospherian:
-Yes, XNA can do some pretty cool stuff and people have used it to make some cool games.
-If you want XNA to be cross platform and work with mono, I think it's technically possible, but I wouldn't hold my breath.
-If you want to end up with a job in the games industry, you are going to need to learn C++.
-I think the path of least resistance to getting a working cross-platform game engine is currently in pyglet. The ease of use might trade off with speed when compared with java or C++.
Just add to the conversation ... C#/.NET is certainly available on other non-microsoft platforms.
Mono.Wii
Tao Framework
Between those two right there, you can target linux, mac, wii ... I'm sure if there was enough funding/interest in it, they can get Mono to run on a ps3 as well. At that point, you'd be able to write for all major game platforms using C# (albeit, probably not with XNA per-se).
Also, to anyone wondering about performance ... lots of great things are in the works, such as Mono's new support for fast floating point math using their SIMD extensions (x86 only for now, of course):
http://tirania.org/blog/archive/2008/Nov-03.html
Surprised nobody has mentioned the possibilities for a mobile gaming. I can't see any managed code competing with C++ anytime soon for the likes of Half-Life and Halo, but for less-intensive mobile device games it seems like it's got legs.
As a follow-up to this question, i started looking at some OpenGL based 3D engines written in C++ (CrystalSpace, Irrlicht, Panda3D), and they all look rather solid. An interesting note about Panda3D is that it is written in C++, but the main way you use it is through Python. It seems to me that method would give the best of both worlds as far as a fast engine written in C++ combined with the ease of programming in Python. I'll pose another question comparing these engines. Thanks for the replies.
Well, between those too I think C#/XNA is a clear winner based on library support and really the maturity given Microsoft's experience in DirectX. That being said, I don't see C#/XNA replacing C++ as the lingua franca of serious 3D game programming (i.e. by large development houses) for a very long time, if ever.
It is not just the studios to consider, it is the audience. Chances are that as long as Sony and Nintendo are around, they are unlikely to move the a C#/XNA platform. At least for Nintendo, when you have the mass-market appeal that they currently do, they will continue to dictate their development platform.
I love XNA, since I can now write applications for my Zune, but C++ for a broad-based development platform for gaming is going to be around for a long time. There might be an influx of new indie developers for Microsoft devices, but we are a far way from seeing XNA be used across the board, if ever.
Lua should be of interest to you, as you can embed it in C# and access your objects from LuaScript.

Categories