Author Topic: Chloroplasts  (Read 23870 times)

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Re: Chloroplasts
« Reply #15 on: August 12, 2013, 07:07:10 AM »
To be honest, I think it's more hassle than it's worth to add a value to the DNA. Changing the settings really isn't going to be as difficult as reading anything new in. If we're still going to go along with doing it this way, I will need help. XD

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Re: Chloroplasts
« Reply #16 on: August 12, 2013, 04:52:11 PM »
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.

EDIT: Another problem, when the reproduction gene breaks, the energy feeding rate is high enough for most of them to survive.
« Last Edit: August 13, 2013, 03:55:53 AM by Panda »

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Chloroplasts
« Reply #17 on: August 13, 2013, 04:40:36 PM »
I am actually taking off work tomorrow to help you out. ttyl

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Chloroplasts
« Reply #18 on: August 13, 2013, 04:47:27 PM »
Quote
To be honest, I think it's more hassle than it's worth to add a value to the DNA. Changing the settings really isn't going to be as difficult as reading anything new in. If we're still going to go along with doing it this way, I will need help. XD

I need this to figure out what robots evolved to use chloroplasts, there is a good chance that they lost there chloroplast gene but still use them. I need this for my system of restarting a simulation with an evolved DNA file. There is a lot of skytsaphernia going around that makes evolved DNA files completely useless and definitally does not prove this software package as a useful tool for representing evolution because the stupid evolved DNA files just don't work. I spend 2 years on this project figuring out a fix for this (2.44.01) and then Eric L released 2.45.01 , I am still ok , minor changes (no problem) then you guys decide to add chloroplasts. Now everything is completely messed up and I had to step in. I spelled skytsaphernia  wrong, sorry, it is getting close to 5pm :P

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Re: Chloroplasts
« Reply #19 on: August 13, 2013, 05:48:45 PM »
I think I understand what you mean but I can see that there are some problems with the system that is being created and I really want to discuss them with you. If you're absolutely determined to do it in your way then you can. I just have encountered a number of problems with it already.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: Chloroplasts
« Reply #20 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.
Oh my god, who the hell cares.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Chloroplasts
« Reply #21 on: August 13, 2013, 06:03:24 PM »
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.

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Re: Chloroplasts
« Reply #22 on: August 13, 2013, 06:16:30 PM »
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 :)

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.

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.

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.

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.

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. :/
« Last Edit: August 13, 2013, 06:21:26 PM by Panda »

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Re: Chloroplasts
« Reply #23 on: August 13, 2013, 06:22:28 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.

And I've found quite a few of these loopholes already.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Chloroplasts
« Reply #24 on: August 14, 2013, 10:12:58 AM »
Quote
I would definitely recommend charging bots for building chloroplasts.
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.

I think we should charge energy for ANY change in chloroplasts:
Code: [Select]
I am thinking  energy = energy - abs(old chloroplast value - new chloroplasts value ) / 4
I think we need a new sysvar called 'light' that will give the robot:
Code: [Select]
light = Total robot area / Screen area * 32000
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.

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?

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).

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.

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.

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.

We kinda ran out of control space in the options form :P
We can add another checkbox and do:

Code: [Select]
1 / (total number of veggies) * incoming energy per cycle.
I don't see a need for:

Code: [Select]
veggy body / (total amount of body among all veggies) * incoming energy per cycle.
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.


I agree with this.

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.

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.

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.
« Last Edit: August 14, 2013, 10:52:06 AM by Botsareus »

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: Chloroplasts
« Reply #25 on: August 14, 2013, 11:30:28 AM »
Why is the metadata necessarily?

The mechanism that gives 'veggies' free nrg is not affected by the chloroplast system or is it?
Oh my god, who the hell cares.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Chloroplasts
« Reply #26 on: August 14, 2013, 11:31:59 AM »
it is

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Chloroplasts
« Reply #27 on: August 14, 2013, 11:32:38 AM »
Hey Panda, I am going trough and adding your changes to the main code.

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Re: Chloroplasts
« Reply #28 on: August 14, 2013, 11:45:07 AM »
Quote
I think we should charge energy for ANY change in chloroplasts:
Code: [Select]
I am thinking  energy = energy - abs(old chloroplast value - new chloroplasts value ) / 4
This is fine. :)

Quote
I think we need a new sysvar called 'light' that will give the robot:
Code: [Select]
light = Total robot area / Screen area * 32000
So it knows when to start using less chloroplasts

I still disagree with this approach to it.

