Author Topic: Energy keeps entering  (Read 6077 times)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Energy keeps entering
« on: June 25, 2006, 03:46:40 AM »
I have discovered something strange here. Usually when I start a sim with 500 bots and 500 veggies and they all have 32000 energy I will have a maximum energy of 42000000 in the sim, but now that value continue to increase after all the bots are full. Where goes that extra energy? There's no corpses or anything. This is version 2.42.6d I'm running now.
« Last Edit: June 25, 2006, 03:47:13 AM by Testlund »
The internet is corrupt and controlled by criminally minded people.

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
Energy keeps entering
« Reply #1 on: June 25, 2006, 09:23:16 AM »
Is it locked up in body?

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Energy keeps entering
« Reply #2 on: June 25, 2006, 10:30:11 AM »
Umm... not sure what you mean by that, but earlier when I ran sims there could never be more than 42000000 energy in the sim when 1000 bots have 32000 energy. I've checked out the vegs but they are not even up to 32000 and still the amount of energy in the sim is above 42000000. But otherwise the new function where the sun is supposed to go up and down when it passes the energy limit works very nice. I think all the veggies and bots should have 32000 energy when it's over 42 miljon in the sim, like it was before.
The internet is corrupt and controlled by criminally minded people.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Energy keeps entering
« Reply #3 on: June 25, 2006, 11:26:29 AM »
The max energy possible in a sim with 1000 bots total and no free shots or corpes is:

((maxnrg) + (maxbody * 10)) * 1000 = (32000 * 1000) + (32000 * 10 * 1000) = 352000000

As Elite says, its locked up in body.
« Last Edit: June 25, 2006, 11:27:54 AM by EricL »
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Energy keeps entering
« Reply #4 on: June 25, 2006, 01:11:08 PM »
You should be able to manipulate the slider between body and nrg as to where veg energy goes.  Set it all the way to nrg, and as far as I can remember bots with full energy won't gain anymore.

I might have had excess nrg get piped to body though, I don't remember.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Energy keeps entering
« Reply #5 on: June 25, 2006, 02:38:03 PM »
Ok, so what is happening now must be that energy is going more to the body of the bots instead. I'm not sure how energy transfer to body works, so it might be as you say. But in any case it has changed from how it worked before. Before nrg was filling up to 32000 (how much got into body I don't know) and total energy stopped at 42 miljon. Then it started to drop slowly when bots got more DNA wich whould start to increase some costs. I'm just wondering if Eric might have changed something here, so the energy works a little different. If it's not a bug than it's all cool.  
The internet is corrupt and controlled by criminally minded people.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Energy keeps entering
« Reply #6 on: June 28, 2006, 06:19:52 PM »
There MUST be something wrong here! I did a little experiment. I started with 10 veggies and 10 bots with nrg set to start at 32000. I set the veg nrg/body distribution to 0 and started a new sim. What happend was that the veggies bodies got raised to 32000, the same as their energy. Total energy stopped at 3940000. The veggies grown 4-5 times bigger than the bots. I entered the gui again the check the slider for body/nrg distribution and it had gone back to 10. But even though it jumps back to 10 it still behaves like it was set to maximum. So the only way to stop veggies from consuming all energy into their body is to set the sun to go down when nrg reaches a certain level.

I don't know what good this function with 'vegs nrg/body distritiution' is for anyway. What effect is this supposed to have other than making the veggies grow larger?
The internet is corrupt and controlled by criminally minded people.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Energy keeps entering
« Reply #7 on: June 28, 2006, 08:02:55 PM »
The vegs nrg/body distribution slider changes the way veggies are given nrg.  If it goes to body, then they'll get bigger and have more body.  This will change the amount of energy they get if you have veggy feeding method set to "per kilobody" or the quadratic one.

I'm not sure, but I think if a veg maxes out either nrg or body, the nrg it receives gets sent to the other one.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Energy keeps entering
« Reply #8 on: June 28, 2006, 09:58:05 PM »
Quote from: Numsgil
I'm not sure, but I think if a veg maxes out either nrg or body, the nrg it receives gets sent to the other one.

A quick glance at the code says no.  There are some lines that look to be hold overs from past iterations which do calculate the remaining nrg and body left over when a bot hits 32000, as if to spread it somewhere else, but alas, nothing is done with it.  The nrg and body each veg receives per cycle is independent of what other vegs receive.

Quote from: Numsgil
I might have had excess nrg get piped to body though, I don't remember.
Nope.  nrg and body are independent.  If one fills up, the other keeps growing at the same rate.
« Last Edit: June 28, 2006, 10:25:29 PM by EricL »
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Energy keeps entering
« Reply #9 on: June 28, 2006, 10:22:52 PM »
Quote from: Testlund
There MUST be something wrong here!

Found it.  The nrg/body slider code was attached to the click event, not the change event.  The value was getting set when you clicked, not the final slider position.  This is why your vegs are still growing their bods and why the slider postition isn't remembered.

Fixed in 2.42.7.

PS.  Testlund, take a look at the Field menu on the main window....  Shhhhhhh.  It's not finished yet.  
Many beers....

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Energy keeps entering
« Reply #10 on: June 29, 2006, 01:13:05 AM »
Hey, the shapes are a very nice feature! You can do a lot of things with them. A lot better than the wall drawing tool.  
The internet is corrupt and controlled by criminally minded people.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Energy keeps entering
« Reply #11 on: July 04, 2006, 01:36:39 PM »
I've been testing 2.42.7 now, but I think the NRG/body feature still acts weird. It's more like turning it on or off. For instance, if I set the slider to 0 and start a new sim then 1000 nrg goes into the veggies body but if I set any other value then all energy goes into body. I whould have expected that when I set it to 10, then 10 % of 32000 should go into the body, wich is 3200.  

Actually, I discovered that what the slider does is setting the SPEED at wich 32000 nrg will enter the body.  

Have I missunderstood something here again?  
« Last Edit: July 04, 2006, 01:42:58 PM by Testlund »
The internet is corrupt and controlled by criminally minded people.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Energy keeps entering
« Reply #12 on: July 04, 2006, 02:31:25 PM »
I just stepped through the code and it looks to me like it is doing the right thing.  Here is the relevant code:

Code: [Select]
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.  
        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

So, if using normal per cycle feeding, if you have it set for 1000nrg/cycle/veg and move the slider to 10, then 90% of the 1000 will go to nrg and 10% of the 1000 will go to body.  nrg will go up by 900 per cycle and body will go up by 10 per cycle (not 100.  It takes 10 units of nrg to make 1 unit of body).
Many beers....

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Energy keeps entering
« Reply #13 on: July 04, 2006, 02:56:31 PM »
So that's how it works! I allways use per kilobody point feeding wich I have set to 12. I found it worked the best for me several versions ago and I have never tried anything else after that.
The internet is corrupt and controlled by criminally minded people.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Energy keeps entering
« Reply #14 on: July 04, 2006, 10:13:31 PM »
Per kilobody makes the most sense I think from a biological point of view.  You would expect larger cells to have more surface area, and thus produce more energy.  It also discourages cancer, which is a fairly lame adaptation.