Author Topic: body and mass  (Read 5761 times)

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
body and mass
« Reply #15 on: August 01, 2006, 08:52:10 AM »
... either that or any remaining body is converted to energy on death

I've got a workaround solution. Just have your bots dump energy into body on reproduction, like this:

cond
*.nrg 10000 >
start
50 .repro store
1000 .strbody store
stop

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7722
    • View Profile
body and mass
« Reply #16 on: August 01, 2006, 09:42:50 AM »
Quote from: Elite
In 2.37.6, If a bot was killed, say if all it's energy dropped to zero, then all it's remaining body was transfered to the killing bot. If a bot's body dropped to zero, the bot died, but transfered all it's remaining energy to the attacking bot

I don't think that's true.  I didn't really play with this when I made 2.4, so in this respect things should be the same between 2.37 and 2.4.   I think Eric's played in this area a little, so 2.4 now might be a little different, but I don't remember for sure.

Also, returned energy shots add a little to your body as well as your energy, so a tiny, unreproducing bot will eventually grow large enough to reproduce without managing its body.  It will just take a while.

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
body and mass
« Reply #17 on: August 01, 2006, 10:03:39 AM »
Quote from: Numsgil
Also, returned energy shots add a little to your body as well as your energy, so a tiny, unreproducing bot will eventually grow large enough to reproduce without managing its body. It will just take a while.

They don't. Not in 2.42.7a

If you're only using -1 shots, then you can't get body directly from other bots

Ah, that's interesting ...

-6 shots don't add to your body either. They convert body to energy and then transfer it to you, adding to your energy

Hmm ...

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7722
    • View Profile
body and mass
« Reply #18 on: August 01, 2006, 10:14:09 AM »
Eric might have changed that, or there might be some hicup.

When PY added the concept of Body ages ago, he made it so that -1 shots etc. would add to your body too, in order to specifically prevent the problems we're having now.

Let me look at the current source and see if I can see the problem.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7722
    • View Profile
