Author Topic: What's the "right" way to control attract mode?  (Read 10617 times)

Fireball

  • Newbie
  • *
  • Posts: 5
    • View Profile
What's the "right" way to control attract mode?
« on: July 30, 2016, 10:28:01 PM »
Hey there -

New member here.  I'm actually enjoying attract mode IMMENSELY, and I've gotten everything set up with minimal issues.  (I've even started modifying layouts that match my own custom build.  Works fantastically well!  Thank You AM people.)

That said, I have an issue.  I use a "Wolfware Howler" interface card, programmed to act as a keyboard for all the inputs coming out of my control panel.  This works well until I quit a game and as it returns to the Attract Mode interface where it freaks out as if Attract Mode was also receiving the keyboard command inputs as I was playing the game (retained focus), sometimes choosing another random game, but usually ending in Attract Mode quitting to a command prompt (exit).  I realize that there was a line item in the 2.1 release notes that addressed something similar to this, but I've upgraded to 2.1.0 (from source) and it hasn't fixed my issue.

So, my question is this,  "Are you supposed to have separate buttons for Attract Mode functions (is that just how it works)?  Can I fix it while still using the emulator controls to also control Attract Mode?  -or-  Is this an issue with Attract Mode in it's current state?"

Thanks very much for your kind attention,

J "Fireball"

Raspberry Pi 3 Model B
RetroPie 4.0rc1
Attract Mode 2.1.0
Wolfware Howler USB Interface
« Last Edit: July 30, 2016, 10:35:08 PM by Fireball »

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1274
    • View Profile
Re: What's the "right" way to control attract mode?
« Reply #1 on: July 31, 2016, 12:26:12 AM »
I have been using Attract-Mode with RetroPie on a Raspberry Pi for a while. I haven't had any issues using the same controls in AM as in the emulators. I have however recently made an emulator called "Setup" that uses the RetroPie "runcommand" to launch bash scripts to configure/setup things right from AM without needing to go into RetroPie and have noticed a similar problem to what you are explaining but only using these scripts and not the actual emulators. My problem only happens when I use specific controllers or a keyboard but not with other controllers.

Overall I think the controller support seems pretty good but in my latest venture I do see issues with certain specialized setups. Here's a link to what I'm doing that I sometimes see a similar problem but only with certain controllers http://forum.attractmode.org/index.php?topic=869.0 .

Fireball

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: What's the "right" way to control attract mode?
« Reply #2 on: July 31, 2016, 09:58:04 AM »
That's actually very cool!  I may use/modify some of those.  The scripts are pretty straight forward, but I hadn't considered doing anything like that (genius!  :D).

My issue is specific to using the same commands for both emulator play, AND AM control.  For example, the howler (as a keyboard) sends arrow keys as the inputs for Joystick1.  These are the same keys that allow navigation within AM.

Buttons 1 and 2 send 'space' and 'z' respectively, and my Start button sends 'num1' (the number key '1') for maximum compatibility, all of which I have also configured in AM as "Select" to make it easy for folks who aren't familiar to select a game to play.

'Esc' key is sent for exiting a currently running emu, AND to exit AM to shell.

All these coupled together however result in random inputs going into AM at exit.  (and yes, I've tried exiting very calmly without pressing any extraneous buttons or keys.

I know I COULD probably fix this by adding smaller navigation buttons on the panel tied to "AM only keys", but that's certainly not as clean, and I really would rather not.

Appreciate any other thoughts.
« Last Edit: July 31, 2016, 09:59:51 AM by Fireball »

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1274
    • View Profile
Re: What's the "right" way to control attract mode?
« Reply #3 on: August 01, 2016, 03:10:24 PM »
I personally haven't used the Howler interface but I doubt it's the issue. Based on my experience mentioned above it's likely related to how you're running the emulators. Does this happen with every emulator you use or just some? To test, if you connect a gamepad or different encoder do you have the same issue? Post a couple of the emulator.cfg files that you have the issue with so we can see if anything looks odd.

Fireball

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: What's the "right" way to control attract mode?
« Reply #4 on: August 04, 2016, 02:13:56 PM »
Thanks for response, and sorry for the slow reply.  (life)

I've uploaded a couple of the appropriate configs (please see below).  This is purely an arcade machine, so I'm not running any console emus, although this system was built on top of Floob's latest Attract mode image, and then upgraded as time went by.  Also, I'm not 100% clear on the flow of all the configs (god there's a lot of them due to the interconnected nature of ES, Retroarch and AM.  These are the ones I've found so far while romping through the system.  If I missed something, please let me know (as that's probably where my problem is.)

~/.attract/attract.cfg
http://pastebin.com/pGXLpX76

~/attract/emulators/FBA.cfg
http://pastebin.com/Y6SdBZ9T

/opt/retropie/configs/all/retroarch.cfg
http://pastebin.com/P0xSz0eC

/opt/retropie/configs/fba/retroarch.cfg
http://pastebin.com/weMzBh8G

 Again, the howler is in "Keyboard mode", so the system takes those inputs as standard key presses from a keyboard device.  No difference from using an actual keyboard as far as I can tell.  In AM, selection works perfectly, and emulation starts as expected.  It's only when we quit back to AM do what appear to be cached inputs execute a number of functions within AM, even if we haven't pressed any additional keys since the single "exit" command from the emulated environment.

Appreciate any help.

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1274
    • View Profile
Re: What's the "right" way to control attract mode?
« Reply #5 on: August 04, 2016, 10:20:02 PM »
I see gamepad entries in your controls in addition to keyboard settings. This is pretty normal but you mentioned that your encoder is only sending keyboard presses. Why are these entries in the attract.cfg? Do you have a gamepad too? If so, do you have the same issue if you test with it?

Fireball

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: What's the "right" way to control attract mode?
« Reply #6 on: August 05, 2016, 01:28:51 PM »
I pulled out an old Buffalo SFC pad, and can confirm that my AM install doesn't cache the joystick inputs while in the background and emu running, just the key presses.  However, I WAS also able to replicate the issue with only a logitech keyboard attached, so it's not specific to the Howler encoder at all.

The obvious work around seems to be "don't use a keyboard as a controller", but that seems like a poor solution and also completely eliminates my being able to use AM for this build (I'm kind of tied into using the Howler at this point). . .

Are there any other options?  I would think there would be a lot more people out there that would be discussing this if it was wide spread, so it must be me misconfiguring something, but I can't seem find out what.  Or am I wrong in my thinking that I should be able to do this with just the standard button layout and minimal/no navigation?

omegaman

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 880
    • View Profile
Re: What's the "right" way to control attract mode?
« Reply #7 on: August 05, 2016, 08:33:02 PM »
Fireball-

Try using a different button than esc for exiting out of attract. I bet that will fix the issue you're having.

Daimon

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Re: What's the "right" way to control attract mode?
« Reply #8 on: August 06, 2016, 01:14:59 PM »
The same problem here with an IPAC controller, the solution as stated below, can be an option.
You could try adding/appending  the following script snippet to your selected theme "layout.nut"  file.
This code will disregard the first 1.5 sec of transistions after starting or returning to the theme.

//
local _ignore= true;
local os_list= ["Linux","Windows"];
function on_signal(signal_str) {if (_ignore && os_list.find(OS)) return true; else return false;}

local _ignore_timer= 1500; // milliseconds
local _timer1= 0;
function on_tick( ttime ) {if((ttime- _timer1)> _ignore_timer) _ignore= false;}

function my_transition( ttype, var, ttime)
{
    if ( ttype == Transition.FromGame ) {_ignore= true; _timer1= ttime;}
    return false;
}

fe.add_transition_callback( this, "my_transition");
fe.add_signal_handler(this, "on_signal");
fe.add_ticks_callback("on_tick");
//

omegaman

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 880
    • View Profile
Re: What's the "right" way to control attract mode?
« Reply #9 on: August 06, 2016, 05:10:37 PM »
If you're using floob's image, I just posted a fix for this in this thread -> http://forum.attractmode.org/index.php?topic=705.390