Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Taito Paddle with analog value #626

Open
sonik-br opened this issue Jan 19, 2023 · 4 comments
Open

Feature Request: Taito Paddle with analog value #626

sonik-br opened this issue Jan 19, 2023 · 4 comments

Comments

@sonik-br
Copy link

Hi,

Would be possibible to map the paddle position to an analog stick position?
Or even better, use a mouse to change it's value.

Thanks.

@rogerman
Copy link
Collaborator

Controlling the Taito Paddle using an analog control already exists in the Mac version. However, this only controls the rate of positive/negative change in the paddle value, which is how the Taito Paddle actually works. You cannot directly correlate the Taito Paddle position (since it does not use positions) with an absolute position on the screen.

As for controlling the paddle using the mouse, you probably want to keep that free for emulating the NDS stylus. If you really really really still want to control the paddle using the mouse, you may find that writing a LUA script may help, but this only works in the Windows version.

@sonik-br
Copy link
Author

Got it.
It's not really a paddle (a potentiometer based one), but more like a spinner (with infinite rotation).
Mouse mapping would fit perfectly for it as mouse is a relative position device. This would also work with a real trackball or a rotary encoder.
This is the way the mac version works?

@rogerman
Copy link
Collaborator

paddle_settings

I can only describe how the Mac version works by describing how the Taito Paddle works. All the paddle does is maintain a single unsigned 16-bit value (0 to 65535). It is up to the game to figure out how to interpret that value. Most games, such as Space Invaders Extreme, check for value changes, where the higher the rate of change, the faster your shooter moves. Positive changes move your shooter right, while negative changes move your shooter left. In other words, most games DO NOT map the paddle value to an absolute position on the screen.

The Mac and Windows versions (and maybe Linux versions) all allow digital control of the paddle, where the rate of change in the paddle value are set to a fixed value. By default, the 'O' key is set with a rate of -5 per frame, while the 'P' key is set with a rate of +5 per frame. Of course, these rates can be changed by the user, but because they are digital controls, the rate change can only be a single fixed value at any one time.

But analog controls are better in this case, since one can read the analog control and adjust the rate on the fly. The Mac version's analog control was designed around standard analog thumbsticks. If you were to assign the X-coordinate of the thumbstick, then hard-left would correspond to a maximum negative rate change, hard-right would correspond to a maximum positive rate change, while center would a zero rate change. As you can see in the screenshot above, the user can change the sensitivity of the analog control depending on the game so that lower sensitivity reduces the rate change while higher sensitivity increases the rate change.

With all of this said, there are only a few ways I can see a mouse controlling the paddle:

  1. Assign the mouse wheel so that each step of the wheel changes the paddle value by a fixed amount. Rolling the wheel forward or backward can adjust the paddle either negative or positive. This is probably the easiest and most elegant solution that is most compatible with how the paddle actually works.

  2. Capture the mouse cursor and hide it, then use the speed of the mouse movement to adjust the paddle's rate of change relative to the mouse's movement speed. Since you can no longer use the mouse cursor anymore, the NDS stylus cannot be used, along with using the mouse cursor for anything else. This seems like the worst possible option since you would have to sacrifice your mouse control just control the paddle alone.

  3. Assign a location as a 'central location', whether this be a point on a window, on the screen, or wherever. Moving the mouse cursor away from this central location will adjust the paddle's rate of change relative to the cursor's distance from the central location. This avoids the problem of sacrificing your mouse control completely, but it doesn't feel as natural for the user as the above two solutions.

I personally have no interest in implementing any of these solutions, as the current analog implementation in the Mac version works very well with analog thumbsticks. However, I might reconsider implementing the mouse wheel solution for the Mac version if I ever get to it, as it is quite elegant.

I have no plans or interest in implementing any of these things for Windows or Linux.

@sonik-br
Copy link
Author

Option 1 looks like the best solution.
Mouse scroll directly changes the 16 bit value that game will read.

Sadly I don't have a mac and I can only use windows and linux.

An real, physical device, can be made with just a arduino and a rotary encoder. This device can output like a usb mouse with a wheel.
Would be an interesting way to use the emulator and this device works on the 3 operational systems.

Anyway, thanks for taking your time.

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

No branches or pull requests

2 participants