timeSinceDirChange bug

Jump to navigation Jump to search

timeSinceDirChange bug

Hey, I was trying to plug Druss' gun into Knight (to do some experiments using my MEA/preciseIntersection/features calculations to see if they break your gun) and I noticed something interesting in the code.

I looked throughout the wiki and found nothing about it being a known bug (and probably performance enchancing?), so I'll put it here anyway.

In the onScannedRobot() method, you override the "lastDirection" variable with the new direction value before updating "timeSinceDirChange". This causes this variable to be incremented at every scan, as you increment it if(lastDirection == direction). So, the normalized version 1/(1+2x) vanishes quickly during the round, which is probably almost the same as having weight 0 for this feature.

Not sure when you introduced this, but maybe it is worth it fixing it in the future for a possible programmatic tuning round.

Rsalesc (talk)23:13, 30 October 2017

That certainly isn't intended behaviour, and might also explain why I was never able to get much benefit from this attribute. Thanks!

Skilgannon (talk)10:55, 31 October 2017

And then that attribute serves as another time attributes ;) you may want to reintroduce it to simulate legacy behavior at some point ;)

Xor (talk)11:10, 31 October 2017