This is something we have been putting off for a while but I have run up against it in making the CPA prototype so we should probably start discussing it.
Problem: The CPA system requires a “predation matrix”. This means that each time step we know what quantity of compounds to transfer from species A to species B based on them predating on each other. So B might eat A a lot so it get 1% per timestep or A might occasionally eat a B so it gets 0.01% per timestep. The answer should be a real number in the set [-1,1] for each species A and B (as negative numbers mean B -> A and positive mean A -> B making the matrix upper triangular and so not so large)
Its relatively straight forward to say this should be “Number of encounters” x “Amount of compounds transferred per encounter”. The number of encounters is really not so bad (we can use the density of the two species in the patch to work it out) but it’s knowing how a fight between them would turn out which is hard.
Constraints: The big constraint here is that we need to be able to produce a result for ANY possible species that auto-evo might generate. Moreover in the later stages we need to be able to produce it for ANY possible species in the whole game (though we don’t have to solve this now). Which makes the space of possible creatures huge. Also whatever mechanism generates the matrix needs to be reasonably computationally cheap because a row of the matrix will need to be rerun each time auto-evo changes a species (because that will change it’s predation relations with all other species in it’s patch). Further the players enjoyment of the CPA system does really rest on the CPA being tuned to the actual gameplay. So if you can easily beat a species yourself then your species should easily beat it, if you lose they should lose etc. The less in sync they are the worse the experience of the CPA is going to be. Also how are agents going to fit into this? Agents have codes which are specifically targeted to different species.
Here are some ideas which have been brought up already:
- A simulator. Build a little petri dish, put two microbes in it and let them fight it out.
Pros: This is the most accurate possible method.
Cons: Computationally intensive, probably prohibitively so (though this does rather depend on how many species are in each patch)
- A lookup table. Basically try to split all possible creatures into n groups and then run a simulator between each of these beforehand. Then give the player a lookup table which gives accurate results.
Pros: Simulated and therefore pretty accurate, it’s as good as a simulator if the groups are size 1, if the groups are very large (everything with wings is in one group, for example) then the results will be pretty poor.
Cons: Adaptations made to a species will have no effect on its predatory success unless it moves them to a new group. So there is a problem of “useless intermediate steps” in evolving the creatures which is always a nightmare.
- A magical algorithm which can predict the outcomes of fights.
Pros: Very computationally cheap and accurate.
Cons: It would probably take a PhD to try to work out the average outcome of fights between one species of fish and one type of bear. (what happens if the fish is faster or bigger or the bear has better eyesight etc)
- Some sort of points based system. So you get +1 point for each pilus and +1 point for each agent. Your points determine your strength and the two strengths are used to determine the result.
Pros: Cheap and super fast
Cons: Not really very accurate, may end up with ridiculous adaptations where a cell has 4000 pilus and is an ultra predator. Again we need to be careful because whatever incentives we set up in this system auto-evo will try to satisfy. If we say being bigger will make you stronger then over time the cells will just get bigger and bigger.
We could also have a dynamic points system which looks at what is happening in the patch and then awards points differently based on that (if everyone has a lot of pilli maybe they are only worth a few points but if you are the only species with them then they are worth more etc).
- Points based + decision tree. So maybe different behaviours matter (which is something which a simulator captures) and there should be a tree. The tree could include lots of different behaviours.
Example: If A and B fight the result is 0.1 but seeing as A is faster it is offered the chance to flee instead and this gives a result of 0.05 which is preferable.
Pros: More accurate than a simple points based system.
Cons: Priority, what if A wants to fight if B wants to flock but B wants to flee if A wants to fight. Who has to choose first? For fleeing maybe the faster microbe is offered that choice but the other one is not however with other behaviours (crawl into a ball vs fight) the creature will always have those options.
Anyway all input welcome, it’s a pretty complicated question and it’s very important because this is one of the main ways the CPA mirrors the experience the player has while swimming around and so we want it as good as we can get it.