New to Monkey - need help!

Monkey Targets Forums/HTML5/New to Monkey - need help!

Yoda(Posted 2011) [#1]
Hi guys, I'm new to Monkey and there are some things I couldn't find documented, so maybe someone can answer or help me with this:

I want to make a game running online (so html5, right?) and it should be able to save the users progress in a mysql database on the server, so he can later go back and continue where he stopped.

Is this possible? How to do it?

Thanks for your help!


Gerry Quinn(Posted 2011) [#2]
You can't do that out of the box, though maybe someone has written code or modules for it.

However, you can use SaveString() and LoadString() to serialise progress.

I honestly don't know how reliable saving this stuff on current browser platform is (it certainly works, but will deleting cookies or something kill it?) and if you are writing a very deep game you might want to give people a code they can write down for backup once in a while!

HTML5 or Flash are your two choices for browser games. HTML5 is the future, and already has some advantages, but it can be frustrating to support all the browsers out there, most of which have gaps in their support at the moment. (Chrome seems to be pretty complete.)


slenkar(Posted 2011) [#3]
http://monkeycoder.co.nz/Community/posts.php?topic=137

this is the code you need to send a message to a php script

then the php script on your server will insert values into a database


Yoda(Posted 2011) [#4]
That looks like what I'm looking for, however I can't unpack a rar (I'm on Mac), so I tried the ajax.js (in the same directory as the monkey code), but I get an error when compiling. Where do I have to put the ajax.js file? In the modules-directory or where?

Sorry for my stupidity, but I'm not familiar with that concept yet. Had Blitzmax before and everything was quite easy.


skid(Posted 2011) [#5]
Video games by convention keep game progress files on the client computer.

IMHO you should forget about servers and just use mojo.SaveState and use Flash not HTML5 if you want to follow current industry standards as far as web games are concerned.


Yoda(Posted 2011) [#6]
Maybe I also want to save some variables that should not stay on the users computer, like paid game-credits.


Gerry Quinn(Posted 2011) [#7]
"Video games by convention keep game progress files on the client computer."

An obsolescent convention, perhaps - more and more games require an internet connection even for offline games. Part of the reason is probably to discourage piracy.

Can one use Flash without having the right mouse button disabled? If not it is worthless IMO.


Yoda(Posted 2011) [#8]
This discussion is going the wrong way! My question is not IF I should store these variables on the server, it is HOW can I store them.

So:

That (http://monkeycoder.co.nz/Community/posts.php?topic=137) looks like what I'm looking for, however I can't unpack a rar (I'm on Mac), so I tried the ajax.js (in the same directory as the monkey code), but I get an error when compiling. Where do I have to put the ajax.js file? In the modules-directory or where?

Sorry for my stupidity, but I'm not familiar with that concept yet. Had Blitzmax before and everything was quite easy.


MikeHart(Posted 2011) [#9]
however I can't unpack a rar (I'm on Mac)


http://www.unrarx.com/

Works good here


skid(Posted 2011) [#10]
Can one use Flash without having the right mouse button disabled? If not it is worthless IMO.


I would argue that without an audio standard or tinted image support HTML5 is useless, that and it's market share:



Yoda, if you want to do something commercial with your Monkey game, you should be looking at signing up with the likes of www.mochigames.com who can look after your game saves, leaderboard and micropayments with a simple to use SDK.

If you do decide to implement it all on your own please don't complain how difficult it is to implement in Monkey.


Yoda(Posted 2011) [#11]
That is an interesting graph! Looks like Flash is still the way to go at the moment?

I'm not complaining, I'm just asking how to do it, since I can't find it documented in a way I can understand it somewhere. I wouldn't even mind having someone else coding that whole thing for me and paying for it, so I can concentrate on the game itself. Anyone interested?

Since I want to setup a special system of payments and micropayments, it has to be special-coded.


Gerry Quinn(Posted 2011) [#12]
Of course one advantage of Monkey is that you can do both Flash and HTML with the same codebase if you want!


slenkar(Posted 2011) [#13]
http://www.monkeycoder.co.nz/Community/posts.php?topic=137

i used this to interact with a database in flash


impixi(Posted 2011) [#14]

...without an audio standard...



There is one in the pipeline:

WebAudioAPI.
Samples.

However, probably a long time before it's implemented by all the important browsers. I've been considering exposing the API for use with Monkey but haven't got around to it yet. We'll see...


... tinted image support HTML5 is useless...


This is annoying for sure, though not necessarily a HTML5 killer, IMO. But it does make some usually simple things unnecessarily complicated.

I do strongly agree that Flash is currently the best platform for commercial WEB games. Maybe HTML5 will be viable one day, but that might take a few years. (Hell, IIRC, the HTML5 standard is not due to be officially 'ratified'/'adopted' until 2020! I could be wrong...)


Gerry Quinn(Posted 2011) [#15]
Surely IE9 and Chrome are okay with tinted images? Of the three browsers I've tried, only Firefox seems to have trouble.