Author Topic: Free energy? RESOLVED 2.43.1  (Read 3215 times)

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Free energy? RESOLVED 2.43.1
« on: January 30, 2008, 07:32:44 PM »
I suspect I found a free-energy bug in 2.43z.  In the attached sim look at the lower right corner, there are some tiny veggies (alga shellular), that look tiny even at the highest magnification (you can only see their eyes). On the attached screenshot of that area they are circled in red. Their genomes are composed only of viral DNA, which deleted everything else.

The sun is turned off, they are neither shooting nor tied. But they have 1 body and ~45-47 energy. Their energy goes down slightly, but then jumps up by about 0.4 energy which apparently comes from nowhere. At least I have no idea where it could come from. One thing I noticed is that their energy is always just a tiny bit below a whole number - 45.95, 46.87, 49.99.  The jump is usually when it goes below .85-.86 of that number.
« Last Edit: January 31, 2008, 12:34:34 AM by EricL »
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Free energy? RESOLVED 2.43.1
« Reply #1 on: January 31, 2008, 12:34:02 AM »
Wow!  Nice bug!  I have been looking for this one for months and months.  I think this may be the same nrg leak bug Nums had a few months ago that I couldn't find.

Long story short, there's a bug in how turns are handled in the case where the bot's aim crosses 0.  In such cases, the calculated nrg loss due to the turn can be negative.  If a turn cost is specified with a positive cost multiplier, the bot will gain free nrg just by using .setaim or .aimsx and .aimdx to turn back and forth across 0.

Very nice find.  Many thanks for the detailed bug report and repro instructions.  Made finding this bad boy relativly easy.

Fixed in 2.43.1.  

I may further modify the setaim function so that turn cost is a function of which way around (the short way or the long way) and how many times a bot attempts to turn to a specific aim.  As of now, the bot is charged the shortest fraction of a circle even if the bot is trying to turn the long way around or make multiple rotations.
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Free energy? RESOLVED 2.43.1
« Reply #2 on: January 31, 2008, 07:23:40 AM »
I always just sort of assumed that the robot's brain may be stupid, but it's body is smart enough to know that a turn of 720 degrees is the same as a turn of 0.  So that's that's reasoning.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Free energy? RESOLVED 2.43.1
« Reply #3 on: January 31, 2008, 10:19:08 AM »
Quote from: Numsgil
I always just sort of assumed that the robot's brain may be stupid, but it's body is smart enough to know that a turn of 720 degrees is the same as a turn of 0.  So that's that's reasoning.
But bots may really want to spin around twice in a single cycle, to whip a tied bot around or similar.

Part of me wants to dive in and finially fix this whole absolute turn paradym mess right now, moving to thrusters but I'm hip deep in new crossover code at present...
Many beers....

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Free energy? RESOLVED 2.43.1
« Reply #4 on: January 31, 2008, 01:21:57 PM »
Glad that helped!  So, if you are busy with crossover stuff, I can't expect to have an updated version soon?  Any ideas how to deal with these bastards? From what I understand, raising costs on turning is not going to help, but will make matters worse, right?
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Free energy? RESOLVED 2.43.1
« Reply #5 on: January 31, 2008, 01:29:02 PM »
Quote from: shvarz
Glad that helped!  So, if you are busy with crossover stuff, I can't expect to have an updated version soon?
I've got a pile of testing still to do on .sexrepro, but I'll try to drop 2.43.1 this weekend with both this fix and .sexrepro working.  If that doesn't look feasable, I may drop a release without .sexrepro just to get this out.


Quote from: shvarz
Any ideas how to deal with these bastards? From what I understand, raising costs on turning is not going to help, but will make matters worse, right?
Correct.  Zeroing out the turn cost will stop the free nrg but they won't loose nrg by turning either...
Many beers....