I will be releasing my iPad Baseball game very soon and need an online leaderboard.
Since OpenFeint or Game Center isn't working for the iPad at this time, I'll use GLbasic to create
my leaderboard. Actually OpenFeint or Game Center might be over kill for what I need anyway.
So, after reading the topics below on High Scores over the internet, I have a couple of questions.
Before i get started, let me say I know nothing about using PHP.
Here's the info I will be recording for online:
Game Mode "Classic"; Name, Score, and Date
Game Mode "Player vs CPU"; Name, Score, Date
Game Mode "Home Run Derby"; Name, Home Runs, Date
Will I need to use NETWEBGET for each of my game modes?
// High score record for game mode "Classic"
NETWEBGET("mydomain.com", "/classicscores.php?name=" + highplayer$ + "&score=" + (highscore) + date$, 80, 99999)
// High score record for game mode "Player vs CPU"
NETWEBGET("mydomain.com", "/cpuscores.php?name=" + cpuhighplayer$ + "&score=" + (cpuhighscore) + date$, 80, 99999)
// Home runs record for game mode "Home run derby"
NETWEBGET("mydomain.com", "/homeruns.php?name=" + highplayer$ + "&homeruns=" + (mosthomeruns) + date$, 80, 99999)
Is there a way to use the internal iPad keyboard to type in the persons name or do I use DDgui to make the keyboard?
If there is an easier way to keep online high scores(stats) than what's above, then please let me know.
GLBasic topics on High Scores over the internet:
Topic: Help Please with High Scores Over Internet with iPhone
http://www.glbasic.com/forum/index.php?topic=4988
Topic: BIG THANKS and high scores over Internet
http://www.glbasic.com/forum/index.php?topic=5222
Topic: online high scores tutorial
http://www.glbasic.com/forum/index.php?topic=2268
Thanks!
Baseball on the iPad sounds great! If you don't know PHP then where do you plan to host it?
i've written an ipod/iphone Keyboard routine . its fully GLB with some images from the ipod and works well.
http://www.glbasic.com/forum/index.php?topic=4497.msg33648#msg33648 (http://www.glbasic.com/forum/index.php?topic=4497.msg33648#msg33648)
Quote from: matchy on 2010-Dec-16
Baseball on the iPad sounds great! If you don't know PHP then where do you plan to host it?
hi matchy!
Google will be hosting. Hopefully PHP will be o.k on google. here is some info:
http://code.google.com/apis/documents/docs/1.0/developers_guide_php.html (http://code.google.com/apis/documents/docs/1.0/developers_guide_php.html)
http://code.google.com/apis/spreadsheets/data/1.0/developers_guide_php.html (http://code.google.com/apis/spreadsheets/data/1.0/developers_guide_php.html)
Quote from: Marmor on 2010-Dec-16
i've written an ipod/iphone Keyboard routine . its fully GLB with some images from the ipod and works well.
http://www.glbasic.com/forum/index.php?topic=4497.msg33648#msg33648 (http://www.glbasic.com/forum/index.php?topic=4497.msg33648#msg33648)
Thanks Marmor, I'll look in to that.
Hi Millerszone
Maybe you can host your highscore table in http://www.000webhost.com/ (http://www.000webhost.com/)
Works good, It's free and you have the tools to work with PHP and MySql.
Hope it helps!
Cool site! I'd use it but perhaps someone can install a simple generic system for us to use? It would be nice to be able to have a ready system for online scores separate for each application (code/password) and admin like OpenFeint but extremely trimmed down, even to (no signin) anonymous scores - nothing complex really and easy to maintain.
Experimentally I have thought about using the RSS blog feed to transfer data also.
Hello..I'll try to help as best I can.
I have a game out called Hairy Legs that tracks the top 50 scores. I'll explain how it works in game and what goes on behind the scenes.
The game tracks the top 5 scores locally. Every time you play it checks if your score is higher than one of the top 5 scores and if so, it arranges the scores accordingly. There is a High Scores button on the title screen. When you click on that it looks for the web server that hosts the scores. If it can not find it, it continues on to show you the top 5 local scores along with the option to reset them. It tracks their name and score. For a keyboard I made my own. Took a screenshot of the actual iOS keyboard and then used it along with checking the mx,my position on a mousestate check to get which key was pressed. May be an easier way, but at the time I didn't know of one. If the device does find the server it then uses netwebget to download a data.ini file that contains the data in the format of name and then the score underneath it. I use readline to read each line and assign it to a variable..example "HighScoreOneName$" for the player name and "HighScoreOne" for the actual score.
If it finds the server it adds a button to the options to Submit Scores. This will submit your top 5 local scores to the web server. Here is where you almost need to know some PHP. Really I was very much a novice at PHP, but doing some searching I found some great sites that cover everything you need. I used netwebget to submit the scores. The server looks at the top score on your local scores and checks if it should make the top 50. If not it does not even bother looking at the rest. If it does it looks at the others and then rearranges scores accordingly. Once it rearranges the scores it then rewrites the data file with the names and scores. After you submit your scores you can click on the global scores button and see the changes right away, because whenever you click on global scores it retrieves the data file each time so that it can get any updates. The server does not change your local scores. You can reset them, but they are stored on the device. Global scores are not stored on the device. You are simply looking at them when you are on the Internet.
Here were some of my hangups. Again I was very new to all of this and there maybe or probably is better ways of doing it.
How to get the keyboard to work- Ended up using mousestate to determine what key was pressed and then assign the appropriate letter to an array. I allowed for 13 characters within the array, so if a person entered say 6 characters I had to account for when they pressed enter to have it fill out the remaining 7 slots with spaces.
Speaking of spaces- Netwebget would not work with PHP sending spaces. So before I sent data to the server I had to use a replace command and replace all spaces with underscores. Then when the file is retrieved because the user presses Global Scores I would reverse the process and turn all underscores into spaces before showing them.
To do what I did you need a server with PHP. I had a domain name through one of these cheap places that offer a domain name and web space, so I just made a folder to contain the PHP program and the data file. If you can get access to a PHP server it is not that hard to figure out.
Hope this helps some.
Thanks ggindlesperger for the info.
I have the local leaderboard finished. It looks like Google apps will not work, so I'll
be getting a new host.
I use my own webserver now, but originially i tested my code with these and it worked fine.
http://freehostingphpmysql.com/ (http://freehostingphpmysql.com/)
Sign up for a free account and away you go :)
My leaderboard is now complete. I got a host that supports Php and MySql.
Since I had experience with MySql, I ended up using that for my database.
Learned a lot about php online.
So now my game is almost ready!
Thanks.