Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Php Game Programming?

Featured Replies

I had a friend tell me today that he was building a Php/Ajax game. Now i never thought of this before but can Php really be used for building Online games? then i did research and found books like this http://www.amazon.com/PHP-Game-Programming-Matt-Rutledge/dp/159200153X tell me what your thoughts on the subject are. I mean i guess it can be used for game programming cause in the end it is a programming language like any other just not as powerful as maybe something like C++ or java anyways let me know your thoughts would love to hear it :)

I think they mean that PHP will be used at the backend of your game, and just html or flash as graphics.

I don't think PHP really can be used to develop game engines etc, it's a scripting language and therefore probably not performant enough.

 

But text-based games like Travian can use PHP on the server of course.

( actually I'm pretty sure Travian uses PHP )

 

Léon

I think they mean that PHP will be used at the backend of your game, and just html or flash as graphics.

I don't think PHP really can be used to develop game engines etc, it's a scripting language and therefore probably not performant enough.

 

But text-based games like Travian can use PHP on the server of course.

( actually I'm pretty sure Travian uses PHP )

 

Léon

 

This was my first thoughts.

I'm no pro with PHP but for browser based games where PHP is primarily used to store user/character information then it should be plausible but he's not going to recreate World of Warcraft like that.

I don't see why you would use php over another language like C++.

 

I see why you would use it for storing player data but not for much more. I used to use the Unity3D engine a tonne and for any game that required networking we used php. This was just for stuff like logins, and storing player positions and so on but never for really much more than this.

 

But if you can make a decent game with it, then I don't see it as a problem to use.

Firstly PHP is rarely used in isolation these days, so really what were talking about is a php/javascript game.

 

Now ask yourself what is the difference between a website and a game is...

 

I'm sure you have seen that javascript/jquery can be used to create some pretty cool graphical effects and manipulate images in a variety of ways. You can easily pick up keyboard presses and mouse actions, with javascript. And php does a pretty good job of logical processing and content service. So yes of course a combination of web technologies (such as php/js pr php/Flash) could be used to create a game.


There are a number of successful online games built with a php back end - Notably a lot of gambling/poker games and point and click affairs - though much more is possible and out there.

 

Of course there are realistic limits to what you can do with this approach. Both PHP and js are runtime interpretted languages (slow), neither are really intended for game development (long) and most machines in the public domain dont understand php (not very portble). You certainly wont be putting out the next Call of Duty.

 

If game development is what your interested in then something like c# with the xna framework would be a much better choice. Following some basic tutorials I managed to get a simple 3d game running with this approach in under an hour. You can also easily port your games for windows desktops/ windows mobile and XBox (I'm told - my tutorial didn't go that far).

  • Author

Either way, that book linked from the first post might be worth a read. Would be interested to see exactly how it;s done in all honesty.

Can't be to worth a read it has a 2 star i believe but yes would be interesting to give it a look through

  • 2 weeks later...

What about Boggle? Do you think this type of game could be created in PHP? I've always wanted to try and code my own simple word game, like a customisation using different aspects of my favourite games (word racer, scrabble, boggle, SWF etc). Or even a program that allows me to practise, something along the lines of Zyzzyva (http://zyzzyva.net/screenshots.shtml). What do you guys reckon?

My first year assignment was to create a text-based adventure game using PHP. For example, it gave the description of the room and what directions you could go and you could type 'north' or 'examine' or 'take' and interact with rooms and items. That is a pretty simple form of a game, written in PHP with a database.

  • Author

What about Boggle? Do you think this type of game could be created in PHP? I've always wanted to try and code my own simple word game, like a customisation using different aspects of my favourite games (word racer, scrabble, boggle, SWF etc). Or even a program that allows me to practise, something along the lines of Zyzzyva (http://zyzzyva.net/screenshots.shtml). What do you guys reckon?

Id say any word type based game in theory could be created with PHP so id say go for it :)

Id say any word type based game in theory could be created with PHP so id say go for it :)

 

Awesome. Maybe I'll try something like this in the future! :D

Reading a few topics on java and php it seems rather simple( I use the term loosely) to make a "spreadsheet" type game(s). Using html to set up the tables, css to make it all pretty, and java/php to handle the input and data manipulation. ( I think Vampire Wars was originally designed on a spreadsheet)

  • Author

Reading a few topics on java and php it seems rather simple( I use the term loosely) to make a "spreadsheet" type game(s). Using html to set up the tables, css to make it all pretty, and java/php to handle the input and data manipulation. ( I think Vampire Wars was originally designed on a spreadsheet)

id personally use java over php to make games but in combination they could make a great team as well :p

There are tonnes of PHP based games, I myself am developing one.

I can't post links, but searching for the names I mention may help you.

 

The kind of games you can make with PHP:

  • Kings of Chaos
  • Ikariam
  • Mafia corruption

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.