Author Topic: Got bots that behave differently in 2.37.6 and 2.42.4?  (Read 9036 times)

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« on: May 15, 2006, 12:09:20 PM »
After fixing serious bugs such as crashes, my number one priority for continued work on the 2.4 code fork is closing the gap on issues with bots which work in 2.37.6 but which do not work in 2.42.4 or which behave radically different in that version.

To that end, I am soliciting examples of such behavioural differences.  If you have a gene or bot which works in 2.37.6 but does not work in 2.42.4 or which demonstrates significant differences in behaviour between the two versions, please reply with details to this topic.

Please be as specific as possible.  I'm happy to go get bots from the beastiary and run them in the two versions myself and read the DNA and reverse engineer what it should be doing and what it is actually doing, etc. but that takes time, time I could be using writing code or fixing bugs and I'm only one guy.   So, the extent to which you can help me out by pointing me to the specific differences or ideally to the actual DNA area or sysvars which behave differently, that would be much apprecated.  Uploaded sims which illustrate this are of course, much apprecaited.

Also, 2.42.4 fixed a bunch of things, so please use that version and not previous versions of 2.4 for your testing.

Known issues with 2.42.4:

.stifftie is not yet implemented.
.fixlen and .fixang work, but multibots which rely upon specific tie physics for crawling or using tie length for acceleration, etc. probably behave differently.  Please report such differences.
I have not personally tested .tielen1-4 and .tieang1.4 so they may or may not work in 2.42.4.  Specific help here requested.
Viruses have been reported to work in 2.42.4, but I have not tested them.
I am still investigating issues with retruned energy shot ranges and small bot evaporation.

Thanks for your help!
« Last Edit: May 15, 2006, 12:10:06 PM by EricL »
Many beers....

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #1 on: May 15, 2006, 12:38:36 PM »
Play the attached sim in 2.42.4

Animal minimalis just dies out

This sim illustrates some of the bizzare shot bugs

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #2 on: May 15, 2006, 03:00:45 PM »
Quote from: Elite
Play the attached sim in 2.42.4

Animal minimalis just dies out

This sim illustrates some of the bizzare shot bugs
First, thanks for the sim.  I've taken a look and found several things.

The first is a bug.   MaxVelocity is not saved to or loaded from sim files.  The setting will be whatever it was from the previous sim run.  This is a real bug.  I had been doing some testing eariler with virgin installs where you install 2.11 and then lay 2.42.4 on top of it.  In such cases, MaxVelocity gets set to 0 adn since it's not in the saved sim file, stays 0.  With a 0 Max Velocity, the engine correctly prevents bots from moving and thus they die out fast.

Once I changed the Max Velocity slider to something reasonable, the bots started moving and feeding and promptly dying.  This is not a bug.  The waste threshold setting in the sim as posted is set to 100 and Animal minimalis has no gene to rid itself of waste.  As soon as waste crosses this threshold, random values start getting written into the bots memory and quickly they do something stupid which kills them.

I could not run the sim for very long even after I increased the waste threshold because (and this is another real bug) sim files seem to store absolute path names instead of relative path names.  The bots were feeding and killing off the veggies and as soon as they killed the veggies off to a certain level and the engine needed to load some more veggies, it looked for the veggie bot file in the path indicated by the sim which does not match my install.

I will fix the Max velocity issue and the sime file path issue in 2.42.5.

If there are "bizarre shot bugs" illustrated by this sim, I'm too dumb to see them.  I suspect that what people may think are problems with shots, etc. may in reality be do to death by altzheimers due to waste buildup.  Certainly one would expect bots with no waste elimination gene to die rather quickly in a sim where the waste threshold is set to 100.

Elite, I would be interested in knowing whether you still think there are issues in this sim with shots once you set the waste threshold to negative 1.
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #3 on: May 15, 2006, 03:09:15 PM »
As a postscript, it's not clear (to me at least) why altzheimers is as fatal as it is.  This is something I will look at I.e. to understand exactly how bots die from altzheimers.
« Last Edit: May 15, 2006, 03:09:51 PM by EricL »
Many beers....

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #4 on: May 15, 2006, 03:23:13 PM »
Ah yes, you are correct. I set my waste threshold lower and the bots survived quite nicely  

