« first day (6 days earlier)      last day (37 days later) » 

12:45 AM
Could you translate [botColour, 0, floorColour][Math.abs(botColour - floorColour)%3] into English, please? — Nic Hartley 41 mins ago
I have no idea how to do that
 
1:02 AM
0
A: Art Attack KoTH

MnemonicClever Name function(myself, grid, bots, gameInfo) { // Parse the arguments. let myId = myself[0]; let myX = myself[1]; let myY = myself[2]; // Check each square to see if it's a good target. let targetX, targetY, targetDist = Infinity; let numAtDist; for (let x ...

 
1:48 AM
0
A: Art Attack KoTH

Conor O'BrienHumble Paint Salesman // Humble Paint Salesman function(myself, grid, bots, gameInfo) { let [id, x, y] = myself; // if first move if(gameInfo[0] == 2) { this.size = grid.length; this.mid = this.size / 2; this.dx = x < this.mid ? "right" : "left"; this....

 
 
2 hours later…
3:33 AM
0
A: Art Attack KoTH

kenorbSmart Ant V1 function(myself, grid, bots, gameInfo) { // Assign variables. let name = "Smart Ant V1"; let [mc, mx, my] = myself; let [rcurr, rmax] = gameInfo; let min = 0, max = grid.length-1; let left = "left", right = "right", up = "up", down = "down", wait = "wait"; ...

 
 
3 hours later…
6:18 AM
0
A: Art Attack KoTH

Jo.GiveMeSpace function(myself, grid, bots, gameInfo) { var firstchoice = {up:-1,down:-1,left:-1,right:-1}, nearestblank = [9999,-1,-1], currdist, i, j; function dist(a,b){ return Math.abs(a[1]-b[1])+Math.abs(a[2]-b[2]); } function finalcolor(a,b){ return Mat...

 
7:16 AM
D: entries modifying the this of functions don't work in my controller and i have no idea how to make them
oh wait they _do_ work, just that games by some reason start at round 2
and entry cares about that ಠ____________ಠ
 
7:49 AM
0
A: Art Attack KoTH

user1502040DFSBot function(myself, grid, bots, gameinfo) { my_id = myself[0]; my_x = myself[1]; my_y = myself[2]; delta = [[0, -1], [0, 1], [-1, 0], [1, 0], [0, 0]]; seen = Array(grid.length).fill().map(() => Array(grid.length).fill(false)); scores = Array(bots.length + 2).fill(0);...

 
@BetaDecay you should've probably put some speed limits in place, ^ is taking 40ms/turn :|
now a 50 game tournament doesn't take minutes. It's one game that does
ignore me what
oh it's the latest bot whose color isn't randomized
 
 
1 hour later…
9:09 AM
I was thinking a bit of antisymmetry would mix it up a bit - currently if bot 1 can overpaint bot 2 then bot 2 can overpaint bot 1 and they can get stuck in a paint loop. Maybe if the bot 1 can overpaint bot 2 then bot 2 should erase bot 1 instead?
 
@Neil that makes bot 1 have a huge advantage over bot 2
 
@dzaima right, but bot 2 has that advantage over bot 3, and bot 3 has that advantage over bot 1
so if bot 1 kills bot 2, then it dies to bot 3
also in dzaima.github.io/ArtAttack/… lots of bots get stuck, does that mean their ai is bad?
 
@Neil in the center, ¯\_(ツ)_/¯ is DQ'd and hunter is stuck on trying to destroy it. No idea what's happening with NearSightedGreed though.
for fun to see how badly can targeting be I made TBTKTBTPTBCBINAPCBINATBTPTBCBINAPK that tries to destroy TBTPTBCBINAP specifically. It itself doesn't do that good but it does bring TBTPTBCBINAP down in some games (though not as many as I hoped it would :/)
 
9:28 AM
hmm, how do I debug a bot? My rewrite keeps getting disqualified but I don't know why
 
@Neil disqualified from not painting enough or erroring?
in both controllers you're able to use console.log (though in mine, with strange stringifying which I'm gonna remove at some point), what I do is spam it everywhere I can think of problems existing.
oh, also you can add a debugger; somewhere in your function which will start the JS debugger if devtools are open
 
well, I assume erroring, but how do I find out what the error is?
 
@Neil in both controllers erroring results in the game being stopped (no bots move at all). The reference will put you at the erroring place if devtools are open (at least in chrome), mine will log botname errored: with the entry & error message.
 
ok maybe it's not erroring
but it keeps pausing on turn 1 anyway
oh, the stop button is actually the pause button
 
10:21 AM
@BetaDecay If I console.log(gameInfo[0]); it starts at 2. Why is that?
I'm hardcoding my bot into the botdata.js file. Do I need to change anything in the controller?
 
@HeinWessels because turnNumber starts at 1 and is incremented before execution in the controller.. I found that annoying as well
wait that makes the disqualifying happen 3 rounds in (instead of the advertised 5) too ಠ_ಠ
 
@dzaima Oh, I see. I'll fix that now
 
@BetaDecay beware that there are entries which already depend on that fact and will error upon changing it
 
I won't fix it then
 
well the spec does say where roundNum is the number of the current round (1-indexed)
 
10:34 AM
But if it breaks current answers, there's no point in changing anything without causing havoc
 
really all that would need to be changed is Humble Paint Salesman's if(gameInfo[0] == 2) {
it's the answers fault for not following the spec
 
I see.
It's fixed now
 
Just make sure to notify the HUmble Paint Salesman
 
 
1 hour later…
12:01 PM
Okay, so the controller now has the option to update the bots directly from PPCG
I'll work on adding a tournament mode next
 
12:19 PM
0
A: Art Attack KoTH

tomsmedingEuclid function euclidFn(myself, grid, bots, gameInfo) { const W = grid.length, H = grid[0].length; const meIdx = bots.findIndex(b => b[0] == myself[0]); const meClr = bots[meIdx][0]; const botIdToIndex = {}; for (let i = 0; i < bots.length; i++) { botIdToIndex[bots[...

0
A: Art Attack KoTH

tomsmedingMC function(myself, grid, bots, gameInfo) { const W = grid.length, H = grid[0].length; const meIdx = bots.findIndex(b => b[0] == myself[0]); const meClr = bots[meIdx][0]; function copy2D(a) { return a.map(l => l.slice()); } function paintValue(gr, x, y, clr) { ...

 
argh so many bots that are extremely slow D:
 
Why are they so slow?
 
@BetaDecay they're testing many many possibilities and finding the best one
 
DFSBot is apparently doing some kind of depth-first search (didn't analyse the source, just going by the name and the existence of a search function :p); my MC is doing some simulations
 
DFSBot tests ±11^4 outcomes from the couple seconds I spent looking at it
for Jim I keep the expensive calculations at long intervals so on average it's fast. The 42, 27 & 15ms time/move of the last 3 bots makes any optimizations I do irrelevant though :/
@tomsmeding nope, still erroring
you need to check that grid[x] isn't undefined before doing [y] on it
 
12:35 PM
ok so 1. thanks for helping me fix my fails
but 2. what the hell why would grid[x] ever be undefined
 
oh ignore me
 
oh
I'll do some testing myself :')
 
or maybe it doesn't error and I didn't properly refresh page?
 
¯\_(ツ)_/¯
 
50 games with it, Jim & 3 other bots finished just fine, I'll assume I just didn't refresh properly :|
 
12:40 PM
yay!
 
meh i'll just test my bot without the 3 time-hogs & let Beta Decay deal with his 10000 games :p
 
are you using the gist controller or the one on github.io?
 
@tomsmeding I'm using mine
it's probably not 100% spec conformant but otherwise it's pretty nice for bot development
 
boy that one is like 20x as nice as the github.io one :p
 
@dzaima Which ones are the time hogs? I think I might add a blacklist option
 
12:46 PM
@BetaDecay the latest 3 - MC, Euclid & DFSBot
 
12:58 PM
euclid should be a bit faster now
 
1:15 PM
oh yay I've refreshed the page of my controller enough times that now I'm blocked from the SE API for 3.2 hours :P
 
1:33 PM
Nice! I was wondering what the rate limit on that was...
 
added thing where hovering on an entry in the table points to them on the board
 
1:57 PM
```
VM229:24 Uncaught TypeError: Cannot read property 'NaN' of undefined
at scoreOf (eval at <anonymous> (controller.js:62), <anonymous>:24:31)
at Object.func (eval at <anonymous> (controller.js:62), <anonymous>:165:7)
at runBots (controller.js:101)
at doStuff (controller.js:310)
```
Line: `score+= scoreboard[cx][cy];` of scoreOf()
This is the error when running on the beta site.
After loading all bots.
 
@kenorb that'd be my bots fault, pretty sure
oh found the problem. It's a quirk of how my controller works vs the official ones this setting :|
@kenorb fixed, may take a bit for SEs API to clear cache
 
I feel so dirty eval-ing code downloaded directly from the internet
 
Seems to work now.
 
yay
 
2:45 PM
for 20 distinct colors i created an array from https://sashat.me/2017/01/11/list-of-20-simple-distinct-colors/:
var CSS_COLOR_NAMES = ["Red", "Green", "Yellow", "Blue", "Orange", "Purple", "Cyan", "Magenta", "Lime", "Pink", "Teal", "Lavender", "Brown", "Beige", "Maroon", "Mint", "Olive", "Coral", "Navy", "Grey", "White", "Black"];
better as hex:
var CSS_COLOR_NAMES = ['#e6194b', '#3cb44b', '#ffe119', '#0082c8', '#f58231', '#911eb4', '#46f0f0', '#f032e6', '#d2f53c', '#fabebe', '#008080', '#e6beff', '#aa6e28', '#fffac8', '#800000', '#aaffc3', '#808000', '#ffd8b1', '#000080', '#808080', '#FFFFFF', '#000000'];
 
oh woooow I only just now noticed that the map displayed in my controller is actually the transpose of the reality (up goes left, left goes up, ect)
 
My Hunter-Killer bot seems to be doing better with a bigger board. Probably because I no longer kill all my targets :P
@dzaima Your tournament is ranking bots based on the number of squares painted, but the rules say that it's number of wins that matters.
 
3:01 PM
@logicBV heh I went to add those to my controller and turns out that the colors already there that I was overwriting with random colors were actually that list :|
 
seems like we googled similarly then
 
@Spitemaster I know, but in those 50 games wins only probably isn't enough info to gain much info about the results, and scores give way more info for development (which is my controllers purpose)
oh nope im an idiod
 
@dzaima that's not really a problem, so much, since all the mechanics are the same :p
just for debugging that becomes interesting
 
3:26 PM
Some of the bots here seem unable to paint over others
https://beta-decay.github.io/art_attack/
 
which ones
 
The blue one arrived later than the grey one
 
yeah
I see it too
 
That is intended.
 
what?
 
3:28 PM
The new colour is [botColour, 0, floorColour][Math.abs(botColour - floorColour)%3]
 
but the formula
exactly
 
I don't get it
 
So if botColour is 6 and floorColour is 4, it's not painted over
But if botColour is 4 and floorColour is 6, it should paint white
 
ohh
sad
 
"This formula is made so as to allow a bot to move over its own colour without repainting it."
 
3:31 PM
@Spitemaster white? it still shouldn't be painted over, as |a-b| = |b-a|
 
Wow, I'm a dummy
 
^ that doesn't make sense
 
Forgot about the Math.abs() bit
 
too much code golf... needed to condense borderline down to
function([, x, y], grid, bots, gameInfo) {
    let l = grid.length - 1;
    // Move anticlockwise around the border
    if (!y && x) return "left";
    if (x == l) return "up";
    if (y == l) return "right";
    if (!x) return "down";
    // Find the nearest border and move to it
    return x + x <= l ? "left" : "right";
}
 
@Jonathan it does other strange things if the color moved on wasn't the bots color
 
3:34 PM
But the explanation doesn't explain it
 
@Jonathan if the distance from the color below the bot and the bots color (aka ID), mod 3 is 0, the floor is overwritten by the bots color. If it's 1, the floor gets colored white. If it's 2, no painting is done
 
IMO a bot should just always paint where it moves right?
 
@Jonathan no
@Jonathan there's the [botColour, 0, floorColour][Math.abs(botColour - floorColour)%3] which I've humanified above
 
Ah ok
Ok so much for my pattern mover bot idea
 
 
1 hour later…
4:49 PM
@dzaima I don't know if you realized, but you're not reading the pastmoves and nowmoves correctly. Both times you are returning pastmoves. And, I hope you don't mind if I steal your way of storing of positions :P
I'll show credit ;)
 
5:09 PM
@HeinWessels nowmoves is a temporary variable, pastmoves is the only thing kept trough rounds. Its only purpose is update localStorage.pastMoves, so the pastMoves variable doesn't include the current move
and that thing should probably be rewritten with storing at this.pastMoves and not using stringifying
wait why am I even not storing the current position in it, only thing affected would be 'wait' which shouldn't ever be called (except if above color 0)
oh god my controller has this refer to the same thing for all submissions D:
 
oof
 
 
2 hours later…
7:07 PM
0
A: Art Attack KoTH

MnemonicKneecapper function(myself, grid, bots, gameInfo) { let [myId, myX, myY] = myself; // Figure out who's doing well. let targets = bots.map(bot => bot[0]).filter(id => (id !== myId) && (Math.abs(id - myId) % 3 !== 2)); let flatGrid = [].concat.apply([], grid); targets = target...

 
I find it interesting how many bots here are more refined versions of some component of Jim
 
7:37 PM
0
A: Art Attack KoTH

Nick DechiaraBoxer function(myself, grid, bots, gameInfo) { let val = gameInfo[0] % 21; if(val < 3){ return "right"; }else if(val < 6){ return "up"; }else if(val < 9){ return "left"; }else if(val < 12){ return "down"; }else if(val < 14){ return ...

 
7:47 PM
Boxer crashes, but I don't have the rep to comment.
Specifically, s is not defined (line 14 column 13)
 
8:08 PM
0
A: Art Attack KoTH

SamYonnouNumerologist function(myself, grid, bots, gameInfo) { let myCol = myself[0]; let myX = myself[1]; let myY = myself[2]; function getScore(x) { let score = 0; for (let i in grid) { for (let j in grid[i]) { if (grid[i][j] == x) { score++; } }...

 
@Spitemaster thanks for the heads up, think I fixed it
 
No problem :)
I'm wondering if the board isn't getting too big
https://dzaima.github.io/ArtAttack/artattack.htm#G%CE%BEvFo%CE%BC%CE%B3xF3B%CE%B12%CF%88mNRW%CF%86AE
This game ends with Euclid having 941 points, nearly half the number of moves
Perhaps we should change the board size to 2*bots?
 
8:28 PM
@Spitemaster I think it's too late to change something like that now
All I could do is increase the number of rounds per game
 
Perhaps. I'm not certain if it would obviously favour or disfavour any bots, and I don't think anyone has built a strategy that depends on the board size.
 
8:53 PM
0
A: Art Attack KoTH

Hein Wessels(Annoying) LittleBrother This little bot is like any little brother. It will latch on to you, and mirror your every step. Like your little brother would jump onto your footsteps with his over-sized boots. But he will only follow you if he can annoy you. He is your little brother after all. This...

 
9:03 PM
@HeinWessels your bolding of the name seems to make the reference controller fail to load it (because it parses HTML with regex :P)
also round === 0 should be round === 1
 
@dzaima What's the K-S in that table?
 
@tomsmeding "distinctness from next-highest entry (two-sample Kolmogorov-Smirnov test)" is what the tooltip on it says
 
9:22 PM
it intrigues me that you have exact 0.0% and 100.0% values if that's the case
but maybe I'm misunderstanding the test
or are you comparing the amount of wins?
 
@tomsmeding no, scores
@tomsmeding I have no idea what's the test either (it often stays at 0 and at some point starts rising up quickly - maybe the lower bound is less than 0?) but all I care about is that 90% is a big number :p
now that there are ~4 bots with the purpose of destroying other entries, I think it's finally time for me to make a bot that targets bots which seem to target bots
 
and the lower bound should definitely be zero, not less than zero, because you're taking the maximum of some absolute values of differences :p
compared to this text, are you dividing D_{n,m} by c(alpha) sqrt((n+m)/nm) ?
or are you doing something else
 
@tomsmeding I didn't make the test, it was in the koth framework
 
ah right
 
and either way it's been replaced with the Mann-Whitney U test, I'm just too lazy to pull that
 
9:30 PM
Q: If the color formula is Math.abs(botColour - floorColour)%3, then if the floor is color 2, and bot got uid 2 as well, the floor should stay the same, but Math.abs(2 - 2) % 3 returns 0, what I'm missing?
 
@kenorb the [botColour, 0, floorColour][...] part
the 0th element of that being botColour, which is then painted (over the same color, resulting in no change)
 
@dzaima so much for trying to do statistics :p
 
Ok, I think I get the syntax now, thanks.
 
@kenorb, it's [list][element number], meaning "from the list, pick the element number element number (starting with 0)".
 
So I think the only explanation why my bot is painting its own floor white, is most likely I got another bot at exactly same spot and it's doing exactly the same moves so I got stuck in a loop, since it's trying to repaint it over and over again. Pretty weird edge-case.
 
9:41 PM
That indeed would be a pretty weird case. Note that two bots in the same spot unconditionally paint the square white.
 
Yep, conflicted with M.A.D.S., I could see the same coords when checking console.log(botData);.
 
@BetaDecay you should probably note in the post that the bots array will skip disqualified entries because otherwise it's easy to assume that bots[color-1] will give the bot with the wanted color
 
10:13 PM
@dzaima thanks for the heads up. I forgot to check for eliminations. Will a bot not be eliminated if the following is true: bots[i].length>2 ?
 
@dzaima Okay, yeah sure
 
@HeinWessels the bots array will simply not have the entry (aka bots.length will shrink)
 
This looks awesome. Is it intentional that the total area of the grid increases with the square of the number of players? With a fixed 2000 rounds per game I'd expect that to lead to less meeting of bots the larger the grid gets. — trichoplax 41 mins ago
I should change it to size = Math.ceil(Math.sqrt(botData.length))*3
 
@BetaDecay that'd mean a bot is on every 9th cell and the whole board can completely change in 9 frames
@HeinWessels to get a bots position from its id/color you'd have to do bots.find(([id,x,y])=>id==wantedColor)
 
@dzaima Which coefficient would you suggest?
 
10:24 PM
I'd suggest aiming for a number of squares per bot - say, 49. In that case the formula would be:
size = Math.ceil(Math.sqrt(botData.length))*7
 
@BetaDecay I feel like a board with 20 players by the current formula looks decent, which turns into a coefficient of 180
(oh, that coefficient is for botData.length - size = Math.ceil(Math.sqrt(botData.length*180)))
really I feel like the round count should equal the amount of cells, but the games with all bots are already extremely slow
 
10:46 PM
@BetaDecay looking trough DFSBot I noticed that there's no way to get the biggest ID in any way other than going trough the whole grid (or storing it at the games beginning), as the bots array will shrink (that seems a worse and worse thing the more I think about it, disqualified really should've been another parameter for bots in the array)
 
Get the biggest ID? But you can't control the ID
 
@BetaDecay it's useful for creating an array in which the nth element is some thing you want to store for bot ID n
DFSBot creates a scores array of length bots.length, and then, going trough each cell, does scores[grid[i][j]]++; to get the score of every bot
Jim v1 did the same thing (though I am now noticing that I never initialized the array, resulting in all scores being NaN ಠ_ಠ)
though I suppose the spec doesn't say that the IDs are all adjacent, they could be billions
I should really go to the sandbox more ಠ_ಠ
 

« first day (6 days earlier)      last day (37 days later) »