Author Topic: Slam_Funk2.1(F3)(Ta-183)-5.27.09  (Read 2942 times)

Offline Ta-183

  • Bot Destroyer
  • ***
  • Posts: 105
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« on: May 27, 2009, 08:09:48 PM »
ROBOT TOO BIG TO FIT!

Here you go guys, as promised. I got it to beat Beholder, and once it did, it shot to the top 5. (With a little hitch at Alpha..... You can just ignore the results of that match. It beats it... Sometimes.....)
« Last Edit: May 13, 2014, 02:19:06 PM by Botsareus »

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« Reply #1 on: May 29, 2009, 06:49:51 AM »
I'm afraid that to get the position in the league it needs to achieve a statistical win.
It won 1 out of 8 fights against Alpha 2.7, so so alpha still retains it position.
Other than that it does beat a lot of the following bots.

To run the full league you just need to download the 2 files from the newest league topic, containing a league file and a folder with all the bots.
Theres an easy guide on running the league, and it makes it easy to run a full test. Sometimes once you finaly manage to beat a bot you'll discover you no longer beat some of the previous ones

Anyway nicely done, big step forward. Alpha 2.7 is a tough bot, it doesn't reproduce till it's reached a rather large size. One approach for a small bot could be to stay away from oponents that are too big untill you've reached a certain population or size. Locust (F1 league) does something like that, except in F1 tiefeeding is legal, making it much easier for Locusts to spread out and consume all the alge in no time (This is a lot harder to do with just -1 and -6 shots)

Or you could look at the top F3 bots... see if any of them remind you of your own and compare the tweek values and general behavior.
On that note, comunication can be realy usefull to gain the extra edge.

Alpha 2.7 is toough to beat once it gains size, fortunately it takes a while for it to get big, so you have time to gain size or numbers before engaging them.

Also you could take a look at the F2 and F1 leagues. If nothing else just to gather inspiration.
The different leagues promote very different behaviors. And it will likely be a good idea to start on a brand new bot when working on a new league, since the behaviors in one league may not work as well in the others.
Ofcourse I can understand if you wan't to get to nr 1 in F3 first, but the closer you get to the top the tougher the resistance will be. It can be fun to have another bot to work on aswell, also to get a break from hurdles that are causing problems, and refreshing your mindset. The other leagues also introduce a lot of new interesting toys to play with, and exotic oponents like cameleon bots, who change their code to fool your conspec

Offline Ta-183

  • Bot Destroyer
  • ***
  • Posts: 105
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« Reply #2 on: May 29, 2009, 09:08:02 PM »
Thanks, man. I already know how to run leagues, my computer just doesn't work doing it anymore. Don't try to help fix it, I've tried everything already. Anyway, I already have a good idea on how to beat alpha. But I decided that the work I'd done was enough for one release. It's impressive performance stems from two things. One SF2's main feature is that it uses relatively simple behaviors, that actualy require moderately complex code. The second thing is that there was a single, fatal syntax error in the body regulation system that made it impossible to beat Beholder until I found and fixed it. But, I spent so much time and effort on adding subtle new behaviors and optimising values to give it enough of an edge to beat it, that once I found and fixed the syntax it shot up the ladder like a rocket.

My plan for beating alpha has two possible routes; one, improve upon the existing jumpstart repro gene (which was added to kill alpha in the first place, IIRC) and get it off the get-go. The second is a bit trickier. This path requires a sophisticated vision and swarm-tracking gene set that allows SF to gain a relatively simple behavior; back off of big ones until the group it's with is big enough. This requires not only a vision system that can rapidly change the focuseye to I.D. adjacent bots while it does other things, but also requires a way for each bot to tell each other fellow SF-bot how many friendlies it sees. This could be done with a simple ref variable stating how many Friend IFFF pings it sees by storing it to some location. But to keep pace with quick bots and combat, once fighting starts or if the average .refvel of Foe pings exceeds a threshold, it reverts to the current eye system. During trials I noticed some bots getting the shit kicked out of them while eating, and got killed before they could run. Such a vision system might fix this.


But for now I don't think I can strong-arm SF's technology any higher than 5th. I watch the top four fight and it's as if I see the screen fill with top-condition bots nearly instantly, they just start too fast. But 5th place isn't something to complain about. Now, to get passed Alpha (reliably)...

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« Reply #3 on: May 30, 2009, 06:21:16 AM »
The eyes from EyeBot (In the starting gate) have one method for changing focuseye to the next non empty eye, constantly scanning all directions.
(It also spreads out the eyes on all 360 degrees).
And since your bot doesn't push alge but stands still next to them, then you would have the option to keep scanning while your eating, so you would actualy be able to see oponents coming. This way you can also try to make a getaway with the alge by ramming into it or somthing (So you don't leave it behind for the enemy).
Anyway if a bot is big enough the first shot from it will kill you, so it can often be an advantage to have eyes in the back of your head.