EDIT: Oops, I meant higher
« Last Edit: May 15, 2006, 03:24:20 PM by Elite »

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #5 on: May 15, 2006, 03:29:09 PM »
Ok, here's the shooting bug

A single fixed bot in the centre of the screen fires at a veg. It's shots hit the veg but the energy shots that the veg returns don't reach the shooter bot.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #6 on: May 15, 2006, 04:14:42 PM »
There was a routine that I modified back in 2.36 that set returned shots to have the same speed, duration and energy (not *.nrg type enrgy) as the incoming shot.

Prior to that they were all fixed values.

Sounds like it has gone out of whack in 2.4.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #7 on: May 15, 2006, 06:06:48 PM »
Figuring out the math for returning shots is somewhat difficult.

You want it to have the maximum liklihood of finding the eating bot.  You would expect a bot moving at constant speed firing at a veg moving the same speed to feed successfully.  This took alot of work, but here's what I ended up with.  It would be good to check and see if this is how the VB version is handling it:

Returning shot's velocity = colliding bot's velocity - shooting shot's velocity / 2

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #8 on: May 15, 2006, 07:13:17 PM »
Quote from: Numsgil
Returning shot's velocity = colliding bot's velocity - shooting shot's velocity / 2

This is the essence of the problem.  When shooting at a stationary bot, the returning shot's velocity will be half of the velocity of the incoming shot.  Since range is the number of cycles the shot lasts, this means that the return shot travels only half as far in it's lifetime.  

I have remedied this by doubling the "range" of returned energy shots.  Per the formula above, their return velocity from stationary targets will be half that of the incoming shot, but they will last twice as many cycles.
« Last Edit: May 15, 2006, 07:14:12 PM by EricL »
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #9 on: May 15, 2006, 07:31:14 PM »
Note that there is an additional issue of much smaller magnitude (nerdly vector math pun intended).  Whereas regular shots begin their journey right at the edge of the firing bot's radius, the starting position of a returned shot is presently specified as the position of the incoming shot at the end of the cycle where the impact of the shot on the bot was detected.  But of course, this is not the actual point of impact - it happened sometime during that cycle.  The actual point of impact is somewhere back along the shot's trajectory.   The faster the incoming shot is traveling, the further it will have penetrated inside the target bot during that cycle.  Thus, at present, returning energy shots start from somewhere inside the bot, not at the edge of the bot.  How far inside is a function of how fast the incoming shot was traveling.

