Page 1 of 1

problems with loadingLevel?

PostPosted: Wed Oct 15, 2014 9:46 pm
by Sergio
Hi all,

I've found a problem with loadingLevelSchema, where we can find the next code:

...
for (int k = 0; k < 15; k++)
{
proxy.send(new ProxyMouseWheelMessage(-1));

}
...

The problem lies with " ProxyMouseWheelMessage(-1) ".
I have tried the naive agent about 2-3 weeks ago and it worked. Then, I decided to do an agent by my own, but when I tried it, I found out that it was blocked. The instruction Actionrobot.loadLevel(currentLevel) was the end of that algorithm, doing nothing. I tried again the naive agent and I found the same problem (so fullZoomIn and fullZoomOut neither run). Despite of that, if I use the mouse wheel, I can zoom in/out manually :S

Does someone have the same problem as me? Maybe It's a problem with my laptop, but I still dont know.

Thanks :D

Re: problems with loadingLevel?

PostPosted: Wed Oct 15, 2014 10:12 pm
by Gary
Dear Sergio

can you please open the chrome console ( tools -> javascript console), execute a few mouse wheel actions in your code, and check if the ProxyMouseWheelMessages are received by the chrome.

Smile
Gary

Re: problems with loadingLevel?

PostPosted: Fri Oct 17, 2014 7:03 am
by Sergio
Hi Gary,

I've tried it, and the problem shown is:

Uncaught TypeError: undefined is not a function script.js:122
mousewheel script.js:122
sock.onmessage script.js:41

mousewheel problem.png
mousewheel problem.png (509.73 KiB) Viewed 74129 times


Thanks. Cheers :)

Re: problems with loadingLevel?

PostPosted: Fri Oct 17, 2014 9:32 am
by jrbitt
Hi Sergio
I have the same problem since monday. I'm professor and my students have created bots for evaluation. We submited in last friday everything right. In monday, I tried to used to correct the projects and problem in wheel message :(

For my console:

Message received: [8,"mousewheel",{"delta":-1}] script.js:33
Uncaught TypeError: undefined is not a function script.js:122

Thanks!!

Re: problems with loadingLevel?

PostPosted: Fri Oct 17, 2014 11:00 am
by jrbitt
Sergio I resolved!

In script.js in plugin folder change mousewheel(data) for

Code: Select all
function mousewheel(data) {
        var delta = data['delta'];       
        var canvas = $('canvas');
        var evt = document.createEvent('WheelEvent');           
   evt.initEvent('mousewheel', true, true);
   evt.wheelDelta = delta;      
        canvas[0].dispatchEvent(evt);
}


I uninstall the old extension and installing again. Until now is ok :D

Re: problems with loadingLevel?

PostPosted: Tue Oct 21, 2014 1:15 am
by Jochen
Yes, it seems Chrome has been updated and some commands removed. Thanks for pointing it out!
The solution jrbitt suggested (thanks!) seems to be specific to certain Chrome versions.

Gary and Peng have implemented a new version of the Chrome extension that should work for all Chrome versions and all OS.
You can download it here: https://aibirds.org/basic-game-playing-software.html

We called the new version 1.32, but only the plugin has been changed.

Please let us know if it works without any problems.

Regards,
Jochen

Re: problems with loadingLevel?

PostPosted: Wed Oct 22, 2014 7:09 pm
by Sergio
HI all =)

Thanks. Version AB1.32 works properly on Ubuntu 14.04 - new chrome version. I could see this is not the first time that updating chrome some commands have problems.
I was trying your solution jrbitt (I'm an student researching algorithms applied on videogames now :D ) and it hadn't worked for me (just partly). It didn't zoom in/out (on my laptop), but it recognized your function without problems, so it kept working as if it zoomed in/out and it could find the pigs that we could see without applying that zoom, completing some levels. I tried to solve it too but I hadn't had successful results :/

Now in this new version all is ok (as far as I could check). Thanks a lot ^^

Regards.