Thursday, July 19, 2012

Of Feast & Famine simulation

I've decided to try something that I've never tried before with a game (at least not with a whole game).  I'm going to write a computer simulation of it.  The goal is to use the simulation to help balance the game.  I'm not sure how far I'll take it, but the farther the better. 

Disclaimer:  For the rest of this post, I'll be writing as if you understand Java (the language I'm writing it in).   That may be Greek to some people so I apologize in advance! 

Here's the basic idea:
Every time there is a player decision to be made I'm going to introduce an interface to represent a strategy to be taken in that situation.  (E.g. AssignWorkerSkillsStrategy).  Then I'm going to try to come up with a fair number of reasonable implementations of each Strategy.  (E.g. GeneralistAssignWorkerSkillsStrategy or SpecialistAssignWorkerSkillsStrategy).  Then I'll have a class called Player that is returns a particular implementation for each strategy.  Somehow I'll create players with different strategies.  I'm not sure if I'll make an exhaustive collection of every permutation of strategy or just make Players randomly...  it will probably depend heavily on how many permutations that would be.  Regardless, I'll then assign a Players to a game and run the simulation keeping track of if they won or lost (and if they lost how) as well as the strategies used.  Do that many thousands of times and I can get an idea about the difficulty of the game as a whole and which strategies seem to work best. 

I can then tweak the game rules so that the game is the right level of difficulty (actually I'll probably want a way to have several difficulty levels).  Real players are going to better than the simulated ones, so I want to lean on the difficult side.
I also want to make sure that there isn't one strategy that is clearly better than the rest.  Foolish strategies should, of course, fail.  But It would be nice to have more than one way to attack a problem.

Well...  that's the plan at least.  I started working on it a couple of days, but it will take a while before it's runnable.  We'll have to see how successful this is.

No comments:

Post a Comment