Author Topic: moving from AS3 to C/C++  (Read 5483 times)

bpercevic

  • Member
  • **
  • Posts: 87
  • Karma: +2/-0
    • View Profile
moving from AS3 to C/C++
« on: Fri, Dec 9, 2011 »
Lets say I know AS3 and Flixel like the back of my hand, BUT I've never taken a stab at game development in a more prominent language such as C/C++.  Given that I've never done anything other than command-line C/C++, where would I start?

Existing frameworks?
Make an engine myself?
What should I study?

Hopefully someone who has been through this can share a few pointers (no pun intended).

:)

KWarp

  • Active Member
  • ***
  • Posts: 105
  • Karma: +0/-0
  • Game Programmer
    • View Profile
    • kwarp.com
Re: moving from AS3 to C/C++
« Reply #1 on: Sun, Dec 11, 2011 »
First ask yourself, what do you want to get out of C++? Then ask, is it worth your time?

Are you ready?
http://en.wikipedia.org/wiki/List_of_game_engines
To understand recursion, you must first understand recursion.

axcho

  • Active Member
  • ***
  • Posts: 174
  • Karma: +0/-0
    • View Profile
    • Evolution Live!
Re: moving from AS3 to C/C++
« Reply #2 on: Mon, Dec 19, 2011 »
Don't waste your time. C++ is nothing special.

I use C++ in my day job programming casual games, and unless you need the extra speed that C++ provides, there's no reason to use it. C++ is messy and ugly and powerful. C# is like a clean, elegant, not-as-fast version of C++ that only runs on Windows. AS3 is like a Flash-flavored C# that runs everywhere except iOS.

If you want the few extra language features that C++ offers, like generics and enumerations, use haXe. haXe is basically a souped-up version of AS3 that runs faster and can compile to other languages in addition to Flash. And it works great with FlashDevelop.

If you want to use a particular engine or library or platform that requires C++, obviously you'd have to use C++. But it doesn't sound like you're doing this for the engine.

But if you still want to try C++, just to see what it's like, you could try the Allegro game library. Or the Monocle game engine.

Good luck! ;)
« Last Edit: Mon, Dec 19, 2011 by axcho »

John Hutchinson (Johntron247)

  • Commodore 256
  • Contributor
  • ****
  • Posts: 392
  • Karma: +1/-0
  • I can has lazerz?
    • View Profile
    • Level X Games
Re: moving from AS3 to C/C++
« Reply #3 on: Mon, Dec 19, 2011 »
I'd also suggest C#.  Don't get me wrong, C++ is great. It's crazy-powerful and fast but it's also a pain in the arse!  There are some great game engines out there that in C++ but even using ones of those you'll find that actually making a game with it takes A LOT more work than with AS3+Flixel.  The XNA framework, which uses C#, is a good happy medium in my opinion.  You still have most of the power and speed of C++ but you also benefit from garbage collection and a lot of other things that makes your life a lot easier.  The language itself is also quite a bit closer to AS3 so the transition would be smoother.

Now, with that said, I'd also suggest giving the switch plenty of thought before diving in.  Make sure you thoroughly examine WHY you want to switch and make darn sure that you're doing it for good enough reason.  Keep in mind that you'll cripple your production time while you learn the language, figure out how to "think in C", learn a new framework or engine, learn through trial and error what to do and not to do, and build your own libraries, helper classes, and APIs.

I've used C++, C# and AS3, and while C#+XNA gives you a pretty good launch pad and fairly quick production, AS3+Flixel beats it hands-down in terms of production time and ease of development.

Also, think about your target platforms and what you expect to get out of the experience as a whole.  If you're looking to make games in your spare time or as seconary income, by yourself or with a very small team, then I believe AS3+Flixel is still the best choice.  If you go with C++ or C# then you'll be competing with other desktop games and XBOX games and it's much harder to stand out.  The thing about Flash is that anyone with a computer can access your game, without ever having to download or install anything (provided they have Flash installed).  Yes, lots of people have XBOXs and Windows Phone 7, and people can still download your game to play on their desktop, but you're immediately limiting your audience.  Also keep in mind that the Indie scene has been upset with Microsoft for quite some time because, while MS's support of Indies has been growing, their support still sucks hard.  Most players never visit the "indie games" section at all and the "top games", "top downloads", "new games" and other tabs glitch up constantly.  It's kind of like throwing a coin in a slot machine.  Sometimes you win... usually you don't.

