Php, coding games and such

  • Thread starter Aria
  • Start date
  • #1
1
0
Hi, I'm a php student, or rather I'm teaching myself php with the aid of some friends and co-workers for a project which I'm planning - to create an online game made with php and sql, I was wondering 2 things

Firstly, would anyone be able to give me any advice on what I'm likely to need to know for it?
Secondly, can anyone suggest any decent online games that I could take a look at to get a few ideas?

Thanks in advance for any help you can give.

Ari.
 

Answers and Replies

  • #2
437
1
Aria said:
Hi, I'm a php student, or rather I'm teaching myself php with the aid of some friends and co-workers for a project which I'm planning - to create an online game made with php and sql, I was wondering 2 things

Firstly, would anyone be able to give me any advice on what I'm likely to need to know for it?
Secondly, can anyone suggest any decent online games that I could take a look at to get a few ideas?

Thanks in advance for any help you can give.

Ari.
I hadn't thought that online games can be made with PHP. PHP is a dynamic web technology that downloads a different HTML page from each request. It would be another case if you combined PHP pages with an active technology like JavaScript, Java, DreamWeaver or Shockwave. I think that a combination of PHP and SQL would be appropriate for queries, browsing, guest books, forums, etc., but not for games. Consider a Java Applet.
 
  • #3
dduardo
Staff Emeritus
1,890
3
Unless your making some type of text based game php is not the right language for creating an online game. You'll want to code a code in java or actionscript (flash).
 
  • #4
122
1
I'm pretty sure you two seem to be forgetting database driven games.

For instance, you could have a quiz based on a databank of questions. Or a management simulation (soccer ones are popular) involving details on the database. It's actually quite a good way of doing it - having a web-based front-end written in markup and PHP is easier in my mind than making your own GUI in programming language.

Just Googling, I've found a page of interesting links:

http://www.onlyscripts.com/pages/PHP/PHP_Scripts/Games/

Also, a Colorado-based company called VR1 were developing an online game called Lost Continents, a massive MMORPG based around SQL and C++. I think it got shelved, but it was thought it had massive potential.
 
  • #5
299
1
The problem with PHP for games isn't in the PHP itself - PHP has a syntax very much like C, except that the variables are not typed - they are more like perl variables.

The problem is with the way browsers work. They have to request a refresh from the server, and every page is a fresh start - there are no variables stored by each user, unless you use cookies, or POST or GET all the variables you wish to retain whenever a user clicks on something to request a refresh.

So for simple question and answer games, or Adventure games where there's not much in the way of graphics, or for board games like chess or othello, PHP should be fine, but for more graphically demanding games, you need Flash or Java (Java applets, not Javascript).
 
  • #6
437
1
timmay said:
For instance, you could have a quiz based on a databank of questions. Or a management simulation (soccer ones are popular) involving details on the database. It's actually quite a good way of doing it - having a web-based front-end written in markup and PHP is easier in my mind than making your own GUI in programming language.
After all it will depend on what game Aria wants to develop. With PHP the scope is too limited. The screen is updated with each request sent to the server, i.e. with a new HTML page. Thus text-based games or games where there is little interactivity/animation like chess or 'hang-the-duke' can be developed with PHP and a server side database like SQL.
 

Related Threads on Php, coding games and such

  • Last Post
Replies
4
Views
3K
Replies
1
Views
3K
  • Last Post
Replies
10
Views
30K
  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
9
Views
2K
  • Last Post
Replies
2
Views
7K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
4
Views
3K
  • Last Post
Replies
8
Views
2K
  • Last Post
Replies
2
Views
6K
Top