What cognitive abilities do we need to cooperate? Studies of simple cooperative games often focus on the role of reputation, reciprocity, and other-regarding preferences. Real-world social dilemmas, however, are characterized by the diverse capabilities and needs of the individuals within them. These create situations where reciprocity, for example, is not enough. A person who receives important help cannot directly return the favor. While diversity can present new ways to prosper, it may require different abilities to discover and maintain highly-structured cooperative "cycles". We present a multi-agent resource exchange game–the "Mars Colony game"–that captures the essence of these complexities. We study the impact of preferences (selfish and other-regarding) and strategies (direct and indirect reciprocity, and causal attribution) on emergent cooperation.