« first day (1 day earlier)      last day (26 days later) » 

00:08
Only two more bots!
Going to dinner, though
00:52
1373 lines of bots and controller functions...let's test it!
01:25
Okay, Execution.js in github has all bots included. Time to run one execution...
 
4 hours later…
05:09
I tried to run you latest controller. But there seems to be many issues. Many of the bots are buggy. I removed them, but still controller seems to be buggy as well.
The botvariable in botNotes.storeData and botNotes.getData tends to be undefined and cause errors.
After I fixed that and ran the game for a few hundred rounds, it looks to me that the controller is not giving any points for coins and doesn't change coin locations
For example, looking at botData, my bot is sitting on [ 18, 5 ] for a long time and its coins are always at 0, looking at coinLocations, it is stuck on this for a long time: [[ 3, 11 ],[ 6, 19 ],[ 3, 21 ],[ 18, 5 ],[ 22, 9 ]]
 
5 hours later…
10:02
@Night2 Could you link to your version of the controller with these fixes?
10:20
My fixes were just ignoring errors in botNotes with try/catch and removing bots that caused errors so I could run the controller. When I saw controller is buggy in other places, I just discarded it.
Alright, so the problem with botNotes was that getData and storeData should be using caller.index instead of just caller (and getData should use its own name to get the caller)
But that still leaves an issue when the bots use an inner function to call storeData or getData
because the inner function is the caller in that case, so the code can't figure out what the bot is
(it could try calling the caller if caller.index returns undefined, but there's hopefully a better less hacky solution than that)
11:06
@RedwolfPrograms I think the coins being stuck at 0 problem, that @Night2 mentioned, is solved by moving the ` while (arrayIndex(coinLocations, b.loc) !== -1)` loop to go inside the for loop that comes after it
Also, maybe the for loop for (n = 0; n < dat.length; n++) {(that comes after "//if three+ bots in same space") should use dat[n] and push[n], instead of i?
(Both of these are based on a cursory look and trial & error though, I haven't tried to figure out what all of it does.)
@OMᗺ Thanks for letting me know! I've deleted the original Katamari bot anyway (since it was pretty much a reimplementation of yours), but I've updated the two other bots that used the same code (Katamari with Values and Damacy)
@RedwolfPrograms Could you take into account the updates I've mentioned above ^ when running the bots?
 
1 hour later…
12:38
I'm aware of a few problems, but thanks for letting me know of the rest. I'll fix these when I get back in around an hour.
@Sundar They should be easy to fix, so I'll fix them and debug the bots once I get back
13:20
One option for the data storage is to modify each bot to send three arguments: its own name, the key, and (when necessary) the value
Idk if you've already solved it though
13:35
I don't think that's necessary.
Plus, it adds the "I still accessed (Someone else's) botData" loophole
How'd you get it working then?
I'm not very familiar with javascript
Well, if Sundar is right, it's a few simple errors I made
I put a code for the bot in a property of the function, but forgot to access it.
@Sundar yup, they were pretty simple issues. Of course, the 2 parts of the controller I didn't get around to testing have the most errors...
I'm going to debug the bots now. Wish me luck...
Wait...deleted Katamari?
14:01
@RedwolfPrograms It was the same bot as Greedy, just in a different language and with a different name
Oh
Potentially Victorious just potentially jumped off the board. And it did.
What?
That's interesting.
(0 <= x < me.arenaLength) returns true always
Why is it so?
I'm not even sure. But all I know is it does
14:08
x is not the position of the bot but the position where the potential is calculated. So in theory it should work OK.
I'll do some debugging in the TIO. Is the finalized controller published?
But any numbers in (n <= n < n) always returns true
The finalized controller?
Oh wait, let me go publish that
The version without bugs.
By the way, thank you for that expression. I was so used to it.
But JS has obviously problems with this kind of comparison.
If any x <= y < z returns true.
I tried (x < 0 || x >= me.arenaLength || y < 0 || y >= me.arenaLength), but it still seems to head north at [0,0]
Hm... I will really need to have a look at it in the TIO. Maybe JS doesn't know that Infinity is larger than every other number? :—)
It's getting NaN as x and y vars
14:14
Well, that baffles me completely.
I haven't the slightest idea where any NaN could come from in there.
I'm checking something
But this is an interesting test!
Whoops!
About half of it was me testing it with the wrong controller, the other half was the bot.
It works well now that I switched (n <= n < n) and used the most updated testing controller
@Ramillies Fixed
Okay, got a South/
That's a good thing. (At least if it gave South anywhere else than on the southernmost boundary of the arena :—))
I tested it in the TIO and it luckily won't get off the arena too.
Good
I'm making progress debugging. I
am at The GUT
14:23
I wish you luck with that. I think it should have been called the Euler-Lagrange bot.
It seems to always return none, even when a way more powerful bot is right next to it
:—D
The GUT is thinking that the first parameter is an array.
It's not.
I have my work cut out for me, fixing this bot
x_acceleration = NaN
y_acceleration = NaN
You guys hate numbers
Don't you think bug fixing every bot might be a little above and beyond the call of duty?
I wanted to ask the same thing.
14:33
Well, I need practice, and it's important that I run a bunch of functional bots
It's no fun if they don't work
Normally, anybody organizing KotH will just tell the buggy bot that it has this and that bug, and the people fix that for themselves.
Problem is, by the time they see the message and fix it, I could have already done it, right?
Right, but you could be doing different things in the meantime.
Unfortunately, I have nothing else to do
and it's kind fun
kind of fun
You could tell everybody which bugs they have and come to collect the fixed bots the next day. But of course if you want...
then the people will surely be glad that you fixed it for them.
14:35
The GUT seems to have no idea what to do when it has no coins
That is because all of its decisions are made according to the value k = coins of something to grab / its own coins.
Apparently spreading NaNs through the whole system like mad.
Yeah
Once it gets it's first coin, it functions
Ramillies to fix this problem in my proton bot I used Math.max(1,own coins)
I'm going to let the owner fix that
I notified him in the comments.
14:39
Yeah, I just fix bugs (Not complete mistakes in the formula)
Well, I just use -k / (r + 1/5) in order to circumvent that.
(in the other place where there is a potential division by 0)
Math.max(0.1, me.coins) works fine for this
but I won't fix it until @BetaDecay does
Yeah. Everybody has their own view on that. I, for instance, don't think that the division is the right thing to do here, so I would abandon it completely.
BetaDecay acknowledged the comment, so he will be probably fixing it soon-ish.
Damacy is casuing errors already
You need to let everyone know about their bugs
14:44
Oops, it's because botNotes wasn't updated in time
Otherwise, when they update their bots, you will have to fix same bugs again!
@BetaDecay While your at it, me[0] should be replaced by me.locationX and so on
me[1] should be me.locationY
me[2] should be me.coins
and finally, me[3] should be me.arenaLength
How about others
And coins?
14:46
They're fine
There you go
The GUT looks like it's doing fine, I'm now testing @Sundar's Damacy
How's X marks the spot?
Do you want me to convert it to JS
Already did. I haven't tested it yet, though.
But you might want to fix the me[3] type errors on that one, too
Damacy seems to love south
Some bots even have debug codes to output to console
14:54
@RedwolfPrograms It's in Python though
Don't you have the translation?
Oh, yeah. NvM
Sorry
It's fine
Your arrayIndex function seems to be not working
arrayIndex([1,1], [1,1]) returns -1
Actually it seems it always returns -1
That should be OK, no? Try arrayIndex([1, 1], [[1, 1]]). That should give 0.
(from a quick skim of the code yesterday)
But he is using it like this: arrayIndex(coinLocations, b.loc)
And b.loc = [x,x]
It is not [[x,x]]
Anyways, arrayIndex([1, 1], [[1, 1]]) still returns -1
15:06
Well, then it should be arrayIndex([[1, 1]], [1, 1]).
I just tried in TIO and it gives correctly 0.
It tries to find an array in an array of arrays.
And -1 if does not exist
Alright, this one works
But why isn't it giving any bots on top of a coin the points?
Damacy is fine
You all have such different styles of formatting...it's cool, because you can almost tell whose bot is whose by just looking at the code
I just wonder whether Damacy doesn't try to eat more powerful bots too.
Hmm, I guess we'll have to see
15:11
I did a couple of 1vs1's with it and Damacy always gets eaten by me. (In one case, we have eaten each other.)
Huh
Well, that's an actual issue (Not a bug)
But now I tried again and it has eaten me!
I wonder how that happened.
LOL
How many ms are your rounds?
@Ramillies, how are you testing it when the controller is not working?
That shouldn't have been ever possible :D.
2e4 steps.
15:13
Do I have the wrong controller?
I updated the Github
Well, I just grabbed one from the link in the OP.
So if that one is broken, then I'm doing the testing on a broken one too.
Execution.js
15:14
That one is broken
Controller.js isn't
I use the Controller.js and fill in the bots as I want.
I'm debugging Execution now
(I don't need free for all anyway.)
OK, I saw the bot codes in Execution.js so I though that is the complete one
I'm going to test with Controller.js then
My complaints were all about the wrong one then! Sorry!
That's the intent I guess. I'm just copying the bots from the thread as needed.
15:15
@Night2 It's fine
I've been getting mad at people for having lots of bugs
then relaizing that I'm
using the wrong controller!
Well this one still has the issue with botNotes: TypeError: bot is undefined line:1041
Execution.js still has the error, yes
I'm not getting that one...
Controller.js is not 1,000 lines long anyway
Execution.js is, though
KatamariWithValues gets my approval for actually avoiding an enemy, while not having any bugs
OK, now that I got a working controller, I can confirm that my bot is the best ^_^
After a few hundreds of runs, alive ones:

0: Object { name: "Goldilocks", coins: 20, alive: true, … }
1: Object { name: "Proton", coins: 12, alive: true, … }
2: Object { name: "TBTPTGCBCBA", coins: 47, alive: true, … }
3: Object { name: "Wild Goose Chase", coins: 0, alive: true, … }
15:20
Which one is yours, again?
The Bot That Plays The Game Cautiously But Can Be Aggressive
Oh, I liked that one
Haven't tested it yet
Well it was the first bot with a score/value/weight or whatever you call it, decision system :D
Yeah
Uh-oh, Proton forgot to add Math. in front of sin, cos, etc.
Yeah. I actually didn't notice that you were using the same system until much later than I posted mine...
15:24
@RedwolfPrograms Yeah, and soon you will find someone else who forgot to puth Math. before abs :D
Also, I shortned the name to TBTPTGCBCBA
:D
@RedwolfPrograms I see, that is OK the purpose of the long name was to be unique, TBTPTGCBCBA is still unique!
@RedwolfPrograms; your controller shouldn't be passing the dead bots to all the living ones.
It doesn't
That's weird.
15:25
It .filters them
In my testing, it does.
And Potentially Victorious gets always stuck in the NW corner because of that.
botPos stores dead bots at [-2,-2]
Really?
Yes, really.
botPos.filter(function(a){return a!=[-2,-2]})
I see that. I'm baffled once again.
I'll have to check what code am I running.
15:27
You're right, I checked and it doesn't filter anything!
It does.
But it filters the bots to which you're sending the messages.
It's because no two arrays are ever equal
They are objects acoording to JS
Aaand that doesn't help as well.
(but I didn't mean this)
15:28
I'll fix it
I already have an arrayEqual() function
Hm, actually the bug I found is nonexistent, I can't read.
I just need to Ctrl + C and Ctrl + V
So if you correct that filter, it should be OK.
Yes
Added it to Controller.js
My prediction about the non-dying bots seems to be correct
After thousands of runs, some bots keep avoiding stronger bots
And the game doesn't seem to get any end by bot terminations
15:33
Hmm, how long does 20k runs take?
In 1:1, on TIO, probably a second.
Well it depends on your hardware and software :D
Only .243 sec.
So 50 bots is probably around 25 times that
But I was doing it in steps of 100 rounds manually and then checking bot statuses
15:34
By the way, game won't end by itself.
If it is run 20k times, then the status checked, then 80k times, then tiebreaker, we should be good
Is the git updated?
In the 1:1's I'm running, usually Potentially Victorious eats the other bot around the round 2k and runs around amassing tons of coins ever after :—).
Only Controller.js
(the only question is why does the bot ever eat the other bot when it shouldn't be doing so)
(or it should, but I didn't think it would actually manage to eat anything)
21 bots, 20,000 rounds on Google Chrome took less than 1 second
But I have removed debug codes that output to console from the bots
That's insane. It won;t take 5 mins, it'll take 5 secs!
You should put a rounds limits on each game instead of time limit
Yes. 100k.
15:37
Hooray! Finally!
10,000 rounds, 20 at a time, that's [worst case scenario] 1 hour
After 20K, TBTPTGCBCBA with 59 coins is playing while "Polite Near-Sighted Drunk Bot" with 0 coins is running :D
This'll be fun
lol, I think my bot might be broken then
Maybe I should move the due date closer?
15:39
Polite Near-Sighted Drunk Bot shouldn't have 0
At least it refuses to die :P
(Hm, after 20K, TBTPTGCBCBA with 1257 has been long dead while Potentially Victorious with 26164 runs in circles.)
Is it telling you to bugger off?
Console.log is off
Aw
My Google Chrome with a 100K run is broken
Not sure what is the issue
It is eating 1 core of my CPU and is not finishing at all!
My an infinite loop is happening when only 1 bot stays alive, hmm ....
15:41
BUGGER OFF
lol
@Ramillies Is that a prediction or did you actually got this? :D
Polite NS Drunk only has so much patience
Chase it too long and you'll upset it :P
I got that.
However, I get some weird things too.
Yes, something look weird
I'm afraid that if a coin appears at a spot where a bot had died, then the dead bot collects that coin!
15:43
Yes
Safety Coin has been dead very soon
But on my run I have this:
{name: "Safety Coin", run: ƒ, coins: 5929584, ...}
I think I should wait for the final controller
In my last run, the TBTawjnkwawhatever took me out very soon (I have no idea how) and Potentially Victorious amassed 700 coins while dead!
Oops!
Dead bots collecting coins?
Sounds like...oh no.
Yeah. I think the problem is that you store the location in 2 different places.
botData[...].loc and botLocations.
No, it's the .filter array problem
where 2 arrays can never be equal
No, it's because I put the while loop in the loop of every bot
Not the other loop of living bots
I see.
15:46
We okay with 8x8 pixels for every square?
Maybe 10x10
Certainly.
If it's going on youTube, it needs to be visible
I was hoping to keep it standard so people can use sprites
:—).
15:47
8x8 or 16x16 seems to be common for sprite sizes
This will obviously not run at 20k/second, so I will not use this graphic output for the competition
Actually, the whole thing will be maybe 100×100 at the very most, so 8×8 should be OK.
That's obvious.
Yeah, the visual is just for observing behavior "in the wild"
But I would love to see a graphic version soon. Now there are some cases when Potentially Victorious gets eaten, and I have no idea why.
Actual simulations should <i>never</i> use graphics when possible
I'm working on it
Should get it done before lunch
15:48
Great!
Added b.alive part of the while loop, so dead bots don't collect coins
Uodated the github
Almost 3k views! Thanks so much!
Ben
Ben
Hello!
Perhaps 10fps? That would make the games action filled, but not too fast
Hello!
The most action happens in the first 1k rounds anyway, so 10 fps should be OK.
So around 10 minutes should give a very nice look at how the game works
Or, maybe, speed up as the game goes on
15:53
I'm planning to tweak the FPS until it looks "good"
where good is arbitrarily determined by me, lol
Maybe double the speed when you hit 1k moves
You're free to adjust it once I publish
So how long d'you reckon it'll be before we get a proper run?
15:54
We can already get a proper run, I believe
ooh neat
Ben
Ben
I'd love to see that
There are some things very dynamic, my previous 20k run was done less than 1 second, but my 1k run now is 10 seconds!
Ben
Ben
Because I don't know what this map looks like
But not all the bots are ready
The arena is a big square
Ben
Ben
15:56
Made of ASCII or pixels?
Ben
Ben
Ok cool
I'm learning so please excuse my amateur-ness
Have you thought about building a bot?
It's easy
I'm also learning as I go, don't worry about it!
Proper runs are being done even now. // @Ben: definitely go ahead and build a bot, that's the best way to learn!
15:57
I think Redwolf is too :P
Ben
Ben
No. This is like a top tier golf in my opinion
First KoTH
Hahahaha, if this is top tier, we can definitely raise the bar then!
No way. There are a lot of simple bots out there.
Except Polite Near-SIghted Drunk Bot, who drinks at the bar instead of raising it
15:58
Hey Red, what's the structure of coins again?
[x, y, size]?
Ben
Ben
Yeah. I'm just like super-way beginner because I don't know how I'd start my bot. I've been glancing at the other bots to try and rap my head around them
[[x, y, size], [x, y, size]]?
[ position of gold, position of silver, ... position of silver]
[[x,y],[x,y]]
where position = [x, y].
15:58
OH, that's why my bot is broken
I thought it was [x, y, size of coin] for each sub-array
Found the problem?
Oh, that would explain it!
Perhaps that will be the reason :—).
It's also why my display is broken, loo
Is there any reason to use let rather than var?

« first day (1 day earlier)      last day (26 days later) »