Code center > Bugs and fixes

Free energy? RESOLVED 2.43.1

(1/2) > >>

shvarz:
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.

EricL:
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.

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.

EricL:

--- 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.
--- End quote ---
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...

shvarz:
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?

Navigation

[0] Message Index

[#] Next page

Go to full version