May 4 2016, 11:26 pm
|
|
Any stick-to-verb setup will allow for the axis' actual value to be used.
|
In response to Lummox JR
|
|
Thank you Lummox JR. That's what I wanted to know.
It's interesting that you plan to use verbs with arguments. That's not the way things are usually done for built-in features, but I do like the idea. It should be possible to do that for analog triggers as well, but I don't know if the gamepad you are testing with has such a thing. |
My gamepad is a Logitech. It's a few years old, but it has parity with the PS2 controller model except for no vibration feature. (Although I'm honestly not sure about that last part.) There's a D-pad, four buttons on the right, Start, Select, two shoulder buttons on each side, and two analog sticks that are clickable.
|
In response to Lummox JR
|
|
Lummox JR wrote:
My gamepad is a Logitech. It's a few years old, but it has parity with the PS2 controller model except for no vibration feature. (Although I'm honestly not sure about that last part.) There's a D-pad, four buttons on the right, Start, Select, two shoulder buttons on each side, and two analog sticks that are clickable. That about sums up most PC/console controllers. I think controller design has come to a point where the most comfortable/effective designs have been found, and slight variations are being made on that. Two clickable sticks, DPAD, two sets of shoulder buttons, four button on the face for actions, and the start/select buttons near the center. But you can guarantee Nintendo will be that special snowflake. |
In response to Lummox JR
|
|
Try opening this site with your gamepad connected. Press buttons until it is recognized, then slowly press the L2 or R2 button (closest to the back), and if you notice any number other than exactly 0.00 or 1.00, then those are analog buttons, and you should be able to support them. In most gamepads out now, those buttons in particular are analog, not digital.
|
If I may ask a few questions about this before the work on it is finalized, how would this work with keyboard libraries (such as those that store the state of keys in a keys[] list and also have keyUp(), keyDown(), and keyRepeat() procs)?
Would a button-to-key setup also call the respective procs/modify the keys list? How would multiple controllers be handled? Would it be possible to manipulate the gamepad connections in softcode to work in a similar way to the keyboard libraries we have now? How would this map in the webclient? At present, I've been using the gamepad API to call client verbs and update relevant information based on values that have been changed. Would I have to change how that works to keep it similar to how it would work in Dream Seeker? Finally, you mentioned your gamepad doesn't have rumble support; because of that I'm gonna assume that won't make it into 511. If you obtain a gamepad with rumble support at some point (such as a standard Xbox 360 or Xbox One controller), would it be possible to add rumble support to the engine with whatever tools you plan on using? |
In response to Pokemonred200
|
|
Pokemonred200 wrote:
If I may ask a few questions about this before the work on it is finalized, how would this work with keyboard libraries (such as those that store the state of keys in a keys[] list and also have keyUp(), keyDown(), and keyRepeat() procs)? Yes. Mapped button presses would be treated like keypresses for those purposes. How would multiple controllers be handled? Undecided. This is likely something the game or user will have to define. Would it be possible to manipulate the gamepad connections in softcode to work in a similar way to the keyboard libraries we have now? I'm not sure what you mean by that. How would this map in the webclient? At present, I've been using the gamepad API to call client verbs and update relevant information based on values that have been changed. Would I have to change how that works to keep it similar to how it would work in Dream Seeker? When I add this to the webclient--it may not be in the first phase of 511--I'll probably do so via a special .dms control. I'm sure there will be a way to disable that control if you have your own gamepad setup. Finally, you mentioned your gamepad doesn't have rumble support; because of that I'm gonna assume that won't make it into 511. If you obtain a gamepad with rumble support at some point (such as a standard Xbox 360 or Xbox One controller), would it be possible to add rumble support to the engine with whatever tools you plan on using? I'm not certain if my gamepad has rumble support or not. The L2 and R2 "trigger" shoulder buttons are digital-only on my gamepad, and I may end up getting a new one for testing purposes. My current plan is to use XInput since that appears to have wide support, and since that supports vibration I may try to build in something for that. However I don't have any specific plans along those lines at this time. |
I'm not sure what you mean by that. He's talking about Forum_Account's keyboard library, which lets you define a list of keys that will be assigned at the client level, and then when the client finishes connection to the world, for each value in that list, two winset()s are called to link the key to client key-up and key-down verbs. ...Don't ask me why people think this is ideal, but they seem to like it. |
In response to Ter13
|
|
Ter13 wrote:
I'm not sure what you mean by that. I prefer to put the macros in a .dms or .dmf file so the winsets don't need to happen. key_up() and key_down() verbs are mostly a preference/something I use to make the game do something different regarding situation, but I don't find a massive-scale winset to be a good thing at all personally. |
I don't find a massive-scale winset to be a good thing at all personally. Nor I. |
I assume it will be possible to set any gamepad bindings through code.
Pokemonred200 wrote: I don't find a massive-scale winset to be a good thing at all personally. There's really nothing wrong with it if you use JavaScript. Lummox JR wrote: My current plan is to use XInput since that appears to have wide support, and since that supports vibration I may try to build in something for that. However I don't have any specific plans along those lines at this time. XInput vs. DirectInput is a serious dilemma. XInput is the obvious choice, but I wouldn't say that it has wide support. I think the truth is that this issue represents a major battlefield in the console wars, and Microsoft wants to control it. It doesn't help that Sony refuses to provide XInput drivers for their DualShock controllers. It's almost as if each company is trying to force players to boycott the other one by providing limited support. XInput and DirectInput are both incomplete solutions. If only one can be supported, it should be XInput, but both would be better. There have been games that support both. Another issue is getting the name of the controller for correct button mapping and prompts. |
I don't mind trying to support both, as long as there's an easy way to tell which one I should be using.
|
Quick update: I've successfully managed to get joystick info using DirectInput. I need to modify the code so that it's easier to tell how the right analog stick (if present) is oriented, and I need to figure out how to handle the L2 and R2 shoulder buttons as non-discrete buttons--which may also require me to get another controller, because on mine they're push-only.
|
Yeah, on some controllers they read as an axis, on others they're buttons, etc.
Which controller are you using again? If you want one that reads as axis for the shoulders, the Xbox One controller does just that. Not sure about PS4 |
My controller is an older Logitech. I don't like its arrangement of buttons (1,2,3,4 start from the left and go counter-clockwise, so it has no relation to the Xbox XYAB), but it has all of the basic controls including L3 and R3. What it doesn't have are L2 and R2 as pressure-sensitive triggers rather than simple buttons.
|
I'm at an interesting stage with gamepads and could use some input.
I know that controllers are not well standardized in terms of which buttons they report to be which. I want to setup a quick way for players to map their controllers so that it knows which are which, and I'd like them to ultimately conform after mapping to the HTML5 standard as demonstrated here. Browsers do this mapping internally. I'd like to have some basic mappings setup already (ideally), and for those that aren't, a quick way to set that mapping with a dirt-simple UI. Any suggestions on how to handle the UI portion of this quickly and simply without going into a lot of depth? |
Personally I'd basically give access to a 2xN grid.
The first column will contain the HTML5 standard layouts so: FACE_1: 0, FACE_2: 1, FACE_3: 2, FACE_4: 3, LEFT_SHOULDER: 4, RIGHT_SHOULDER: 5, LEFT_SHOULDER_BOTTOM: 6, RIGHT_SHOULDER_BOTTOM: 7, SELECT: 8, START: 9, LEFT_ANALOGUE_STICK: 10, RIGHT_ANALOGUE_STICK: 11, PAD_TOP: 12, PAD_BOTTOM: 13, PAD_LEFT: 14, PAD_RIGHT: 15 LEFT_ANALOGUE_HOR: 0, LEFT_ANALOGUE_VERT: 1, RIGHT_ANALOGUE_HOR: 2, RIGHT_ANALOGUE_VERT: 3 The second column would be something you click and then press the corresponding button on your controller to fill in. You could also show a third column with the keyboard/mouse/etc assignments of those specific buttons. Take a look at Visual Boy Advance to see how their controller mapping is done. It's pretty straightforward and simple IMHO. That UI layout with HTML5 standard instead of the GBA controls would probably work like a charm. |
Take a look at Visual Boy Advance to see how their controller mapping is done. Agreed. Emulators have done this in a way that just about any idiot can work out. |
Lummox JR resolved issue with message:
Gamepad support is here! Configure your gamepad by going to the Client | Gamepad Setup menu option in Dream Seeker, and then post on the forums with your cfg/joysticks.txt file contents (found in your BYOND user data folder) so we can build up a standard set of controllers. A DirectInput-compatible driver for your gamepad is required. |