Author Topic: Keeping eye on tied bot RESOLVED 2.43r  (Read 3656 times)

Offline Gobo

  • Bot Builder
  • **
  • Posts: 67
    • View Profile
Keeping eye on tied bot RESOLVED 2.43r
« on: November 12, 2007, 01:59:51 PM »
I'm trying to make a bot keep an eye on whom it tied to. In most cases, it misses. Does anyone have an idea, what's the matter?

Code: [Select]
cond
*.eye5 50 >
*.numties 0 =
start
1 .tie store
1 .tienum store
stop

cond
*.tienum 1 =
start
*.tieang .aimsx store
stop
« Last Edit: November 13, 2007, 11:07:28 AM by EricL »

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Keeping eye on tied bot RESOLVED 2.43r
« Reply #1 on: November 12, 2007, 02:49:12 PM »
It's a bug.  .tieang isn't getting updated.  This is easy to see if you watch the bot's memory in the properties dialog.  

The tie routines are still a mess in the code.  It would not surprise me if there a bunch of huge problems still but I think I know enough now to finally dig into it, which I will do shortly.   Nice find.
Many beers....

Offline Gobo

  • Bot Builder
  • **
  • Posts: 67
    • View Profile
Keeping eye on tied bot RESOLVED 2.43r
« Reply #2 on: November 12, 2007, 03:43:18 PM »
Isn't there any workaround?

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Keeping eye on tied bot RESOLVED 2.43r
« Reply #3 on: November 12, 2007, 04:22:48 PM »
Quote from: Gobo
Isn't there any workaround?

Quote
cond
*.eye5 50 >
*.numties 0 =
start
1 .tie store
1 .tienum store
stop

cond
*.tienum 1 =
start
 *.eye4 *.eye6 sub .aimsx store
stop

Does general desame, folowes the bot that is right bofore it. Could go wrong if there is going a bot between the two(itself and the bot the tie is connected), but this works in most cases. There is posibly a better way but I don't of any.

And you did a good job of finding the problem, kudos to you.  Well done, could explain some of the problems I had when using it, in my first attempt to make a multi-bot altrough most promblems had to do with the phycics there I gues, complete flying of bots around the screen then.  

The second time I tried to make a multibot, from another setup , The bot is sudenly working, altrough very(very,very,very) basic. So it is still possible to create a multibot.
This could possibly solve problems of some of the multibots.
Oh my god, who the hell cares.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Keeping eye on tied bot RESOLVED 2.43r
« Reply #4 on: November 12, 2007, 05:05:57 PM »
Moving this to the bugs forum, since it's not really about evolution or internet sharing.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Keeping eye on tied bot RESOLVED 2.43r
« Reply #5 on: November 13, 2007, 11:06:28 AM »
Fixed in 2.43r.  Both .tieang and .tielen were broken.  It appears there simply was no code in the 2.4 fork to update them.  Now there is code to populate the the appropriate values for either the last tie (when .tienum is 0) or whatever the tie specified by .tienum.    They work both for the bot which initiated the tie and the bot to which a tie is connected.

*.tieang .aimsx store

should now work correctly at both ends of the tie.

Additionally, it looks like .tiepres was not working correctly for non consecutive tie ports or for bots that had different numbers of ties.  That is, as far as I understand, after you do:

99 .tie store

.tiepres should contain 99, not 1 or 2 or whatever .numties happens to be.  But if you are the bot at which the tie is fired, .tiepres should be 1 or 2 or whatever .numties is since you didn't fire the tie and didn't specify a tie port.  The tieport should be different for each bot at each end of the tie as a fiunction of the number of ties each bot has, the order they were created and what (if any) tie port number was specified when the tie was created.

Anyway, things now work as they should I think.  Should be able to release 2.43r later today hopefully.
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Keeping eye on tied bot RESOLVED 2.43r
« Reply #6 on: November 13, 2007, 01:33:09 PM »
One small correction.  *.tieang returns the angle from .aim to the tied bot.  Angles clockwise from .aim are positive, counter-clockise negative.   Thus, to rotate to face the direction of the tied bot, one needs rotate clockwise *.tieang and thus the gene above should store *.tieang into .aimdx (aka .aimright) not .aimsx (aka .aimleft).
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Keeping eye on tied bot RESOLVED 2.43r
« Reply #7 on: November 14, 2007, 04:44:30 AM »
Quote from: EricL
...The tieport should be different for each bot at each end of the tie as a fiunction of the number of ties each bot has, the order they were created and what (if any) tie port number was specified when the tie was created.

As far as I know, tieport was designed to be the same for both bots.  I never really played around much with ties, so the reasoning is before my time.  I have no objections to changing it, (no real feelings one way or another), but just wanted to point out this would be a feature change, not a bug fix.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Keeping eye on tied bot RESOLVED 2.43r
« Reply #8 on: November 14, 2007, 01:00:19 PM »
Quote from: Numsgil
just wanted to point out this would be a feature change, not a bug fix.
You are correct.  Per the other thread on this topic, I think it makes sense to change it but I'm very open to other points of view...
« Last Edit: November 14, 2007, 01:00:46 PM by EricL »
Many beers....