Sign in to follow this  
  • entries
    570
  • comments
    2427
  • views
    216029

Untitled

Sign in to follow this  
Mushu

63 views

Uhh, so I'm back from my no-internet week. Early. Because I got a job interview at Target, and they wanted me to come in on Friday. And they want me to work the flow shift, which is from 4-10. Oh, and its in the morning. No idea what I'd actually be doing though, because the restock shift is from 11-4. I'm assuming its stuff like sweeping the floor, and generally making the store look nice before the "guests" arrive. I hate working there, but alas.

So I was working on code while away... at one point I wanted to check back in my old gui code for the usage of boost::bind for something. Now, normally when a project terminates I just drop the project folder into the \projects\old\ directory, which works because I use only relative stuff.

Checking \projects\old\gui\, however, yields nothing. In fact, the directory doesn't exist.

At this point, I'm like "O__o" and figure I misfiled it or something. So I do a system-wide search for the project file. Nothing.

It appears, once again, my entire library of basecode is completely gone. Gone. No idea what the hell happened to it, which isn't explainable because I've been sober for months now.

While this isn't that big of a concern in the way that "its a lot of code lost" since I was going to rewrite it anyway, it means I won't be able to refer to old code. Which is crap, because there were some really sexy things going on in there. And some really disgusting things, which were hopefully going to be factored out to leave only the sexy [tears]

In any case, I've become slightly distracted with Moola. I'm working out a way to accurately predict player choices with a two-pronged approach - behavioral analysis and brute-force calculations. The former requires I have a sizable database, but (as tests have shown using Hippo's game data as a sample) its quite effective for determining early-game decisions. For example -

If the first piece is a '1' or '2', Hippo plays 1 or 2 100% of the time.
If the first piece is a '3' or '4', Hippo plays 3 or 4 91% of the time.
If the first piece is a '5' or '6', Hippo plays 5 or 6 70% of the time.


Likewise, if you look at it from a more global perspective -

If the first piece is '1', 72% of the time the opponent will play < 3.
If the first piece is '2', 78% of the time the opponent will play < 4.
50% of the time the opponent will play < 3.
If the first piece is '3', 85% of the time the opponent will not play a 2 or 5.


Just random stuff like that, which can be easily compiled at run-time and outputted for the player.

The problem with this is that the accuracy quickly diverges for the later rounds. In fact, its almost only good for the first round, before any decisions have really been made, and where numerical analysis is almost pointless due to the overly large decision tree.

Now, in the later rounds numerical analysis is key. Right now my numerical system is shite, it has a few simple rules ("If you have a piece which your opponent cannot match and can win this turn, suggest to play that piece") and needs to be expanded. Still working out on paper how I can do this, and what limitations I'll face (there are 370 million possible permutations for the game; if each outcome is stored in a 64-bit integer, the smallest I've been able to squeeze it into, the entire outcome database would take 22GB).

Though I've been toying with the idea of building such a database - I don't know if MySQL can handle such a beast. Or if I can even fit that many numbers on my disk while still having room for, erm, "temporary files".

I could make a bunch of precomputed outcome tables for the first few rounds, then compute probabilities on the fly for the later rounds (where the permutations are greatly reduced). It scares me to think of how much memory/how long that would take to generate...

Rah. I have tommorrow to sort this out. Any suggestions on the computation/storage of very large trees?


(This was to compute the tree from beginning to the fourth of six steps, IIRC...)

(Have 3 more invites if anyone wants, btw. Note - they only pay out to US/CAN)
Sign in to follow this  


2 Comments


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now