Optimizing resource management game (similar to Farmville) Given a fully deterministic single player resource management game 
with a pre-known finite number of turns and reasonably simple rules 
(eg, Farmville, if it were single player, deterministic, and ended 
after a certain number of turns), is it usually possible to write a 
computer program that can optimize the game in a reasonable amount of 
time? Details: 


I'm trying to create such a game (sort of a M.U.L.E. clone, but 
not really). Players would compete individually to get the highest 
score under a given set of starting conditions. The game must be 
simple enough to be fun, but complex enough that someone can't write 
a computer program to rapidly optimize it. The game is semi-tedious 
(in its current form), so I encourage API/automated use. 
Since the game is deterministic and finite, I realize that an 
optimization algorithm must exist. So my question really is: can 
someone always write an optimization algorithm that runs fast enough 
to be useful? 
I realize the answer depends on the actual game I write, so I'm 
looking for one of these answers (roughly): 


Give up. If you design a resource management game easy enough 
for people to understand, someone could easily design an algorithm 
to win it. 
There's hope. Depending on how you design the game, it may or 
may not be possible to write a reasonable algorithm to optimize 
it. However, you have to be very careful. 
Go for it. In general, there are no algorithms that can optimize 
most resource management games. Barring extreme conditions, any 
resource management game you design could not reasonably be 
optimized by a computer. 

There are Farmville strategy guides online, but they focus on 
general strategy, not an explicit algorithm. 
I realize this is a specific case of P != NP, and that's it 
theoretically possible to create simple questions that cannot be 
solved easily (eg, factor a product of two large primes) or even at 
all (eg, the halting problem), but I'm wondering if resource 
management games fall, in general, into the NP category. 
For reference, the game will be a scaled down (and single player) 
version of: 


https://github.com/barrycarter/bcapps/tree/master/YAMC
In general, you cannot hope for a polytime solution to all such games.  For many such games, the problem of playing them optimally is NP-hard.

For instance, Minesweeper (on a $n\times n$ grid) is NP-hard, and thus does not have a polytime algorithm to solve it (unless $P=NP$, which most consider unlikely).  The same is true for Sudoku (on a $n^2 \times n^2$ grid) and Tetris.  Optimal play for chess, checkers, Go, and Scrabble (on a $n \times n$ grid) is either EXPTIME-complete or PSPACE-complete (depending upon whether you put a bound on the number of moves that a player can make), so they too are very unlikely to have any polytime algorithm to play them optimally (unless the polytime hierarchy collapses or something equally surprising).

In fact, I've seen some folks suggest that there's a strong connection here: the best games tend to be ones where finding the optimal solution is asymptotically hard.  If finding the optimal solution was too easy, the argument goes, the game wouldn't be fun for humans.  Obviously, this is not a rigorous argument and it is easy to come up with counterexamples, but I think there might be something to it.

There's lots more written on this sort of topic.  For a entry point and overview, see, e.g., the following:


http://for.mat.bham.ac.uk/R.W.Kaye/minesw/ordmsw.htm
https://en.wikipedia.org/wiki/Game_complexity
https://www.ics.uci.edu/~eppstein/cgt/hard.html