« first day (87 days earlier)   

9:20 AM
Hei, so I have a complicated colony bot that I'm working on and it takes time since I never used Javascript before. But also I have this little Queen-only bot, which behaves a little like Claustrophobic Queen on dope and is therefore quite erratic. On its own it works ok at the moment, but I'd like to test it against other bots that colour the arena, I suspect that it gets stuck quite often. Since my pc is VERY slow, does somebody else maybe want to test the code and give feedback?
 
 
1 hour later…
10:49 AM
@GNiklasch
I'm very impressed by your Windmill ants! I looked through the code to learn and understand, but oh my god its complex. I think I get the general idea of how it works, but I have problems understanding the CCW/Compass procedure. You know the part after your comment: "Mapping our logical to the controller's physical notion of cell coordinates:" Can you explain that to me as a noob mathematician & programmer?
 
11:26 AM
@PelleLundkvist More ant species still evolving, yeah! If you could put CQ On Dope somewhere other people can retrieve it from, I'll be happy to give it some exercise.
@PelleLundkvist re Windmill's CCW: Simple example first, consider the gardener standing next to the queen. The ant function scans the surroundings and finds a friendly queen on a corner neighbor cell. It wants to consider this as nbr cell number 0, numbering further nbr cells 1, 2,..., 7 in counterclockwise order. And it wants to think of the queen as being SW of it. This isn't how the controlled presents the view, though.
If the queen is on view[6], that's already SW. We set compass to 0, and CCW[0] is 6, so CCW[compass+0] is the controller's subscript in the view leading to the queen's cell. And CCW[compass+1] is 7, the S cell in the view, and so on around the clock, until CCW[compass+7] = 3, the W cell.
If the queen is on another corner cell, compass is again set so that CCW[compass+0] is the controller's subscript into the view for the queen's cell. And the next cell counterclockwise from the queen's cell, as seen by the gardener, is again CCW[compass+1], and so on. The CCW array is long enough (repeating with period 8) that we can do all this subscripting without having to worry about reducing the sums mod 8.
It gets more complicated when we're pattern matching and set the compass to reflect a good match we found... basically the engine tries the four possibilities, bails out when the match is too bad, and sets the compass according to the current attempt when it is good enough.
On the rails, the compass is set so the queen is south, outward is north, and homeward is south. In the shafts, down (where we're drilling) is considered south, up/homeward is north. (Arbitrarily, just to fit the "mine shaft" metaphor.)
Once the compass is set, if (say) I see an enemy at CCW[compass+3] and what to do something with the next cell to the left of that (from my point of view), that cell is CCW[compass+4]. The next cell on the right is CCW[compass+3-1]. But when doing this in terms of CCW[compass+i], where compass might be 0 and i might be 0, I can't safely subtract 1, so I add 7 instead: Next cell to the right is CCW[compass+i+7] (and CCW is long enough for this to work in all cases).
(...and want to do... silly autocorrection plus thick fingers, sorry 'bout that. :) )
 
 
6 hours later…
5:24 PM
@GNiklasch
Cool: I have the code for the jumping queen here: https://paste.ofcode.org/wZAFCtkMgUXzXDRBt5venM
 
5:35 PM
@PelleLundkvist If you want to test a bot with much more speed, Daves controller is the way to go. Some bots get disqualified on it because it forces JavaScript strict mode (don't worry about that, it only affects bad code), but otherwise it's very good
 
@GNiklasch
Thank you very much for this detailed explanation. That is so cool! Nice way to fix the rotating view! So you set the compass first to -1, to be able to set it to the orientation in line 3610... How did you come up with the number of discrepancies allowed and the weight (when calling the patterncheck function?). Did you sit down with a complete plan for all patterns, or did you change them while testing/coding?
@dzaima
Thanks, I will take a look at that!
 
5:59 PM
@dzaima that controller is fast enough for my pc, Hehe, it was beating claustrophobic queen by 5 food in the game I watched :-p, although it indeed got stuck at some yellow lines (roman ants?) and had to wait for a trail eraser to free it. But I have problems finding my queen in the zoom view, just shows a white frame with gif477 written in it. Maybe a thing with my browser...
 
@PelleLundkvist huh. The queens there are represented as (probably)emoji crowns, and yeah, finding your queen can be annoying.
 

« first day (87 days earlier)