Offline Ta-183

  • Bot Destroyer
  • ***
  • Posts: 105
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« Reply #4 on: May 30, 2009, 03:17:35 PM »
It's funny you should mention eyebot, it was suggested a few times back when I was building SF1. But I didn't know as much about DNA then so it looked pretty dang complicated, and I didn't use it. Next time I get the chance I'll go over it again and try commenting the system. But because of the level of integration I'm trying to acheive between the various behaviors, and as a learning exercise (especially in the boolean stack and inline conditions) I will be writing my own system, which will act quite similar to the fashion you discribed, switching focuseye every cycle between each nonzero eye and eye5 to keep track of what's in front of it, for example it starts at eye5 and goes 5-4-5-6-5-3-5-7 ad nausium. Another thing I ought to address is the retreating and retaliation functions, which act more like addons than functions of the bot, sometimes causing a conflicting action which leaves it turning back and forth. This will be solved by expanding the scope of SF's situational parameters to include nothing, fighting, eating, and now, running. I find that the more I tie each action to the main parametric system, the better the bot works. Once I work on the new advance vision, I will expand the parameter sets to health, situation, and tactical, which will integrate IFFF readings, swarm densities, average enemy velocity and body size, and if need be, specific enemy bot species. I think that with SF2's superb dogfighting capabilites, the addition of a diagnostic system to counter info shots, poison, and venom (which I have been thinking up for a while) could make it a deadly F2 contender. And with a robust, nearly unfoolable antivirus system I've been thinking up, it might even get into the low F1 standings.


But first I want to get this bot to work exactly the way I want it, THEN I'll start building crossover variants. But yeah. Expect me to have a status update in one-two weeks or so.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« Reply #5 on: May 30, 2009, 06:54:50 PM »
Actualy the eye system in eyebot is set up with a lot of comments and helping features, to make it more plug and play like...

Eyebot has 2 systems, one for turning to the next non zero eye, and one for changing focus eye.
The system for changing focus eye doesn't rely on any of the other code in eyebot, it will work on it's own.

