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] Option to operate the same as the N64 Console #161

Closed
jonaeru opened this issue Sep 9, 2023 · 23 comments
Closed

[Feature Request] Option to operate the same as the N64 Console #161

jonaeru opened this issue Sep 9, 2023 · 23 comments

Comments

@jonaeru
Copy link

jonaeru commented Sep 9, 2023

I am familiar with the N64 controller and would like to perform the same operation if possible. I am connecting in DIrectInput format.
I tried playing with the "Use / Cancel" (B) and "Reload" (X) assigned to the B button and it reloads every time I open the door, which is troubling if I have the Mauler charge-up equipped.
How about preparing a special flag for N64 controllers?

EDIT: It would be nice to be able to place a cam spy with the A button.
The door opens by pressing the A button, so if I change the weapon in front of the door the door opens and I am in trouble.

Action Keyboard and mouse Xbox pad N64 pad N64 pad (Console)
Fire / Accept LMB/Space RT Z Trigger Z Trigger
Aim mode RMB/Z LT R Trigger R Trigger
Use / Cancel E N/A B B
Use / Accept N/A A A A (No "Use")
Reload R X X (0x40) B
Previous weapon Mousewheel forward B D-Left A + Z
Next weapon Mousewheel back Y Y (0x80) A
Radial menu Q LB D-Down A Hold
Alt fire mode F RB L Trigger B Hold
Alt fire mode (Temporarilly) F + LMB RB + RT L + Z B + Z
Quick-detonate E + Q A + B A + D-Left A + B
@Atari-Dude
Copy link

Atari-Dude commented Sep 9, 2023

I agree and I hope it's possible to bring the "press and hold" functionality to keyboard as well. With my current keyboard mappings, reloading with [C] automatically switches weapon functions as well because I've mapped them to the same key as that's my muscle memory from playing PD64 on original hardware for so long. But because there's no option to re-enable "press and hold", you get stuff like this lol

2023-09-09.01-38-47.1.mp4

@Graslu
Copy link

Graslu commented Sep 16, 2023

Yes it'd be appreciated if we could have proper N64 controller support. Raphnet Adapter support would be ideal since it's 1:1 to real N64 hardware.

@LanHikariDS
Copy link

Best overall solution I think would be having a toggle in the .ini for Xbox (current default) or N64 controller type for each player, since there are dozens of different N64 adapters, not to mention the Switch N64 controller, and likely N64-styled USB controllers as well.

@fgsfdsfgs
Copy link
Owner

So what features from the N64 control scheme would you need? The press-and-hold reload, what else? Need an exact list of what to enable/disable when the "N64 control mode" is on.

@Graslu
Copy link

Graslu commented Sep 20, 2023

B hold for mode swap, A hold for radial menu, B for reload and use, if crouching is added to an independent key then allow crouching by aiming + pressing back on movement.

since there are dozens of different N64 adapters

Yes but most if not all of those will be recognized as controllers right away and allow for remapping, while also wrongly detecting C-Buttons as a second stick. I believe Raphnet doesn't get detected automatically unless supported, but I'll have to test this.

@jonaeru
Copy link
Author

jonaeru commented Sep 20, 2023

The following operations are currently not possible, so it would be great to be able to set the following.

Action Keyboard and mouse Xbox pad N64 control mode Note
Use / Accept N/A A A Disable "Use"
Reload R X B "Use" is priority, otherwise "Reload"
Previous weapon Mousewheel forward B A + Z -
Radial menu Q LB A Hold Enable "Hold"
Alt fire mode F RB B Hold Enable "Hold"
Alt fire mode (Temporarilly) F + LMB RB + RT B + Z -
Quick-detonate E + Q A + B A + B -

@Gorilli09
Copy link

Off topic, but the Xbox controls needs to be based off of TimeSplitters and XBLA Perfect Dark.

@cylonicboom
Copy link

The following operations are currently not possible, so it would be great to be able to set the following.
Action Keyboard and mouse Xbox pad N64 control mode Note
Use / Accept N/A A A Disable "Use"
Reload R X B "Use" is priority, otherwise "Reload"
Previous weapon Mousewheel forward B A + Z -
Radial menu Q LB A Hold Enable "Hold"
Alt fire mode F RB B Hold Enable "Hold"
Alt fire mode (Temporarilly) F + LMB RB + RT B + Z -
Quick-detonate E + Q A + B A + B -

B + Z alt-fire oneshot should be working right now.

I added more buttons so I can move the "extra" buttons for 1964/xbox parity to those slots. Then the other things are straightforward to restore & run conditionally based on the expanded controller options settings.

@BiatuAutMiahn
Copy link

BiatuAutMiahn commented Nov 2, 2023

When I use an Xbox controller for N64 emu I usually set these:

A = A
B = B
Z = RT, LT (Both Z)
L = LB
R = RB

@jonaeru
Copy link
Author

jonaeru commented Nov 2, 2023

@NeonNyan

B + Z alt-fire oneshot should be working right now.

Thank you, it worked, but "Next Weapon" and "Reload" also worked at the same time.

