1
\$\begingroup\$

Some time ago I launched my FlashPunk primer, an adaption of Asteroids, which mainly served as a basis for trying out a simple optimization algorithm.

Now I'm planning to take this concept a level further and program a version of Lunar Lander. This would require to incorporate a sophisticated external C++-based numerical optimization library into my Flash Punk code.

When looking for a solution I came across the Crossbridge compiler. If I got it correctly, it would allow for writing native C++, accessing flash functions via the AS3 header and have it compiled to a *.swf-file.

Would that mean I have to give up FlashPunk and write the whole piece in C++/AS3?

\$\endgroup\$
  • 4
    \$\begingroup\$ My idea would be "abandon flash entirely" and don't try to mix and match \$\endgroup\$ – Alec Teal Sep 24 '15 at 22:11
  • \$\begingroup\$ Thanks for the comment @AlecTeal! I would guess there is reasoning behind that.. \$\endgroup\$ – Max Herrmann Sep 25 '15 at 3:44
  • \$\begingroup\$ I'll answer this tomorrow when I wake up (it's 5am here - I just woke up for painkillers really - please reply to this comment and remind me) but it wont really be "on topic" if you know what I mean. \$\endgroup\$ – Alec Teal Sep 25 '15 at 3:48
  • \$\begingroup\$ @AlecTeal: Back on your feet again? -and- No, I have no clue what you're up to. \$\endgroup\$ – Max Herrmann Sep 26 '15 at 19:44
  • \$\begingroup\$ Thanks for the reminder, on it now. But I warn you not to be optimistic, it's basically gonna be an answer about: "why you shouldn't do this" \$\endgroup\$ – Alec Teal Sep 26 '15 at 19:49
-2
+50
\$\begingroup\$

I call this the "Hello-world gulf" - the HUGE gap between "hello world" and what are basically samples and actual code.

In Python creating an auxiliary library in C++ that does the computationally intensive things is absolutely brilliant. The ability to link languages like this is also something you should consider when choosing what language to do stuff in, so great work there.

However this doesn't apply to flash - you should basically drop Flash.

The best technologies here are "open" and I don't mean this in the hippy-ish sense (although I really do fall under that banner....). Look at PDFs, these are great, look at Adobe's ability to do PDFs - it's crap. But they have specific extensions (things you can only do in Adobe's reader) that "locks you in". Flash is a bit like that in the sense it is a closed aboimination (there are open source implementations but whether or not they'd work with your library, or your mentioned compiler is another issue)

I know of no "serious" game (that is made by someone who's aware of what MinGW is) that is compiled using Microsoft's C++ compiler for example. This is often because open stuff either plays nice with other things, or can be made to play nice with other things. Before someone dismisses this as off topic, please read the next paragraph.

I hate Javascript, I think it's gotten way too much attention, but it's an example of "things playing nice". There's a project called "asm.js" which is a collection of all the parts of javascript that are easy to optimise. There's a back end for LLVM (a compiler, that's open) that emits "asm.js", there are many front ends for LLVM (like CLang) that allow it to compile say C++.

So now you get to write stuff in C++, have it compiled by the second best compiler on the planet (GCC is in first place. RTL is a lot more advanced, story for another time though) to this "asm.js" then have the browser (Firefox, Chrome will also) compile this really easy to compile chunk of javascript to native code. The result is NEAR native speeds of stuff you wrote in FORTRAN, C, C++.... any front end you like for LLVM (you could even make your own)

If it's the browser based bit you like, this is the way to go.


The Hello-World gulf

Many years ago I started with this thing called "DarkBasic" - it held me back years by:

  1. Not working like any engine should (so I had this warped idea of APIs engines should present to users)
  2. Selling dreams and false-hope (buy this ad-on for AI! Because implementing such stuff in it was not feasible, this was simple money-making from "dreams" as I said)
  3. Letting you make "samples" quickly but being the most awful thing ever for "actual software" (this is the "hello-world gulf")

You're at the point now where you're looking to cross it (from the sounds of it) and this is the toughest part of "growing up" programmer wise. I see this post as a nudge in the right direction because with game design especially there are HUGE markets for false hope.


How to cross the gulf

With systems programming I say "do actual projects" like things that let you put in data and analyse it with graphs and such, this shows you user input validation and the importance of planning ahead and over time you'll learn.

I've always said: "one cannot be taught how to model object orientated things" unlike the Matrix (which you can explain without showing) you actually do need to see it to understand it. After a while everything will just "click" and finally those diagrams will be something you actually want.

The same largely goes for games, only they're more complicated. Once you can plan ahead you'll see the huge massive gaping chasms that crap like DarkBasic doesn't show you and be like "I shouldn't use that for the job, because of this"

I think you should go for Python/C++ and OpenGL, or even wxPython/wxWidgets and drawing your lander on a DeviceContext as an image or whatever. IF you get stuck with things like "understanding shaders" - that is the kind of question I am here to answer. Understanding why/how things work make them easy to use OR go Javascript of browser-based is important to you.

I know this seems like a rant but I am totally serious, from the sounds of it you're teetering at the edge you now need to cross into the "real" world.

\$\endgroup\$
  • 5
    \$\begingroup\$ So to summarize this long article, is it enough to say, the OP should use C++, not because what he asks impossible, but because flash sucks? \$\endgroup\$ – Ali1S232 Sep 29 '15 at 20:43
  • 4
    \$\begingroup\$ And about the claims you made... do you really think MS would let people build games for XBox using MinGW or LLVM? XBox games seem pretty serious. And about unity, have you ever visited they showcase page? can you even count number of serious games in that page? OpenSource community sure has lots of things to show off, but it doesn't mean they are better at everything. Just because you were held back by one engine, doesn't mean every one is a crap. In fact that one engine might have been design to do that exact thing it was doing, and you shouldn't have forced it to do more in the first place. \$\endgroup\$ – Ali1S232 Sep 29 '15 at 20:55
  • 5
    \$\begingroup\$ Not an industry veteran if you know of no games using MS compiler, I guess. \$\endgroup\$ – Almo Oct 1 '15 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.