Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Controller feature test

just_in_case
Moderator
Quote
2023-01-23 08:54:36

Hey guys as you might already be aware I was able to create controller support for Coppercube and I would like to ask you guys for help in some testing. So that I can fix the bugs or issues and further improve the controller system. As there are different types of controllers(joystick) available in the market, I can't test them out all. So I want you guys to test it with your controllers.


If you guys have a controller(joystick), you guys can try out the project by downloading it from my GitHub repo here

https://github.com/vazahat/CC-ex...

download the repo and simply run the win32player.exe inside the Release folder, make sure you have your controller plugged in before starting the app. It will load the default terrain example of CopperCube, try using one of the Stick(axis) or D-pad(Pov) of your controller to move the player around. If your controller has an Analog/Digital button do try to test it with the button on and off, for me, analog turned off works much better, as the Axis Stick works more efficiently then. Please try this project and provide feedback. So that I can further improve it.

When providing feedback please do mention your Controller name, so that I can get an idea of which controllers it is working and on which it isn't.

I used the generic Playstation-style controller see the image below and it works fine for me.

🔎︎


Thanks!


VP
Guest
Quote
2023-01-23 12:33:10

XBOX 360 controller.

Code execution cannot proceed because VCRUNTIME140D.dll was not found. Reinstalling the program may fix this problem.

Code execution cannot proceed because ucrtbased.dll was not found. Reinstalling the program may fix this problem.


just_in_case
Moderator
Quote
2023-01-23 13:27:45

Seems visual studio runtime libraries are missing, you can try installing the latest runtime libraries from here https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

if it still dont work for you you can try installing the .dll by downloading them from the internet.


VP
Guest
Quote
2023-01-23 14:46:23

I have the dll's already - I think the problem is that I don't use the SDK. I think the D in the .dll filename refers to the SDK debugging mode? Maybe redeploy it using a universal runtime instead.


VP
Guest
Quote
2023-01-23 14:48:32

I mean, it's looking specifically for VCRUNTIME140D.dll, instead of VCRUNTIME140.dll.

I read that you can create a "static link" to fix the problem?


just_in_case
Moderator
Quote
2023-01-23 15:26:53

@VP, Thanks for the response, I just deployed a release version, You can redownload the archive from GitHub and you will find a Release folder there, run the win32player.exe

if you still face the .dll issue then can you please reinstall the VS runtime libraries from the link that I provided in the previous comment as it has runtime library support for 2022.

Hope it will work this time.


VP
Guest
Quote
2023-01-23 18:46:21

Thanks. The release version works well with xbox 360 controller. Only issue for me is that diagonal doesn't work with the analogue stick.

Forwards/Backwards/Left/Right work properly. Nice one!


just_in_case
Moderator
Quote
2023-01-24 04:40:12

@VP, thanks for confirming, well it does diagonal as well, but that's very hard when anlogue is on you have to move the axis very harsh in diagonal, same happens with the generic controller as well. With anologue off, it works fine.
Maybe that's because of the dead zone, I have set up in the code. Will look into this.

But I am glad that it is working with a different types of controllers.


VP
Guest
Quote
2023-01-24 07:25:29

You're welcome! It's really great to finally have native controller support in coppercube. Thanks for making it!


okeoke
Registered User
Quote
2023-01-24 14:48:41

Hi just_in_case,

I tried xbox 360 controller - it doesn't really work for me.
Left axis works only sideways and down. If I move the stick forward nothing happens. Also it only works one direction only, i.e. if I move the stick left and down it only reads left. I believe, VP already mentioned that.

Also tried a bootleg nes style usb controller. It uses directinput and weirdly enough it works perfectly. I.e. I can move forward and backwards and turn at the same time.


just_in_case
Moderator
Quote
2023-01-24 16:35:58

@okeoke, don't know why the forward axis is not working on your Xbox 360 controller, yeah for diagonally it might not work, and maybe that is because I am emulating the ccbEmulateKey command instead of writing a movement controller specifically with joystick API. Or maybe it is due to the hardcoded deadzone value for the axis.

btw did you tried the movement when Analogue mode is off, does it work the forward movement or not?

Maybe creating a movement controller specifically with the use of joystick API can fix the issue of diagonal movement on some controllers.

Nice to hear that it worked fine on your other controller, I will create a sample project with joystick api for the movement so that we can confirm if the issue is due to the emulation of the keycode or it is the joystick API that needs improvements.

Thanks for testing it out.


edwin123
Registered User
Quote
2023-01-24 17:30:46

can it be made so you can shoot like a shooting key? right top button?


just_in_case
Moderator
Quote
2023-01-24 17:41:46

@edwin, I didn't understand your question. but the controller can be used to shoot, with any button in the controller, we can access all the buttons as well. I think I should create a proper example maybe a demo game with shooting and all, and the usage of buttons from the controller.

So that we can test them in a more proper way. Will try to create one tomorrow.


okeoke
Registered User
Quote
2023-01-24 17:56:14

It doesn't have an analog/digital switch, unfortunately. I also tried to press all other buttons, but they do not do anything.

I also don't know how exactly you implemented the controls, but could it be that my controller just uses other value mapping? I.e. you expect that axis values would be 0 to 1, there in my case it's from -1 to 1 or something similar?


just_in_case
Moderator
Quote
2023-01-24 18:23:45

I already found the fix for that, actually I hardcoded the axis to return -1 and 1 while the actual range is between -32768 and 32767. I was actually doing the calculation in C++, and they were returning 1 and -1 in Javascript, so it might be returning zero if there is something off in the hardcoded value. I should probably update the code to return the value in the range instead of returning 1 and -1.

I will work on it and will update the controller test project. Hopefully, it will be fixed.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Interna?ional" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact