ScratchAgarioBots / agario-bot

An AI designed to take less risks and have the highest possible odds of survival.
MIT License
13 stars 2 forks source link

Food clusters #49

Closed matthewr6 closed 9 years ago

matthewr6 commented 9 years ago

find major clusters

an-OK-squirrel commented 9 years ago

I don't really feel like this would be good to merge. For me, it toggles from whereever it's going to a random point with no food, which makes progress slow. I don't know why this is happening.

matthewr6 commented 9 years ago

How often does that happen? I've noticed it, but it never seemed to happen much and that's never what killed it. Also, I think the mega food cluster implementation balances that behavior. I'd like it if someone else looked into that as well, but it may just be an issue of lag or the functions we didn't write, as the nonexistent clusters (which is what those random points are) always disappear in a few seconds. If needed, though, I can implement the food clusters into master from a different branch, which may or may not fix the problem.

an-OK-squirrel commented 9 years ago

I'd like for you guys to do the "using buffers for <100"

matthewr6 commented 9 years ago

I'll try that tonight if I have time

an-OK-squirrel commented 9 years ago

Okay. I still can't get over 50

an-OK-squirrel commented 9 years ago

And I can't see what the robot is thinking (which I use a lot for testing)

Znapi commented 9 years ago

It loaded for me, but alternating where it is going every frame is a problem. If the direction to the food is the opposite of the random direction, it just ends up sitting there.

an-OK-squirrel commented 9 years ago

Exactly.

Znapi commented 9 years ago

The problem stops if you remove the else-if in lines 977 to 984. Something must be wrong with the condition you are testing, because it isn't doing what it is supposed to.

matthewr6 commented 9 years ago

Remove that if/else for now, then. It's one of the only parts I haven't tested

Znapi commented 9 years ago

Should we turn back on enemy buffer rendering?

matthewr6 commented 9 years ago

What do you mean?

Znapi commented 9 years ago

You have buffer rendering commented out in this branch

Znapi commented 9 years ago

Here: https://github.com/ScratchAgarioBots/agario-bot/blob/food-clusters/bot.user.js#L762 And some filtering function is commented out there too.

an-OK-squirrel commented 9 years ago

Okay

Znapi commented 9 years ago

Idk, maybe we should leave the filter function commented out. I left the bot running for a while an it's highest score was 105. It was doing better without it for me.nvm, this whole time it has been doing good with the filtering on.

Znapi commented 9 years ago

Should I push a commit and merge with master? It is working great for me right now(or it is just the server). I got to 230, and to 630 earlier because someone hit a virus and put themselves in a corner.

an-OK-squirrel commented 9 years ago

I'm gonna try one more time

an-OK-squirrel commented 9 years ago

Bot gets 30 points, other one almost always gets >50...

Znapi commented 9 years ago

I got to 230 again, and right now I'm at 182. What is the "other one"?

an-OK-squirrel commented 9 years ago

master

Znapi commented 9 years ago

Maybe I should try a different server. The one it is in right now is kinda empty.

an-OK-squirrel commented 9 years ago

OK

an-OK-squirrel commented 9 years ago

Ok, what happened?

Znapi commented 9 years ago

It got ~40 twice, then 204. Master is in a slightly more empty server and is at 265.

Aww, it just hit a virus.

an-OK-squirrel commented 9 years ago

See? Master is better.

Znapi commented 9 years ago

Testing this is so hard. In some servers it is constantly surrounded, and in others it has the whole level to itself. Master got 65, now it is at 305

an-OK-squirrel commented 9 years ago

Servers are always busy for me.

Znapi commented 9 years ago

Hit a virus at 484. Should I make a commit anyways, but not merge yet?

an-OK-squirrel commented 9 years ago

Sure, i guess. I just feel that it would be best to keep using buffers..

Znapi commented 9 years ago

I don't know what is wrong with the super clusters. Maybe it is prioritizing them too much over closer, minor clusters?

I'm going to go for now.

an-OK-squirrel commented 9 years ago

BAI

I'll merge after someone does https://github.com/ScratchAgarioBots/agario-bot/pull/49#issuecomment-118065034

matthewr6 commented 9 years ago

Finished it. Thinking about taking out mega clusters or moving them to a lower priority, or even having them activate after a certain size (maybe 100?)

an-OK-squirrel commented 9 years ago

Still not a good as master right now.

matthewr6 commented 9 years ago

So what's the difference? It's just as good as bufferless right now, if not better, and we have to keep moving even if it temporarily gets worse.

an-OK-squirrel commented 9 years ago

Maybe it's a problem with the superclusters

Znapi commented 9 years ago

How are we defining super clusters? Clusters of clusters?

Znapi commented 9 years ago

Part of our problem might be is that when it goes for a cluster/super cluster, it doesn't always pick up all of the food in it. It might pick up one, and then leave, making the long trip to get to the cluster pointless.

It also got to 272, then went off in a random direction and got eaten.

an-OK-squirrel commented 9 years ago

Remove superclusters

matthewr6 commented 9 years ago

Huh, thought I did. Must not have pushed it up.

Znapi commented 9 years ago

I think you did. I am playing with it and I had to uncomment the superclusters.

matthewr6 commented 9 years ago

Yeah, I did https://github.com/ScratchAgarioBots/agario-bot/blob/food-clusters/bot.user.js#L950

Znapi commented 9 years ago

We should make it so that when it goes towards a food cluster, it picks up all of the food in it by going all the way to the center, and when it goes to a super cluster, it should go to each minor cluster in it one at a time.

matthewr6 commented 9 years ago

The thing is, once half a minor cluster disappears, the cluster itself is not a cluster anymore.

Znapi commented 9 years ago

That is the problem we need to fix. It needs to go all the way to the center, and ignore how the cluster changes. It needs to remember these things inbetween frames, so we should declare some variables outside of findDestination. Maybe one variable that stores the location of the next minor cluster it is going to, and then for major clusters, another variable that is an array of minor cluster locations in the next major cluster it is going to.

matthewr6 commented 9 years ago

Maybe merge this first? :P I'll start a new thing tomorrow or Sunday, probably

sorry, I've been busier than I thought I'd be :L

an-OK-squirrel commented 9 years ago

Me too :L I don't see why we need to merge though.

matthewr6 commented 9 years ago

To get it into master...

an-OK-squirrel commented 9 years ago

Then make a backup branch :P

Znapi commented 9 years ago

What does this have that is different from master? Everything is commented out.