Author Topic: Subscript out of range. RESOLVED 2.43.1f  (Read 2767 times)

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Subscript out of range. RESOLVED 2.43.1f
« on: March 30, 2008, 12:41:37 PM »
I get the error while running LoveBot against Multiply4 or Excaibur and probably any bot realy.
Lovebot basicaly rapes the other bots using -8 shots and sexrepro info shots and sexrepro venom, and at some point the crash occurs.
The crash always occurs in the first stage while the orgy is occuring. Once setled it doesn't happen, so I'm almost sure it's related to sexrepro.
Lovebot doesn't do much, so it shouldn't be too hard to narrow it down, you're lucky if you can run 5 fights without a crash.
« Last Edit: March 30, 2008, 01:14:28 PM by EricL »

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Subscript out of range. RESOLVED 2.43.1f
« Reply #1 on: March 30, 2008, 01:24:49 PM »
Fixed in 2.43.1f.

If a bot sets .sexrepro and passes a bunch of tests (must be room to reproduce, she must have body > 2 and most importantly she must be fertilized) then she gets added to the list of bots that get to reproduce at the end of the cycle.  Female bots stay fertilized for 10 cycles after being hit with a sperm shot currently.  But on the last cycle of that fertilization, the fertilization counter was getting decremented to 0 properly (so that it will be 0 the next cycle) but the SpermDNA was also being incorrectly removed, after the tests were passed and she was marked to reproduce!!  When the code went to create the offspring at the end of the cycle, crossover was attempted with spermDNA of 0 length resulting in the error.  Simple ordering of code bug.   I now delete the spermDNA the cycle after fertilization hits 0 (the same cycle it appears 0 to the bot).   In short, if .fertilized is 1 for a bot, she can still reproduce sexually that cycle.  Barring refertilization, .fertilized will be 0 the following cycle, she will not be able to reproduce that cycle and only on that cycle will the code actually remove the sperm DNA internally.

Nice find and great bug report.  It really helps to have a repro case.  Also, very cool you built a rape bot.  I've been wanting to do that.  I know you did it for combat, but there's a lot of potential in sexual reproduction for evo sims as DNA can change so fast with crossover and speciation is selected for naturally not to mention opening the door for sexual selection to operate.   Very cool.
« Last Edit: March 30, 2008, 03:46:27 PM by EricL »
Many beers....

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Subscript out of range. RESOLVED 2.43.1f
« Reply #2 on: March 31, 2008, 03:17:30 AM »
Well I didn't make it for combat alone, if it was pure combat it would be SG'fied, delete other genes and have an elaborate conspec to tell the difference between originals, enemies and alge.
Instead it uses only *.refshoot for conspec, hoping this means the new offspring won't shoot us, but in reality a new bot could spawn from the sexrepro, able to kill lovebot while having the right conspec or by raping it back more effectively...
Inititaly the idea was to make like a sexrepro spreading bot, one where the sperms and info shots only happen occasionaly, with the purpose of being released in IM and get all the bots in there to reproduce with eachother, see what happens. But like always it took a turn towards combat when I saw the results of the first tests.

I think I'll try to modify locust to use sexrepro, build it in a clever way, with the conspec inbeded in the same gene that prevents canibalism between the new offspring, generaly build it with evolution in mind. But not sure what will work best so it'll probably be a long tryal and error thing. I'm thinking maybe forcing the oponents to shoot sperm ocasionaly and reproduce if hit by it would be the way to go... so basicaly a SlutBot...
« Last Edit: March 31, 2008, 03:26:07 AM by Moonfisher »