Bots and Simulations > F3 bots

Slam_Funk2.1(F3)(Ta-183)-5.27.09

<< < (3/3)

Ta-183:
Pre-production work on the vision system for SF2.2, codenamed 'Walleye', has started. Rough outlines for the code are being laid down with early variables. The switching system is beginning to take a preliminary shape, and is starting to look like a vision system. This is going to take a while to get the actual functional code down and working, and even longer to integrate into SF2.2. The other behaviors are secondary to the new eyes, but will rely on them all the same. The switching system will be simplified a bit, relying on gene order and condition setting. This is just so I can have the patience to code the bot. KISS comes to mind.







And in case you gents havent caught on yet, Slam Funk was a name chosen by taking two random words from the top of my head. It's not pretty, nor does it have anything to do with the bot's behavior. 'Walleye' sounds a lot better, and I think that's what I'm gonna call it now, with the full name being SF2.2-'Walleye'. Has a neat ring to it.

Ta-183:
Well my limited computer acess has slowed down development considerably. But during my C++ class, I've started to knock out some IPO charts for the system. Today, I tried to punch out some DNA.



Holy CRAP this is getting complicated FAST.


All I've tried to do so far is initialize the eye list. That wasn't TOO hard, but its a bit outside my comfort zone. When I got to the first bits of code regarding the actual focuseye.... My head asplode. The fact of the matter is that it is incredibly hard to read a sequence of numbers and set the focuseye to said number. I had to scrap it all and try again later.


Now that I've actually gotten back to writing in DNA assembly again, I suddenly remembered why I wanted to write an interpreter in C++. The complications of doing a simple conditional system are popping up all over the place. It's overwhelming. X_X


I'm gonna need to have some practice on the boolean stack.

Moonfisher:
Heh I was actualy working on a C looking laguage for DB2 using a oerl script to translate the code into DB code.
But ran into some problems concerning braquets and such, and then got away from it and never realy got around to finishing the whole thing. (Even though it's almost half done )
Not sure I'm going to... I might just to take on the braquet challenge, but don't hold your breath though

As for the eyefocus issue, it's indeed rather complex to do all this with logic, which is why a lot of poeple choose to compress it by using math (Aswell as cutting down on the nrg costs for logic).
The lines in the system I use that look like this :
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']501 *.focuseye 5 add 9 mod add * abs sgn
501 *.focuseye 6 add 9 mod add * abs sgn 2 mult |
501 *.focuseye 7 add 9 mod add * abs sgn 4 mult |

make sure that the eyes are relative to the focus eye :
501 is eye1 I think, then I add 5 to the focus eye value (Putting it in the range 1-9), and use 9 mod to change that range to 0-8 (This seems redundant for this line, but since this is done for all lines it makes the code easier to read.)
So for instance if focus eye is 0 (eye5) the line would add 5 to 501, so eye6 would be checked by this line.
The sgn value of *.eye6 is then pushed to the top of the integer stack.
The next line would then check eye7 and add the signed value to the next bit... so eventualy you have some pattern representing all the eyes in a single integer, and it's relative to the current focuseye.
This makes the rest of the logic a lot easier to handle since you can now check multiple eyes at the same time by taking out a section of eyes to see if any of them see anything.

So you could if you like, steal parts of the line, this way you could incorporate your own logic, but still benefit from the advantages of having one value to represent the state of all eyes (Or atleast, empty/not empty).

Anyway to use the information in the integer stack I duplicate it so I can use it several times (You can move it into the right position using swap).

The next piece of code :
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']dup
dup
1 & 1 sub dup div 1 sub abs
*.focuseye 5 add 9 mod 4 sub

This "and"'s 1 and the value on the int stack, and checks if the value is 1, if so the next eye will be "*.focuseye 5 add 9 mod 4 sub".
So if *.focuseye was 0 then bit 1 would be eye6, and the next eye would be... you guessed it, eye6...
The next line then and's with 3 and checks if it's 2, this way it both checks if eye7 (int this case) is not empty and also makes sure that eye6 is empty at the same time.
And then the enxt time checks eye8 making sure eye6 and eye7 are empty asf...

It basicaly makes the logic a lot more compact... you need to keep track of some math, but it realy makes the whole thing less complicated (Or atleast more manageable, and easier to read once you've stared at it long enough ).

Navigation

[0] Message Index

[*] Previous page

Go to full version