last day (32 days later) » 

4:13 AM
1
Q: Red vs. Blue - Pixel Team Battlebots

Calvin's HobbiesThis is a king-of-the-hill contest, but instead of everyone fighting against each other, there will be two teams that compete: Red and Blue. Only one will be the winner. The team you are on depends on your PPCG user ID number. To find this, click your avatar at the top of the screen (you must be...

 
Hello!
Trying to figure out how to test without posting
 
Hey
Right.. you can't even do battles until there's a player on each team.
 
Does the meta sandbox post still work as a testing ground?
 
Yes, I was just about to say
@Sp3000 You can test your bot in the meta post meta.codegolf.stackexchange.com/questions/4954/…
Answer there and run the snippet there
Though once we get two players you'll have 6 hours to write a bot here
 
Hm, k
Well I can't minionbot until someone else posts anyway
... wait
Hm. I can't post until someone posts but if they post then they can't edit unless it's within 6 hours
 
4:33 AM
@PhiNotPi Will you be posting for this challenge/any plans?
 
I will be posting, yes.
Probably sometime tomorrow afternoon, actually.
 
Would you like a bot you can control? :D
 
Actually, yes.
I have a battering-ram strategy I've worked on on paper.
 
I'm thinking of storing my x,y in the first two chars, then the rest of the string is char pairs for each enemy I can see
Movement's entirely dependent on another user (which can be you), but if not commanded it, say, tries to run into the corner and hides
 
That makes sense.
One problem is that the order of turns in random and you might make your move before being instructed.
 
4:47 AM
Hm damn
 
The battering ram strategy involves two team members moving side-by-side.
A red just entered the room.
:(
I'll work something out.
Maybe a series of if-then instructions that can be set beforehand?
I have the feeling this challenge is more fun when answered later in the game.
 
Yeah probably, but mine can be posted early
If we can somehow work out a protocol for delivering instructions
 
Not like I'm spying or anything...
 
I'm going to bed now, but I'll be dreaming about this and will have an answer tomorrow.
We need a secret base.
 
@Calvin'sHobbies Are the disqualification settings on the sandbox post as well?
Cos I don't seem to be showing up
 
Yeah
 
It's in the dq entries at the bottom because it was edited after 6 hours
You'll have to reanswer
So yes, all the dq things work there too :P
 
Aw, ok
 
 
8 hours later…
12:52 PM
@Calvin'sHobbies Is it allowed to retrieve all player IDs from other answers?
 
 
2 hours later…
2:26 PM
And for members of the red team... we should specify the format and content of our messages, so we can communicate effectively
 
3:05 PM
@Manu How exactly? You're welcome to have specific ID's hardcoded but you can't requery them from online or something.
 
3:20 PM
Is it just me, or is messaging a bit restricted? It would be nice if I didn't have to query by specific IDs, but simply get a list of all my team's current messages. That way if we do decide on a standard format, I don't have to update my code every time a new entry is posted just to hardcode another ID.
Querying by specific is fine, too, but I'd like the other option as well.
Oh, especially since I can't edit it later due to DQ rule. Didn't see that.
So I can only use messages of those posted before me? (or those I happen to get close to at some point to discover their ID)
 
@Geobits Essentially, yes. Though I may remove or loosen the edit limit rule if people continue to find it bothersome.
 
@Geobits I'm trying to make a bot that overcomes some of those limitations.
 
K, I'm just trying to make sure I understand the limitations for sure.
I'm thinking of just ignoring messages and doing my own thing. I'll send out a ping with my current location if others are interested, but I can't figure out a good way to do serious teamwork with later entries as-is.
 
What's the longest id for PPCG?
 
@TheBestOne They're all integers in the code not strings
So does it matter?
 
3:33 PM
There's 27k users and ids start at 1 and increment, so I can't imagine there's any over 5 digits either way.
 
Oh, I guess maybe for saving
 
@Geobits Ok
 
I guess technically they start at -1 :P
 
@Geobits You could technically use an id for someone who hasn't answered yet but is expected to
Not the most certain strategy though
 
You could use classes of bots. For example {"all":{"t":enemyId}} would tell all bots to attack an enemy.
 
3:38 PM
@Cal True. Very risky, but possible.
@TheBestOne Include a position with that at the least ;)
The problem is that then you have one "interesting" bot, and the others are all boring followers. If they're not, then the coordinating one isn't interesting either.
 
