Player movement broken on master branch?

For those having trouble installing/running the game or to report a bug

Moderator: Staff

Post Reply
User avatar
Bertram
Senior Member
Posts: 127
Joined: Fri Feb 26, 2010 3:08 am

Player movement broken on master branch?

Post by Bertram » Wed May 25, 2011 5:38 am

Hi,

Following rujasu's topic upon graphical glitch, there is also something else annoying as for now when playing:

Currently, when (trying) to move the main character with my keyboard's arrows, Claudius only move one pixel at a time and stop.
I have to repeatedly push the arrow key to make him budge.

I'm on linux debian unstable, and compiled the game from source.

I've been having the problem since Roots took up the development process again but it may have been present before that of course.

Am I the only one having the problem?

Best regards.
nemesis
Senior Member
Posts: 157
Joined: Fri Apr 29, 2011 1:53 am
Location: Sachsen/Germany

Re: Player movement broken on master branch?

Post by nemesis » Wed May 25, 2011 6:26 am

That's strange. On Windows, I do not have any problems in this direction.
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Player movement broken on master branch?

Post by Roots » Wed May 25, 2011 12:40 pm

That's.....really weird. :twitch: If you hold down the direction key, does it still continue to move only one pixel at a time? What about if you hold down the D key while moving (D makes the character run)? I've never heard of this problem and it seems like something that just shouldn't happen. If I had to guess, I'd say that there's something wrong with our input engine or maybe with your keyboard. If you hold down an arrow key while going through text in this forum's post reply textbox, for example, does the cursor continue to move around? If it moves just once and then stops, its definitely your keyboard.
Image
User avatar
Bertram
Senior Member
Posts: 127
Joined: Fri Feb 26, 2010 3:08 am

Re: Player movement broken on master branch?

Post by Bertram » Thu May 26, 2011 4:47 am

Hi,

Yes, it's weird! :huh:

I must say that my PC is a laptop perfectly working keyboard-wise for any other kind of application. I can use my arrows to play many other linux games without any problem for instance. And I'm using the keyboard arrows for any related tasks without any counter thoughts.

The movement problem is definitely linked to the game. I'll try to rip out the svn repo and check it out again in a pristine place to be sure.

The problem is that if I push an arrow key, and let it pushed, the character moves of about one, two or three pixels and stops. I have to release the key and push it again to make him do another pixel move.
I quite sure I didn't have the bug in the item or in the skills menu. Also, the battle screen seems not impacted.
The fact of using the D key just change the movement animation but the distance is about the same for each key press.

I'll tell you more about it once I've tried a pristine checkout, and make video if it still happens.
Note that I'm using gcc 4.6 and autotools to make it. Maybe I'm doing something wrong here?

Thanks for reading and best regards.
nemesis
Senior Member
Posts: 157
Joined: Fri Apr 29, 2011 1:53 am
Location: Sachsen/Germany

Re: Player movement broken on master branch?

Post by nemesis » Thu May 26, 2011 6:05 am

Hmm, that's interesting. I did face problems with GCC 4.5 in Windows, so may be it is something related to the compiler version. It didn't work until I switched back to 4.4.

Maybe you can try the same, so switch back to an older version of GCC.
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Player movement broken on master branch?

Post by Roots » Sun May 29, 2011 7:06 pm

We just had a second report of this bug occurring on IRC a few minutes ago, and this was with demo 1.0.1 and 1.0.2 (not the svn trunk). I'm beginning to believe its a bug/change in the SDL library which is causing this, because we've never seen this issue before and our input handling code hasn't been touched in years. If you see this issue, please report:

- Operating System
- Allacrost release/build (demo 1.0.2, SVN trunk, etc.)
- SDL library version



marcavis found this thread on the SDL forums which seems like it may be relevant to this situation:
http://forums.libsdl.org/viewtopic.php? ... 1505f6ee95


When I have time, I'll go through their forums and bug tracker and see if I can find any more information.



I'm also going to move this thread to technical issues, since its now a confirmed problem that isn't just a bug in the current development trunk.
Image
User avatar
Bertram
Senior Member
Posts: 127
Joined: Fri Feb 26, 2010 3:08 am

Re: Player movement broken on master branch?

