Code center > Bugs and fixes
Bots with 0 body? RESOLVED 2.43r
Numsgil:
I can't reproduce this, but in version p I saw a bot with 0 body floating around. The robot console and info screen both said body -> 0.
EricL:
--- Quote from: Numsgil ---I can't reproduce this, but in version p I saw a bot with 0 body floating around. The robot console and info screen both said body -> 0.
--- End quote ---
Might be rounding. I checked the code and I'm certain bots with body <= 0 get killed. The bot properties dialog displays off the bot structure, but it only displays 2 digits past the decimal. Similarly, the bot console displays the .body bot memory location, which gets rounded to an integer. If a bot had body of say 0.003, then it would show as 0 both places...
Numsgil:
That's got to cause weird problems for the bots. What, refbody == 0, but the bot is moving around and trying to kill me?
Maybe if body is < 1, clamp it to 1 for the robot's mem structure. And show scientific notation if it's less than .01 in the robot info screen.
EricL:
Okey Dokey.
EricL:
Fixed in 2.43r. I addressed this is a simple and trivial way. At the end of the cycle, if a bot's body is < 0.5, it's dead. Surprisingly, there was already code that did this exact thing for nrg. It strikes me as an remedy given the integer valued mem array as this addresses refvar and nrg/body self inspection concerns without introducing funny rounding up logic that itself could potentially lead to unexpected results.
Navigation
[0] Message Index
[#] Next page
Go to full version