Week 3, Friday

April 13, 2009 at 6:31 pm (Java, Week 3) (, , )

This post has been in the works for days, because I took a big trip down to Georgia to play an Easter gig and pick up my car (my wife and I drove her car up here together last month). I was only at work for half a day on Friday, and I spent most of the time brainstorming and working on ways to make the 3-D game fast enough to be playable. Right now, it just hammers the CPU until I’m afraid for my machine’s life. So Micah’s made 3 suggestions:

  1. have ONE reusable board (rather than creating Board objects for each possible position)
  2. make the Board smarter (so that it knows its state – that is, it has fields for the winner and game end)
  3. caching known board positions and results (based on score from the minimax algorithm call)

I’ve started implementing these, but haven’t done enough to see any large improvements yet. I’m anticipating the biggest improvement in the last step, because of the huge number of boards that need to be scored and the relatively small number of unique boards.



  1. 7kittens said,

    Is this a java app? have you done any profiling yet.

  2. trptcolin said,

    I have done some informal profiling (recording the times before and after method call and tallying up totals), which helped me to find some small bottlenecks, but I haven’t used a profiling tool yet. I may look into that; thanks for the tip!

  3. Yo Gabba Gabba said,

    have you tried pruning symmetries?

    • trptcolin said,

      I have not. I’ve considered the possibility, and I understand that (for a 3×3 board) there are only 3 equivalent starting moves, but beyond the first few moves I’m not sure how I would apply it to the entire game tree.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: