Joystick configuration panel

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderator: JeremyaFr

Post Reply

Joystick configuration panel

marcop000
Cadet 1st Class
Posts: 213
Joined: Fri Dec 27, 2019 7:08 pm

Post by marcop000 » Sat Jan 09, 2021 8:54 am

Hi @JeremyaFr,

I have installed the new version of MegaPack 2020 and in general I see many improvement. Compliments !!!

I also see you have added a new custom Joystick configuration to enable multi device support that is very usuful.

However this change replace the original way to set the controller and this is a advantage but not in all cases.

Now the default controller is detected by index that as you already known is not a secure device identifier this for many reasons:

Suppose for example that you add another device or change USB port or again reinstall windows etc..

What happen ?

For my experience the game point to a different device with the result that you need to re-open the joystick configuration and change the index device different times that is a bit annoying.

To solve this problem I suggest one of these 2 solutions:

1) Restore the game original setting that read in the control Panel the old combobox: Advanced -> Default controller
I have multiple devices and I can confirm 100% that when I set my device as default in control panel, the game use always it independed by the index.
So in this case you can add a checkbox: "Use control panel default device" (for default disabled)

2) Allow the user to choose the device by index or by DeviceName
This is probably the best way but a bit more complicated. So in this case when you check "by DeviceName" the index textbox is replaced by a combobox with the list all devices.
When the user choose the device can be sure that independently by the index, the game point always this this device that it is a great advantage.

To be honest I have already a custom version of dinput.dll that use a ini file and allow the user to choose the device by name, but I like to use your joystick panel that I found it better.

Hope that my feedback can be take in consideration

Thanks !

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Jan 16, 2021 9:49 pm

Hello,
I've published a new WIP version of the joystick hook.

marcop000
Cadet 1st Class
Posts: 213
Joined: Fri Dec 27, 2019 7:08 pm

Post by marcop000 » Sun Jan 17, 2021 11:58 am

Thank you !!

Where I can download it ?

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jan 17, 2021 12:20 pm


marcop000
Cadet 1st Class
Posts: 213
Joined: Fri Dec 27, 2019 7:08 pm

Post by marcop000 » Sun Jan 17, 2021 1:01 pm

Hi @JeremyaFr,

Thanks !

Only for my curiosity how you generate this ID ?

What property you use ?

With direct input (if you use it) You have to choose 2 possibility:

Product or Instance.

The game need Instance, but theorically the user can choose Product (this depend by the source code).

Thanks !
You do not have the required permissions to view the files attached to this post.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jan 17, 2021 1:13 pm

With the wMid and wPid fields of the JOYCAPS struct.

Code: Select all

int controllerId = (int)((unsigned int)caps.wMid << 16 | (unsigned int)caps.wPid);

marcop000
Cadet 1st Class
Posts: 213
Joined: Fri Dec 27, 2019 7:08 pm

Post by marcop000 » Sun Jan 17, 2021 1:41 pm

Perfect this ID is a constant and not change.

Excellent job !!

I will save in my external file "305446573" that is vjoy ID.

I have already tested your previous version and I confirm that work.

Only 2 questions:

1) Your update work good, can I use the original "Joystick.txt" with this update ? Or is incompatible ?
2) About the cutscene I have upload the files in ".wmv" (ex. Briefroom.wmv) for internal cutscene (mixed with the menu).

https://drive.google.com/drive/u/0/fold ... v1UnLn1MmD

The only compromise there is a short black screen at the end of cutscene. There is a way to remove this black screen ?

Thanks !

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jan 17, 2021 2:10 pm

1) Yes, you can use it. The two methods are compatible.
2) I'm not sure that it is possible.

marcop000
Cadet 1st Class
Posts: 213
Joined: Fri Dec 27, 2019 7:08 pm

Post by marcop000 » Sun Jan 17, 2021 2:52 pm

OK good.

In the meantime I have do a real deep test of controller and in general work fine, but I have found a bit problem.

I have assegned the some joystick configuration of my previous version of xwa, but the hat timed is incorrect:

In my case the left hat change the target, but now if I press left hat simulate 3 or 4 press.

While in the original version when I press left hat change the target only one time, now change 3 or 4 target.

This problem seem present only for hat, but the normal buttons seem work fine.

Is possible fix it ?

Thanks !

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jan 17, 2021 3:33 pm

Did you check the UsePovControllerAsButtons setting?

marcop000
Cadet 1st Class
Posts: 213
Joined: Fri Dec 27, 2019 7:08 pm

Post by marcop000 » Sun Jan 17, 2021 4:04 pm

You have right with UsePovControllerAsButtons = 1 all work. Thanks !!

In the meantime I have checked the source code for cutscene, so probably is not possible remove this short black screen.

This seem caused by this line:

//
// Init DirectDraw resources
((void(*)())0x540370)();
//

not present the standard avi playback, but is not possible remove it.

With standard avi playback seem there is no external library that do this, and seem very hard allow to play 30 or 60 FPS.

Thanks again !

donthegreat
Recruit
Posts: 2
Joined: Sun Jun 13, 2021 11:22 am

Post by donthegreat » Sun Jun 13, 2021 11:24 am

JeremyaFr wrote:
Sun Jan 17, 2021 3:33 pm
Did you check the UsePovControllerAsButtons setting?
Oh duh. Thanks very much, I spent some time googling to find this answer when I should have just been looking at the settings utility more closely. But I'm very appreciative you posted this to counter my stupidity.

Post Reply