Post by Bertram » Mon May 30, 2011 7:37 am

At least, I'm not becoming mad ;)
User avatar
Bertram
Senior Member
Posts: 127
Joined: Fri Feb 26, 2010 3:08 am

Re: Player movement broken on master branch?

Post by Bertram » Mon May 30, 2011 7:53 am

Hi Again,

I took the time to investigate in the input code, and I must say that I do not think that my issue is linked
to the SDL_EnableKeyRepeat compatibility question.
As the input engine is dealing only with key down and key up events to dealt with buttons states (and it's clever to do so, IMHO), I do think you're out of that kind of problems. Why?

Because I successfully went out of this problem by disabling the code dealing with the joystick buttons events:
void InputEngine::_JoystickEventHandler(SDL_Event& js_event)

Even with no joystick plugged in, my computer seems to see a virtual joystick and reset my key states.
I also remember the supertuxkart team having problems with that too, btw.

May I suggest then to separate the joystick key state handling from the keyboard one, and make sure that the user wanted to enable the joystick before dealing with its key states?

I hope it helped.

Best regards.
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Player movement broken on master branch?

Post by Roots » Mon May 30, 2011 11:16 am

That explanation makes sense. Wow, that's weird that your computer sees a joystick that isn't there. I'll work on a fix for this and let you know when its in SVN so you can confirm whether or not it works.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Player movement broken on master branch?

Post by Roots » Tue May 31, 2011 1:49 am

FYI, I'll backport this fix to the demo once I have it as we were planning to release a demo 1.0.3 in the near future that contains some improved translations.
Image
User avatar
Bertram
Senior Member
Posts: 127
Joined: Fri Feb 26, 2010 3:08 am

Re: Player movement broken on master branch?

Post by Bertram » Tue May 31, 2011 2:55 am

Ok,

I'll test both by then.

Thanks again :)
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Player movement broken on master branch?

Post by Roots » Tue May 31, 2011 3:39 pm

The way I'm thinking about implementing a fix for this is to add a new boolean variable to the settings.lua file called "joystick_disabled", which the default settings will set to true. Then BootMode would have to be modified so that the options menu there the user could toggle whether or not joysticks are enabled or disabled. Then for people with these "phantom joysticks" that are somehow screwing with their system, the joystick input wouldn't screw up the keyboard input.


I probably won't get around to this for another week though as I leave for vacation in a couple days. If anyone wants to implement this solution (or come up with a better one) be my guest.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Player movement broken on master branch?

Post by Roots » Sun Jun 12, 2011 11:45 am

Bertram, in revision #1965 I added a temporary hack to try and address this issue, but I need you to test it to see if it works. Basically all I did was add a setting that disables joystick input. There is no in-game option to do this right now, however, and you'll need to manually edit a settings file. What you have to do is open the "settings.lua" file and set the value of the following property to true:
settings.joystick_settings.input_disabled = false
The location of the settings.lua file depends on your OS. On my Linux system its at ~/.allacrost/profiles/settings.lua. Windows and OSX put them in appropriate locations as well, though I'm not sure exactly where at the moment. I think its "My Documents/Allacrost" on Windows and "/Library/Application Support/Allacrost/" on OS X. Anyway, if you can test that out and let me know if it fixes your problem, I'd appreciate it. :)
Image
User avatar
Bertram
Senior Member
Posts: 127
Joined: Fri Feb 26, 2010 3:08 am

Re: Player movement broken on master branch?

Post by Bertram » Mon Jun 13, 2011 5:06 am

Hi Roots,

I've tried your fix by adding the config key in ~/.allacrost (I'm testing it on debian unstable) and it's working! :approve:

Congrats for the quickfix :)

My best regards.
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Player movement broken on master branch?

Post by Roots » Tue Jun 14, 2011 2:06 am

Awesome, glad that it works. We'll get around to implementing a more permanent fix sometime soon so you no longer have to manually edit that file.
Image
Lenetty
Newbie
Posts: 1
Joined: Tue Feb 21, 2012 3:18 am

Re: Player movement broken on master branch?

Post by Lenetty » Wed Feb 22, 2012 12:11 am

That's pretty weird you have the problem on Windows.Because I have never faced it before. But I am glad you have already solved the problem.
Post Reply