Quote
Quote
Another problem, when the reproduction gene breaks, the energy feeding rate is high enough for most of them to survive.

I need to see this happen enough times before I figure out what to do with it.
Charging for chloroplasts and not having them as part of the DNA file and splitting them like we currently do is, from what I can see, the best way to do it.

Quote
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?

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.

What I'm saying is, there is no upkeep cost for having chloroplasts during night.

Quote
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.

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.

By shots do you mean? Otherwise they don't get fed by the simulation so of course they're not going to get any free body.

Quote
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.

In my system robots do not lose chloroplasts, it is a static value.

I think he is saying that the cost for each chloroplast should increase so more nrg is needed for each chloroplast. I quite agree with this.

Quote
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.

We kinda ran out of control space in the options form :P
We can add another checkbox and do:

Code: [Select]
1 / (total number of veggies) * incoming energy per cycle.
I don't see a need for:

Code: [Select]
veggy body / (total amount of body among all veggies) * incoming energy per cycle.
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.


This system is different because it keeps the incoming energy into the system constant (as long as there are veggies).

Quote
Quote
   
Quote
When a bot divides, you split up its chloroplasts just like what happens with body right now.


I agree with this.

If chloroplasts are static this should not matter.

Why do they have to be static? I don't think this works in practice especially due to probelms already found in the simulation (such as the mass reproducing and surviving)

Quote
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.

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.

But couldn't you argue that if you wanted to develop a certain other type of robot then the metadata should be there for you to do that. Why are veggies any more important.
Quote

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.

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.

I don't know why the old system that we had (with a few modifications to allow for an F1 mode that works) doesn't work like this? I thought it was a perfectly good system (and I knew others agreed with me).

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Chloroplasts
« Reply #29 on: August 14, 2013, 12:04:21 PM »
Quote
I don't know why the old system that we had (with a few modifications to allow for an F1 mode that works) doesn't work like this? I thought it was a perfectly good system (and I knew others agreed with me).

I am just adding what I worked on for a good 2 years, it will be optional.
I need a way to generate DNA files that actually work, I figured out a way.

Quote
not having them as part of the DNA file

I have spent 2 years how to make a robots DNA file reflect what the robot is currently doing when extracted from a simulation. I want to include chlroplasts as part of the DNA for two reasons:

1.) It will save exactly what the robot is doing
2.) I can have an entire working eco-system as DNA files.

This is getting stupid, I am acting like Botsareus from 6 years ago where I am just repeating myself and no one is comprehending anything I am saying. Can I just code this stuff in in peace plz?

Quote
What I'm saying is, there is no upkeep cost for having chloroplasts during night.

True.
There is also no upkeep cost for pond mode on the bottom of the pond.
This is all by design.

Quote
By shots do you mean? Otherwise they don't get fed by the simulation so of course they're not going to get any free body.

I want robots to be able to add to there body from the sun the way they do now artificially. I want to leave that slider alone. Let it be the way it is.

Quote
his system is different because it keeps the incoming energy into the system constant (as long as there are veggies).

What will be our constant? How will it work with:

Code: [Select]
      Select Case SimOpts.VegFeedingMethod
      Case 0 'per veg
        Energy = tok * (1 - SimOpts.VegFeedingToBody)
        body = (tok * SimOpts.VegFeedingToBody) / 10
      Case 1 'per kilobody
        Energy = tok * (1 - SimOpts.VegFeedingToBody) * rob(t).body / 1000
        body = (tok * (SimOpts.VegFeedingToBody) * rob(t).body / 1000) / 10
      Case 2 'quadratically based on body.  Close to type 0 near 1000 body points, but quickly diverges at about 5K body points
        tok = tok * ((rob(t).body ^ 2 * Constant) + (1 - Constant * 1000 * 1000))
        Energy = tok * (1 - SimOpts.VegFeedingToBody)
        body = (tok * SimOpts.VegFeedingToBody) / 10
      End Select
      rob(t).nrg = rob(t).nrg + Energy
      rob(t).body = rob(t).body + body

Quote
Why do they have to be static? I don't think this works in practice especially due to probelms already found in the simulation (such as the mass reproducing and surviving)

I have to research further, let me grind trough your code and see what is going on for myself.

Quote
But couldn't you argue that if you wanted to develop a certain other type of robot then the metadata should be there for you to do that. Why are veggies any more important.

I think it is not fear for people to be able to set some of these values, it makes the current league unusable and I have no base to test my robots on.