Darwinbots Forum

Code center => Suggestions => Topic started by: abyaly on September 30, 2008, 12:58:08 AM

Title: Shot code cleanup
Post by: abyaly on September 30, 2008, 12:58:08 AM
.shootval does not work properly.
http://www.darwinbots.com/Forum/index.php?...ic=2590&hl= (http://www.darwinbots.com/Forum/index.php?showtopic=2590&hl=)

shots do not do consistent damage based on rob size.
http://www.darwinbots.com/Forum/index.php?...ic=2572&hl= (http://www.darwinbots.com/Forum/index.php?showtopic=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)
Title: Shot code cleanup
Post by: abyaly 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.
Title: Shot code cleanup
Post by: Numsgil 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?
Title: Shot code cleanup
Post by: abyaly 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.
Title: Shot code cleanup
Post by: Numsgil 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?
Title: Shot code cleanup
Post by: abyaly 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.
Title: Shot code cleanup
Post by: abyaly 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.
Title: Shot code cleanup
Post by: Numsgil 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.
Title: Shot code cleanup
Post by: abyaly on October 02, 2008, 08:09:24 PM
This is consistent for the following body levels:
2000, 1000, 5000, 250
Title: Shot code cleanup
Post by: Numsgil on October 02, 2008, 08:20:41 PM
hmm.  Try something with ~2 body (9 divisions).
Title: Shot code cleanup
Post by: abyaly on October 02, 2008, 09:12:43 PM
18 nrg damage with 1 body.
Title: Shot code cleanup
Post by: Numsgil on October 02, 2008, 10:42:43 PM
Huh, well I guess it's accurate then