Cocos2D-iPhone ?

Monkey Forums/Monkey Programming/Cocos2D-iPhone ?

Armitage1982(Posted 2011) [#1]
Hi

Monkey is taking the path of BlitzMax.
Modules are coming along nicely but I was wondering something.

The idea behind Monkey is translating code to another one, but what about optimizations ?
I suppose it's important to know the target language /machine you are working on...

Take the example of the Box2d modules, I know it's still under heavy development but there is important speed differences from let's say GLFW, HTML and iOS. How exactly are you doing to speed up things with such modules from Monkey ?

Would it be possible to non-only translating monkey code to a different languages but also using specific framework like for example Cocos2D-iphone? This one is specialized and should give better performances out of the box.

I don't know if you catch the idea, but I'm wondering if on big project you won't hit a wall that could only be resolved on the target language side. I know you can use non monkey code, but if you have to do this a lot of time I fear having to learn the whole target language before :)

Do you have an opinion on the subject ?


Sledge(Posted 2011) [#2]
The suggestion seems to be to risk a dependency nightmare in order to avert very ill-defined, ethereal problems. I'm not convinced.

Also, when I wrote BlastOff! Cocos2D-iPhone was still on GoogleCode and the examples for drawing sprites instantiated an object per-sprite, per-frame, each and every frame. That approach was hideously slow (although still faster than Quartz!) so what I wound up doing was having a collection of sprite objects that persisted throughout the application's life and altering what each displayed by changing each's texture pointer. No object instantiation or destruction during the game-loop = fast execution.

I mention this not to cock a snook at Cocos2D-iPhone (which is fantastic library and will, by now, be a million miles removed from the build I was hacking around in) but to make the point that the greatest gains often come from your general approach. What you get from avoiding object instantiation/destruction during the game-loop UNDER ANY FRAMEWORK will be vastly more significant than the difference in speed between good practise under both. Assuming neither is utterly incompetent.

In other words, the returns on the kind of optimisation you're referring to probably aren't worth the time/effort.


Richard Betson(Posted 2015) [#3]
Posted in wrong thread... :)

Moved to here: http://www.monkey-x.com/Community/posts.php?topic=9823#106454