Author Topic: A couple of bugs in 2.48.8c  (Read 2981 times)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
A couple of bugs in 2.48.8c
« on: November 07, 2006, 04:41:17 AM »
I have a sim here where ties are getting extremely long and veggies getting clumped together. It says there is 1000 veggies in the sim but it doesn't look like that at first glance. If you zoom in and look closely to some of the veggies you will see why. I don't think it has been addressed in your two latest buddy drops.
The internet is corrupt and controlled by criminally minded people.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
A couple of bugs in 2.48.8c
« Reply #1 on: November 07, 2006, 10:36:03 AM »
First of all, let me just express my thanks for the bug report.  It's specific, it includes a sim, it specifies exactly the version used and lays out the suspicious behavior concisely.  Bug reports are so critical to making the code better and I just want to stop and say that I very much appreciate the work that goes into reporting these.

So, here's what is happening.  It doesn't appear that there are 1000 bots in the sim, but as you noticed, there really are, they are just piled exactly on top of each other.  How is this possible given there is brownian motion in the sim and a coefficient of elasticity that should separate them?  Because the bots are fixed (I think they evolved the code to fix themselves) and the moving shapes are 'sweeping' them into the low spots, the corner intersections of multiple shapes as they move.

Fixed bots present a problem for moving shapes.  What should happen when an immovable object meets an irristable force?  What I do currently is move the bot only as far as necessary to get it out of the shape that cycle, so each cycle bots get swept along and pile up.  Since the bots are fixed, other forces like Brownian motion and the elastic repel force due to their overlap has no effect.  We could decide to change this so that fixed bots actually respond to some subset of forces, but today the only thing that can move them is a shape (or a teleporter).

The long ties are a related issue and here there is indeed a clear bug.  The moving shapes are separating fixed, tied bots.  I mistakening short circuited the code that checks for excessive tie length for fixed bots for performance reasons on the presumption that two fixed, tied bots wouldn't be moving.  Obviously, I missed the case where moving shapes move the bots (teleporters assume tied bots are part of the same organism and teleport both, or all N tied bots).  I will address this problem shortly.

Again, nice bug report.
« Last Edit: November 07, 2006, 10:36:48 AM by EricL »
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A couple of bugs in 2.48.8c
« Reply #2 on: November 13, 2006, 03:30:23 PM »
Here's my solution to colliding fixed objects:

Here's a heirarchy for collisions.  Objects higher in the heirarchy can't be moved or have their momentum changed by objects lower in the heirarchy:

1.  The border of the world if torroidal is off
2.  Shapes
3.  Fixed bots
4.  Bots
5. Shots

Objects on the same level (two fixed bots) can collide (say, if they were swept by a shape or had their radii increase until they overlapped) and react to each other.

This requires collisions to be implemented as a constraint instead of a spring though.  Basically calculate the minimum distance two things need to be from each other to only just be touching, and "warp" both objects there, changing objects' momentum as necessary using the coefficient of restitution.
« Last Edit: November 13, 2006, 03:31:03 PM by Numsgil »