Game::Matrix

chaoticset on 2004-01-27T06:02:22

I'm attempting to write a game matrix solver. It's been good going so far; got a nice solid start by sitting down, figuring out precisely what subs would actually be necessary, and then whittling around in those to figure out which ones to write first.

I've got the object constructor (although I'm planning to have two, one for blank initial matrices and one for ones that are filled in already...can't remember why right now, but I get the feeling this might be useful at some point) and the basic accessor method in place.

I felt greatly relieved when the scribbling I did a few hours ago revealed that all the other accessors are almost exactly the same as the most basic possible accessor. Essentially, I'm just writing two verification methods that are wrapped around it, so you can't call a payoff and get a strategy label or vice versa. It looks a lot more simple.

This was one of those cases where I tried desperately to start with a data structure in place but needed to figure out what the interface would look like instead. Once I sat and wrote the interface, the data structure became immediately apparent. Sloppily, I'm effectively just using a huge matrix with some of the edges reserved, and I have a feeling this may bite me in the ass should a 100x100 matrix ever be plugged into the thing for solving -- but, honestly, that's the kind of problem I only wish I had. I wish I'd finished this thing today.

I seem to have a problem with momentum some days. Hopefully, tomorrow won't be one of those days.

Anybody who knows anybody is apparently now on Orkut, confirming my belief that I am indeed an unsocial creature. I keep hearing from people that there's nifty things to do in that there secret club, but nobody will let me look at the Coded Orkut Handbook with their Orkut Decoder Ring. Anybody willing to break ranks and confess as to what sort of nifty things...well, I have no real prize to offer you, save for the knowledge that you have encouraged an insane person in their delusions.

And, in the end, isn't that really enough?


Game Matrix Solver?

xenchu on 2004-01-27T06:29:01

I would ask what that is but I probably wouldn't understand the answer. Is it something like Shisen Sho?

The Orkut webpage looks familiar but I can't think why. It is nothing I could ever join. It would require that I be sociable and have friends. Too many qualifications for me. They might even have a dress code!

Re:Game Matrix Solver?

chaoticset on 2004-01-27T06:54:38

A dress code they might indeed have.

I read The Compleat Strategyst some time back, and outlines the basics of Game Theory, where analysis of a set of strategies that can be played against an opponent can be quantified and compared effectively.

The basis for this is a grid where there is one row for each of your potential options, and one column for each of your opponent's potential options, and at the intersection you record the value of that outcome to yourself.

With simple games that involve simple strategies, this is an obvious task. Looking at the matrix for, say, paper-rock-scissors can reveal that, barring foreknowledge of what your opponent will choose for a strategy, you should play an evenly mixed bag of strategies.

When you get games that are more than, say, 4x4, you have to start delving into special cases that make it easy to eliminate certain strategies, allow you compare results quickly, etc. Shortcuts.

An additional chapter, added after the book's original publication, includes an updated method for finding any game matrix's strategies for each player. This is a computationally intensive process, involving (forgive the advanced terminology) shitloads of repetitive math.

Now, I'm sure I'm not the first person to think such a thing, but when my mind flags something as including a lot fo repetitive math I start looking for something to code with.

I can imagine some interesting uses for this -- NPCs that "learn" over time, by adding new strategies and new opponent matrices to their strategic repertoire, and general decision-making for a program should it need something along those lines.

This, plus, frankly I can't think of anything else I'd like to write that would be worth uploading to CPAN (that someone else much more experienced isn't already attached to and working on). And I'd really, really like to upload something that works and is useful to CPAN.