Game Rules 1

I mentioned I would talk about a domain specific language for game rules so I will but first a rant on why the term DSL is silly and some discussion on what a game rule itself will be.

The term DSL is kind of stupid

Like any good acronym one day you wake up and it is as if while you were sleeping everyone got together and decided to surprise you the next day. Suddenly people realized they could make their own languages to solve specific problems and that this was now the neatest thing since sliced bread and other suitably neat cliches.

It is not that I am opposed to them. I just find it appallingly annoying how computer science and the software industry is often reduced to fads. It is as if all the people who slept through their compilers courses (really when else are you going to get a nap?) suddenly realized that this information was actually useful. DSLs don't solve all of your problems--but being smart and knowing the theory behind them will transform them into useful tools. I suggest picking up the dragon book and books on automata and language theory.

What is a game rule?

When playing games generally there is a set of rules to play by. These usually follow as consequences for some action the player does. These rules can also be the consequences of actions by other rules. Such as a player moves his piece on a board game and receives 5 points. He already has 10 and it only takes 15 to win lets say. The rule for winning was based off an action from another rule (gaining 5 points).

A game rule is action and then a consequence or more formally a predicate and some function that changes the course of game play somehow. R = (P(s),F(s)) So to apply a rule P(s) must be satisfied. Then s := F(s). Of course fashioning this into an actual usable system will require more work which I will save for next time.

0 comments: