Environmental and technological effects on ancient social evolution at different spatial scales