Author Topic: Torroidal Trouble 2.43n RESOLVED 2.43p  (Read 4850 times)

Offline strangers

  • Bot Neophyte
  • *
  • Posts: 37
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« on: October 27, 2007, 02:41:57 PM »
I haven't checked this in 2.43o, but in 2.43n in non-torroidal sims my bots dissapear off screen.
I was using standard F1 conditions with torroidal turned off.
« Last Edit: November 03, 2007, 01:25:09 PM by EricL »

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #1 on: October 28, 2007, 01:38:41 AM »
Yeah, I just noticed that too.  I don't think they disappear, I think they just go off visible field for a bit and then come back.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #2 on: October 28, 2007, 10:06:56 AM »
Try unlocking the screen and zooming way out.  Do the bots disappear or are they just going out of the arena?

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #3 on: October 28, 2007, 11:54:42 AM »
Where is the option for unlocking screen? I saw it somewhere, but now can't find it.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #4 on: October 28, 2007, 01:49:41 PM »
It's in the top toolbar.  It looks like a padlock.  When you unlock the screen, it'll look like an unlocked padlock.

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #5 on: October 28, 2007, 06:05:34 PM »
Thanks.  Yes, they just go out of bounds for short periods of time. Usually it's a small bot being pushed out by a large bot.  They do come back though, so I don't think this is a serious problem.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #6 on: October 28, 2007, 07:47:48 PM »
It's an artifact of the way the physics engine works.  The arena isn't a hard constraint.  It's more like the walls are made of rubber.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #7 on: October 28, 2007, 09:02:48 PM »
A recent perf change I made is calling attention to this.  If the center of the bot is outside the visible portion of the field, I don't display the bot even if part of it should still be visible.  This helps perf, primarly when zoomed in, but it also has the side effect of making bots whose center crosses the edge seem to disappear when the field is locked and zoomed all the way out.

I could change this in a generalized way, but there would be a small perf hit to do the math for every bot every cycle when zoomed in arbitrarily.

What I think I will do unless someone has strong objections is special case the locked zoomed all the way out mode and check center + radius in that case only.
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #8 on: October 29, 2007, 09:21:12 AM »
This shouldn't be too hard to fix in the general case, I did it once for the C++ version I believe.  Are you organizing the bots in any way?  Like in a grid?

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #9 on: October 29, 2007, 12:16:09 PM »
It's not hard.  I just don't want to take the perf hit when zoomed.  Every little bit helps...

There is no positional bucketization code for bots in the VB fork presently.  I may end up adding one for the Egrid, but right now, it doesn't exist.
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #10 on: October 29, 2007, 01:32:13 PM »
I don't mean to lecture, but this strikes me as an instance of premature optimization.  What sort of perf hit are we talking?  1%?  Less?  When you say that a feature will create a slight perf hit, most people probably imagine something like 3 to 7 % slower.  If it's in the 1% to less range, I'd call it a negligable perf hit.

Right now you're probably doing a point vs. axis aligned bounding box collision test, right?  When you probably want to be doing a circle vs. axis aligned bounding box collision test.  How many extra calculations are required?  I think it's on the order of maybe double for a naive test.  Maybe less with a sophisticated algorithm.  Maybe the SAT.

Of course, it all takes time to implement, so if implementation time is the deciding factor instead of perf hits, that's another matter entirely.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #11 on: October 29, 2007, 01:51:14 PM »
Its four additional additions and comparisons per bot per cycle plus the drawing hit.  The total imapct on perf is certainly less than 1% so it's not a big deal, but every little bit helps.  Do people really care that they can't see bots that are more than half off the screen when zoomed?  If people really care, I'd be happy to fix it generally.
Many beers....

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #12 on: October 29, 2007, 04:19:10 PM »
I don't really care. Rubber borders work for me, and I don't usually keep track of particular bots to be troubled by their disappearance. And even if I did, I could always unlock the edges and see everything.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #13 on: October 30, 2007, 12:16:45 PM »
Quote from: EricL
Do people really care...


Nope.    Especially if it reduces performance, even just 1%. It may be too much when my sim is down to 0.1 cycles/sec.
The internet is corrupt and controlled by criminally minded people.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Torroidal Trouble 2.43n RESOLVED 2.43p
« Reply #14 on: November 03, 2007, 01:08:45 PM »
Fixed in 2.43p.  I fixed this in a general way.  In all cases, zoomed or locked, all parts (skin, aim, etc.) of a bot are displayed for any visible bot,  even those only partially visible.
Many beers....