We formulate a theory of agent-based models in which agents compete to be in a winning group. The agents may be part of a network or not, and the winning group may be a minority group or not. An important feature of the present formalism is its focus on the dynamical pattern of strategy rankings, and its careful treatment of the strategy ties which arise during the system's temporal evolution. We apply it to the minority game with connected populations. Expressions for the mean success rate among the agents and for the mean success rate for agents with k neighbors are derived. We also use the theory to estimate the value of connectivity p above which the binary-agent-resource system with high resource levels makes the transition into the high-connectivity state.