The effects of resource scarcity on group conflict and cooperation