Page 1 of 1
Making an online RPG game with PHP.
Posted: Tue Dec 21, 2010 10:23 am
by Dannerz
Hi I'm new to the forum and to PHP. I am reading about it at a how to website.
I'd like to know if it is possible to make a game using PHP.
These are the things I'd require:
*A way for people to make accounts.
*Saving variables online and changing them as the game is played. Each player account would have its own lists of variables.
*An online time system to change variables of accounts/players every minute or hour or day, even when the players are not logged into the site/game.
I've seen a few games online that are .php websites.
I've made games in GameMaker, if any of you have heard of it. I have a fair understanding of .gml
I'd like to take my understanding of programming to the next level, and make a multiplayer online game.
I don't want anything too fancy. I just want to make a simple game.
Any advice would be appreciated.
If I have posted in the wrong catagory then mods please move the thread. It's my first time. :3
Re: Making an online RPG game with PHP.
Posted: Wed Dec 22, 2010 2:51 am
by cpetercarter
Yes, of course you can write a game such as you describe using php. Remember, however, that php scripts terminate and lose all the information they contain, when they have completed their work - they don't sit around waiting for a player to make his/her next move, for example. So you need to store information such a details of your players in a database. Learning how to use php to store and retrieve database information might be a good place to start. (PHP has modules for a wide variety of databases, but most people start with MySQL). After that, you might look at the way that php can pass information to the next iteration of the script, using GET and POST; and store information in SESSION variables and cookies.
You say that you want to update information automatically every hour/minute. If you design your database writing routines carefully, you may find that this is unnecessary. Otherwise, you will need to be able to place 'cron jobs' on your server, and your webhost may not permit this; or you can write a 'pseudo-cron job' which your php script calls every time it is run.
I hope this is helpful as a place to start. Please feel free to post again with any specific issues you need help with.
Re: Making an online RPG game with PHP.
Posted: Fri Dec 24, 2010 1:29 pm
by Dannerz
In game maker, you can assign variables to arrays and "objects". these variables can be strings and values [numbers].
Also the format of the game maker scripting language has things such as built in functions and { } making codes between brackets.
But all of the PHP functions are new to me. I'm like an absolute newb who is interested. Thanks for your reply.
I hope to make friends with someone whom is good at PHP, then just ask them questions on yahoo or msn, as that may be
the fastest and most convenient. Thank you for answering my questions.
Re: Making an online RPG game with PHP.
Posted: Fri Jun 17, 2011 7:57 pm
by Dannerz
I have just downloaded Alleycode HTML Editor.
It is what I was looking for, a program to write test and save scripts, html and php documents.
Now I need to run .php documents on my computer in a way that will work.
How do I do that? What else do i need to download?
Re: Making an online RPG game with PHP.
Posted: Mon Jun 20, 2011 8:01 am
by cwheel3915
Im taking the assumption that you are using windows.
www.apachefriends.org/en/xampp-windows.html
Thats what you need to run php files, its like a webserver on your pc.
Re: Making an online RPG game with PHP.
Posted: Mon Jun 20, 2011 1:40 pm
by Peter Kelly
I used to have a script which you could have looked at for examples, really these RPG games are just maths and probabilities. But require a lot of work, I would recommend getting some proper web hosting but as cwheel3915 has suggested one of the best programs that compiles apache, php, mysql and phpmyadmin easily all in one program is xampp.
Re: Making an online RPG game with PHP.
Posted: Wed Aug 10, 2011 3:39 am
by Dannerz
I have XAMPP now.
I can run and test .php files.
Now i need to figure out how to make player accounts,
store and modify information of each player,
randomly select players then have them fight eachother.