{"spy":{"f":enemyId}} would make all spies search for that enemy. The advanced spies could even collaborate
with other spies and other classes of bots.
 
Maybe I just need to see some better/more bots before the possibilties open up to me.
 
I just realized that you're on the other team. Ignore all that I previously said please.
 
(removed)
 
I think a good strategy would be to pair up with just one person on your team and write complementary bots. Don't worry about the rest of the team, that's too hectic. With 2 (maybe 3) closely in tune bots you should be able to consistently take out single enemy players.
@TheBestOne Haha, I would make separate Red and Blue chatrooms but there's no way to make the private/restricted.
At least I don't think
 
3:49 PM
Yea, small groups sounds better that way.
 
@Calvin'sHobbies Ban them :P
 
Are there any Blues in here?
 
I'm blue (da ba di?)
 
I also think working in groups is a good idea.
 
So now we just find lab partners and go to work, right? ;)
Any ideas? I don't think a search/destroy group is a bad idea.
 
3:58 PM
I have an idea for an attack strategy that uses two bots.
I've worked it out on paper.
 
I'm all <s>toes</s> ears
 
It's basically that two bots right next to each other cover each other's blind spots.
They move around the map in formation.
 
Hmm. How to account for differing turn order?
 
@PhiNotPi Your blue too! We're doomed.
 
They would store current move in Msg, so they can figure out which of the pair has already moved. Then, the bots is either a leader or a follower.
 
4:02 PM
@The Oh hush, you've got good players on red ids, I looked at the KOTH leaderboards :P
Ok, sounds good.
 
Martin is red.
 
