Because slime-mold cells reproduce asexually, the r among them is 1; they are all identical twins. From the point of view of the gene, then, there is no difference between the fate of its own cell and the fate of a nearby cell. It's not surprising that many slime-mold cells fail to reproduce, and devote themselves instead to buffering fertile fellow cells from the elements. Their
neighbors' welfare, in evolutionary terms, is identical to their own. That's altruism.