Darwinbots Forum
Code center => Suggestions => Topic started by: k0zm0 on April 08, 2005, 04:57:28 AM
-
I have a suggestion about objects in DB.
If a bot sees a large group of objects, bots and vegs, then how can it decide which would it go to.
Can we add something like:
.objects - returns a number of objects it sees and assign reference numbers to them.
(number 1 is the closest, number n is the most distant)
.numobj - select a object you wish to gather info from. If you dont use this, than program would reference the closest bot. This number should be 1 by default.
.refobj - used for reference in conditions. Without of use of refobj the program should automaticly reference the closest bot.
cond
*.eye5 0 >
*.objects 1 >
start
2 .numobj start
*.refxpos *.refypos angle .setaim store
stop
Explanation: If a bot sees more than 1 bot than, with this code would go to second closest.
cond
*.refobj 1 >
*.refeye 0 =
start
*.refxpos *.refypos angle .setaim store
stop
Explanation:
If a second closect (or more) bot is a veg than go for it!!!
Just an idea...
-
What about a .eyevar?
'5 .eyevar store' will let the refvars apply to bots in eye5 (like it is now)
and for example:
'1 .eyevar' will let the refvars apply to bots in eye1.
I mean; do we humans only look straight ahead?
Henk
-
That would be useful. Imagine if there are two objects one in eye1 and another in eye9, a bot could check on both locations to see which one to move towards. Would really help reduce turning inorder to center the other bot in eye5.
Endy :blueblob: