ermiyaeskandary / Slither.io-bot

Just for fun and AI. Written in Javascript, this is a project which the aim is to make a computer play against humans inside a human-driven game, which is in this case Slither.io. The goal is simple - try and make the snake live and get as long as possible.
Mozilla Public License 2.0
193 stars 124 forks source link

Custom oef (reduce food glow and other zoom maintain) #311

Closed tjorim closed 8 years ago

tjorim commented 8 years ago

Description

Create custom redraw() for foodglow, this modifies the standard one.

Remove the foodglow as suggested by @pllsner in #310 , the issue is also stated in #236 . Since this modifies the redraw()-function, the zoom is altered as well instead of calling an extra function on each redraw.

TESTING STAGE

Current bot (develop and master is the same):

I have let a few bots run overnight, all scores where put in an excel-file where I did some quick statistics. I ran 4 bots: master, develop and 2x the custom_oef branch.

Map1.xlsx <-- Here are the results!!!

Both master and develop branches have the same bot code, you can see that the results differ a lot. This is just to demonstrate that 2 running bots can have totally different scores.

Types of changes

tjorim commented 8 years ago

:+1: I would say :smile:

Approved with PullApprove

ChadSki commented 8 years ago

Alright! Excited to see this change get in. I will test tonight!

alexzeit commented 8 years ago
  1. The current zoom is not stored for the next game after respawn.
  2. Suggestion: set the same one collor for all food (b=per_color_imgs[number])

I have tried to set one collor for all foods in the same way but without success, could you have a look on this:

var original_newfood = window.newFood;
var original_newfood_string = original_newfood.toString();
var newfood_string = original_newfood_string.replace(/per_color_imgs\[e.cv/gi, 'per_color_imgs[10');

window.newFood = new Function(newfood_string.substring(
newfood_string.indexOf('{') + 1, newfood_string.lastIndexOf('}'))); 
ermiyaeskandary commented 8 years ago

100% approved! Looks great and after (not alot of) testing, it doesn't seem to have an influence on performance - after all, it should be improving it anyway Great job @tjorim ! Approved (edit: forgot)

Approved with PullApprove

ChadSki commented 8 years ago

:+1:

Approved with PullApprove

tjorim commented 8 years ago

@alexzeit That's already in the script somewhere.

Seple commented 8 years ago

Please add a standard "master" code

ChadSki commented 8 years ago

We need more approvals! @OneEyed @chancity @MattDuffin @Drflash55 @ErmiyaEskandary @Evanito @FliiFe @K00sKlust @j-c-m @clemens-tolboom

FliiFe commented 8 years ago

Approved :+1:

Approved with PullApprove

Evanito commented 8 years ago

:+1: Looks good to me!

Approved with PullApprove

ermiyaeskandary commented 8 years ago

Approved (forgot otherwise I had approved it long time ago ;))

ChadSki commented 8 years ago

Nice work @tjorim, thanks for landing this feature! :tada:

HamishBlank commented 8 years ago

Performance has dropped severely after this merge. Windows 10 Firefox 47 with greasemonkey

FliiFe commented 8 years ago

@HamishBlank Can you try with the commit right before the merge to confirm this is the issue ?

Le mer. 29 juin 2016 00:19, HamishBlank notifications@github.com a écrit :

Performance has dropped severely after this merge. Windows 10 Firefox 47 with greasemonkey

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ErmiyaEskandary/Slither.io-bot/pull/311#issuecomment-229201749, or mute the thread https://github.com/notifications/unsubscribe/AIVeIfTbedtkAegEa-mxPcgiDdLyEeZ-ks5qQZ3-gaJpZM4I8l1k .

HamishBlank commented 8 years ago

commit 420e562 is the commit right before, and screen goes completely blank edit: except for the background

commit 0e3a1b4 the one before 420e562 performance is back to normal without issues

HamishBlank commented 8 years ago

working fine in Google chrome 51.0.2704.103 tampermonkey windows 10, only a slight/very minimal difference between 0e3a1b4 and latest

ChadSki commented 8 years ago

Dang, I tested in Chrome and didn't catch this. :P

Opening issue #315 to track this.