The good news is that I think the shot collision routine takes into consideration shots which pass all the way through a bot in a cycle, either through the edge on a glancing shot or right through the meat of small bot (though it appears it may not take into consideration the target bot's own velocity when determining shot collisions, only the taget bots position at the end of the cycle).  So, for glancing shots, return shots may actually start from outside a tagetted bot or for small bots, even behind them!!!!
Many beers....

Offline Sprotiel

  • Bot Destroyer
  • ***
  • Posts: 135
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #10 on: May 15, 2006, 09:18:19 PM »
Quote from: Numsgil
Figuring out the math for returning shots is somewhat difficult.
Not really: the only difficult part is to understand that it's a fairly simple kinematics problem, and that's physics not math.

The shot is fired with a velocity V_shot* relative to the bot, so its velocity in the standard referential is V_shot = V_bot + V_shot*. In the target's referential, the energy shot should be fired back with a velocity V_back' = -V_shot', with V_shot' = V_shot - V_target and V_back' = V_back - V_target. Therefore,
V_back = 2 V_target - V_shot

Assuming neither bot accelerates during the exchange of shots, back in the bot's referential, we have:
V_back* = 2 (V_target - V_bot) - V_shot*
which means that if the bot matches velocity with its target everything's just as if both bots were stationary.

Edit: clarification.
« Last Edit: May 16, 2006, 09:03:36 AM by Sprotiel »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #11 on: May 15, 2006, 10:21:05 PM »
Sprotiel,

It could be just me, but you've lost me in the derivation   As to the final equation, remember that shots don't get to "know" information about the bot that shot them the cycle they hit another bot.

The only information you have to play with is the velocity of the shot and the velocity of the hit bot.

Eric:
I actually had a question about this like two weeks ago.  Basically you can set up a quadratic equation and solve it with the quadratic equation to find the time of impact, and from that the location of impact via pos(t) = pos + vel(t)

This is the link I found.
« Last Edit: May 16, 2006, 09:49:59 AM by Henk »

Offline Sprotiel

  • Bot Destroyer
  • ***
  • Posts: 135
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #12 on: May 16, 2006, 09:14:52 AM »
Quote from: Numsgil
It could be just me, but you've lost me in the derivation   As to the final equation, remember that shots don't get to "know" information about the bot that shot them the cycle they hit another bot.

I've clarified my post (I hope). The bottom line is just that the expression we should use is V_back = 2 V_target - V_shot

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #13 on: May 16, 2006, 10:44:28 AM »
When I get back home from vacation I'll plug it in and see what I get.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Got bots that behave differently in 2.37.6 and 2.42.4?
« Reply #14 on: May 16, 2006, 11:56:05 AM »
It works, but there are issues.   I was mistaken, bot/shot collision detection DOES NOT take into consideration shots which pass completely through the target bot during the cycle.  The faster the shot (and the smaller the bot) the higher the probability that the shot will not actually be located inside the bot at the end of any specific cycle but will have rather passed completly through it during the cycle, particularly when the shot is off-center.  In such cases, no collision will be detected.  Since Sprotiel's formula speeds up return energy shots relative to what is in the code at present, this dramatically increases the probability that bots will not receive the returned energy shots even when they hit them.  Perhaps this is why you slowed down retruned shots in the first place Nums, I.e. so that they would have a decent chance not only of getting impacted but of having this impact detected.

As someone who has not studied the history of shots, I find the whole concept of returned energy shots a little strange.  What exactly are we simulating here?   Energy chunks of bots being shot off?  Why then do they fire back towards the firing bot as opposed to scatterring in a more realistic, semi-random real-world explosion fashion?  This strikes me as neither a simulation of a real-world phenomenon nor a cyber-effecient artifact.  Since bot's can't see shots, whether the bot gets the retruned shot is purely probabilistic today and thus encourages conservative bot-target ranging behaviour (whether evolved or designed) which attempts to increase this probability by reducing relative changes in velocity while shot feeding.   If we wanted to insure bots got the energy when their shot hit a target, it would be trivial (and computationally faster) just to give the firing bot the energy at the point when their shot hit the target bot instead of dealing with returned shots at all, so I assume that the probabalistic nature of returned shots is desired for some reason.  I expect that the plan was someday to make shots visable, thus requiring shot feeder sophisication not only in aiming shots but in manuvering to capture released energy.  But until that day, things are kind of half pregnant in my opinion.  But I digress...

The issue with shot/bot collision detection needs to be fixed.  Num's ray/circle intersection algorithm looks like a good start but what we really need is a ray/cylinder interesction algorithm since the target bot may also be in motion.  Even that is not exact since it does not take into consideration motion during the cycle (I.e. the shot ray may intersect the bot cylinder, but the bot may not have been at that location in the cylinder when the shot was there or vice versa).  I'll be working on this for 2.42.5, but if you have a good algorithm for this, please let me know.

The issue with where the return shot starts from, whether from the edge of the targetted bot or the position where the shot that caused it is at the end of thet cycle is important, but not critical in my opinion.  As the code stands, on average, returned shots will start their return journey from inside the targetted bot at a depth of 1/2 of the distance the original shot travels in a single cycle (modulo the collision detection problem).  This is significant, but given the probablistic nature of retruned shots, not as critical as the collision detection thing.
Many beers....