j-c-m / slither.io-bot Goto Github PK
View Code? Open in Web Editor NEWSlither.io Bot Championship Edition
License: MIT License
Slither.io Bot Championship Edition
License: MIT License
After watching/playing several sessions trying to rescue getting circling around when in circle mode the bot should resume normal when under 5000 points
even better with your improvements... im thinking about using https://www.npmjs.com/package/density-clustering#dbscan-1 and basing the radius on the snakes radius
How do I change the delay between death and attempting to 'play' again?
Hi! On the mod page, it says press C to toggle collision modes. However, there seems to be no indicator in the HUD / index whatever you want to call it. Might be worth adding in unless the mod page got it wrong maybe...??
Also, this is my first post/thing on GitHub so sorry if I have done something stupid! I will learn XD just tell me what I did and how to do it... I probably got something wrong XD
First of all, I've clonned and only changed the following option: followCircleLength from 100000 to 5000.
Then I've noticed that when the snake enters the circle mode and it reaches something about 20k or more (sometimes 24k, sometimes 27k, maximum tested 34k), it suddenly loses the tail reference and its direction sense for a few seconds.
So it tries to recalculate its circle route but instead of search the final of the tail, it searches a point near to the head, and starts to circle mode again.
The problem is that in most of the cases, this behavior is fatal, and when it loses the sense, it colide against another snake.
This is what I could note in my tests until now, but I dont 100% sure that it's a rule. I'm following with the tests, and if I realize some important information, I'll keep you guys updated.
Is someone else noticed this strange behavior?
One proposal to implement the movement prediction, i.e. shift the bot head coordinates xx and yy in the movement direction deends on its speed. The same approach to be used for snakes heads also.
The predicted coordinates to be used for all calculations i.e. collision poins, detection etc.
I have dumped a bunch of the snake and snakes data into json while playing the game and im working on detecting when a snake is being wrapped up. is this feasible?
Proposal for bugfix:
angleBetween: function (a1, a2) {
var r1 = Math.abs(a2-a1);
if (r1 > Math.PI) r1 = 2 * Math.PI - r1;
return r1;
},
If it is, I'll implement a Predator part. It's awesome.
The bot is rather slow in gaining mass compared to manual play, So sometimes I disable the bot for a while for a bit of manual gameplay to hasten the speed of mass gain. There seems to be a bug in the bot version 3.0.1. With the bot disabled, the game lags when I boost the snake with the left mouse button. However, boosting the snake by pressing space bar doesn't cause this lag. I am able to boost like normal..... Pressing left mouse button when the bot is enabled also doesn't result in the lag...
the last update removed the circle feature that used to start at 5k mass.
oops, remove, wrong branch
It is getting harder for big snakes to survive. After a video on youtube with over 400000 views, hostile people came to the server with my three big snakes, having names like "4 millions is too much". They managed to contract all snakes and finally encircle them.
I feel that the snakes could survive if they were controlled by hand, or if the algorithm of expansion was better. Or we need a new idea.
I am trying to explain how the expansion currently works, as of cf32e79. It is sort of primitive. Maybe someone will have an idea how to make it better.
On the picture above the line BC
is the snake's body (tail), and point A
is the head. The head is moving at an angle alpha
to the body, and at a distance h
.
We try to compute where and how fast the snake can hide its head. This involves first estimating the emergency return path (pencil dashed curve).
-PI/4
, the pencil line continues straight.C
;Now we have to make sure that we can reach the point C
before any other snake can get in our way.
We look at the least distance from hostile snake heads to the point C
, and compare it to twice the length of the return path. Use this comparison to decide if we should start hiding. The factor of 2 comes from that the other snake may be accelerating.
I've been noticing the bot will sometimes recognize danger when there is not, although algorithmically partitioning the space is probably difficult...
An approximation: A quadrilateral projected in front of the snake, and if the snake itself intersects with this quad - divide the quad into fore/aft sections where the fore is in front of the snake, and the aft is past the line intersecting the quad. Any danger in the aft section is ignored. The quad could be a box (simpler), or a trapezoid.
Might have to tweak it a bit, I'm still trying to understand the bot, maybe I can help implement this when I have the time.
every time I get 3000 mass it makes itself into a scrunched up little ball and at 5000 it goes in big circles and does not care about its surroundings.
When the bot is in circle mode and gets circled (which happens sometimes), the bot circles too wide and close to the enemy and dies.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.