body and mass
« Reply #19 on: August 01, 2006, 10:21:41 AM »
Eric did indeed change it, perhaps on accident (probably on accident since the comments aren't changed).

new code:
Quote
' robot n takes the energy carried by shot t
Private Sub takenrg(n As Integer, t As Integer)
  Dim partial As Single
   
  If rob(n).Corpse Or rob(n).wall Then Exit Sub
 
  If Shots(t).Range < 0.00001 Then
   partial = 0
  Else
   partial = CSng(Shots(t).nrg / CSng(Shots(t).Range * (RobSize / 3)) * Shots(t).value)
  End If

  If (rob(n).nrg + partial * 0.8) > 32000 Then
   ' EnergyAddedPerCycle = EnergyAddedPerCycle + (32000 - rob(n).nrg)
   rob(n).nrg = 32000
  Else
   rob(n).nrg = rob(n).nrg + partial * 0.8      'most of energy goes to nrg
 '   EnergyAddedPerCycle = EnergyAddedPerCycle + partial * 0.8
  End If
 
   If (rob(n).body + partial * 0.019) > 32000 Then
   ' EnergyAddedPerCycle = EnergyAddedPerCycle + (32000 - rob(n).body) * 10
   rob(n).nrg = 32000
  Else
   rob(n).nrg = rob(n).nrg + partial * 0.019      'a bit goes to body
  '  EnergyAddedPerCycle = EnergyAddedPerCycle + partial * 0.19 '(0.019 * 10)
  End If
 
  rob(n).Waste = rob(n).Waste + partial * 0.01  'tiny amount goes to waste
 
  'Shots(t).Exist = False
  rob(n).radius = FindRadius(rob(n).body)
End Sub

and here's the old one.

Quote
' robot n takes the energy carried by shot t
Private Sub takenrg(n As Integer, t As Integer)
  Dim partial As Long
 
  If rob(n).Corpse Then Exit Sub
 
  partial = Shots(t).nrg / (Shots(t).range * (RobSize / 3)) * Shots(t).value
   
  rob(n).nrg = rob(n).nrg + partial * 0.8      'most of energy goes to nrg
  rob(n).BODY = rob(n).BODY + (partial * 0.019) 'a bit goes to body
  rob(n).Waste = rob(n).Waste + partial * 0.01  'tiny amount goes to waste
  If rob(n).nrg > 32000 Then rob(n).nrg = 32000
  If rob(n).BODY > 32000 Then rob(n).BODY = 32000
  Shots(t).Exist = False
  rob(n).radius = FindRadius(rob(n).BODY)
End Sub
'  robot takes a venomous shot and becomes seriously messed up
Private Sub takeven(n As Integer, t As Integer)
  Dim power As Long
 
  power = Shots(t).nrg / (Shots(t).range * (RobSize / 3)) * Shots(t).value
 
  If Shots(t).Memloc = 340 Or power < 1 Then Exit Sub 'protection from delgene attacks
 
  If Shots(t).FromSpecie = rob(n).fname Then   'Robot is imune to venom from his own species
   rob(n).venom = rob(n).venom + power   'Robot absorbs venom fired by conspec
   rob(n).mem(825) = rob(n).venom
  Else
   If power < rob(n).Shell * ShellEffectiveness Then
     rob(n).Shell = rob(n).Shell - power / ShellEffectiveness
   Else
     Dim temp As Long
     temp = power
     power = power - rob(n).Shell * ShellEffectiveness
     rob(n).Shell = rob(n).Shell - temp / ShellEffectiveness
     If rob(n).Shell < 0 Then rob(n).Shell = 0
   End If
   
   If power < 0 Then Exit Sub
   
   rob(n).Paralyzed = True
   rob(n).Paracount = rob(n).Paracount + power
   
   If Shots(t).Memloc > 0 Then
     If Shots(t).Memloc > 1000 Then Shots(t).Memloc = (Shots(t).Memloc - 1) Mod 1000 + 1
     rob(n).Vloc = Shots(t).Memloc
   Else
     rob(n).Vloc = fRnd(1, 1000)
   End If
   
   rob(n).Vval = Shots(t).Memval
  End If
  Shots(t).Exist = False
End Sub
« Last Edit: August 01, 2006, 10:23:39 AM by Numsgil »

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
body and mass
« Reply #20 on: August 01, 2006, 10:26:28 AM »
Ah. That would explain it then
« Last Edit: August 01, 2006, 10:30:21 AM by Elite »

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
body and mass
« Reply #21 on: August 05, 2006, 01:21:09 PM »
Quote from: Numsgil
Eric did indeed change it, perhaps on accident (probably on accident since the comments aren't changed).
Unintentional on my part.  My apologies.  Will be changed back in 2.42.8.
Many beers....

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
body and mass
« Reply #22 on: August 06, 2006, 04:18:24 AM »
Ok, that was weird. I never thought it was a bug. I just thought it was the way the bots decided to evolve. I'm thinking the genes are just set to send very little energy to offspring when they reproduce, and I'm running with 'per kilobody point' setting so tiny bots wont get any energy, or at least very little. I've been waiting for some bot to evolve to give 50% of it's energy to offspring, like the '50 .repro store' gene, but I haven't seen it yet in my sim. Instead I have a bot with these genes that reproduce tiny bots:

 =
 dup and
 14 >
 rnd sqr xor
 *.dn and
 rnd *.sx << or
 inc
 0 mult * *.dx 2 or
 rnd and
 mult pyth not
 rnd *.dn - and
 or
 =
 store
 | dist and
 rnd *.sx | and
 >
 else
 << ++ dist angle rnd *.sx | 1 2 cond
 xor
 dist xor
 sqr *.sx ~ and
 inc
 start
 else
 cond
 xor
 1 and
 rnd *.sx | and
 inc
 cond
 mult else
 cond
 ~ dist pyth rnd *.sx mult 1 >
 cond
 xor
 dist and
 rnd *-1 | <
 inc
 3 else
 cond
 or
 dist and
 rnd *.sx | and
 store
 else
 else
 cond
 xor
 dist not
 rnd *.sx and
 dec
 inc
 else
 start
 cond
 xor
 dist and
 div *.sx | and
 inc
 else
 cond
 xor
 start
 .up inc
 *.sx | 9 *.dn cond
 xor
 dist and
 cond
 *.sx -- and
 inc
 else
 else
 cond
 or
 dist and
 5 *.sx and
 not
 inc
 else
 cond
 stop

''''''''''''''''''''''''Gene  13: Last 'stop' at position  158''''''''''''''''''''''',

 xor


And evolved genes look like a mess and I have now idea why this one multiplies on occasion. But of course all of you may not be running evosims so if you have a bot with a '50 .repro store' gene that produces tiny bots it must be a bug I guess. So I'm looking forward to see how the next drop will look like.
The internet is corrupt and controlled by criminally minded people.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
body and mass
« Reply #23 on: September 20, 2006, 01:24:54 PM »
Quote from: Numsgil
Eric did indeed change it, perhaps on accident (probably on accident since the comments aren't changed).

new code:

SNIP...
If (rob(n).body + partial * 0.019) > 32000 Then
' EnergyAddedPerCycle = EnergyAddedPerCycle + (32000 - rob(n).body) * 10
rob(n).nrg = 32000
Else
rob(n).nrg = rob(n).nrg + partial * 0.019 'a bit goes to body
' EnergyAddedPerCycle = EnergyAddedPerCycle + partial * 0.19 '(0.019 * 10)
End If
...snip

and here's the old one.

SNIP...
 rob(n).nrg = rob(n).nrg + partial * 0.8 'most of energy goes to nrg
rob(n).BODY = rob(n).BODY + (partial * 0.019) 'a bit goes to body
rob(n).Waste = rob(n).Waste + partial * 0.01 'tiny amount goes to waste
If rob(n).nrg > 32000 Then rob(n).nrg = 32000
If rob(n).BODY > 32000 Then rob(n).BODY = 32000
Shots(t).Exist = False
rob(n).radius = FindRadius(rob(n).BODY)
End Sub
' robot takes a venomous shot and becomes seriously messed up
Private Sub takeven(n As Integer, t As Integer)
Dim power As Long
...SNIP

Could someone please fix this little line of code so I can start running DB again? I whould do it myself but as I've explained in earlier posts I had troubles installing VB and can't get inside the source code.  
The internet is corrupt and controlled by criminally minded people.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7722
    • View Profile
body and mass
« Reply #24 on: September 20, 2006, 05:06:48 PM »
I'll see if I can get around to it.  Remind me in a day or so if I forget.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
body and mass
« Reply #25 on: September 22, 2006, 07:53:52 PM »
It's been 2 days now, hasn't it? Sorry, but I feel a little desperate here. I just bought a new computer and I was thinking it whould be great to run a non-stop sim on my old one and as it is now DB is a mess. There are two main problems right now: The mutations and bots that are getting born are too tiny to survive. The problems with the mutations seems to have something to do with the saving of a sim. It get reset when you load it. But the most important is this line of code that causes all new bots to stay tiny and prevents the sim from going any furter. As I understand it's just that line of code that needs to be change. Wish I could do it.  
The internet is corrupt and controlled by criminally minded people.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7722
    • View Profile
body and mass
« Reply #26 on: September 22, 2006, 11:05:31 PM »
Sorry, I did forget

I'm on it.  I'll try to upload a version later tonight.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7722
    • View Profile
body and mass
« Reply #27 on: September 23, 2006, 02:59:39 AM »
I've fixed the incoming nrg shot bug so bots should gain body again.

I'm not releasing an actual new version for it because I'm lazy   But it's named as a new version.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
body and mass
« Reply #28 on: September 23, 2006, 12:40:08 PM »
Great! I'll check it out!
The internet is corrupt and controlled by criminally minded people.

Offline Griz

  • Bot Overlord
  • ****
  • Posts: 608
    • View Profile
    • http://community.webshots.com/user/objack2
body and mass
« Reply #29 on: September 23, 2006, 02:25:51 PM »
Quote from: Numsgil
I've fixed the incoming nrg shot bug so bots should gain body again.

I'm not releasing an actual new version for it because I'm lazy   But it's named as a new version.

source?  or is it just the new/old code changes outlined above?
不知
~griz~
[/color]
   "The selection of Random Numbers is too important to be left to Chance"
The Mooj  a friend to all humanity
[/color]