To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 958
957  |  959
Subject: 
advice for game of tag?
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Sat, 3 Feb 2001 01:43:56 GMT
Viewed: 
1966 times
  
Hi, I've got 2 bots that I want to play tag with each other.  The
challenge is that I want them to see each other at a distance.  I'm
working on some code to combine the IR ports with the light sensors
(which can detect IR) as follows:

1) each sends out a random signal (1-255) every so often
2) each constantly scans for a burst of light
3) on detecting a burst they check if a message was also received.  If
so and it is not their own outgoing message then assume it is the other
bot.
4) (optional) use the intensity of the light burst to estimate the
distance to the other bot
5) act appropriately (tagger=chase, taggee=evade).

It's kind of working but there are a few technical issues:
1) The SendMessage() is quite slow so you can only send approx 20
messages per second.
2) While a message is being sent, none can be received.

With these restrictions the best I've been able to do so far is roughly
one recognized message per second (accompanied by a light burst)---to
slow to make the game interesting.  Does anyone have any suggestions how
to get around these problems?  Or maybe you can think of a different way
to approach the game?

TIA, Rik.

PS. Oh, and one other question.  How does Random() work?  Is it a
pseudo-random number generator?  If so, what does it use as its initial
seed?  I am concerned that both bots might use the same seed and thereby
stay completely synchronized.  If so, they would both send out the same
signal as the other bot every time.

--
Rik Blok  <RikBlok@mail.com>
Centre for Applied Ethics,
University of British Columbia, Canada
http://RikBlok.cjb.net



Message has 1 Reply:
  Re: advice for game of tag?
 
(...) Hi Rik, I am familiar with the idea of "Tag" but I don't understand what this means "to see each other". Normally, it would be enough that a bot sends a message as soon as it has hit the other. Another problem: why do you use random numbers in (...) (24 years ago, 5-Feb-01, to lugnet.robotics.rcx.nqc)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR