Archive for the 'facebook' Category

Good design decision

February 09th, 2008 | Category: facebook


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

Facebook application design

February 05th, 2008 | Category: facebook

I decided the other day to jump onto a very crowded bandwagon, that of a facebook app. At the time of publishing, there are 15,270 facebook apps. Of course, not all of them are used, or even useful.

I don’t intend to make a popular app; I doubt this server could withstand the traffic. I’m making an application just for the sake of making it, to learn.

My first app will be an interface with my Paper Knaves game. It would be rather basic, a chessboard look. I will update this blog with progress reports as it goes, and then the final unveiling. I want to be done in two months. A very reasonable goal.

The overall design is rather simple, and done. The game will consist of a game object, which is a state-machine. It keeps track of its previous state, and based on that, plus input through a generic interface, will perform the actions needed.

What that means is that, I can now make any kind of view I want, telnet, applications, or a web app, without modifying the core business logic. The interface takes care of presentation and returning neccesary information.

The presentation interface will be done with Django, with the database storing only relevant player data: name, games won, games lost, games drawn. Nothing else is stored.

Till next time

 

Comments are off for this post