Author Topic: Poison Question  (Read 5412 times)

Offline googlyeyesultra

  • Bot Destroyer
  • ***
  • Posts: 109
    • View Profile
Poison Question
« on: December 29, 2007, 05:44:07 PM »
I've looked, but I can't find an answer: exactly how much poison is returned when a poison containing bot is shot? What are the variables in this, and is it possible for either bot to calculate this amount?

Thanks in advance.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Poison Question
« Reply #1 on: December 29, 2007, 08:16:31 PM »
It's a total mess in the code and probably full of bugs.  One day I will dig into it and try to figure out the intentions of whoever wrote this mess, but for now, I'm afraid to screw with it.  Here's what I can determine from reading through the code.  Could be way off.

Basically, when a bot gets hit by a posion shot t, it's posion counter gets increased by the amount:

Shots(t).nrg / (Shots(t).Range * 40) * Shots(t).value

that is, it will stay poisoned for that many cycles.

The posion shot's "nrg" is a paradoxically a function of the range of the shot (not it's nrg) that caused the poison shot in the first place.  That is, a posionous bot will emit a more powerful (meaning longer lasting) posion shot when it gets hit with a shot at close range instead of long range.  The exact formula of the posion shot's nrg appears to be is (r * 40 + 40 + 1) / 40 where r is the range of the original shot at the time it impacted.  Range is a countdown of cycles of life for the shot.  And don't ask me why this forumla is the way it is.

The range value at the time the poison shot impacts is a function of the number of cycles the poision shot has been in existance.  It counts down each cycle.  It's original value is itself originally a function of the where in the range the original shot that casued the posion to get emitted was when it impacted.  The initial range for the posion shot is r *40 + 40 + 1.  So it looks from a first glance at the code that posion shots last a long time.  Do they?

The poison shot's value is paradoxically defined as half the nrg of the original shot that casued the posion shot to be emitted in the first place.  What is this nrg?  That depends on the original shot type and is in part determined via .shootval for most shot types.

Confused yet?  So am I.  If you figure it out, let me know.  If someone knows how this was supposed to work, also let me know.
Many beers....

Offline googlyeyesultra

  • Bot Destroyer
  • ***
  • Posts: 109
    • View Profile
Poison Question
« Reply #2 on: December 29, 2007, 08:51:07 PM »
If you can post the source code for this particular snippet maybe I can read over it, try to figure out what the hell it's doing, and possibly write a slightly less idiotic version. I know enough VB to do some of the basic stuff, and the stuff I don't know I can just toss in as psuedocode comments.

Off hand, the easiest way would be to make it have all of the properties of a returning nrg shot (half the speed of regular shot, twice duration, etc.). Once I get a peek at the source, I'll see if I can figure it out.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Poison Question
« Reply #3 on: December 30, 2007, 12:15:03 AM »
You can grab the source from the link on the downloads page.  Most of what you want is in the Shots Module.  Take a look at updateshots() newshot() and takepoison() for starters.

Don't spend a lot of time plowing through the source unless you really want to get into it.  What would be most helpful to me is a clear design and broad consensus on exactly how posion shots should work w.r.t. the relationship between poison longevity and whatever - the shot that evoked the poison shot, it's range, it's nrg, the poisonous bot's poison level and so on.

Writing code is easy.  Knowing what code to write, that's hard.
Many beers....

Offline googlyeyesultra

  • Bot Destroyer
  • ***
  • Posts: 109
    • View Profile
Poison Question
« Reply #4 on: December 30, 2007, 01:23:31 AM »
Thanks. Taking a look in the source should answer many of my future questions. I learned a couple of things just by looking through it for five or ten minutes:
Poison is absorbed by conspecs (I knew it didn't affect them, but I didn't know they got the poison, too).
Bots are given shot immunity when robage < 1. Spiffy.
Anyways, thanks again.

Offline Peksa

  • Bot Destroyer
  • ***
  • Posts: 118
    • View Profile
Poison Question
« Reply #5 on: January 10, 2008, 03:57:13 PM »
Quote from: googlyeyesultra
Poison is absorbed by conspecs (I knew it didn't affect them, but I didn't know they got the poison, too).

How are conspecs determined in the code? I can't atm look myself..

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Poison Question
« Reply #6 on: January 10, 2008, 04:17:30 PM »
Quote from: Peksa
How are conspecs determined in the code? I can't atm look myself..
A bot's name determines it species at present.  One day I will move this to use GUIDs but for now, two bots with the same name are the same species as far as the code is conerned.  The shot structure maintains which specific bot and which specific species shot it, which is how the code knows not to let bots to shoot themselves for example and allow conspecs to absorb poison shots rather than be posioned.
Many beers....

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Poison Question
« Reply #7 on: March 14, 2008, 11:47:34 PM »
Does poison have an upkeep cost while it's being stored?
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Poison Question
« Reply #8 on: March 15, 2008, 12:59:47 PM »
Nope.  It takes nrg to make and unmake.  An andditional nrg charge proportional to the amount made or unmade is charged if specified.  Waste is produced as a side effect of making or unmaking (if a cost is specified - probably a bug).  But there is no ongoing carrying cost I can find.
Many beers....

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Poison Question
« Reply #9 on: March 15, 2008, 07:02:52 PM »
I suppose a waste cost does make more sense than nrg ... after all, something's got to make it.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan