Darwinbots Forum

Code center => Bugs and fixes => Topic started by: Greven on June 13, 2005, 10:24:36 AM

Title: Houston we have a problem!
Post by: Greven on June 13, 2005, 10:24:36 AM
:wacko:

I thought the overflow errors were corrected?

I did set my work PC to simulate a beautiful sim friday morning.
When I came back at work, here this morning the sim had an overflow at approx. 23 h 36 m 13 s after start! I could cry when I saw it! :(   :shoot: overflow-errors!

In addition, I did set up a new sim, with 50000 in all the vegs mutation rates, but suddenly they all began to mutate wildly!!??

Seem like a few bugs here? The mutation numbers, and text with graphs etc. seem extremely shrewed up!
Title: Houston we have a problem!
Post by: Numsgil on June 13, 2005, 10:35:45 AM
Hm, that's going to be a hard one to isolate.  I sure thought most of the errors were corrected.

I have fixed a few simulation freeze bugs since 2.37.2, but no overflow errors.
Title: Houston we have a problem!
Post by: PurpleYouko on June 13, 2005, 11:01:01 AM
I fixed a bunch of overflows in my last upgrade. They were mostly related to sharing routines which the bots evolved.

Another place where this can happen is in the sexrepro routine. I have started using scripts to instantly kill any bot that evolves the .sexrepro sysvar. For some reason the whole routine gets overflows all over the place in the last few versions.

I suspect that the reason the bots started to evolve wildly is that the rate of mutation rates changed after mutation. It is kind of difficult to stop this happening even if you set it to zero. It still seems to change now and then. It only has to mutate to 1 and all hell breaks loose.  :(
Title: Houston we have a problem!
Post by: Numsgil on June 13, 2005, 11:04:26 AM
I'll be going over all those routines at some point for my new mutations form and controls.  I suspect there are some problems with resizings of the DNA array and the rate of change of mutations too.
Title: Houston we have a problem!
Post by: PurpleYouko on June 13, 2005, 11:07:45 AM
It certainly appears to be a resizing issue since it happens in the "CopyAB" routine immediately after making new space in the array.
An overhaul of this stuff would be most welcome.
Title: Houston we have a problem!
Post by: Botsareus on June 13, 2005, 01:22:00 PM
Num I seen an overflow, brb I'll go get source:

Here is the corrected code (dont mind my really extream methods of correction , I did them bc this way its backwords compatible)


The Shots_Module:
Quote
Public Sub newshot(n As Integer, shottype As Integer, val As Long, rngmultiplier As Single)
....
  If shottype = -7 Then
    Dim tempa As Single
    tempa = CLng(rob(n).mem(338)) * 20  'Must have a Clng in there
    If tempa <= 32000 Then
      Shots(a).nrg = rob(n).mem(338) * 20
    Else
      KillRobot n
    End If
    Shots(a).range = Shots(a).nrg
    Shots(a).color = vbCyan
  End If
....
Title: Houston we have a problem!
Post by: Numsgil on June 13, 2005, 02:16:40 PM
I already got that one in 2.37.2 I beleive.
Title: Houston we have a problem!
Post by: Botsareus on June 13, 2005, 05:52:18 PM
I am pritty sure there is no clng in there (unless the source code on the web site is not the one, or unless I messed up when copying my own custom functions from 3.26)

Num, check it for clng() to make sure
Title: Houston we have a problem!
Post by: Numsgil on June 13, 2005, 05:57:37 PM
Not a CLng, but I fixed it another way.  That particular overflow should be fixed.