This paper presents a new game theory based method to control multi-agent systems under directed and time varying interaction topology. First, the sensing/communication matrix is introduced to cope with information sharing among agents, and to provide the minimal information requirement which ensures the system level objective is desirable. Second, different from traditional methods of controlling multi-agent systems, non-cooperative games are investigated to enforce agents to make rational decisions. And a new game model, termed stochastic weakly acyclic game, is developed to capture the optimal solution to the distributed optimization problem for multi-agent systems with directed topology. It is worth noting that the system level objective can be achieved at the points of the corresponding equilibriums of the new game model. The proposed method is illustrated with an example in smart grid where multiple distributed generators are controlled to reach the fair power utilization profile in the game formulation to ensure the aggregated power output are optimal.