@Geobits Everyone in here (except for me) is blue :(
 
#BlueMasterRace
 
@PhiNotPi That's a good sign. But he doesn't usually participate in KOTH.
 
Both teams have a "dead" bot right now` Ismael and dieter never move (and aren't throwing errors).
 
4:06 PM
We should have a green team.
 
Wait, that would only make sense if i was red, nvm
 
Hell no, blue and proud :D
 
Way to represent your avatar colors guys
 
@PhiNotPi I should flag that post.
2
With a red flag :P
 
4:13 PM
My avatar was blue before it was cool.
 
My avatar color is the opposite of red :P
Not including the tongue.
 
Did both the previous blue bots disqualify themselves?
 
There's one active I think, but it just sits still from the run I did.
I didn't peek the code.
 
@PhiNotPi Yes
 
@TheBestOne You're only ~120° from red in the only sensible color space, not opposite :P
Color is pretty damned weird in general though.
 
4:22 PM
Then me and PhiNotPi are opposites. I should now name myself PiNotPhi.
Or maybe PhiNotPi should name himself TheWorstOne
 
@TheBestOne The "1" would make very little sense then. You'd need to update your avatar to a mirrored green version of his.
 
Is there any way to test submissions before posting them?
 
Sandbox post?
 
You could modify the fiddle.
 
The meta question was deleted.
 
4:26 PM
Ooooh, didn't see that.
I fell into a wikipedia hole starting from 'hue'. Did you know that you have blobs and globs?
 
5:08 PM
@Geobits Once a group of two consecutive pixels is formed (one above the other to protect each other) they pick an enemy and align themselves to be in the same column.
 
Or same row for those who are red
 
Then, they move upward, moving diagonally as needed to maintain alignment.
 
@TheBestOne Nobody cares about red :P
Makes sense so far.
 
Death is certain once they hit a wall.
 
Let me think about this. It sounds good, but I'm having doubts. Time to get out my graph paper and play.
 
5:19 PM
Note that the edit window has been changed from 6 hour to 8
3
I'm also working on a testable bot
 
Okay.
 
I mean place to test a bot
 
5:42 PM
Redteam: should the outer braces be removed from each JSON message? Star prefered option.
yes
no
@AdamDavis @NinjaBearMonkey @orlp ^
 
It's very tempting to arbitrarily star one of those. The response is quite anemic so far and I almost feel bad. #RedTeamApathy
 
Yeah, I'm not sure a star poll works so well
 
My message isn't setting or getting. Can anyone identify what's wrong with my setMsg?
Nevermind, I put the parens in the wrong spot.
Setting a message still isn't working.
setMsg(String.fromCharCode(vector*2+step,x,y));
 
Nit
6:19 PM
Is it okay to getMsg() from a specific ID, or can I only address players in my circle area?
 
@Nit Anyone on your team
Wherever they are
 
I don't know
I don't really participate
 
Nit
Okay, cool. I'm thinking about creating a bot that shares information to other bots, trying to figure out what my options are.
 
6:39 PM
I've added a testable bot at the bottom of the snippet. You nee to click "Reload with test entry" to include it and it is only included if it is not the empty string.
5
 
@AdamDavis Use JSON. Try to follow my schema. It will help others if we have a standard. I ran out of time for edits, so, can't change anything now.
 
I also removed the -3 vote limit.
 
@Nit You can follow my basic schema. It's an easy way and it can be easily fixed. If something goes wrong, you can try to fix it easily. With 64 bytes, you can send the informations of around 29 enemies.
@Calvin'sHobbies I think that was a good and bad decision. Good because there won't be undeserved downvotes. Bad because it might trigger favoritism to the blue team. I don't mind the limit, but I also don't know everybody to judge them and tell what they will do and how they will behave.
 
Why would it favor the blue team rather than the red?
 
His ID is odd
Or I mixed the teams?
 
6:47 PM
I'm not competing
 
I don't see what Calvin's id has to do with it.
 
The team color is assigned based on the ID
 
Right, but he's not playing...
 
I know, but there might be some crazy dude who comes here and makes accusations
 
Accusations of what? That Calvin wrecked his own game? Yes, that would be crazy.
The odds of a blue player voting down reds is the same as a red voting down blues. I'd like to think nobody's that petty, though.
 
6:50 PM
I would like to think the same...
 
(assuming teams are roughly evenly distributed)
 
They aren't
 
Right now it's 3v4, so it's not like it's heavily lopsided or anything...
 
Votes have no bearing the game whatsoever now. The number of people per team is a different issue
 
It's going to be hard to say what happens until more people participate.
 
6:52 PM
Yea, a game where it's 5 vs 15 won't be very fun.
 
Exactly!
 
Exactly what?
 
Precisely!
 
Exactly - it wouldn't be fun
 
What does that have to do with votes??
 
6:53 PM
Oh. Well if that's what you meant you should have said that instead of saying removing the vote dq would favor blue.
 
Interesting stuff will happen when "swarming" starts to develop.
 
@PhiNotPi As fun as that would be, I don't see it happening on a large enough scale to be very noticeable. Swarms are generally very similar entities, and posting a bunch of near-dupes would be boring to see IMO.
 
@IsmaelMiguel I'd really rather avoid json. Unfortunately the way the code character stuff is designed, I don't think I can pack things in as easily and tightly as I want.
 
@AdamDavis It won't be tight, but it will fit and it isn't error-prone. Errors are fixed most of the time by adding "} to the end. It is easy to implement: just read 2 chars each time and subtract 32. And you have the enemy position in the map.
@Calvin'sHobbies One great idea: add an option to only show debug messages from a single ID, instead of all.
 
None of the current entries are very good at all.
 
7:01 PM
Can everyone see and work the TEST ENTRY bot at the bottom of the snippet?
 
The TEST ENTRY works, and I just swept the floor with it.
 
@PhiNotPi Mine is just a beacon. It only kills if needed. And goes where others send.
 
@IsmaelMiguel Nah, I'm not bothering with unnecessary changes. Though you could fork the sippet and just replace if (debug) with if (debug && player.id === 123) where appropriate.
 
@Calvin'sHobbies Have you seen how hard it is to debug anything? I can't understand anything. The idea would be to only monitorize an id (if set in a textbox). The hardest was already made. Now, only limit it if necessary.
 
7:17 PM
@Calvin'sHobbies Maybe I'm crazy, but does moving diagonally actually move the pixel two spaces diagonally?
 
I don't think so. The grid is actually (128*3) by (128*3) and the bots are 3x3 pixel squares. So they move 3 screen pixels.
 
I zoomed way in on the screen and it's fine.
My suspicion was caused by a test bot that was supposed to move straight up when aligned with an enemy but diagonally if the enemy wasn't directly above. It looked like the bot was zigzagging upwards.
Meaning that it was 1pxl to the left and then moved 1pxl to the right.
But I don't think that was the case.
 
jsfiddle.net/2721hhu6/1 Version to debug a specific id
It's bugged
 
The debugging version is bugged? That's ironic.
 
Yeah, my attempt is bugged. But only after updating... It was running ok-ish before
 
7:44 PM
jsfiddle.net/2721hhu6/2 Now it isn't bugged! It shows in the console if the debug is enabled or not, what ID and only shows debug messages for that ID.
 
The challenge this chat is about: Red vs. Blue - Pixel Team Battlebots
3
 
@Calvin'sHobbies Did you updated the Javascript?
 
Only a tiny bit. I made console available for the test entry.
 
Ok, I'm finally killing others.
Looks like red is winning slightly more frequently than blue.
 
@IsmaelMiguel I only added if (player.id === -1) params.console = console after the line params.eNear = near (round line 155)
@AdamDavis Seems mostly thanks to you :P
 
7:54 PM
I wish I knew how to debug this better. Oh well - it was a fun exercise, hopefully others come along and play too!
 
@Calvin'sHobbies jsfiddle.net/2721hhu6/3 Here it is, with that line added
@AdamDavis Use the version I've changed, on jsfiddle.net/2721hhu6/3 (at the bottom, put your ID on the field and you won't see any other messages)
 
@AdamDavis It seems your guy often avoids dieter when in range. Is that intentional?
 
I tried adding debug messages to my code, but haven't been successful. Can you give me a line of code I can add that would display a debug message in the console?
On the one's I've run, I often kill dieter.
Erlik is better at killing me than I him, though.
Loovjo and I have gotten into a stalemate dance more than once.
 
Debug messages won't work actually, at least in answers. console and alert and things are shadowed and undefined. This is to prevent player messages filling up the console.
 
I thought so
 
7:59 PM
The test entry bot (bottom of the snippet) can use console.log though.
Or anything with console
 
When I reload the fiddle, it doesn't get my code anew each time. Is there a delay or time frame it uses between requests, or some other way to force it to reload all the answers?
@Calvin'sHobbies
 
It does reload them. Just sometimes I notice the SE servers take a minute to reflect the most current data.
 
Ah, ok, caching then.
Boy I love to dance with loovjo...
 
Also it might stop loading if you do too many requests. Your IP only get's 100 or 300 free data requests per day or something.
 
Ah, interesting.
Well, if I have time tonight I might fiddle with it. There's a case where chasing Loovjo into a corner makes me stop moving. Further, I'm too far away from the edges and if a blue gets stuck near the edge I never get them.
 
8:11 PM
Just be careful of the edit time limit. It already took out 2 people until I increased it.
 
8:30 PM
@AdamDavis You might want to try to use the function setMsg with the debug option on, to test your code.
Can we submit more than 1 bot?
 
@IsmaelMiguel No...that's one of the major points emphasized in the spec. "...every user may only submit one answer to this question."
 
@Calvin'sHobbies Sorry. It's just that I've realized that my bot is too stupid. It won't move when it should.
 
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.
 
8:47 PM
I know. The idea of making another bot would be to have another bot to tell it where to go. Since it moves backwards and craps out when it should move, it's pretty disapointing. I've focused too much on the communication instead of the moving and killing. And no one communicates with it! Everybody just makes up some weird way to tell what it is doing or will do.
It would be nice if there was a standard communication mode.
But, that is asking too much already.
The game is fine the way it is.
 
@IsmaelMiguel funny thing: I thought that your bot didnt move at all, then a test bot that I made ran past yours and your bot suddenly moved and destroyed mine. I was fairly impressed :D
 
@i
@cirpis The idea was that, but I made a few tests and it did NOTHING AT ALL.
@cirpis The idea is to stay still and wait for the enemy, then kill IF AND ONLY IF needed.
@cirpis It lives up to it's name: it is trully lazy
 
9:02 PM
Just autoran 30 battles. Red won 5. Blue 22. 3 ties.
@Jakube seems to be the main dominator
 
That bot always kills me!
 
haha.
yeah, the only enemy I have trouble with is Adam Davis
 
Well, if someone could implement a way to say: "stupid bot, move left", it would be good. But I guess no one will ever do that...
 
am I missing something, or is it by design that there's no way to request the list of all of your team members?
 
@Runer112 That's correct.
Geobits and I were talking about it earlier: chat.stackexchange.com/transcript/message/20881913#20881913
 
9:15 PM
@Calvin'sHobbies Can I read the message of a team-mate when he is far away? For instance if I hard-coded his ID.
Or only from the team-mates in my radius?
 
They can be anywhere.
I'll clarify that in the spec
 
O.k., thanks.
 
9:39 PM
Are eNear and tNear objects or arrays?
 
Are they modifiable?
 
Yes. Though the changes wont reflect anything anywhere else
 
10:05 PM
How will the winner be decided?
And when?
 
Please read the entire question.
 
"•Since this is not an official Stack App, the controller may stop loading answers for you if you restart it more than 300 times in a say." --> shouldn't it be 'day'?
 
I read it all over at least 5 times. Either I'm too sleepy or distracted or there is nothing saying when you will play the 100 matches.
 
"When the question settles down" which means in a week or two when no one is editing their answers anymore or anything. People seem ok without having fixed contest end dates around here.
 
10:16 PM
That isn't a very fixed date... Something like "This contest will end on 16th May (UTC time) and the winning team will be announced on the top of the question." would be pretty clear. And it is a fixed date. But I'm not your boss or anything. But that, in my opinion, would be the best thing to do.
 
11:15 PM
There seems to be a bug. A blue bot was at the bottom, y=127, and attempted to execute a diagonal move 5. Rather than staying in place, it moved sideways - ie, an illegal move for blue.
Console capture of event:
====== Red 1761 ======
(index):282 --- Moving Adam Davis [1686] ---
(index):283 position before move = (64, 126)
(index):311 Loovjo [34543] is near
(index):303 got message "29" from player with id 1686
(index):298 set message to "28"
(index):337 time taken = 0.6950000024517067ms
(index):384 move direction = 5
(index):398 ====== Blue 1762 ======
(index):282 --- Moving Loovjo [34543] ---
(index):283 position before move = (64, 127)
(index):311 Adam Davis [1686] is near
(index):337 time taken = 0.428999999712687ms
It's happened with me on the top too, where y=0. I'm next to a blue, it's their turn, and they move into me and take me out sideways.
 
@AdamDavis It's not precisely a bug. I did notice that it was possible and thought it was alright. But now I'm thinking yeah, they shouldn't be able to move in those ways even on the edges. Fixing shortly.
 
Thanks!
 
11:46 PM
Fixed
 
Thanks, it was disconcerting to see that there was a way to make them move in a direction I thought they weren't allowed to move in.
@IsmaelMiguel I would be interesting to try and control another bot, but there's no way for me to send you messages, you'd have to design your bot to read my messages and act on it. I'm guessing two people working together could do this, but it's not something that could easily be done after the fact.
I'm not sure I want to spend the time decoding the bot's message to find nearby enemies. I'm guessing that the msg doesn't change after your death either, so unless you increment a counter I wouldn't be able to tell if your information is current.
 
A players message changes to the string "X" when they die (see spec)
 
Ah, that's true. I'll have to give that some thought.
 

  last day (32 days later) »