Author Topic: Bots with 0 body? RESOLVED 2.43r  (Read 3096 times)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Bots with 0 body? RESOLVED 2.43r
« on: November 10, 2007, 04:05:51 PM »
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.
« Last Edit: November 13, 2007, 11:08:17 AM by EricL »

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Bots with 0 body? RESOLVED 2.43r
« Reply #1 on: November 10, 2007, 04:17:18 PM »
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.
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...
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Bots with 0 body? RESOLVED 2.43r
« Reply #2 on: November 10, 2007, 08:35:00 PM »
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.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Bots with 0 body? RESOLVED 2.43r
« Reply #3 on: November 10, 2007, 09:17:19 PM »
Okey Dokey.
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Bots with 0 body? RESOLVED 2.43r
« Reply #4 on: November 13, 2007, 11:12:52 AM »
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.
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Bots with 0 body? RESOLVED 2.43r
« Reply #5 on: November 14, 2007, 04:47:41 AM »
might still want to play with refbody clamping.  What happens when the bot dies and corpse mode is on, and another bot tries to read refbody?

Alternatively, when a bot has less than .5 body, you could just outright delete it from the world, or convert it into an energy shot (the bot is small enough at .5 body that it's effectively the same size as a shot anyway).

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Bots with 0 body? RESOLVED 2.43r
« Reply #6 on: November 14, 2007, 11:59:54 AM »
Quote from: Numsgil
might still want to play with refbody clamping.  What happens when the bot dies and corpse mode is on, and another bot tries to read refbody?

Alternatively, when a bot has less than .5 body, you could just outright delete it from the world, or convert it into an energy shot (the bot is small enough at .5 body that it's effectively the same size as a shot anyway).

Right now, when a bot's body drops below 0.5, be it alive or a corpse, it gets deleted from the world that cycle and the nrg tied up in whatever body it has vanishes from the world with it so there isn't really a body refvar issue with corpses.   One could argue I suppose that that nrg should remain in the sim, but at most it's 5 nrg.  Depending on the decay size, the last decay shot is likely to take much or all of that with it so on average, in practice, the nrg actually leaving the sim due to fractional body is pretty trivial...

It's on my list to implement the "die in a burst of nrg shots" option you suggested a while back.  In this mode, of course all body will be converted to nrg shots...
Many beers....