Author Topic: Borg's runtime error  (Read 2466 times)

Offline Griz

  • Bot Overlord
  • ****
  • Posts: 608
    • View Profile
    • http://community.webshots.com/user/objack2
Borg's runtime error
« on: March 04, 2006, 02:03:20 PM »
Borg!
finally got the error 6 after running many trials.
used version 2.37.6 ...
with the error trapping added and recompiled.
it saved an error.sim ...
which I will attach as Borgerror.sim.zip

reloaded into the VB version for debug.

in Public Sub lookoccurr ...
the debug break occurs near the end of the routine in line:

rob(n).mem(825) = rob(n).venom

rob(n).mem(827) = rob(n).poison
End Sub

n=159
rob(n).mem(825) = 32751
rob(n).venom = 32801

I find venom dimensioned in a number of moduals as:
venom As Single
and in other's it is capped at 32000.

so ... what to do?
PY?
Nums?

I put this in just ahead of the line above ...
If rob(n).venom > 32000 Then rob(n).venom = 32000
as a temp workaround.
reloaded the Borkerror.sim ...
no error. [yet] ;)
and it is running again now

stay tuned. ;)
不知
~griz~
[/color]
   "The selection of Random Numbers is too important to be left to Chance"
The Mooj  a friend to all humanity
[/color]

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7718
    • View Profile
Borg's runtime error
« Reply #1 on: March 04, 2006, 02:21:15 PM »
That fix looks like it would work just fine.

Offline Griz

  • Bot Overlord
  • ****
  • Posts: 608
    • View Profile
    • http://community.webshots.com/user/objack2
Borg's runtime error
« Reply #2 on: March 04, 2006, 03:16:31 PM »
Quote
That fix looks like it would work just fine.
but it's just a patch, a band-aid .... not a fix.
DB is too full of these 'temp fixes' as is, imo.
pretty soon one runs out of fingers to stick into every
little hole that springs in the dike, or altering one thing
pulla a different band-aid off in another place.
treating the symptom, not the disease.
so what is the 'cause' of .venom ever going above 32000?
that's the thing to sus out, eh?

but ... at this point ...
iyo ... would it be better to do this line here ...
or to dimension rob(n).venom, or venom as Double?
what saves in time?
I would think that having to check if it's >32000 for
every bot would not be the ideal thing to do here ...
while the extra dimensioning would result in greater mem use.
so there is a tradeoff, eh?
or ... in the best of all worlds ...
to find and 'fix' the problem.
不知
~griz~
[/color]
   "The selection of Random Numbers is too important to be left to Chance"
The Mooj  a friend to all humanity
[/color]

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7718
    • View Profile
Borg's runtime error
« Reply #3 on: March 04, 2006, 03:22:05 PM »
Quote
Quote
That fix looks like it would work just fine.
but it's just a patch, a band-aid .... not a fix.
DB is too full of these 'temp fixes' as is, imo.
Right, so that's why I'm rewritting it.

Don't change any of the variable type declarations, that sort of things usually ends up causing more problems than it solves.  Right before the crash add a line to cap venom at 32000.  That should fix it well enough I think.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2554
    • View Profile
    • http://kuro-tejina.com
Borg's runtime error
« Reply #4 on: March 04, 2006, 07:17:57 PM »
I would be interested to find out at what point of the program, venom is being added to push it over 32000. There are only a small number of places where this can happen so it shouldn't be too hard to trackdown.

I don't like band-aid fixes either.
There are 10 kinds of people in the world

Those who understand binary.

and those who don't

:D PY :D

Offline Griz

  • Bot Overlord
  • ****
  • Posts: 608
    • View Profile
    • http://community.webshots.com/user/objack2
Borg's runtime error
« Reply #5 on: March 04, 2006, 07:34:56 PM »
well ... that band-aid does work ...
been running it for a few hundred thousand cycles, no problem.

any changes I make, I try to label/comment .... with reason/date ...
so it the 'fix' or core problem is later found, I can come back and
clean it up.

run that Borgerror.sim that I attached, PY ...
it should break as soon as it is loaded in.

the bots I used,  Excalibur1.1.txt ...
does seem to do a lot of mutating ...
so I don't know how that might affect what they try to do with
venom.  and he has the veggies set to get 100nrg/cycle ...
again, not sure how that might affect anything.
I only mention these as this is something I don't usually run
and I haven't gotten a crash in a long time up until tring his settings.

btw ... in the compiled version of 2.37.6 ...
the 'save error' is commented out and won't save error.sim on a crash.
it's just one line to uncomment, very close to the beginning ...
something like: 'on error go to fine'
once I did that and recompiled, it worked fine and wrote the error.