I made the following assignments.
Fire / Accept: Z
Use / Accept: A
Use / Cancel: B
Reload: B
Next weapon: A

Alt-fire oneshot
[Use / Accept] + [Fire / Accept]: A + Z (A: Next weapon also works)
[Use / Cancel] + [Fire / Accept]: B + Z (B: Reload also works, sometimes not work Alt-fire oneshot)
[Alt fire mode] + [Fire / Accept]; L + Z

Quick-detonate
[Use / Accept] + [Reload]: A+B (A: Next weapon also works)
[Use / Accept] + [Previous weapon]: A+D-Left

On another matter, StickCButtons=0 in pd.ini is not working.

@fgsfdsfgs
Copy link
Owner

fgsfdsfgs commented Nov 2, 2023

What do you mean not working?
When it's set to 1, left analog stick generates C button presses, resulting in "digital" movement.
When it's set to 0, left analog stick acts as a real analog stick, resulting in analog movement.
I can definitely reproduce the correct behavior locally. Maybe you need to update your build? If you're building locally, try doing a make -f Makefile.port clean first.

@jonaeru
Copy link
Author

jonaeru commented Nov 3, 2023

I used the artifact. https://github.com/fgsfdsfgs/perfect_dark/actions/runs/6726244516.

Sorry, this may be a slightly different case.
I am imagining the control style 1.2.
Stick: Look
C button: Move

In previous builds, if StickCButtons=0, the stick was only for viewpoint movement. In the latest build, viewpoint movement and movement are combined.

@cylonicboom
Copy link

Hi @jonaeru, I just tried the jpn build. It seems to be behaving correctly.

@cylonicboom
Copy link

I can't reproduce the movement and aim movement being combined on one stick, either on ntsc-final or jpn-final.

@jonaeru
Copy link
Author

jonaeru commented Nov 3, 2023

Thank you. I think I may have found the cause somewhat.
I have an N64 controller connected in DirectInput, with only one stick. the L stick and R stick seem to be working at the same time.

I solved the problem by setting L Stick Scale to 0!
image

@fgsfdsfgs
Copy link
Owner

Seems that the one stick on the controller somehow maps to both left and right stick in SDL. That's quite weird and is probably a quirk of that particular controller or adapter. In this case yeah, just setting sensitivity for one of the sticks to 0 is the easiest solution.
As a side note, I should probably add support for loading SDL gamecontrollerdb files, then you could configure any exotic controller to your liking.

@jonaeru
Copy link
Author

jonaeru commented Nov 4, 2023

I used 407d472 build.

Assignment

  • Fire / Accept: Z
  • Use / Accept: A
  • Use / Cancel: B
  • Reload: B
  • Previous weapon: D-Left
  • Next weapon: A
  • Alt fire mode: L

Alt-fire oneshot

The following worked, but if I assign A to Next weapon and B to Reload, they may get in the way.
Remote Mines appear to behave strangely with "Unlimited Ammo, No Reloads".

[Use / Accept] + [Fire / Accept]: A + Z
[Use / Cancel] + [Fire / Accept]: B + Z
[Alt fire mode] + [Fire / Accept]; L + Z

Quick-detonate

The following worked, but change "Unarmed" after detonation.
With the above assignment, just pressing the B button will detonate the bomb, but the B button will not open the door.
When Quick-detonate is performed while moving, the movement stops.

[Use / Cancel] + [Reload]: B + B (B + X)
[Use / Accept] + [Reload]: A + B (A + X)
[Use / Accept] + [Previous weapon]: A + D-Left

pd_pc_port_operation_test_2.mp4

@cylonicboom
Copy link

I submitted a PR which will help with the remote mine selection issues: #230

I'll take a look at the unlimited ammo + remote mine scenario.

Like @fgsfdsfgs said the N64ness should be restored per-item w/ a config entry (which makes sense now that we have extra buttons to accommodate and per-player configs.)

@fgsfdsfgs
Copy link
Owner

I've added (partial?) support for the original control schemes. The "PC port" control scheme that the port had before is now a separate scheme called Ext and is the default. Note that if you change to an N64 scheme you'll have to rebind some buttons anyway, since there's only one set of bindings in the config and it's set to reasonable defaults for the PC scheme. I'll probably add another one for N64 schemes later.

@jonaeru
Copy link
Author

jonaeru commented Dec 7, 2023

Build: https://github.com/fgsfdsfgs/perfect_dark/actions/runs/7117212181 (aeb6851)

I was able to operate the same as the N64 console. Thank you!

image
image
image

@fgsfdsfgs
Copy link
Owner

Thanks for testing. I'll close this then. Feel free to bump this issue if there are any problems.

@FrostKnight
Copy link

Is raphnet N64 V3 supported? I would love to be able to use it on my computer for this.

@fgsfdsfgs
Copy link
Owner

Yes. If you don't have the Rumble Pak inserted set the vibration strength to 0 in the extended options, otherwise it will lag every time it attempts to vibrate due to a quirk in how the Raphnet adapter works.

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

9 participants