Monkey viable for making mobile games?

Monkey Archive Forums/Monkey Discussion/Monkey viable for making mobile games?

ENAY(Posted 2012) [#1]
Has been a few months since I have used Monkey.

If I write and finish my game and it works fine in HTML5, is it quite simple to compile for iOS and Android? Or should I simply just stick with Java and Objective C for mobile development, is Monkey really all that good?

Does Monkey support save/load and netplay, update highscores on a network etc?

Thanks in advance for the advice. :)


Soap(Posted 2012) [#2]
Yes, it's ridiculously easy and simple.

>Does Monkey support save/load and netplay, update highscores on a network etc?

That's all possible.


Xaron(Posted 2012) [#3]
I did some example highscore code: http://monkeycoder.co.nz/Community/posts.php?topic=812


pantson(Posted 2012) [#4]
ENAY!!!
I have to shout, your on the other side if the world ;-)

Some of the code I wrote in HTML demo, we really had to think about it and redo when working with Android as well. (have to cater for the many many devices on the market)
But now, my code easily compiles in HTML5 and Android.
Not all my modules work in both iOS and Android yet. but I'm getting there.

If you want to plug into anything external, you will have to write your own cpp and java code

As for highscores, I have my code plugging into OpenFeint now

Check out the games we've done in my SIG to see what we have done on Android (soon to be iOS soon, if I can afford the sponduly!)

If you want something that can do gfx easily on various devices instantly this is for you. If you want to put a bit more effort in and write external modules (less than what you would do anyway for the various markets), then this is still for you.

I like Monkey and would recommend to anyone for its ease of use.
Today Android, tomorrow iOS and other stuff ;-)


GfK(Posted 2012) [#5]
In all honesty, having used Monkey for a good couple of months, the "write once, compile many" methodology is something of a myth. Things that work perfectly well for one target (i.e. LoadString) behave strangely on other targets, while some things (i.e. the OS module) only work on certain targets anyway - all well and good as long as you realise that from the outset.

File handling is globally awful, however. You're pretty much limited to LoadState and SaveState - again the success of which varies from target to target and loading any sort of raw data will give you problems (i.e. it just fails if your data contains a 0 anywhere within it).

I'm not saying Monkey is crap, because it isn't. Just don't go into it thinking you'll be able to compile for anything right off the bat without any head-scratching/swearing/bewilderment, because you won't.


therevills(Posted 2012) [#6]
Just don't go into it thinking you'll be able to compile for anything right off the bat without any head-scratching/swearing/bewilderment, because you won't.


QFT!! LOL!

Monkey is still alot faster than writing your game in the target languages yourself, you "dont" have to learn C++, Obj-C, Javascript, Java, C# or Flash - you just have to learn Monkey and live with it small downfalls.

I really like Monkey and had fun developing for it since release, it has come a long way in such a small amount of time.


AdamRedwoods(Posted 2012) [#7]
I made a simple load/save game class here:
http://monkeycoder.co.nz/Community/posts.php?topic=1958


ENAY(Posted 2012) [#8]
Cheers for all the replies everyone. :)

Ric, you will have to shout a bit louder I am afraid I can't hear you ;)

Looks like Monkey certainly seems up to the task, and since I have written about 9 games in B2D,B3D,Max etc it would certainly seem that Monkey can do the job. But isn't Monkey slow?

My sudden interest in Monkey came from a sudden chat with my boss last week. On Friday, he went around the office asking people for game ideas, it seems we have secured a deal with a company to make iOS and Android games, they don't seem to care too much for what sort of game, as long as we can provide the content.
Whilst a few other people were preparing design documents and ideas in Photoshop/Powerpoint etc I thought it would be easier to simply write the game in Blitz. I completed that on Friday and thought about converting it to Monkey, I have almost finished doing that now. My boss when quite excited when I showed him a firework demo I compiled into html5 because he was able to access it easily using his iphone.
I think it will have quite a big impact tomorrow on Monday morning when instead of a design document I can show my game idea which will be the full game.

My concern was basically now that it is almost fully functional in html5 and everyone can play it on their PCs or mobiles using html5, can I realistically put forward a proposal that I could make some games for Android and iPhone? I would hate to find out later that actually Monkey can't handle a specific feature and never will and then I've wasted all that time and money developing for a dead end language.

Everyone in the office is learning Unity including myself at the moment but I can't help thinking that for many games we could just use Monkey instead.

I have spent the last month or so with another programmer converting an Android game to iOS from java to Objective C and I can't help feeling that it would have been easier to simply rewrite it from scratch in Monkey. Especially since it is only a puzzle game. I could have probably converted it to BB myself in a week. Objective C looks very odd with all the [[][]] all over the place and it is tough to debug.

Dave, if I recall you made a Transport Tycoon deluxe looking spy game (or something or other). That was in Monkey right? Did you find getting your game onto the market using Monkey easier than you thought?

One other question, on the market page it says Monkey can also convert to X360?! Is that really true? Somehow seems like a lie. I can't seem to find any information about that here on this site. There are a couple of Xbox360 dev kits in the office and it would really interesting trying out to see if Monkey can compile to that too.


skid(Posted 2012) [#9]
Regarding monkey on Xbox - it is a lie, you need to give Microsoft money, sign away parts of your soul then they pay 70% of all application sales as your revenue share.

develop for Windows Phone 7.5 and Xbox LIVE Indie Games


ENAY(Posted 2012) [#10]
Cheers for the info Skid :)

Good old Microsoft eh, not sure how a development license differs in Japan but I guess for now no point in looking into XBox. (Not that I was intending too anyway)


therevills(Posted 2012) [#11]
On the point of licenses, you need to pay Apple $100 per year for them to put your Apple approved game on the App Store. With Android you need to pay Google a one off fee of $25 so you can sell you game on the App Market...

If you game is running fine on HTML5, it "should" run fine on the other targets - I find that HTML5 is the slowest target, due to the slow SetColor command.


muddy_shoes(Posted 2012) [#12]

My concern was basically now that it is almost fully functional in html5 and everyone can play it on their PCs or mobiles using html5, can I realistically put forward a proposal that I could make some games for Android and iPhone? I would hate to find out later that actually Monkey can't handle a specific feature and never will and then I've wasted all that time and money developing for a dead end language.


Can you make games for Android/iOS in Monkey? Yes.

Can you guarantee that any game you write that works well using the HTML5 target will work well on a phone? No.

Can Monkey "handle a specific feature"? Presumably you can spot how this question fails to be useful or answerable with anything other than "maybe".


siread(Posted 2012) [#13]
I spent a couple of months converting a lot of my New Star Soccer 5 code from BlitzMax to Monkey and have been immensely impressed at how well it builds for different devices. Sure you have to deal with quirks for each platform but the help on this forum and from Mark is fantastic, and Monkey is improving with each update. I'm feeling pretty confident about a synchronised release on iOS, Android and Flash in the next month or so and having looked at plenty of other options out there I would definitely recommend Monkey to anyone wanting to do cross-platform 2D games.


ErikT(Posted 2012) [#14]
Just my opinion here. I think Monkey performs as well on mobile formats as you can reasonably expect. I installed a DS module (done by slenkar I think?) just for kicks and got a small game prototype using rigz collision module (ported from blitzmax), relatively big animated sprites and an animated scrolling background running on the Nintendo DS at full 30 fps.


dawlane(Posted 2012) [#15]
Objective C looks very odd with all the [[][]] all over the place
Yes that's true but you don't have to use Objective-C all the time with ios. You only need it for a few things the rest can be done in C/C++. Plus it can be a pain to debug any thing written with monkey as I found out the other week when some code worked perfectly on FLASH/HTML5 but crashed on glfw.

I tend to think of Monkey as a abstract language with basic API libraries and if you want more functionality you have to then write your own modules in the targets native code and then wrap them in monkey.

Can you guarantee that any game you write that works well using the HTML5 target will work well on a phone? No.
I think that answer should be extend a little to include the fact that the HTML5 target doesn't work well a cross all browsers that support HTML5 either.
So far I've managed to get my game to work on HTML5/FLASH/GLFW/IOS/XNA but I have to do more work to get some of them to play nicely with the target devices OS. Which means writing native code.


muddy_shoes(Posted 2012) [#16]
I think that answer should be extend a little to include the fact that the HTML5 target doesn't work well a cross all browsers that support HTML5 either.


Sure, HTML5 is not a homogeneous platform and nor are iOS and Android phones. The monkeybox2d pyramid demo runs at 30fps on my laptop in HTML5 on Chrome but 7fps in Firefox. It runs at 12fps on my Android phone but no doubt at 25fps on something more current and maybe 1fps on the lowest spec. The answer to the question is still "no".


ENAY(Posted 2012) [#17]
Seems so far that playing sounds is the only thing I can't get working in html5. It is just silence in a firefox browser using any of the sound commands from the Monkey IDE. If I upload the code to my website the music plays but very choppily, and eventually it just dies, despite being on repeat.

I guess I still have a lot to learn, but the gfx and everything works great. :)


Paul - Taiphoz(Posted 2012) [#18]
The Browsers support different formats when it comes to audio files m8, check which browser your using, and what file format your using for your audio, and what target your using.

Flash for example only plays mp3, flash also does not like channels so you need to just play the sound straight up.

Chrome does not like wav or is it ogg I forget, just have a dig around and find out what file format you need to use.


MikeHart(Posted 2012) [#19]
Marks sound sample script shows which sound formats should be used on which platform.

#If TARGET="glfw"
		'GLFW supports WAV only
		fmt="wav"
#Elseif TARGET="html5"
		'Less than awesomely, there appears to be no 'common' format for html5!
		'Opera/Chrome appear to handle everything, but...
		'IE wont play WAV/OGG
		'FF wont play MP3/M4A
		'Let's support OGG!
		fmt="ogg"		'use M4a for IE...
#Elseif TARGET="flash"
		'Flash supports MP3, M4A online, but only MP3 embedded.
		fmt="mp3"
#Elseif TARGET="android"
		'Android supports WAV, OGG, MP3, M4A (M4A only appears to work for music though)
		'There are rumours of problems with WAV sounds so let's use OGG.
		fmt="ogg"
#Elseif TARGET="xna"
		'XNA supports WAV, MP3, WMA
		'Probably OK to use mp3 here, as audio is converted by XNA so you're not actually 
		'redistributing/decoding mp3s so probably don't need a license. But that's a lot
		'of 'probablys'...
		fmt="wav"
		mfmt="wma"
#Elseif TARGET="ios"
		'iOS supports WAV, MP3, M4A
		fmt="m4a"
#End


I experience the same problems with sound on FireFox. On Chrome, things work much much better.


Gerry Quinn(Posted 2012) [#20]
There's a thread about sound in HTML5. Basically you have to test which browser is running and load an appropriate sound. Firefox doesn't work with repeating sounds, and it also cannot colorise bitmaps. You can't really blame Monkey for that.

Everything will probably have to be tweaked for different platforms. I don't think Monkey will be terribly slow, though, if it is being translated into a Java-like language, as the structures are quite similar.


Gerry Quinn(Posted 2012) [#21]
"Good old Microsoft eh, not sure how a development license differs in Japan but I guess for now no point in looking into XBox."

As I understand it, MS and Apple are both the same, i.e. $100 a year for the licence, and your app has to be approved.

On the plus side, it means less competition when you do get in.