« first day    last day (31 days later) » 

12:26 AM
@AdamDavis Send a JSON message without {} around it. Then you set the key with my ID here. Then you set "a" to 0 or 1, and "m" to have where you want to go. Example: 14732:{"a":1,"m":9} (move to position 9). My code will automatically add the {} around it. It will only respect it if it detects it is safe.
1:07 AM
@IsmaelMiguel Setmsg only has one argument, I can't set a key with your ID, and looking at your code it doesn't appear you look at my messages using getmsg. setMsg is a one argument function that sets your string to the string passed in.
1:20 AM
@AdamDavis Exactly. Use JSON. But without the {} around the string.
@AdamDavis If you use setMsg('14732:{"a":1,"m":9}');, you will most likely be controlling my bot. And telling it to move to position 9.
1:54 AM
The tables have turned. I ran 100 battles: red won 61, blue 31, 8 ties.
Who got most of the kills?
I'm guessing Adam
That wouldn't surprise me
He has a really good bot, but his bot has a flaw: it won't cross half the screen...
Have you made any change to the Javascript code?
Since I've made the version to filter out the debug by ID?
I fixed the border moving issue Adam mentioned a bit ago. Nothing else besides minor changes to the html.
I've wanted to implement something incredibly basic: A textarea where all the console messages are displayed. It's really basic to implement, takes almost no time and can be done easily. You already have a really nice code for debugging, but that piece would help a little.
4 hours later…
6:05 AM
Now I know why my bot is useless!!!
`to=moves[eNear[k].y - y][eNear[k].x - x];` should be `to=moves[eNear[k].x - x][eNear[k].y - y];`
And `to=moves[-(eNear[k].y - y)][0];` should be `to=moves[0][-(eNear[k].y - y)];
(and backticks aren't working)
4 hours later…
10:30 AM
@IsmaelMiguel In chat, try indenting by four spaces
2 hours later…
12:03 PM
Is it me or the test script cannot use getMsg or setMsg ?
1 hour later…
1:09 PM
@Hit I believe the test script has a user id of -1, so you have to getMsg(-1) to get your set msg's.
Hi, I'm new to CodeGolf but this network question peaked my interest. How can I test my code before submitting? That part wasn't really clear because I am not familiar with "Stack Snippet".
I found an error in my bot this morning. Fortunately it occurs in a lower priority process than evasion and killing, so it only slows my bot down under certain circumstances.
@MarcDingena Let me do a quick test to make sure I understand how the test bot works, then I'll write a little blurb about it here.
What I do is open the full-screen jsfiddle:
Then post my code into the Test Entry textbox near the bottom left, then click Reload with test entry, and run it.
Note that the test entry has an ID of -1, so if you plan to read your own messages, you must use getMsg(-1), but when you post it as an answer to the question you'll need to use getMsg(myUserID)
You can copy my code, change myself=1686 to myself=-1 near the top, and it works just fine in that manner.
Okay, I understand :) This will be nice to play with in the weekend. Is there a time limit to submitting your bot? (Not the edit limit, just a limit until which you may submit an answer)
"When things settle down" but I imagine you've got at least a week before the contest is called. This is barely the beginning.
But I'm enjoying my bot's current position on top of the heap for now. It won't last, but it's the first time on this site I felt I could compete and the problem was interesting enough to ensnare me.
King of the hill is the lure we use to snare unsuspecting Stack Overflowers. It worked on me... I even started golfing after hanging out here long enough ;)
1:22 PM
It seems that many bots get stuck in a 'helix' towards the board's edge just before one of the colors gets stuck and dies. Surely there must be some logic that one of the bots can use to break free from this. It seems (depending on horizontal or vertical helix) that one color is always doomed to die at the border.
@IsmaelMiguel Ah, I see now. It will respond to commands from me if I'm within your near search radius. So I could wander around until i found you, then control you for as long as you are near me.
@MarcDingena It's my bot's kill method.
You "drive" them towards the board edge?
I depend on the rule that blue cannot move sideways. In the open there is always a way to evade a single bot.
But get them against the top or bottom edge and they can only evade away from the edge - not directly sideways.
If I were blue, I'd be driving them towards the sides.
Blue should detect the border coming closer sooner and do different moves based on that. But who am I kidding, I'm on the RED team! :P
Ha! Nice.
Yes, future blue bots will have to detect a drive to the bottom and evade in a manner that draws the battle to the sides.
This is why it appears in a helix - I drive towards the center bottom or center top depending on their evasion.
1:25 PM
so, red cannot move up and down, right? (uh-oh... monty python incoming)
If I can get them towards the center, they have less ability to drive me towards the side.
My bot has one huge flaw though - I only pay attention to the first enemy in the enemy list. I should be looking at the closest enemy for attacks, and I should be looking at all enemies for evasion.
Your bot just got eaten pretty easily by blue... I could tell it was your bot since it first chased a blue bot to the center of the board before plowing him into the wall... Then you took a stroll and got eaten pretty quickly... somehow. What is your bot's weakness?
And, as you've suggested, the evasion routine should look out for walls and other nearby enemies.
Red should have a commander bot, really
I'd have to watch the match. It has several weaknesses, and I just picked them off one by one until my time was up.
1:28 PM
One that gathers all other bots' information about enemies and keeps track and broadcasts in uniform format
something with hexadecimal encoding or so to preserve on character space
Reds should probably perform a "reset" and gather in the middle to get all the IDs. Then they should have a communication method to coordinate searches to reduce redundancy.
i think the very first message everyone should send (first team move only) is broadcast your own position and everything you can see in 16px radius
I spent way too much time trying to make a compact, easy communications method yesterday, but threw it out because javascript's string character encoding is like a black hole of stupidity.
that way, everyone can expect an informational message in the second move and take things from there
it's not allowed to let your bot have memory right? (other than sending a message that you read next move)
That would work as long as you knew everyone's ID, but once you submit your bot and pass the time limit, you can't continue to add IDs.
Correct, all the state must be stored in your message.
1:31 PM
64 is pretty limited to send useful info
In theory each character holds 11 bits, so there are actually 168 bytes available, but, again, dealing with the javascript unicode stuff was a nightmare.
At least you can encode XY coords
using 1 hex pair, you can give both X and Y somehow?
Dunno it sounded plausible in my mind until i wrote it here :P
000000 through 127127 can be encoded in hex 0 through 1F097.... it only saves 1 character...
but sending x and y indepentently, you can write it as 7F and 7F. as long as you omit a separator (always expect 4 chars per XY-coord) you can make it shorter?
since coords are now always 4 characters, you can trail that with an answer id (or whatever ids bots get assigned), then followed by a character separator
You can, but at this point I'm not sure it's worthwhile. Might as well use 4 characters per location, you'll still have enough space to point out 8 enemies and still have half your string space available.
so my bot's information could be 406038934, where first 2 characters are my X (64 in hex), second pair is Y (96 in hex), and the rest until a space char or comma or so is my id (38934 is my account id on this stack)
If someone figures out a better encoding method that easily and reliably stores 8 bits per character, then I'd go with that.
In theory 7 bit ascii should make it into each character and back out without a problem, but reality is painful - even if you encode it using the correct javascript functions, certain values are interpretted badly.
not sure if javascript is limited here, but can't you interpret a string as ascii to convert it to an integer?
Probably - I'm not a javascript programmer. Give me C or give me death!
it only seems you cannot ascii-encode the number '127'.... well you can but it's a "delete character"
1:51 PM
And some of the lower control characters. My bot was initially attempting to store numbers under 31 in the first character as state information, but they were almost always munged.
Red team needs a private chat :P
Yeah, I thought of that early on, but the chat system is, by design, completely public - save for special moderator rooms.
But once the code is submitted, anything written becomes public anyway.
if 64 byte message are the only method of storing information about your bot, we should at least come up with a uniform format for storing bot states. Not saying the state information should be uniform, but at least the characters in the string that are reserved for it
@AdamDavis Just so conversations don't get mixed up.
@IsmaelMiguel proposed a json package that is reasonable, though not tightly packed.
@TheBestOne That's true. I'll join a red team chat if someone creates one.
2:03 PM
so eNear is an array of objects, yeah?
I found the next big bug in mine.
Are you allowed to define functions?
nothing you make will persist though
will it work? isn't our answer encapsulated by the controller somehow?
2:06 PM
If I'm at x,y, and an enemy is as x-1 and y-2, then I move right under them into their kill zone. I expect this is symmetrical, though I haven't looked at the code yet.
nah i want to make a bubble sort function that i will probably use a couple of times throughout the code
@AdamDavis that is exactly how I watched your bot die
See stackoverflow.com/questions/7295634/javascript-nested-function for functions inside functions. It's like being able to declare a variable inside a block - a function is just an object/variable.
it went straight up and a blue px was coming down
@MarcDingena Yep. Anyone who writes a blue bot can exploit that - it's determinate.
if( AdamDavis ) { exploitMode } :(
wow, this stack exchange makes me feel even nerdier than usual
2:09 PM
@AdamDavis That's why I hate javascript.
Heh. Without examining my code for the path, I expect it's a 4 in 16 chance depending on the positioning, and in general my movement paths don't put me in that direction anyway.
i think my bot will have some kind of mode where it will find and try to single out blues but when another blue enters its radius it will abandon stalking its prey and start evading
That seems a safe strategy. Right now the blues aren't working together, but they may in the future.
Nifty - someone has finally written a C interpreter in javascript: stackoverflow.com/questions/6142193/…
Well, y'all have fun. I'll check back later today to see how things are going.

 Red Team Chat for Pixel Team Battlebots

Chat for the Red Team to Discuss Strategies for Calvin's Pixel...
@AdamDavis Hmm I did that but it won't work (using another guys script) I'll think it out at home :D
2:42 PM
Here, this code works in the test box without change - it creates a copy of my bot:
// v009
// I exist, therefore I am identifiable and have motivation
var myself = -1;
var motive = [ 4,4, 4,-1, 4,3, 3,-1,
               3,3, 3,1, 1,1, 6,1,
               6,6, 6,-2, 6,5, 5,-2,
               5,5, 5,2, 2,2, 4,2];
var killzone = [4,2,5, 3,1,6];

// Default move is to not move.  Then we consider each task in lowest
// to highest priority.  Each task only modifies the move if it needs to.
var move = 0;
var vector = 0;
var step = 0;

// Restore internal state from message
var selfMessage;
Remember to click "Reload with test entry" after pasting the code into the little text box.
Also, be aware that my code assumes Red team and sideways movement. You have to change it in several ways to make it work as a blue bot, so check the "On red team" box if playing with a red team bot, and leave it clear if starting with a blue team bot. For others it might not matter, but for some (and mine definitely) it depends on the team.
3:04 PM
@Calvin'sHobbies Could someone delete their bot, modify it, and post it as another answer?
18 hours ago, by Calvin's Hobbies
Yeah, but the first few bots are bound to be suboptimal. The point of the edit rule is to keep them like that so the team has to build on what it has. You are technically allowed to delete your answer but you can't post again without extenuating circumstances.
I hope we get a lot of time to post answers, because I really want to participate but I'm virtually always strapped for free time
3:29 PM
Can a bot kill his own teammate?
From the rules post, "Nothing happens if two players on the same team occupy the same cell."
4:21 PM
@MarcDingena There won't be an official end to this contest for 2 weeks from now at the very least.
@AdamDavis Or you can use:
var ismael=getMsg(14732);
if( ismael != 'x' || ismael != 'X' )
ismael = JSON.parse('{' + ismael + '}');
ismael = JSON.parse('{' + ismael + '"}');
ismael = undefined;

//here you process the information


//this would move me to position m


but you still need to be around, within the 16px limit.
@TheBestOne No. Plain deleting is allowed (though I don't encourage it). But posting a second answer is not allowed unless I give you permission because someone maliciously edited your post or something. The spec talks about this.
And if that does happen you aren't allowed to change your code.
4:42 PM
@Calvin'sHobbies Can we import libraries into our code?
@TheBestOne I suppose you can as long as you don't break your cycle time
What and how are you importing?
I don't know. Just a curiosity.
The basic answer is no. It's JS so importing is not exactly a thing. And most "libraries" are things like Jquery that don't really help here. You aren't allowed to make web queries.
Pasting in a complex math function (or something) found elsewhere would probably be ok (with attribution).
5:02 PM
Red team made their own chatroom: chat.stackexchange.com/rooms/22548/…
Status update: Ran 100 battles. Red won 81. Blue won 10. 8 ties.
Fire Crabs (because we walk sideways...)
9 ties I mean
All my tournaments are coming up about 80%, 10%, and 10% too.
I'm adding a kill counter soon so we can see who is doing all the work
1 hour later…
6:34 PM
The number of kills each player made is now displayed when a battle ends (works for autoruns too).
Red is clearly dominating:
Pick up the pace Blue team!
The bots by Sp3000 and I are pretty much ready. I'm just waiting for him to show up.
They are going to be super-bots.
I'm very eager to see them
You can run the meta sim to watch what they do.
Once they manage to team up, they do great.
7:00 PM
I'm looking forward to it. I've been watching it team up with existing blue team members, and it's neat to watch the coordination.
7:20 PM
Just checked, I'm on the red team
4 hours later…
11:21 PM
Just fixed "X" not being set on player death.
And if Blue wants to make a chat I'll add a link to the question
My bot has a feature where is fakes the messages of the partner if the partner is dead.
Meta also updated to latest versions (still different time limits there)

« first day    last day (31 days later) »