John Hutchinson (Johntron247)

  • Commodore 256
  • Contributor
  • ****
  • Posts: 392
  • Karma: +1/-0
  • I can has lazerz?
    • View Profile
    • Level X Games
Re: moving from AS3 to C/C++
« Reply #4 on: Mon, Dec 19, 2011 »
There are good reasons a lot of developers transition from C++ to C#, and then from C# to AS3.  Not nearly as many developers transition the other way around and many who do end up coming back.

Now that that's all out of my system, I do need add a disclaimer:
I still love C#+XNA, almost as much as AS3+Flixel, and I plan on continuing to use it.  In fact, I have a game in C#+XNA that's about 90% done and plan on releasing it sometime early next year.  I'm using both, and plan on continuing to do so.

There's no doubt that you have more power with C#+XNA and can make more impressive games with it, and I enjoy those aspects emensely.  However, the trade off is that production is much slower and the development experience as a whole couples with many more headaches.  As it is currently, I'm alternating between the two, choosing the more appropriate language and framework for the particular game that I'm making.  If it's a super small game that I want to release quickly and make more money on then I go with AS3+Flixel.  If the game requires a bit more processing power and I don't mind losing money on it (read: "not really paying for my time") then I'll go with C#+XNA.

And my second disclaimer:
I haven't publicy released a game in either language just yet. However, I have made complete games for myself and friends using both languages and frameworks. I'm also extremely close to public releases with other games using both (one in AS3+Flixel in likely less than a month, and the other in C#+XNA in a few more months).  I also closely follow sales trends as well as Indie development trends on both Flixel and XNA, so take my advice for what it's worth to you (to me, it's informed advice but with somewhat limited experience so far).
« Last Edit: Mon, Dec 19, 2011 by JohnTron247 »

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: moving from AS3 to C/C++
« Reply #5 on: Mon, Dec 19, 2011 »
^Great posts by guys before me on this.

There are good reasons a lot of developers transition from C++ to C#, and then from C# to AS3.  Not nearly as many developers transition the other way around and many who do end up coming back.

That would be me. Tried C++ for several years (Actually worked on a AAA game as a Technical Artists that I was used to write C++ code here and there for my tools), then went to create a C#+XNA game (which you can on my blog) and since none of them could be as retro as flixel games, I'm here.

But the worst thing about AS3 is that first I cannot do Android/iOS development which is a huge downside right now (or even don't know how I can port with minimal changes) and after that Flash is slowly fading away and we soon will be throw this great flixel library, given if it doesn't get ported or something.

There is a good balance on C++ vs C# vs AS3 vs anything else: the more diversity and freedom you want, the harder is the way but the faster you want to get there, the more limited you will be (anything wise). So choose carefully what exactly you want so you won't curse yourself while you are fighting a null pointer in C++.

But whatever you choose, I suggest you learn C/C++ anyway, even read about it once or twice a week, after all, almost anything is built upon it and it would help you understand other stuff in other language/environments, even indirectly. I highly suggest it if you don't have a Software Eng. degree.
blog, twitter, Check out my award winning game, Rot Gut:

pixelomatic

  • Active Member
  • ***
  • Posts: 131
  • Karma: +0/-0
    • View Profile
Re: moving from AS3 to C/C++
« Reply #6 on: Sat, Dec 31, 2011 »
You will be dealing with null pointers, memory access violations and get lots of mindf**ks. I don't really like C++ as you can understand. I hate C++ when it comes to code readability and syntax. Header files are enough to give you an headache. So I'd use C# or Java if I'm getting enough performance for what I want to do. Oh, and the long compile time!

Use C++ at your own risk. I mean, it's not totaly garbage, but it's partially garbage when it comes to code clarity.

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: moving from AS3 to C/C++
« Reply #7 on: Sun, Jan 1, 2012 »
yeah, C++ is the most freedom you can get but some of us don't really want that much of "freedom". It's like living on an empty island, you are left to do everything yourself but you can build everything the way you want it. it takes a lot more to develop a simple thing but it is as good as you want it to be, with least limitations and no limitation comparing to other scenarios.

So the balance depends on you and your project.
blog, twitter, Check out my award winning game, Rot Gut: