11.23.06

Game Creation with PHP - Introduction

Posted in PHP at by jason.michael

If there is one thing I have been wanting to do, but somehow never had the time, was to create a turn based game written in PHP.  A couple years ago, I actually came close to having a good framework created, which allowed the player to move around a generated map.  It took me an hour to get that far, but then I was stumped trying to decide how to store the items the player would pick up, and how to store the information about each building on the map.  There are so many factors that need to be considered for one of these games to be successful. 

I have finally decided that in order to put together a decent framework for this game, what is needed is a good plan.  So I started to write some things down and make the decisions I could not make two years ago, and so far, here is what I have:

The game would be similar to Urban Dead at urbandead.com

The players table will have fields with information directly related to the player:

  • name
  • password
  • location on the map
  • player class type
  • health points
  • experience points
  • action points
  • timezone
  • email
  • last login time
  • created date
  • number of logins
  • disabled flag
  • IP Address

The players items would be stored in a seperate table in a category type structure in which you have a parent item, with its associated child items, and each item would have some attributes such as hit point effectiveness (I will have to research a better term for this from other games), which is the minimum and maximum on both hit points multiplied by max and min percentage.  The value could be negative (for weapon items) and positive (for healing items). 

I want to give some more thought to the player items data structure and design, and will layout these details in my next posting.  I hope you can appreciate the value in planning these database details first.  It will make coding the game alot more fun.

Leave a Comment