Author Topic: Shot code cleanup  (Read 4528 times)

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Shot code cleanup
« on: September 30, 2008, 12:58:08 AM »
.shootval does not work properly.
http://www.darwinbots.com/Forum/index.php?...ic=2590&hl=

shots do not do consistent damage based on rob size.
http://www.darwinbots.com/Forum/index.php?...ic=2572&hl=

.shotrange , .shotspread and .shotpower sysvars are still on the wishlist and could be lumped in.


.shotrange and .shotpower could work as follows:
Values are modded into the range [1, 100]
1 would be 10% of normal range/power
100 would be 1000% of normal range/power

This means that the possible multipliers for shot power/range are in the range [.1,10]
Cost could simply be modified by the square of the multiplier.

.shotspread could work as follows:
.shotspread defaults to the current spread at birth (15 units, perhaps?)
Values are mod 618
Shots randomly spread between the following angles: [0 - .shotspread, 0 + .shotspread]
0 means shots fire in the exact same direction every time.
617 means they fire in a random direction (except directly backwards)
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 abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Shot code cleanup
« Reply #1 on: October 01, 2008, 08:41:05 PM »
PS: with the current shot code, a -1 shot fired by a bot with 1000 body point blank at a bot with 1000 body may do (and has done) twice as much damage as a -1 shot fired by a bot with 1000 body at a bot with 1000 body.
This level of inconsistency is bad.
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: 7742
    • View Profile
Shot code cleanup
« Reply #2 on: October 01, 2008, 08:43:39 PM »
Quote from: abyaly
PS: with the current shot code, a -1 shot fired by a bot with 1000 body point blank at a bot with 1000 body may do (and has done) twice as much damage as a -1 shot fired by a bot with 1000 body at a bot with 1000 body.
This level of inconsistency is bad.

Am I missing something or did you just say that 2 * x = x?

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Shot code cleanup
« Reply #3 on: October 01, 2008, 09:03:20 PM »
I am saying that a DB operation results in X and that the same DB operation results in 2X.
There is clearly some voodoo going on behind the scenes not related to energy, body, or range that causes damage to double.
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: 7742
    • View Profile
Shot code cleanup
« Reply #4 on: October 01, 2008, 09:09:20 PM »
As I read it, you're saying that the exact same circumstances results in wildly different results for some reason?

There is some degradation of shot strength as the shot ages, but it should have 90% of it's strength left when it is 90% towards death.  As the shot gets ever closer to death, it begins to drastically lose strength.  Could that be what you're seeing, or were they at point blank both times?

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Shot code cleanup
« Reply #5 on: October 01, 2008, 09:19:41 PM »
point blank in both situations. Near the end of the first topic linked from the first post, you can see what experiment I ran and the results.
« Last Edit: October 01, 2008, 09:20:56 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 abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Shot code cleanup
« Reply #6 on: October 02, 2008, 07:37:33 PM »
I just preformed the experiment in 2.44
You'll be happy to know that the bug is gone. I had assumed it wasn't worked on since the topic wasn't closed and there was no mention in release notes
A -1 shot fired by a bot with X body at a bot with 1000 body does
X * (9/50) + 18 energy damage at point blank range.
« Last Edit: October 02, 2008, 07:42:44 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: 7742
    • View Profile
Shot code cleanup
« Reply #7 on: October 02, 2008, 07:41:31 PM »
Actually, it might be more complex than that.  I think it's quadratic below 1000 and linear above 1000, or something like that.

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Shot code cleanup
« Reply #8 on: October 02, 2008, 08:09:24 PM »
This is consistent for the following body levels:
2000, 1000, 5000, 250
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: 7742
    • View Profile
Shot code cleanup
« Reply #9 on: October 02, 2008, 08:20:41 PM »
hmm.  Try something with ~2 body (9 divisions).

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Shot code cleanup
« Reply #10 on: October 02, 2008, 09:12:43 PM »
18 nrg damage with 1 body.
« Last Edit: October 02, 2008, 09:13:08 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: 7742
    • View Profile
Shot code cleanup
« Reply #11 on: October 02, 2008, 10:42:43 PM »
Huh, well I guess it's accurate then