may have to find a way to get a new compiled version to Borg
so he doesn't give up. ;)
不知
~griz~
[/color]
   "The selection of Random Numbers is too important to be left to Chance"
The Mooj  a friend to all humanity
[/color]

Offline Griz

  • Bot Overlord
  • ****
  • Posts: 608
    • View Profile
    • http://community.webshots.com/user/objack2
Borg's runtime error
« Reply #6 on: March 04, 2006, 07:39:01 PM »
VB debug question:

once a break has occured, and the debug has brought me to
a particular line ...
is there a way to continue to step thru the program?
iow ... to step to the next line from within VB?
or to go to another modual to check on a variable that
is in that routine ... ie ... to go look at .venom in other
places .. to 'backtrack' if you will to see where the problem
is coming from?

tnx
不知
~griz~
[/color]
   "The selection of Random Numbers is too important to be left to Chance"
The Mooj  a friend to all humanity
[/color]

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7718
    • View Profile
Borg's runtime error
« Reply #7 on: March 04, 2006, 07:54:49 PM »
You should be abel to continue the program flow to the next line using F8, Shift+F8, Ctrl+Shift+F8.

Check out the Debug menu.

Offline Griz

  • Bot Overlord
  • ****
  • Posts: 608
    • View Profile
    • http://community.webshots.com/user/objack2
Borg's runtime error
« Reply #8 on: March 04, 2006, 10:06:42 PM »
Quote
You should be abel to continue the program flow to the next line using F8, Shift+F8, Ctrl+Shift+F8.

Check out the Debug menu.
yeah ...
I saw it had Step Into, Step Over, Step Out ...
but I couldn't find a way to make them do anything.
I had played with the setting breakpoints and toggle breakpoint
the other day when I was messing with the King Bot thing and
figured that out. sort of. ;)
but couldn't get it to step thru then either.
will have to go play some more I guess.
sure would be nice to have the docs.
tried that link for help you posted ...
but was unable to find any examples ...
just definitions, which weren't of much use.
but then I didn't spend a lot of time checking everything out.
不知
~griz~
[/color]
   "The selection of Random Numbers is too important to be left to Chance"
The Mooj  a friend to all humanity
[/color]

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7718
    • View Profile
Borg's runtime error
« Reply #9 on: March 04, 2006, 10:15:25 PM »
I use F8 et al all the time, so it may just be how you're using it...

If you could find someone who knows VB in person to physically show you how to use it, you would probably learn alot.

Offline Griz

  • Bot Overlord
  • ****
  • Posts: 608
    • View Profile
    • http://community.webshots.com/user/objack2
Borg's runtime error
« Reply #10 on: March 05, 2006, 10:26:51 AM »
Quote
I use F8 et al all the time, so it may just be how you're using it...

If you could find someone who knows VB in person to physically show you how to use it, you would probably learn alot.
yeah ... that's the ideal ....
but I know no one who has the slightest clue about progamming
on any level ... even the computer geeks are pretty much 'users' only. ;)
I may not have had the focus in the right window ... who knows.
but I did go look at the debug menu for that very reason ...
so I don't know what happened/didn't happen.
that's why I asked ...
so now that I know this is where it is 'supposed' to happen ...
that I am in the right place, I'll go ahead and invest the time
and energy to figure it out.
I just hate going down dead ends, you know?
so thanks for pointing me in the right direction.
I'll get it.

so ...
any other suggestions about how to track down where the
prog pushes venom >32000, once it breaks and I am in debug mode?
iow ... is there a way to move the focus to another modual
and then check out the value of the variables at that stage?
I'm still trying to figure out how rob(n).venom wouldn't have
aborted the program as soon as it was assigned that value
somewhere in the program ... rather than at the point it
does break, which is simply calling it up to store it in
rob(n).mem(825).

oh well ...
at least the bandaid does enable it to work.
« Last Edit: March 05, 2006, 10:28:06 AM by Griz »
不知
~griz~
[/color]
   "The selection of Random Numbers is too important to be left to Chance"
The Mooj  a friend to all humanity
[/color]

Offline Ulciscor

  • Moderator
  • Bot Destroyer
  • *****
  • Posts: 401
    • View Profile
    • http://spaces.msn.com/members/shadowedjustice
Borg's runtime error
« Reply #11 on: March 05, 2006, 10:45:23 AM »
Unfortunately there's no such thing as perfectly error free and consistent. There are probably lots of arcane philosophical arguements that say the same thing...  :D
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.