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

Wii TAS input: fix offset in IR coordinates #9018

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Felk
Copy link
Contributor

@Felk Felk commented Aug 8, 2020

The TAS input currently has some weird placement for its made-up IR lights. This causes an offset while the TAS UI suggests the cursor should be perfectly centered.

Here are before and after screenshots for visualization:

ir1
ir2

Also: Do you think adding a fixed offset to the y-coordinate is ok? This will probably make the offset worse for people who changed their sensor bar's position settings to "below screen", but I don't know if people even do that.

@jordan-woyak
Copy link
Member

Couldn't this be fixed properly by using the same routine that the emulated remote's CameraLogic class uses?

@JosJuice
Copy link
Member

JosJuice commented Aug 8, 2020

The current value of the sensor bar position setting should ideally be taken into account for the y coordinate. This is how it's currently handled by the regular IR code:

const bool sensor_bar_on_top = Config::Get(Config::SYSCONF_SENSOR_BAR_POSITION) != 0;

However, I'm not sure if that approach works correctly in the case where the value of the setting in the temporary TASing NAND differs from the value of the setting in the normal NAND. Since the SYSCONF in the temporary NAND has most values set to the default, it may be better to not take the setting into account than to use an approach which takes the wrong setting into account.

@Felk
Copy link
Contributor Author

Felk commented Aug 8, 2020

Couldn't this be fixed properly by using the same routine that the emulated remote's CameraLogic class uses?

Looks like it could, Ideally by just extracting the conversion from Matrix44 to bytes to some InputCommon utility I suppose?

@Felk
Copy link
Contributor Author

Felk commented Aug 11, 2020

If I change the code to use an emulated position of the wiimote, having the TAS window go from 0-1024 for x and 0-768 for y doesn't make much sense anymore. Here's what I came up with instead:
grafik

That's now just arbitrarily goes from -100 to 100 in x and from -75 to 75 in y, which is the wiimote position's offset in centimeters. The additional slider below that is currently set to 500 is the distance from the IR sensor LEDs in centimeters (5 meters by default), and arbitrarily goes from 50 to 10000 (10 meters). I did not apply any offset in y-direction this time, so setting x and y to 0 causes the in-game cursor to be slighly above the center again.

Would this be acceptable?

@jordan-woyak
Copy link
Member

@Felk
The "x" and "y" should probably apply rotations instead of centimeter offsets.
I would make the default distance the same as that of the emulated remote (2 meters).

@Felk
Copy link
Contributor Author

Felk commented Aug 12, 2020

With x and y being rotation in arc minutes:
grafik
grafik

@MoskovchenkoD
Copy link

MoskovchenkoD commented Sep 16, 2020

Thank you for posting this issue. I have the same trouble with Resident Evil 4 for Wii which sometimes goes out of sync on specific IRs. In my case, 1x and 2x works fine, but 3x desyncs.

Game ID: RB4E08.wbfs
Here is a test movie: RE4-part4.zip
Here is a memory card to use (already placed in the data folder): Dolphin Emulator.zip
Here is a video which shows a desync: video

@Felk
Copy link
Contributor Author

Felk commented Sep 16, 2020

Thank you for posting this issue. I have the same trouble with Resident Evil 4 for Wii which sometimes goes out of sync on specific IRs. 1x and 2x works fine, but 3x desyncs.

I don't think that this merge request will affect any TAS desyncing issues, as it's basically just a code refactor and gui change

@JMC47
Copy link
Contributor

JMC47 commented Sep 16, 2020

changing IR to games that read the framebuffer is expected to cause desyncs.

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