Code center > Darwinbots Program Source Code
Chloroplasts
Peter:
Workings of chloroplasts seems way more complicated till you actually know how it works. :wacko:
It really needs some kind of nrg payment to build chloroplasts. Change into a veggie at a whim and changing back might open some loopholes.
Numsgil:
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.
Panda:
--- Quote ---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 :)
--- End quote ---
I quite like the idea of this. It's a lot more work but it keeps the energy constant and competition up. It's quite a lot of work but I'm willing to do this.
--- Quote ---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.
--- End quote ---
Something needs to happen about this but there are many options.
--- Quote ---When a bot divides, you split up its chloroplasts just like what happens with body right now.
--- End quote ---
I agree with this.
--- Quote ---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.
--- End quote ---
This is the biggest thing to fight for.
--- Quote ---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.
--- End quote ---
I agree.
--------
EDIT: I would add more to this but I'm currently in bed and I just wanted to say what I agreed with. I'm sorry Bots if I seem very harsh about what I've said, though. :/
Panda:
--- Quote from: Peter on August 13, 2013, 05:59:20 PM ---Workings of chloroplasts seems way more complicated till you actually know how it works. :wacko:
It really needs some kind of nrg payment to build chloroplasts. Change into a veggie at a whim and changing back might open some loopholes.
--- End quote ---
And I've found quite a few of these loopholes already.
Botsareus:
--- Quote ---I would definitely recommend charging bots for building chloroplasts.
--- End quote ---
--- Quote ---I've found another problem with not having a cost to create chloroplasts: it's too easy to remove chloroplasts, move and then add chloroplasts.
--- End quote ---
I think we should charge energy for ANY change in chloroplasts:
--- Code: ---I am thinking energy = energy - abs(old chloroplast value - new chloroplasts value ) / 4
--- End code ---
I think we need a new sysvar called 'light' that will give the robot:
--- Code: ---light = Total robot area / Screen area * 32000
--- End code ---
So it knows when to start using less chloroplasts
--- Quote ---Another problem, when the reproduction gene breaks, the energy feeding rate is high enough for most of them to survive.
--- End quote ---
I need to see this happen enough times before I figure out what to do with it.
--- Quote ---There won't be a cost if it's not daylight because it's written in that way. Unless there's not meant to be a cost overnight?
--- End quote ---
Plants simply go to sleep when its night time, they don't start messing with there chloroplast count, I think it should be ok. Especially if we need to add a cost for changing the amount of chloroplasts.
--- Quote ---
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).
--- End quote ---
I am keeping this system and only modifying it.
--- Quote ---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.
--- End quote ---
What if the robot has no chloroplasts? Now it will not get fed by body?
I also think we should mess with UI as little as possible, this one of the sliders I actually want to leave alone.
--- Quote ---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.
--- End quote ---
In my system robots do not lose chloroplasts, it is a static value.
--- Quote ---I quite like the idea of this. It's a lot more work but it keeps the energy constant and competition up. It's quite a lot of work but I'm willing to do this.
--- End quote ---
We kinda ran out of control space in the options form :P
We can add another checkbox and do:
--- Code: ---1 / (total number of veggies) * incoming energy per cycle.
--- End code ---
I don't see a need for:
--- Code: ---veggy body / (total amount of body among all veggies) * incoming energy per cycle.
--- End code ---
because we have a way of giving every veggy X nrg for every 1000 body points it has, etc.
The only question(s) here is what will be the value for 'incoming energy per cycle' and where do we add a checkbox ?
edit:
On second thought, I am beginning to really dislike this approach, look at my last edit for this post.
--- Quote ---
--- Quote ---When a bot divides, you split up its chloroplasts just like what happens with body right now.
--- End quote ---
I agree with this.
--- End quote ---
If chloroplasts are static this should not matter.
--- Quote ---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.
--- End quote ---
Well, think about F1, now people will start loading in robots with like 32000 energy, slime, venum etc. That is giving the user way more power then they should have.
With chloroplasts it is a little different, I think the user should have control over this, it tells the system if he is designing a plant or not.
I know Numsgil you hate the idea of DNA files containing metadata. I looked on all other options, there is simply no other way to do it.
Oh, and speaking of metadata, a good one to have in the DNA is all epigenetic memory. But I figured out that if you reset it periodically based on accumulated mutations there is no problem.
edit:
--- Quote ---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.
--- End quote ---
You just figured out a way for your own idea to fail. What if a robot(s) has very little chloroplasts? Now there is less and less energy avaialble in the system.
I understand your logic Numsgil, but I still think we should hard code the vegy distinction into the MetaData.
I am also envisioning an option box if you want to reset the robots that are veg to spawn with a default 16000 chloroplasts.
I am also envisioning a simulation where you load vegs with 16000 chloroplasts and non-vegs with the same amount and DNA to see if they can evolve to hunt.
Bottom line is,
I envision two tests for this system:
Test 1.) Can non-repopulating plants learn to eat?
Test 2.) Can eating robots become plants and completely replace repopulating robots with there own mutated versions?
Both of the above are very useful to me for evolving eco systems.
I envision a way to evolve the most effective self sustaining eco system and even distributed over internet mode with everyone running there own settings. My approach will involve extracting DNA and restarting the simulation, check out 'Botsareus's vision' on the wiki. Well it is more like a reality now, not just a vision. I just have to re-implement it.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version