Feb 9
Good design decision
Okay, so quick progress report. I’m working on the Paper Knaves game engine, and the model I chose for it, makes development almost dead-simple.
WARNING: Programming ahead. For those averse to logic, please avert your eyes.
Anyways, I chose a simple state-machine model. State-machines are great. Theoretically, a state-machine can simulate any computer, given enough states and variables. Theoretically as well, one can enumerate and easily test a state-machine.
What is a state-machine? Well, its basically an object, or concept, where you place an input, and the machine changes state. Simple, yes? Well, lets take a look at a very familiar state-machine: the browser.
Yes, your browser is a state-machine. How do I know? Well, lets picture its actions. It reads in data, the html file. For each valid <> brackets, it does something, or rather, changes state. Take, for example, an <a href=”http://www.example.com/”> tag. When the browser reads that, it begins underlining the following text, as well as making it point to the address given. That is a change of state. Then, when the browser comes upon the </a> it ends the link. This is true for almost all html tags. Except of course Javascript. But thats beside the point.
The browser changes state based on the input, and that state change is represented graphically for us. As I said, state-machines are simple. Which is why development with a state-machine for holding the game model is relatively simple. It acts on the input given based on its state, and then changes state if unnecessary.
A side-effect, is that I can now make a presentation layer, and use the exact same lower-level model. I can choose to make the game work on telnet, through a desktop application, or through facebook. All without changing the essential game-logic! Personally, I like that versatility.
Comments are off for this post