Reinforcement Learning in Commercial Strategy Games
Investigating reinforcement as a way of producing more interesting behavior than behavior trees for AI based commercial strategy game development is a good idea. The simple test game given can be described briefly.


Human pitted against AI
Each player gets a fleet of ships
Each ship begins with a positive health level
One ship can be ordered to fire one shot at one ship per turn
Each hit produces a decrease in ship health
Ships with non-positive health are removed
Player with no remaining ships are removed
The remaining player wins


The question is correct in that game states must be represented as tensors. Ideally, they should be terse representations, with minimal redundancy. The actions must be represented as tensors too. The goal to train a network to play a game is generally feasible, but the simple game may not provide sufficient complexity to lead to learning. It is probably too simple. What is there to learn? In terms of the expectation regarding the result of the game, what advantage is there to firing on one ship over another?

It may be useful to understand that although machine learning can involve networks that can be represented as directed graphs, it is not the graphs of the network cells that are saved or loaded to persist learned behavior. The networks are parameterized, and those parameters are the representation of what is learned. Where this is most important is that, provided the form of the representation is standardized, the learning hardware and software environment need not match that of the environment that later leverages what is learned. The comment, "Build a custom runtime that can run the net [using the previously learned parameters]," is the correct method if this approach is taken.

In reinforcement learning, the representation is less like a graph and more like a structure involving a flexible behavioral policy that is affected by a changing distribution of probabilities. The expectations of future game states resulting from actions are part of the evaluation that must occur before each move. One theoretical approach to automated game play, for which a few varieties exist, is Q-learning. There are others using Markov trees and recurrent networks.

If the approach is to learn something in the lab that can be used in an xBox or Playstation, then supervised learning is indicated, and a high level language may assist in rapid prototyping. The result of training would be saved in language independent form, therefore readable by the portable c/c++. If the approach is to continuously change, then the reinforcement technology must be running on those platforms and most therefore be contained in statically or dynamically linked portable c/c++.

Both of these development approaches can be used in conjunction. For this basic investigative work and probably the first year or two of R&amp;D, the use of Python for rapid prototyping would not require the use of Pybind. For the most common operations, the interoperability between Python and the mature C code ported from FORTRAN for tensor processing years ago is already present. The Python should never run on the game platform. It is not compiled and runs orders of magnitude less efficiently than C/C++ or Java. Determining whether the C++ API of tensorflow ports well to the desired target game environments is part of the architecture process. The Tensorflow underlying C++ API that Python ML newbies aren't generally concerned with is worth review by those who develop commercial games.

If 99.9% of the time, games are still developed on a Microsoft OS, game developers may be excessively patient. Fedora LINUX is much more productive for C, C++, Java, and Python development for both low level and high level programming tasks.

None of this has addressed the mention of a more creative opponent in the question.

The classic training goal in AI game play is to produce winning behavior, but games don't sell when the human always loses. Setting reward and loss functions to optimize on the basis of victory will not create sustainable sales of commercial game products. What a game developer might more wisely chose as a basis for optimization is engagement. Sacrifice victory in favor of sensation. You want gamers to blog to each other and talk in school and work about some crazy and unexpected thing the game did. Consequently, the goals of the learning must be adjusted in terms of training to maximize game value based on these product market realities.