Several recent models have shown that altruism can spread in viscous popula
tions, i.e. in spatially structured populations within which individuals in
teract only with their immediate neighbours and disperse only over short di
stances. I first confirm this result with an individual-based model of a vi
scous population, where an individual can vary its level of investment into
a behaviour that is beneficial to its neighbours but costly to itself. Two
distinct classes of individuals emerge: egoists with no or very little inv
estment into altruism, and altruists with a high level of investment; inter
mediate levels of altruism are not maintained. I then extend the model to i
nvestigate the consequences of letting interaction and dispersal distances
evolve along with altruism. Altruists maintain short distances, while the e
goists respond to the spread of altruism by increasing their interaction an
d dispersal distances. This allows the egoistic individuals to be maintaine
d in the population at a high frequency. Furthermore, the coevolution of in
vestment into altruism and interaction distance can lead to a stable spatia
l pattern, where stripes of altruists (with local interactions) alternate w
ith stripes of egoists (with far-reaching interactions). Perhaps most impor
tantly, this approach shows that the ease with which altruism spreads in vi
scous populations is maintained despite countermeasures evolved by egoists.