Slither.io-bot icon indicating copy to clipboard operation
Slither.io-bot copied to clipboard

Avoid circling by other snakes

Open hnphi opened this issue 8 years ago • 15 comments

First , I want say the current script is fine and very good. But, i need some code detect when my snake be attacked ( surrounded by other snake ), some code let snake chasing its own tail. (not Defense Mode)

Sorry about my English. :)

hnphi avatar May 26 '16 08:05 hnphi

We currently do not have circling avoidance in the master branch but there is in the A* OLD branch, if you want to look at anything...

ermiyaeskandary avatar May 26 '16 12:05 ermiyaeskandary

Complex changes to the AI have been attempted... for now we are sticking with the simple circles-based approach.

However, feel free to attempt the feature! We're open to experimental/development branches with AI improvements.

ChadSki avatar May 28 '16 02:05 ChadSki

Are you sure it's that complex? How about checking if a snake covers at least 180 degrees, and if so, aim at that snake's tail?

Another thing is that since around 90% of the deaths are caused by another snake circling you, it seems strange that this issue should have low priority.

EDIT: I guess the number is closer to around 50% of the deaths.

kmatheussen avatar May 30 '16 14:05 kmatheussen

@kmatheussen Recently changed labels - changing them now...

EDIT : Have a go at it and we'll be happy to merge it if approved !

ermiyaeskandary avatar May 30 '16 19:05 ermiyaeskandary

I have tried the old branche but it seems not to work. i only get a black screen. How can i add this to let snake go in round to not die when they try to circling me?

77656233 avatar Jun 05 '16 09:06 77656233

@ChristianGrieger ...

ermiyaeskandary avatar Jun 05 '16 09:06 ermiyaeskandary

@ChristianGrieger Should be fixed now - install bot.meta.user.js and it be fine. CONFIRMED WORKING

ermiyaeskandary avatar Jun 05 '16 09:06 ermiyaeskandary

I will try thank you :) what is the differense to old and new bot? Is it less good? Can we get in contact in skype i have a question for another simular game a bot would ne cool for?

77656233 avatar Jun 05 '16 11:06 77656233

Okay i tested it :) now i understand why its an old branche :/ So the new version is much better and i really hope this feature gets added soon to be enabled because snake dies really often if someone try to get qround it. But thanks for the update.

77656233 avatar Jun 05 '16 11:06 77656233

If someone circles you, you are still most likely to die, even with the defence mode. If a snake cricles you close enough, the only thing it has to do to make you die is to go in another direction. The snake bodies are not set in a fixed position, they move a little bit depending on the angle it is pulled.

kmatheussen avatar Jun 05 '16 11:06 kmatheussen

But if you hold the circle a bit bigger and you run behind your own tail it can work or not ?

77656233 avatar Jun 05 '16 11:06 77656233

I'm not sure. I think it may be simpler to avoid getting circled than to try running in a circle though. Not that it should be too difficult try to run in a circle either, but you have to decide how big the circle you want to create should be, and while doing that you have to make sure you don't bump into something while creating the circle. Detecting when getting circled, and getting away from it, doesn't seem so hard to implement, but I haven't tried.

kmatheussen avatar Jun 05 '16 11:06 kmatheussen

Okay so i have to wait for that get added :)

77656233 avatar Jun 05 '16 14:06 77656233

@ChristianGrieger Yep - hence why this issue is open and has the prio:important label ;)

ermiyaeskandary avatar Jun 05 '16 14:06 ermiyaeskandary

But if you hold the circle a bit bigger and you run behind your own tail it can work or not ?

@ChristianGrieger No, the body of a snake does not stay exactly where you traveled (unless going in a straight line). Turning and curving pulls the body of the snake tighter. Even if you retrace your tail "perfectly", you will gradually draw a tighter circle.

Of course, if you draw things out and make the attacker circle you for a long time, they might slip up and die, or get distracted by other food.

ChadSki avatar Jun 06 '16 05:06 ChadSki