Darwinbots Forum

Code center => Bugs and fixes => Solved Bugs => Topic started by: Testlund on September 02, 2013, 06:04:53 PM

Title: Run-time error 6 overflow.
Post by: Testlund on September 02, 2013, 06:04:53 PM
I've attached the bots, the autosave file and a screenshot in this zip file.
Title: Re: Run-time error 6 overflow.
Post by: Panda on September 04, 2013, 08:10:06 AM
I'll have a look when I get back home this evening. It shouldn't be a very big problem, hopefully. Was it just while the simulation was running or...?
Title: Re: Run-time error 6 overflow.
Post by: Testlund on September 04, 2013, 10:47:06 AM
Yeah, it should be enough just to load the sim and wait. I keep getting it within half an hour. If I would make a wild guess what it could be it seems to happen when some bot is close to another and feeds/getting hit.
Title: Re: Run-time error 6 overflow.
Post by: Botsareus on September 04, 2013, 07:38:23 PM
Teslund, can you also please give me your

lastran.set
Global.gset

unless you may have overwrote them after the error has occurred, they should be useful to me as well. Using these files I should be able to emulate a crash within a 2000 cycle window.

edit: If you did overwrite the files after the error, can you please give me them anyway and recall what you may have changed.

I'll be able to look this Saturday.

The reason I need this extra files is I have learned that a loaded simulation behaves differently if the settings file it is using is different. It will definitely behave differently if some global settings are different, hence why I also need the global.gset file.



edit: Another FYI is you have to replicate the error in diagnostic mode. Please continue to run diagnostic mode as prompted and then give me the error. DarwinBots will actually let you know at that point of what files you should send. Once again, this is designed so I will only have to look at 2000 cycle window.
Title: Re: Run-time error 6 overflow.
Post by: Testlund on September 05, 2013, 09:51:53 AM
I just ran it again until it crashed and got a new lastautosave.sim, so I put all the files you need in this zip.
Title: Re: Run-time error 6 overflow.
Post by: Botsareus on September 05, 2013, 11:57:45 AM
Panda fixed it,

I will post 2.46BetaA here on Saturday.

I found another reasonably nasty parser error:

Try creating a robot with
Code: [Select]
cond start *.chlr 16000 store stop
It will replace '16000' with '.'

This is also on my fix list...
Title: Re: Run-time error 6 overflow.
Post by: Panda on September 05, 2013, 12:17:49 PM
Doesn't it do that because it's a store variable. We can't store to 16000 so it's set to not store anywhere? I replaced it with 160 and it turned to .vel
Title: Re: Run-time error 6 overflow.
Post by: Testlund on September 05, 2013, 02:08:57 PM
I started to suspect it was something with my bots. I'll just lower the number then. Maybe 8000 works.  :)
Title: Re: Run-time error 6 overflow.
Post by: Testlund on September 05, 2013, 03:08:56 PM
Maybe 8000 works.  :)

It didn't.  :glare:
Title: Re: Run-time error 6 overflow.
Post by: Panda on September 05, 2013, 04:04:39 PM
What's this for, Testlund? What's the problem?
Title: Re: Run-time error 6 overflow.
Post by: Testlund on September 05, 2013, 04:51:59 PM
It's the number used in the dna that you mean, right?

For example I had these dna instructions for my alga:

cond
*.nrg 16000 > and
*.chlr 16000 <
start
16 .mkchlr store
stop
cond
*.nrg 16000 > and
*.chlr 15999 >
start
16 .strbody store
stop
cond
*.body 16000 >
start
50 .repro store
32 .aimdx store
stop

Now I've changed it to this and it has been running fine for about 1 and a half hour now:

cond
*.nrg 1000 > and
*.chlr 1000 <
start
8 .mkchlr store
stop
cond
*.nrg 1000 > and
*.chlr 999 >
start
8 .strbody store
stop
cond
*.body 1000 >
start
50 .repro store
32 .aimdx store
stop
Title: Re: Run-time error 6 overflow.
Post by: Panda on September 05, 2013, 05:19:31 PM
What happened is a number less than 0 was trying to be put into a memory location which caused an overflow. The check on the number of chloroplasts was making body 0, when chloroplasts were 0, rather than setting chloroplasts to 0.
Title: Re: Run-time error 6 overflow.
Post by: Botsareus on September 06, 2013, 09:19:06 AM
Quote
Doesn't it do that because it's a store variable. We can't store to 16000 so it's set to not store anywhere? I replaced it with 160 and it turned to .vel

Correct, but if you reload this DNA it will "." as 0 .

There is a significant data loss when any extraneous value becomes 0. Junk DNA is happening for a reason...


Title: Re: Run-time error 6 overflow.
Post by: Botsareus on September 07, 2013, 10:54:25 AM
The cause of the "." error was the system was not modulating by 1000 before checking a parse condition. Any value such as 2000 or 13000 where failing.

Btw,

 .vel is 200 not 160

 ;)
Title: Re: Run-time error 6 overflow.
Post by: Botsareus on September 07, 2013, 05:23:15 PM
Here it is,

I was also working on the following new DNA commands:

addstore
substore
multstore
divstore
ceilstore
floorstore

rndstore
sgnstore
absstore
sqrstore
negstore

anglecmp

unpow
depow
sin (multiplied by 32000)
cos
Title: Re: Run-time error 6 overflow.
Post by: Panda on September 07, 2013, 06:08:39 PM
So what do each of those do, then?
Title: Re: Run-time error 6 overflow.
Post by: Testlund on September 07, 2013, 07:06:43 PM
Here it is

Great I'll start a new sim right away before going to bed. 1 am here.
Title: Re: Run-time error 6 overflow.
Post by: Testlund on September 08, 2013, 09:06:35 PM
I got it again, this time when I'm running 3 instances, so I upload the instance B where I got the error.

Edit: This save got totally messed up. There's no bots in it and the two bottom teleporters has disappeared, so I doubt you can debug this.