Darwinbots Forum

Bots and Simulations => Bestiary => Untagged bots => Topic started by: Tilthanseco on May 30, 2012, 04:44:01 PM

Title: Animal_Resono_1.3 (F3)
Post by: Tilthanseco on May 30, 2012, 04:44:01 PM
One day I had the greatest idea, I should make a bot that was blind. I thought I should use echolocation as his main sense, and it is. Upon looking at the forums, I discovered he was unique, and he makes it to 15th in the F3 League.
I introduce the strongest F3 Blind Bot I have found, Animal Resono
It also beats Mister Magoo, and PhiNotPi's blind bots.
Version 1.0 also does. (which doesn't use ref)

Warning, I used Nums .shang fix (2) to make this.  http://forum.darwinbots.com/index.php/topic,1249.0.html (http://forum.darwinbots.com/index.php/topic,1249.0.html)

Code: [Select]
' Animal_Resono_1.2 (F3)(Tilthan) 05.06.12
' Also Blind Bot, Interesting Behavior

' This bot does not use any eyes (in practice) and can run with vision disabled
' It uses it's echolocation properties as conspec recognition, if hit by only one shot, friendly
' It is the only bot I know of that uses echolocation using shots
' A side effect of it's conspec is that it makes a mine field and plays pinball
' Changes 1.2 - Uses shot pings as long-distance conspec
'         1.1 - Uses ref values for further conspec and touch targeting, (Having eyes as priority for ref is annoying)

' Variables
def guess 50
def search 51
def detect 52

' Constants
def age 10
def power 32

' 1 Get Mom Tie, and try to make my eyef useless.
cond
 *.robage 0 =
start
 .tie inc
 1222 .eye5width store
 628 .eye5dir store
stop

' 2 Get Rid of Mom Tie
cond
 *.robage 1 =
start
 .deltie inc
stop

' 3 Get Away from Mom
cond
 *.robage .age <
 *.vel 180 <
start
 10 .dn store
stop

' 4 Find Food, Start Sonar
cond
 400 *.nrg div 5 add rnd 0 =
and
 *.guess 0 =
and
 *.robage .age >
start
 214 rnd 100 add .aimdx store
 -1 .shoot store
 .search inc
stop

' 5 Find Food, Get Sonar
cond
 *.shang 0 >
and
 *.robage .age >
start
 *.shang .aimdx store
 2 .guess store
 *.velup -1 mult .up store
 *.veldx -1 mult .dx store
 0 .search store
stop

' 7 Shoot at Food
cond
 *.guess 0 !=
start
 -6 .shoot store
 .power .shootval store
 .guess dec
stop

' 8 Migrate for more Food
cond
 *.search 600 >
 *.nrg 500 >
start
 -100 .up store
 0 .search store
stop

' 9 Unstick if stuck
cond
 *.fixed 0 >
start
 0 .fixpos store
stop

'''''''''''Better movement hopefully
' 10 Shot Front, move forward
cond
 *.shdn 0 !=
start
 *.up -10 add .up store
stop

' 11 Shot Back, move back
cond
 *.shup 0 !=
start
 *.up 10 add .up store
stop

' 12 Shot Right, Move Right
cond
 *.shdx 0 !=
start
 *.dx 10 add .dx store
stop

' 13 Shot Left, Move Left
cond
 *.shsx 0 !=
start
 *.dx -10 add .dx store
stop

' 14 Body Maintenence
cond
 *.nrg 1105 >
 *.body 1000 <
start
 100 .strbody store
stop

' 15
cond
 *.nrg 1000 <
 *.body 1010 > or
start
 100 .fdbody store
stop

' Fam Detector
cond
 *.shflav -1 =
 *.shflav -6 = or
start
 0 .timer store
 .detect inc
stop

' 16 If Fam Fired at Me, Move
cond
 *.shang 0 =
 *.timer 1 >
 *.detect 0 >
and
 *.robage 0 !=
start
 0 .guess store
 0 .detect store
 284 rnd 120 add .aimdx store
 -35 .up store
stop

' 17 Hit Fam Get Away
cond
 *.refup *.myup =
start
 0 .guess store
 0 .detect store
 284 rnd 120 add .aimdx store
 -35 .up store
stop

' 18 Hit Food, Eat Food--From EricL
cond
 *.refxpos 0 >
 *.refup *.myup !=
start
 *.refxpos *.refypos angle .setaim store
 -6 .shoot store
 .power .shootval store
stop

' 19 Reproduce
cond
 *.nrg 9000 >
and
 *.guess 0 =
and
 *.pleas abs 100 <
start
 -314 .aimdx store
 30 .repro store
stop

end

Edit: Replaced with version 1.2 which now is F3, but still is slightly better than 1.1 :)
Included are all three versions:
1.2 Refs
1.1 Info Shots, Refs
1.0 Info Shots, Meets Qualifications of Blind Bot Challenge
Title: Re: Animal_Resono_1.3 (F3)
Post by: Botsareus on June 14, 2014, 02:24:44 PM
Has been disqualified for making a tie.
Title: Re: Animal_Resono_1.3 (F3)
Post by: Tilthanseco on June 21, 2014, 07:59:15 PM
I see you're picking on all the child tie removal bots. I didn't notice the rule application.

It still works with .tie commented out. Is .deltie allowed? I'll wait to make more improvements before I edit.
Title: Re: Animal_Resono_1.3 (F3)
Post by: Botsareus on June 23, 2014, 03:55:22 PM
Specially:

Quote
Private Sub FireTies(ByVal n As Integer)
  Dim Length As Single, maxLength As Single
  Dim resetlastopp As Boolean 'Botsareus 8/26/2012 only if lastopp is zero, this will reset it back to zero
 
  With rob(n)
 
  If .lastopp = 0 And (.age < 2) And .parent <= UBound(rob) Then 'Botsareus 8/31/2012 new way to calculate lastopp overwrite: blind ties to parent
   If rob(.parent).exist Then
    .lastopp = .parent
    resetlastopp = True
   End If
  End If
 
  'Botsareus 11/26/2013 The tie by touch code
  If .lastopp = 0 And .lasttch <> 0 And .lasttch <= UBound(rob) Then
   If rob(.lasttch).exist Then
    .lastopp = .lasttch
    resetlastopp = True
   End If
  End If
 
 
  If .mem(mtie) <> 0 Then
    If .lastopp > 0 And Not SimOpts.DisableTies And (.lastopptype = 0) Then
     
      '2 robot lengths
      Length = VectorMagnitude(VectorSub(rob(.lastopp).pos, .pos))
      maxLength = RobSize * 4# + rob(n).radius + rob(rob(n).lastopp).radius
     
      If Length <= maxLength Then
        'maketie auto deletes existing ties for you
        maketie n, rob(n).lastopp, rob(n).radius + rob(rob(n).lastopp).radius + RobSize * 2, -20, rob(n).mem(mtie)
        'Botsareus 3/14/2014 Disqualify
        If SimOpts.F1 And Disqualify = 2 Then dreason rob(n).FName, rob(n).tag, "making a tie"
        If Not SimOpts.F1 And x_restartmode > 3 And Disqualify = 2 Then KillRobot n
      End If
     
    End If
    .mem(mtie) = 0
  End If
 
  If resetlastopp Then .lastopp = 0 'Botsareus 8/26/2012 reset lastopp to zero
  End With
End Sub

Therefor, for what ever reason. Direct or Indirect. The robot has attempted to make a tie. Sorry Tilth, can not give you more info. than that.