So the actual code for changing focus eye in eyebot is only one line :
[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 | 501 *.focuseye 8 add 9 mod add * abs sgn 8 mult | 501 *.focuseye 9 add 9 mod add * abs sgn 16 mult | 501 *.focuseye 10 add 9 mod add * abs sgn 32 mult | 501 *.focuseye 11 add 9 mod add * abs sgn 64 mult | 501 *.focuseye 12 add 9 mod add * abs sgn 128 mult | dup dup dup dup dup dup dup dup 1 & 1 sub dup div 1 sub abs *.focuseye 5 add 9 mod 4 sub mult swap 3 & 2 sub dup div 1 sub abs *.focuseye 6 add 9 mod 4 sub mult add swap 7 & 4 sub dup div 1 sub abs *.focuseye 7 add 9 mod 4 sub mult add swap 15 & 8 sub dup div 1 sub abs *.focuseye 8 add 9 mod 4 sub mult add swap 31 & 16 sub dup div 1 sub abs *.focuseye 9 add 9 mod 4 sub mult add swap 63 & 32 sub dup div 1 sub abs *.focuseye 10 add 9 mod 4 sub mult add swap 127 & 64 sub dup div 1 sub abs *.focuseye 11 add 9 mod 4 sub mult add swap 255 & 128 sub dup div 1 sub abs *.focuseye 12 add 9 mod 4 sub mult add swap 511 swap sgn mult store


This one line will switch the focus eye to the next non zero eye, if there is one.
It's cheap since it's only one line, and it's very easy to use.

You basicaly just write your condition for whenever you want switch focus and add the line afterwards
(I recommend spreading out the vision in some way (By changing eyedir and eyewidth) to take full advantage of this)

And if you want to keep jumping back to a certain eye you could hack it into doing that aswell (At the cost of a redundant store).
So for instance if you plan to leave eye5 as your center eye, and come back to it every 2 cycles, you could use *.timer 2 mod 0 = (Or 1 =) to make sure you jump to eye5 if it sees something (Or if you remembered the presence of an enemy). You would just have to make sure you make a backup of the focuseye value and reinsert that value in the next cycle before using the line from eyebot.
The focus eye will be changed again in that cycle, you're only resetting the previous value to make sure the eye system continues on it's previous path.

Personaly I find that it isn't nessesary to jump back every 2 cycles, since all the eyes will rarely be full. But maybe if you have wide eyes and a 360 degree vision you'll risk having to wait 8 cycles to see if the alge you where shooting at is still there (That would probably be a problem).

Anyway point being, that one line could be very usefull, it basicaly just jumps to the next non empty eye. (If you need to use the system for turning to the next empty eye you'll also need other parts from eyebot, but I think this is the line you realy need for what you have in mind)

Also if you want to understand how the line works you'll want to look at the broken down version :

[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 |
501 *.focuseye 8 add 9 mod add * abs sgn 8 mult |
501 *.focuseye 9 add 9 mod add * abs sgn 16 mult |
501 *.focuseye 10 add 9 mod add * abs sgn 32 mult |
501 *.focuseye 11 add 9 mod add * abs sgn 64 mult |
501 *.focuseye 12 add 9 mod add * abs sgn 128 mult |
dup
dup
dup
dup
dup
dup
dup
dup
1 & 1 sub dup div 1 sub abs
*.focuseye 5 add 9 mod 4 sub
mult
swap
3 & 2 sub dup div 1 sub abs
*.focuseye 6 add 9 mod 4 sub
mult
add
swap
7 & 4 sub dup div 1 sub abs
*.focuseye 7 add 9 mod 4 sub
mult
add
swap
15 & 8 sub dup div 1 sub abs
*.focuseye 8 add 9 mod 4 sub
mult
add
swap
31 & 16 sub dup div 1 sub abs
*.focuseye 9 add 9 mod 4 sub
mult
add
swap
63 & 32 sub dup div 1 sub abs
*.focuseye 10 add 9 mod 4 sub
mult
add
swap
127 & 64 sub dup div 1 sub abs
*.focuseye 11 add 9 mod 4 sub
mult
add
swap
255 & 128 sub dup div 1 sub abs
*.focuseye 12 add 9 mod 4 sub
mult
add
swap
.focuseye
swap
sgn mult
store


But all you realy need to know is what it does, and it's pretty straight forward.
« Last Edit: May 30, 2009, 07:03:41 PM by Moonfisher »

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« Reply #6 on: May 30, 2009, 07:07:43 PM »
Is it just me or do the codeboxes look realy messed up ?

Anyway here's the codebox content again in a quote box.

One liner :
Quote
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 | 501 *.focuseye 8 add 9 mod add * abs sgn 8 mult | 501 *.focuseye 9 add 9 mod add * abs sgn 16 mult | 501 *.focuseye 10 add 9 mod add * abs sgn 32 mult | 501 *.focuseye 11 add 9 mod add * abs sgn 64 mult | 501 *.focuseye 12 add 9 mod add * abs sgn 128 mult | dup dup dup dup dup dup dup dup 1 & 1 sub dup div 1 sub abs *.focuseye 5 add 9 mod 4 sub mult swap 3 & 2 sub dup div 1 sub abs *.focuseye 6 add 9 mod 4 sub mult add swap 7 & 4 sub dup div 1 sub abs *.focuseye 7 add 9 mod 4 sub mult add swap 15 & 8 sub dup div 1 sub abs *.focuseye 8 add 9 mod 4 sub mult add swap 31 & 16 sub dup div 1 sub abs *.focuseye 9 add 9 mod 4 sub mult add swap 63 & 32 sub dup div 1 sub abs *.focuseye 10 add 9 mod 4 sub mult add swap 127 & 64 sub dup div 1 sub abs *.focuseye 11 add 9 mod 4 sub mult add swap 255 & 128 sub dup div 1 sub abs *.focuseye 12 add 9 mod 4 sub mult add swap 511 swap sgn mult store

Broken down :
Quote
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 |
501 *.focuseye 8 add 9 mod add * abs sgn 8 mult |
501 *.focuseye 9 add 9 mod add * abs sgn 16 mult |
501 *.focuseye 10 add 9 mod add * abs sgn 32 mult |
501 *.focuseye 11 add 9 mod add * abs sgn 64 mult |
501 *.focuseye 12 add 9 mod add * abs sgn 128 mult |
dup
dup
dup
dup
dup
dup
dup
dup
1 & 1 sub dup div 1 sub abs
*.focuseye 5 add 9 mod 4 sub
mult
swap
3 & 2 sub dup div 1 sub abs
*.focuseye 6 add 9 mod 4 sub
mult
add
swap
7 & 4 sub dup div 1 sub abs
*.focuseye 7 add 9 mod 4 sub
mult
add
swap
15 & 8 sub dup div 1 sub abs
*.focuseye 8 add 9 mod 4 sub
mult
add
swap
31 & 16 sub dup div 1 sub abs
*.focuseye 9 add 9 mod 4 sub
mult
add
swap
63 & 32 sub dup div 1 sub abs
*.focuseye 10 add 9 mod 4 sub
mult
add
swap
127 & 64 sub dup div 1 sub abs
*.focuseye 11 add 9 mod 4 sub
mult
add
swap
255 & 128 sub dup div 1 sub abs
*.focuseye 12 add 9 mod 4 sub
mult
add
swap
.focuseye
swap
sgn mult
store

Offline Ta-183

  • Bot Destroyer
  • ***
  • Posts: 105
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« Reply #7 on: May 31, 2009, 07:33:52 PM »
I'm sorry, but I can't exactly read what it's doing. I need to go back and look at mod again, I still don't know exactly what it does. I get frustrated when I don't know something. I am also more comfortable with boolean logic than math, so I was thinking more along the lines of using a single gene with multiple 'if exeX greater than 0 and eyetimer is odd and if switchedeyealready is 0 then switch focuseye to X' statements. The 'front-and-next-and' bit is to make sure that fast moving bots do not escape SF's vision, like Aim does to Beholder.

Again, I'm going for simple behavior, complex gene, simple code. I'm used to programming a calculator with a built in BASIC stamp. But don't get me wrong, the calculator itself allowed me to use complex math and trigonometry. I miss my slow-to-a-crawl 3D engine. Damn random RAM resets.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« Reply #8 on: June 01, 2009, 07:55:27 AM »
Well all that modulus (mod) does is give you the remainder from a dividion between two numbers.
So *.timer 2 mod 0 = will be true when *.timer is even and a division by 2 would have no remainder.
So 26 5 mod would return 1, since 26 is the same as 5*5 + 1.
It's a very usefull opperator.

As for the one line, the first part packs all the logic into the top integer on the stack. (By OR'ing each condition into a given bit)
Each condition is the sgn'ed value of an eye.
Then it makes a lot of copyes of the value on the stack.
And last it can use the integers on the stack to check several eyes at once for every action it might take.
Can't actualy remember exactly what my thought was in this area (And it's hard to read). So can't explain it right now because I can't remember and I just woke up so I don't understand it either
But it ends up switching to the next non empty eye somehow
And by doing it this way it avoids the use of a ton of conditions.

And don't forget to save and reset the previous focus eye every time you've broken the cycle. Otherwise every time you jump to eye5 it'll restarts it's cycles from that point.

Offline Ta-183

  • Bot Destroyer
  • ***
  • Posts: 105
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« Reply #9 on: June 03, 2009, 06:12:05 PM »
Yeah, basically what it does is when it activates the scan feature, it stops checking weather or not to activate it (so it does not reset the list of eyes to check) and builds a list of eyes, using an incrementing counter to store 1 to up to eight memvars, starting by storing the number of eyes to check and building the list by looking at what eyes are nonzero and storing the eye number to the next empty list slot, building the list by checking each nonzero eye in the order that it would check EVERY eye, (5-6-5-4) excluding eye5 and any zero eye, putting those ID's in the 'list' and then it begins to actually DO crap. It starts out by doing whatever all I'm going to make it do at each eye on eye5, (IFFF readings, bot status, enemy count, etc) then changes the focuseye to the next eye in the list. It increments a counter to look to the next list position, as long as the counter does not exceed the number of eyes to check. Next cycle, it does the same thing to the first nonzero eye on the list, then switches back to eye5.  Of course, each cycle it checks every nonzero eye on the list to make sure that *.eyeX hasn't changed too much so that it can tell if it needs to knock an eye off the list or put a new one in the queue. This won't be the ONLY vision system used on the bots I make that have it. SF2.1's eye system works VERY effectively when it needs to track fast moving or irregular targets, or if energy becomes dangerously low and the scanning-eye system becomes too costly to use. I may also throw in a 'frustration' variable, that goes up if it has to adjust the eye list. The more it has to update (meaning shit's REALLY flying) the more frustrated it gets, and after a certain level it just kinda goes "FUCK IT!" and reverts to the old eyes until stuff cools down, relying on other SF's (like they already do) for food and enemy locations that might be juuuuust out of sight.

Also, I like the idea of a bot that can get pissed off.

Offline Ta-183

  • Bot Destroyer
  • ***
  • Posts: 105
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« Reply #10 on: June 08, 2009, 12:12:50 PM »
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.

Offline Ta-183

  • Bot Destroyer
  • ***
  • Posts: 105
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« Reply #11 on: June 25, 2009, 11:03:44 AM »
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.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Slam_Funk2.1(F3)(Ta-183)-5.27.09
« Reply #12 on: July 03, 2009, 05:55:14 PM »
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 ).