Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm building a game similar to Mafia Wars where a player can do tasks for his gang and gain experience and thus advancing his level.

The game is built using PHP and a Mysql database.

In the game I want to limit the resources allowed to player based on his level.

For example:

________| (Max gold) | (Max army size) | (Max moves)  | ...      
Level 1 |    1000    |       100       |      10      | ...  
Level 2 |    1500    |       200       |      20      | ...  
Level 3 |    3000    |       300       |      25      | ...

In addition certain features of the game won't be allowed until a certain level is reached such as players under Level 10 can't trade in the game market, players under Level 20 can't create alliances,...etc.

The way I have modeled it is by implementing a very loooong ACL (Access Control List) with about 100 entries (an entry for each level).

However, I think there may be a simpler approach to this seeing that this feature have been implemented in many games before.

share|improve this question

I would recommend using some type of algorithm rather than an ACL:

Algorithm for dynamically calculating a level based on experience points?

These aren't specific to your question, but the general principle is that there are formulas you can use to determine the requirements rather than hardcoding every possible outcome

share|improve this answer
well my problem starts after calculating the Level itself from the experience points. Think about it this way, if I know that a player is Level 4 how should I handle the privileges for that level? – Songo Apr 30 '13 at 12:09
I updated the answer to give another example. the main point is that you can use an algorithm to determine the access levels rather than hardcoding everything based on user levels – wes Apr 30 '13 at 12:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.