problems with loadingLevel?

Discussion about the provided sample agent.

problems with loadingLevel?

Postby Sergio » Wed Oct 15, 2014 9:46 pm

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
Sergio
 
Posts: 8
Joined: Fri Apr 18, 2014 9:53 pm

Re: problems with loadingLevel?

Postby Gary » Wed Oct 15, 2014 10:12 pm

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
User avatar
Gary
 
Posts: 11
Joined: Tue Mar 19, 2013 7:14 pm

Re: problems with loadingLevel?

Postby Sergio » Fri Oct 17, 2014 7:03 am

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 83881 times


Thanks. Cheers :)
Sergio
 
Posts: 8
Joined: Fri Apr 18, 2014 9:53 pm

Re: problems with loadingLevel?

Postby jrbitt » Fri Oct 17, 2014 9:32 am

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!!
jrbitt
 
Posts: 2
Joined: Fri Oct 17, 2014 9:21 am

Re: problems with loadingLevel?

Postby jrbitt » Fri Oct 17, 2014 11:00 am

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
jrbitt
 
Posts: 2
Joined: Fri Oct 17, 2014 9:21 am

Re: problems with loadingLevel?

Postby Jochen » Tue Oct 21, 2014 1:15 am

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
User avatar
Jochen
 
Posts: 86
Joined: Tue Mar 19, 2013 10:36 pm
Location: Canberra, Australia

Re: problems with loadingLevel?

Postby Sergio » Wed Oct 22, 2014 7:09 pm

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.
Sergio
 
Posts: 8
Joined: Fri Apr 18, 2014 9:53 pm


Return to Naive Agent

Who is online

Users browsing this forum: No registered users and 1 guest

cron