Without hard-coding the groups as separate evolving units, you'll have a hard time.
In general, it is easy to show the group behaviors you want if you can treat the group as atomic for the purpose of the model. But you've just moved the goalposts, your 'individuals' are not the unit of evolution any more, and you've simply set the required behavior in the fitness function.
So try it and see.
Whether this has any relevance to the real world is the debatable matter. I would argue that it does, there are many examples where strong communities have grown as a result of general goodwill and altruistic behaviours, and these communities prosper compared to those where exploitative behaviour is common. There is of course another element which a simplified model neglects - communities, once formed, exert a strong pressure on its members to conform to the norm, be it good or bad. This pressure has the effect that the individuals who depart from community norms are "evolved out" so to speak. In case of altruistic communities, this protects the group from infiltration by exploitative individuals. In case of exploitative communities, unfortunately, this perpetuates the communal problems. Eventually, if the two communities come into a conflict, the exploitative community will be eliminated.
Are you saying the simulation is not valid unless collaboration between individuals arises as an emergent behavior?
Unless you're disputing the existence of group selection in real systems, what does hard coding it change vs. a given system where it is an emergent property?
You can, of course, give a narrative argument on why you feel it is justified to exclude the interplay between these levels. But if you, at some point, try to show it is justified, by removing the assumption from your model, you'll struggle, I predict.
Evolving systems are very complex, it is an unwise assumption that you can chunk their dynamics into levels of abstraction and expect those dynamics to function independently or predictably when combined.
Now selfish behaviour kicks in as every individual wants to give as little as possible. But survivial of the group becomes crucial in face of an adversory. In that case everyone will contribute towards maximising group's strength. So in my understanding nature and wars (to a lesser degree) shaped altruism. But mostly nature. There's no way monkeys can survive without taking care of each other and group dynamics are strongest amongst them.
Altruism is completely practical.
I also agree that it is about the actions more than what you gain by doing so.
Charity is a good example of how altruism helps yourself, I donate to charity every now and then and of course it makes me feel good about donating, thus the act has an emotional gain for me.
But I don't consider it "altruistic". I help them because I want to help them and enjoy having done so, and not out of some innate sense of ethics or of what needs to be done.
I think people doing altruistic things do enjoy them, but they don't do them because they enjoy them. They do them because they need to be done, and the enjoyment is a side effect.
Of course, this distinction makes it incredibly difficult to know if someone is actually being altruistic or not.
For example, a restaurant owner might serve food for free for homeless people for increasing their own reputation and social wellbeing, vs the owner who does it entirely out of the goodness of their hearts. The net result is the same, so why worry so much about the motivation behind it? I'd say they're both equally good people, in this example.
Being able to be generous and therefore altruistic is also a decent signal to the rest of your group you're fit and healthy.
What is the difference between the two conditions? The only one I can think of is that removing the side effect does not change the behavior, but removing the main motivator does. How is this significant though? Is it easier to lose enjoyment from altruistic activities than to lose a sense of responsibility? Is pleasure more fickle than duty?
That distinction, IMHO, also makes the definition of altruism so narrow as to be useless.
I think that I might go as extreme as to say it is only altruistic if it makes you feel bad or puts you in a clearly bad position.
Let's say that out of an act of altruism you help a person achieve some goal of theirs. Now you do not have a material gain from this, but doing so will make you feel good, hence you did it to make yourself feel good?
What you described there is in nature called symbiosis [1]. Like a cat or dogs lives with a human, or an ant with a fig tree.
Artificial studies like this have practically no bearing on actual behavior of real populations in real situations. Try the same study with a family, or a football team or the employees of a company or a military unit and then see what result you get. That's what reality is like. Real people don't live in randomly selected study groups, they live in communities.
Maybe an additional rule where the 20% with less points of the population of the groups with more points also dies. So there is actually an incentive for the individual that keep the points.
* Divide the big group into smaller groups (where they are giving each other inside the group only).
Now individuals in the group where many give to each other get an advantage over individuals in other groups.
Individuals that keep for themselves while staying in a group that gives also keep the better advantage on cost of their group.
* Allow the group to punish those who keep for themselves.
We are not ants.
Now in emergency situations, my experience is that we ARE hardwire to help each others. It works almost automatically, and is quite magical.
But as son as the immediate threats wears off, all the stuff I mentioned come into play.
OK, math.
There are 200 people in Group A. Each has the choice of taking 1 point for themselves or giving 2 points to the group. If everyone gives 2 points then everyone gets 2 points. If everyone keeps the 1 point then no one gets anything from the group and everyone has only the 1 point. But if you keep your 1 point and everyone else gives 2 points then you get 1 + 1.99 points = 2.99 points. You can obviously see how everyone might end up defecting here.
But there are also groups B and C who are all under the same rules. After each iteration everyone in the group with the lowest average dies, is ineligible to receive points in any future iteration, and is replaced in the next iteration with a new group that behaves randomly. Each individual gets to accumulate points for 100 iterations before being replaced, unless their group dies first.
Now what happens?