I have a database table that stores basic player data for the game.
It looks like this:
_________________________________________________________
player_id | player_level | player_class_ref | player_exp
P1 8 W1 68349518
_________________________________________________________
level | required_exp
1 100
...
8 80000000
____________________
The game itself is text and browser based.
I decided to use a rule engine to adjust player data when needed.
It executes after every player event - for example, killing a monster or finishing a quest.
The sample rule looks like this
when
player_exp > closest_level_exp
then
player_level + 1
player_exp = abs (closest_level_exp - player_exp)
There might be a lot of similar rules - for example, quest accepting.
So my question is - Is my approach viable for a web and text based game?
I am not sure how such things are usually implemented in games, such rules be hard coded, or they are stored another way?