I've read through the thread. I'm going to take off my admin hat and put on my general user hat, so feel free to completely ignore me.
I think I understand where shvarz is coming from. Specifically he doesn't consider conservation of energy to be an important limitation in an ecosystem. For him it's more an issue of energy flow, from producers down the basic trophic levels. The natural predator-prey cycles can produce some wild population swings if the energy coming in to the sim is a function of the number of prey. In a robust ecosystem IRL when one producer's population declines, another producer's population increases to fill the gap. The natural food web is able to ride out population swings in individual species through diversity.
Because Darwinbots doesn't have as many natural niches, we can attempt to dampen the natural fluctuations by keeping the incoming energy in to a sim constant. With that in mind, we have to divide up the incoming energy based on the number of veggies in the sim. It also has the nice property that veggies compete with each other for the available energy, without competing with animals for physical space.
This is pretty close to the energy model that was used when I first joined the project. The primary downside is that it it has no relationship with how things actually work, and is not necessarily intuitive to new users. So I don't think it should be dismissed as a bad idea, but neither should it replace the current system.
There's currently a couple of different methods to feed veggies. One is based on just giving every veggy X nrg per cycle. Another is based on giving every veggy X nrg for every 1000 body points it has. Another is based on giving nrg to veggies based on a quadratic function that rewards bots that are larger (this option is pretty much unused in practice, I think).
It wouldn't be difficult to add another option, orthogonal to the above, that lets users specify if veggies are given energy independently of each other, or are apportioned energy from some large energy pie. That still lets you use the above feeding methods, too. You could divide up the energy pie so that each veggy gets 1 / (total number of veggies) * incoming energy per cycle. Or you can do the per kilobody method and give veggy body / (total amount of body among all veggies) * incoming energy per cycle. Or the kilobody version, with math I don't want to do right now
Note that this issue is entirely orthogonal to the issue of chloroplasts. It might be a good idea to do this step first, and release that version for people to play with.
...
On the issue of chloroplasts, I think you can treat it as a new substance very similar to body. You can set the energy conversion rate to/from chloroplasts in code, and then bots can build/unbuild chloroplasts the same way the build/unbuild body. There's no need to reinvent the wheel in terms of interface.
If a bot has the 'veg' flag set, you can replace its body store/feed and body readback memvars with the chloroplast versions. If loading in an old simulation, you can convert all (or maybe 90%?) of the body of bots with the veg flag set in to chloroplasts.
If a bot is spawned with the veg flag set, you can spawn it with all (or maybe 90%) of the usual 1000 body as the equivalent in chloroplasts.
To legacy veggies, there's no difference from the old interface, but new bots can still build chloroplasts and body separately.
In cases where you need a strict is veggy/is not veggy flag, like the per-veggy feeding method I mentioned earlier, you can simply check if they have
any chloroplasts. When a bot divides, you split up its chloroplasts just like what happens with body right now.
There's also a UI slider right now for feeding veggies that defaults to giving veggies 90% of the energy as nrg, and 10% of their nrg as the equivalent in body. You'll want to change that to be a slider between nrg and chloroplasts.
I would definitely recommend charging bots for building chloroplasts. If nrg is given to bots based on the number of chloroplasts they have, and especially if the veggies are competing for nrg, you'll want there to be a cost for large numbers of chloroplasts, even if it's just an upfront sunk cost. It also means that the exponential growth of veggies is limited by the the time it takes to save up enough nrg to build more chloroplasts.
Last, I wouldn't recommend trying to add new metadata to the DNA to represent chloroplasts. There are mechanisms in place already for nrg, body, venom, poison, shell, slime, etc., and there's no reason to have chloroplasts follow a different system. If you want to be able to save bots out in DNA form with the body, nrg, etc. set in the DNA, I think that's reasonable, but you should do that for all the substances, and it's an entirely different change from the chloroplasts. No need to conflate multiple features together.
...
Anyway, that's my 2 cents. I probably won't help with coding any of this, so I'll defer the final say to you guys.