Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

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

Merged
merged 2 commits into from
Jun 28, 2016

Conversation

tjorim
Copy link
Collaborator

@tjorim tjorim commented Jun 23, 2016

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):

  • games 99
  • median 1944
  • average 4883

After these commits:

  • games 125
  • median 2810
  • average 5480

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read CONTRIBUTING.md
  • I fully understand the Github Flow and I'm merging into the develop branch , which is the default branch, and not the master branch
  • My code adheres to the code style of this project but most importantly of all to the things mentioned, which I have read, in CONTRIBUTING.md
  • If my change requires a change to the documentation, I have updated the documentation in /docs accordingly.
  • I have included the results of the test required.

Remove the foodglow as suggested by @pllsner in #236
Since this modifies the redraw()-function, the zoom is altered as well
instead of calling an extra function on each redraw.
Fix typos in custom redraw.
'gsc!=f&&(gsc<f?(gsc+=2E-4,gsc>=f&&(gsc=f)):(gsc-=2E-4,gsc<=f&&(gsc=f)))', '');
new_redraw_string = new_redraw_string.replace(/b.globalCompositeOperation="lighter"/gi,
'b.globalCompositeOperation="hard-light"');
var new_redraw = new Function(new_redraw_string.substring(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Function constructor is eval.

@tjorim
Copy link
Collaborator Author

tjorim commented Jun 23, 2016

👍 I would say 😄

Approved with PullApprove

@ChadSki
Copy link
Collaborator

ChadSki commented Jun 23, 2016

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

@ChadSki ChadSki added this to the Graphics and UI milestone Jun 23, 2016
@alexzeit
Copy link

alexzeit commented Jun 24, 2016

  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
Copy link
Owner

ermiyaeskandary commented Jun 24, 2016

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
Copy link
Collaborator

ChadSki commented Jun 24, 2016

👍

Approved with PullApprove

@tjorim
Copy link
Collaborator Author

tjorim commented Jun 25, 2016

@alexzeit That's already in the script somewhere.

@Seple
Copy link

Seple commented Jun 25, 2016

Please add a standard "master" code

@ChadSki
Copy link
Collaborator

ChadSki commented Jun 28, 2016

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

@FliiFe
Copy link
Collaborator

FliiFe commented Jun 28, 2016

Approved 👍

Approved with PullApprove

@Evanito
Copy link
Collaborator

Evanito commented Jun 28, 2016

👍
Looks good to me!

Approved with PullApprove

@ermiyaeskandary
Copy link
Owner

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

@ermiyaeskandary ermiyaeskandary merged commit 24eec6b into develop Jun 28, 2016
@ChadSki
Copy link
Collaborator

ChadSki commented Jun 28, 2016

Nice work @tjorim, thanks for landing this feature! 🎉

@HamishBlank
Copy link

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

@FliiFe
Copy link
Collaborator

FliiFe commented Jun 28, 2016

@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
#311 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AIVeIfTbedtkAegEa-mxPcgiDdLyEeZ-ks5qQZ3-gaJpZM4I8l1k
.

@HamishBlank
Copy link

HamishBlank commented Jun 28, 2016

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
Copy link

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

@ChadSki
Copy link
Collaborator

ChadSki commented Jun 29, 2016

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

Opening issue #315 to track this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants