Bots and Simulations > The Gene depository
Demo of new .eyeNwidth sysvars
EricL:
Simple example illustrating the new ability to change the width of the field of view for each eye.
'If something comes into the focus eye, narrow the view like a laser beam.
'Make the width of each eye as narrow as possible and point them right next to one another for maximum resolution
cond
*.eyef 0 >
start
-34 .eye1width store
-34 .eye2width store
-34 .eye3width store
-34 .eye4width store
-34 .eye5width store
-34 .eye6width store
-34 .eye7width store
-34 .eye8width store
-34 .eye9width store
-140 4 add .eye1dir store
-105 3 add .eye2dir store
-70 2 add .eye3dir store
-35 1 add .eye4dir store
35 1 sub .eye6dir store
70 2 sub .eye7dir store
105 3 sub .eye8dir store
140 4 sub .eye9dir store
stop
'If there is nothing in focus, revert to normal vision.
cond
*.eyef 0 =
start
0 .eye1width store
0 .eye2width store
0 .eye3width store
0 .eye4width store
0 .eye5width store
0 .eye6width store
0 .eye7width store
0 .eye8width store
0 .eye9width store
0 .eye1dir store
0 .eye2dir store
0 .eye3dir store
0 .eye4dir store
0 .eye6dir store
0 .eye7dir store
0 .eye8dir store
0 .eye9dir store
stop
'Dummy gene that has an eye statement so the program knows to turn on the eyes
cond
start
*.eye5 > 0
stop
end
Testlund:
Hmm... If I understand this correctly the bot get a better sense of the size and position of the object it's looking at? If so, then it whould be better if it could spread it's vision slightly wider to see all of the object.
Numsgil:
Very nice. Alot of possibilities open up.
EricL:
The gene above is mearly illustrative. Given the sight distance and average bot width, there probably isn't much of a need to narrow the width of the eyes beyond perhaps 5 or so (-29 .eyeNwidth store) in real bots though you never know.... The concept is that by narrowing the field, you get better resolution about the exact bearing of far away objects and also can look past nearby objects to see far ones if you want. The image below illustrates this. I changed the gene to make each eye absolute width 5. Note that the bot can look past the near and focus on the far one, which would otherwise show up in a bunch of eyes and maybe even in .eye5 if the eye widths weren't narrowed. With it's vision narrowed, the refvars will be representitive of the far bot, not the near one.
cond
*.eyef 0 >
start
-29 .eye1width store
-29 .eye2width store
-29 .eye3width store
-29 .eye4width store
-29 .eye5width store
-29 .eye6width store
-29 .eye7width store
-29 .eye8width store
-29 .eye9width store
-140 20 add .eye1dir store
-105 15 add .eye2dir store
-70 10 add .eye3dir store
-35 5 add .eye4dir store
35 5 sub .eye6dir store
70 10 sub .eye7dir store
105 15 sub .eye8dir store
140 20 sub .eye9dir store
stop
Henk:
This is nice It is quite drastic though, I imagine evo-bots can get pretty messed up with mutations involving these sysvars, and I've already witnessed what waste can do to a bot if a random value is stored in any of these sysvars.
I imagine this isn't very backwards compatible(ie bots that don't know about this can get messed up pretty bad), or am I wrong?
(not that I'm against these features, I luv em )
Navigation
[0] Message Index
[#] Next page
Go to full version