Author Topic: Quick question  (Read 4023 times)

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Quick question
« Reply #15 on: March 19, 2008, 12:04:25 PM »
Quote from: EricL
From a quick look at the code, -1 and -6 shot range appears not to depend on the body of the shooter at all.
Err..  what?
If not body, then it depends on something very closely correlated.
Lancre operated on the feudal system, which was to say, everyone feuded all
the time and handed on the fight to their descendants.
        -- (Terry Pratchett, Carpe Jugulum)

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Quick question
« Reply #16 on: March 19, 2008, 12:19:32 PM »
The code is a total mess and super hard to read.  

Wait, here we go.  Looks like it depends on .vbody, not body, which for single bots is the same thing.

Looks like a shot's range (no .shootval specified) is

(ln(vbody) * 60 + 41) /40

So, shots from a small bot with body of 100 will last about 8 cycles.

A large bot with body of 32000 will last about 16 cycles.
Many beers....

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Quick question
« Reply #17 on: March 19, 2008, 01:01:01 PM »
Thanks, Eric.

PS - what is vbody?
« Last Edit: March 19, 2008, 01:03:28 PM by abyaly »
Lancre operated on the feudal system, which was to say, everyone feuded all
the time and handed on the fight to their descendants.
        -- (Terry Pratchett, Carpe Jugulum)

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Quick question
« Reply #18 on: March 19, 2008, 01:14:50 PM »
It looks like it's a half-finished multi-bot feature - the 'virtual body' of a multibot.   The code calculates it as the sum of the bodies of all the directly connected bots if a bot is a multi-bot and stores it on that bot's structure internally (but curiously, it does not do so transitivly).  The only place it's referenced in the code is for shot range (which is why I was confused before) but the code to provide multibot's greater shooting range based on this appears to be incomplete and ineffective.  I do not beleive multi-bots gain a shot range advantage currently.   .vbody is internal and not reflected out as a sysvar (values could exceed 32000).  My guess is that some previous coder wanted to give multibots advantage proportional to thier combined body and this was a start.
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7718
    • View Profile
Quick question
« Reply #19 on: March 19, 2008, 11:01:12 PM »
Multibots used to have a whole host of extras that were enabled with .vbody.  Longer range, stronger shots, etc. etc.  After Helios demonstrated that a MB is strong enough on its own, I went through and unplugged .vbody from most of those features.

Those shot routines always have been a huge mess.  The problem is that it's so gnarly I was always afraid to seriously revamp it in case I screwed something up subtley.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Quick question
« Reply #20 on: March 20, 2008, 10:06:29 AM »
Quote from: Numsgil
Those shot routines always have been a huge mess.  The problem is that it's so gnarly I was always afraid to seriously revamp it in case I screwed something up subtley.
This is exactly why I haven't opened them up.  I'd end up re-writing them and don't have the time presently.   I know I'm going to have to do it at some point, but there's other stuff higher on the list.
Many beers....

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Quick question
« Reply #21 on: March 20, 2008, 10:27:57 AM »
I was playing around with robots with varying amount ofr body to see how much damage -6 shots do and something interesting happened.

If I make one of the bots with 1000 body fire a shot, it will reliably do 40.8 damage to the opponent's body (point blank).

I wanted to get several more values and try to find a formula, so I got a bot with 32000 body and manually reproduced it to create bots with 16000, 8000, 4000 body and down. Here's where it got interesting. When I got down to testing the one with 1000 body, it did 102 damage (point blank). Every time I've done this, a bot with 1000 body from this method did 102 damage. A bot with 1000 body that started with it did 40.8 damage.

So if you're worried about breaking things on accident, rest assured that it's already broken.
Lancre operated on the feudal system, which was to say, everyone feuded all
the time and handed on the fight to their descendants.
        -- (Terry Pratchett, Carpe Jugulum)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7718
    • View Profile
Quick question
« Reply #22 on: March 20, 2008, 08:52:49 PM »
I think it's a piecewise function.  0-1000 is linear, or something like it.  1000-32000 is logarithmic.  If the 1000-32000 code got out of sync with 0-1000, that would explain what you saw.

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Quick question
« Reply #23 on: March 20, 2008, 09:33:44 PM »
No. 1k to 32k is linear.
0 to 1k is also linear.


*linear being aphine
« Last Edit: March 20, 2008, 09:45:36 PM by abyaly »
Lancre operated on the feudal system, which was to say, everyone feuded all
the time and handed on the fight to their descendants.
        -- (Terry Pratchett, Carpe Jugulum)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7718
    • View Profile
Quick question
« Reply #24 on: March 20, 2008, 10:11:59 PM »
That might be the problem then.  I'm pretty sure I designed it to be logarithmic after 1000 body.