Author Topic: No gain or loss of energy in 2.42.6c  (Read 5442 times)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
No gain or loss of energy in 2.42.6c
« on: June 22, 2006, 04:18:38 PM »
I think I have found a bug here. Despite that the sun is up no one gains or loses any energy unless they are hit by a shot. The veggies are really tiny.
The internet is corrupt and controlled by criminally minded people.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
No gain or loss of energy in 2.42.6c
« Reply #1 on: June 22, 2006, 04:23:51 PM »
Oh, I just remembered! I have set it so there should be no costs when bots drop below 50! Bot it's still weird they are not gaining any energy.
The internet is corrupt and controlled by criminally minded people.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
No gain or loss of energy in 2.42.6c
« Reply #2 on: June 23, 2006, 01:04:41 AM »
Testlund, you did it again!  How you find these things....

This is indeed a real bug, a rather old one I suspect, most likely has been there since the different veggy feeding methods were added.

Bascially, in the routine FeedVegs(), the tempory variables "energy" and "body" are used to calculate the amount of nrg and body to give each veg, depending upon the feeding method being used and other things, specifically their body size for kilobody feeding.  They are defined as type "long", which while capable of storing really large numbers, has a lot less decimal precision then the type "single", which is how nrg and body are usually stored for each bot.  

Because your veggies are small and because your were giving them a small amount of enery per kilobody per cycle, what was happening is that the energy calculated to add each cycle, while non-zero was pretty  small, say perhaps something like 0.003, too small for a long to handle.  The long-typed variables were getting rounded to 0 when VB coerced them to singles.  Your small veggies got nothing.

So, basically, ever since the feature has existed, kilobody feeding has not worked for small per cycle amounts for very small body veggies.

Very very nice find.  Bug of the week for sure.  Amazing.

Fixed in 2.42.7.
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
No gain or loss of energy in 2.42.6c
« Reply #3 on: June 23, 2006, 02:24:55 AM »
*shakes fist*

Untold numbers of bugs from type conflicts.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
No gain or loss of energy in 2.42.6c
« Reply #4 on: June 24, 2006, 10:21:03 AM »
Quote from: EricL
Testlund, you did it again!  How you find these things....

It's because of my bad luck with things, but I guess it serves a purpose here.  
« Last Edit: June 24, 2006, 10:21:23 AM by Testlund »
The internet is corrupt and controlled by criminally minded people.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
No gain or loss of energy in 2.42.6c
« Reply #5 on: June 24, 2006, 12:41:14 PM »
You should really market your skills Testlund.  You're like the ultimate software tester.