Difference between revisions of "Memloc and Memval"
(memloc should work at memory location 1000, if it doesn't (or anything else doesn't work at mem loc 1000), it's a bug.) |
|||
(14 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
− | These allow the bots to readback another bot's memory locations. | + | Memval reads the value of a location in another bot using the value that was already in or put into Memloc on the last cycle to define the location. Memloc holds its value until changed, max usable value 1000 min 1. Memval will not change if eye5 = 0. |
+ | These allow the bots to readback another bot's memory locations. | ||
+ | ==[[Sysvar]]s:== | ||
+ | {{Memloc and Memval}} | ||
+ | ==Syntax:== | ||
Example: | Example: | ||
cond | cond | ||
+ | *.robage 0 = | ||
start | start | ||
67 .memloc store | 67 .memloc store | ||
+ | 101 67 store | ||
stop | stop | ||
− | + | ||
cond | cond | ||
*.eye5 40 > | *.eye5 40 > | ||
Line 16: | Line 22: | ||
This will cause the bot to attack bots that don't have the same number as it does in memory location 67. | This will cause the bot to attack bots that don't have the same number as it does in memory location 67. | ||
− | A slight problem, is that any bot can determine the location being referenced by simply checking in memloc with it's own memloc/memval. This is simply a more complex version of the problems facing bots using [[ | + | A slight problem, is that any bot can determine the location being referenced by simply checking in memloc with it's own memloc/memval. This is simply a more complex version of the problems facing bots using [[In and Out]] for secure information exhchange. |
+ | |||
+ | Example: | ||
+ | |||
+ | def foundmemloc 51 | ||
+ | def reqmemval 52 | ||
+ | |||
+ | cond | ||
+ | *.eye5 0 > | ||
+ | *.refshoot *.myshoot != | ||
+ | *.foundmemloc 0 = | ||
+ | start | ||
+ | .memloc .memloc store | ||
+ | *.memval .foundmemloc store | ||
+ | stop | ||
+ | |||
+ | cond | ||
+ | *.eye5 0 > | ||
+ | *.refshoot *.myshoot != | ||
+ | *.foundmemloc 0 != | ||
+ | start | ||
+ | *.foundmemloc .memloc store | ||
+ | *.memval .reqmemval store | ||
+ | stop | ||
+ | |||
+ | cond | ||
+ | *.reqmemval 0 != | ||
+ | *.foundmemloc 0 != | ||
+ | start | ||
+ | *.reqmemval *.foundmemloc store | ||
+ | stop | ||
+ | |||
+ | These genes will fool memloc/memval based [[conspec recognition]]. | ||
A more complex method would be to randomly vary the locations checked per cycle, but most bots simply make do with the refeye/myeye combination. | A more complex method would be to randomly vary the locations checked per cycle, but most bots simply make do with the refeye/myeye combination. | ||
+ | |||
+ | To use the commands tmemval and tmemloc the procedure is similar, but requires the tie number to be stored in tienum. | ||
* [[Robot DNA]] | * [[Robot DNA]] |
Latest revision as of 15:36, 7 August 2006
Memval reads the value of a location in another bot using the value that was already in or put into Memloc on the last cycle to define the location. Memloc holds its value until changed, max usable value 1000 min 1. Memval will not change if eye5 = 0. These allow the bots to readback another bot's memory locations.
Sysvars:
Memloc & Memval:
|
Syntax:
Example:
cond *.robage 0 = start 67 .memloc store 101 67 store stop cond *.eye5 40 > *.memval *67 != start -1 .shoot store stop
This will cause the bot to attack bots that don't have the same number as it does in memory location 67.
A slight problem, is that any bot can determine the location being referenced by simply checking in memloc with it's own memloc/memval. This is simply a more complex version of the problems facing bots using In and Out for secure information exhchange.
Example:
def foundmemloc 51 def reqmemval 52 cond *.eye5 0 > *.refshoot *.myshoot != *.foundmemloc 0 = start .memloc .memloc store *.memval .foundmemloc store stop cond *.eye5 0 > *.refshoot *.myshoot != *.foundmemloc 0 != start *.foundmemloc .memloc store *.memval .reqmemval store stop cond *.reqmemval 0 != *.foundmemloc 0 != start *.reqmemval *.foundmemloc store stop
These genes will fool memloc/memval based conspec recognition.
A more complex method would be to randomly vary the locations checked per cycle, but most bots simply make do with the refeye/myeye combination.
To use the commands tmemval and tmemloc the procedure is similar, but requires the tie number to be stored in tienum.