How abouts we have ourselves an all new controller system?!

#11
I've never encountered that problem- interesting. It sounds like it's definitely a hardware limitation in they keyboard's internal encoder chip.

Joy2Key shouldn't have any problem like that because it's completely software based. It can't fix your physical keyboard's problem of course, but it bypasses the problem by reading controller button pushes and relaying them directly to the PC as keyboard/mouse button pushes. It's like having a second mouse/keyboard plugged in.
Reply

#12
Do you really think your keyboard can only handle 3keys at a time?? That sounds like a waste of plastic Evil

PS: I'm planning to add a toggle system, which would probably only normally be useful for running (for the built-in buttons that is) ...if you're really married to that keyboard, that might help.

PPS: For any of you keyboard players out there, I'm just finishing up a keyboard remapping extension. I use the keyboard myself sometimes for quick testing sessions...
Reply

#13
Makes no difference to me I use a controller. ‎  Keyboard King's Fielding is not in my to do list. ‎  Just thought I would mention that issue that some people may have. ‎  The limitation of 3 keys isnt simply not being able to press more than 3 keys, its 3 keys in a certain matrix of keys. ‎  I could likely hit 10 different keys at once no problem as long as they aren't in a certain area of the keyboard.
- Todd DuFore (DMPDesign)
Site Founder
Reply

#14
(2009-10-21, 02:03 AM)dmpdesign link Wrote: Makes no difference to me I use a controller.? Keyboard King's Fielding is not in my to do list.? Just thought I would mention that issue that some people may have.? The limitation of 3 keys isnt simply not being able to press more than 3 keys, its 3 keys in a certain matrix of keys.? I could likely hit 10 different keys at once no problem as long as they aren't in a certain area of the keyboard.

Well remapping might help then?? Anyway, just finished that up. Next up is Joypad and analog control experiments...

The Keymap bit wasn't what took so long the last couple days. It was mostly work/decision making about the ini file interface and reorganizing the project space now that I have an overview gameplan. The ini file is internationalized as well btw. So it can be translated into any language.

The Keymap is used by the entire system, including extensions, so it goes beyond just using the keyboard. And there will be reasons to use the keyboard for some things in the future (added things)

The Keymap section now just deals with the internal keys themselves. There is a new Keypad section for simulating many keys single action setups and macro keys (basically same way the Joypad works)
Reply

#15
This is going to have been an 8~10hr job before I get the joystick configuration in place (not including an in-game menu way)

Really it would've taken me no time at all to swap out the keyboard and joystick had I hard coded it in. Literally so far I've spent all of 5mins on that. It's all about processing the ini configuration file. I gotta admit I really set the bar high and the code is in my usual perfectionist vein. So maybe I have my self to blame. But anyway, the final product will really feel different compared to the crap you're accustomed to putting up with from SOM.

You'll be glad I've been able to hack circles around it... and the good news is by the time I'm done there will be few new challenges in the ini dept. So I can just focus on real features. I will distribute some stuff once the controller configuration is all there.

We will have to revive the what do you want out of SOM thread Cool

[code=SOM_EX.INI]
;This is a Microsoft standard .ini extension file...

;C=en_US

;Anything else not within a section (the start of which is a
;single line surrounded by brackets, ie. []) Will be ignord.
;Everthing after the first section will be a section. You can
;make a [.Notes: Anything you wish here] section however. Or
;hide a section completely by putting a period before the name
;in brackets, ie. [.Player].

[Player]

;This section can assign different ini files per Windows user
;account (instead of this one)

[Remote]

;This section will fetch/merge additional configuration info
;from somewhere on the internet.

[Locale]

;This section is for manually overriding the environment locale
;settings (of your Microsoft Windows enivironment)

[Window]

;This section pertains to playing Sword of Moonlight inside a
;window (instead of fullscreen only play)

do_play_som_in_window = yes

[Stereo]

;Section pertaining to stereo projection ("3D goggles" vision)

[Action]

;The Action section assigns action names to keys (like a macro)
;Actions may also be assigned to a series or combination of keys.
;Changing these values may effect the effectiveness of the following
;sections, and or make controlling your game difficult or impossible

;The action names are up to you, but sould not be all caps because
;all caps symbols will be matched to internal symbolic constants.
;Action names must also be more than two letters so not to be
;confused with two character hexidecimal values.
?

Enter_menu = TAB
Shoot_magic = LCONTROL
Swing_weapon = LSHIFT
Dash_or_interact = SPACE
Reset_view = NUMPAD8
Look_up = NUMPAD9
Look_down = NUMPAD7
Walk_forawrd = NUMPAD5
Turn_left = NUMPAD1
Turn_right = NUMPAD3
Walk_backward = NUMPAD2
Step_left = NUMPAD4
Step_right = NUMPAD6
Select = RETURN
Cancel = ESCAPE

[Keymap]

;Each key (named variable) in this section represents a key
;on a keyboard and the corresponding value assigned is the
;key the player must press instead of the original key...

;Sword of Moonlight assigns the following keys to the
;following actions...

;In normal play
;TAB: Enter menu? ? ? ? ?? ;0f
;LCONTROL: Shoot magic? ?? ;1d
;LSHIFT: Swing weapon? ? ? ;2A
;SPACE: Dash/Interact? ? ? ;39
;END: Reset view? ? ? ? ?? ;cf
;PGDN: Look up? ? ? ? ? ?? ;d1 (also known as NEXT)
;DELETE: Look down? ? ? ?? ;d3
;UP: Wak forward? ? ? ? ?? ;c8
;LEFT: Turn left? ? ? ? ?? ;cb
;DOWN: Walk backward? ? ?? ;d0
;RIGHT: Turn right? ? ? ?? ;cb

;NUMPAD7: Look down
;NUMPAD8: Reset view
;NUMPAD9: Look up?
;NUMPAD4: Step left
;NUMPAD5: Walk forward
;NUMPAD6: Step right
;NUMPAD1: Turn left? ??
;NUMPAD2: Walk backward
;NUMPAD3: Turn right? ? ? ?

;Make walking/stepping via WASD
NUMPAD5 = 11
NUMPAD4 = 1e
NUMPAD2 = 1f
NUMPAD6 = 20
?
;In the menu of message dialog
;RETURN:? Select/Choice #1
;ESCAPE: Cancel/Choice #2

;Any hexidecimal number or DirectInput code can be used to
;name a key or value. For a complete reference please visit:
;https://www.gamespp.com/directx/directInputKeyboardScanCodes.html
;Or search the WWW for "DirectInput keyboard scan codes"

[Toggle]

;This section lets you toggle keys so they will remain pressed
;until the same toggle input condition is met (untoggling a
;key in a different way than it was toggled is not supported
;at present)

;This section works just like [Keymap], the keys are the original
;SOM keys and the assignments are the keys the player is to press
;in order to toggle the original key (which SOM will see)

;Currently toggling can only be in effect during normal play mode
;(that is not while inside a menu or text dialog context)

;A simple toggle can be SPACE = SPACE, ie. continue dashing once
;the SPACE key is pressed, until pressed again.?

[Keypad]

;Here extra keyboard keys may be chosen to simulate those
;designated in the [Keymap] section

[Joypad]

;This section can be used to spoof Sword of Moonlight's keyboard
;inputs, by simulating a keyboard via a Windows "Game Controller"
;you should set hide_controllers_from_som = yes so to avoid any
;conflicts with your Sword of Moonlight game.

;SOM will not detect any controllers
do_hide_controllers_from_som = yes

;A number or name with wildcards will do
joypad_to_use_for_play = 0??

;"Analog" stick/button/trigger functions:

;throttles look/move keys per frame
do_simulate_analog_signals = yes
?
;Pseudo-Buttons: you can create digital and analog buttons from your
;controller's feature set, such as joystick axes and pov hats. Even
;button combinations. This is necessary because only buttons can
;be used to simulate the keyboard.?
?
pseudo_x_axis = 13
pseudo_y_axis = 14
pseudo_z_axis = 15
pseudo_z_rotation = 16
pseudo_hat_north = 17
pseudo_hat_east = 18
pseudo_hat_south = 19
pseudo_hat_west = 20
?
;Buttons: each button is a number (see: Control Panel->Game Controllers)
;which is assigned to a key value (see: [Keymap] section) or series of
;keys called a macro. Assigned keys should correspond to the keymap!!

1 = Look_down
2 = Enter_menu
3 = Look_up
6 = Dash_or_interact
7 = Shoot_magic
8 = Swing_weapon
11 = Dash_or_interact
12 = Reset_view

;Negative/positive numbers have meaning for calibrated analog "buttons"

-13 = Step_left
+13 = Step_right
-14 = Walk_backward
+14 = Walk_forward
-15 = Turn_left
+15 = Turn_right
-16 = Look_down
+16 = Look_up

;Menu buttons are special. They end with an M

2M = Select
3M = Cancel
17M = UP
18M = RIGHT
19M = DOWN
20M = LEFT

;Text buttons end with a T

17T = Select
19T = Cancel

;The following keys can be used for on the fly modification of the
;existing joypad configuration

;flip_button_poles = ;list of analog buttons for which to flip polarity
;swap_button_pairs =? ;list of button pairs for which to swap assignments?

[Joypad2]

;Here you could define another joypad configuration...

[Joypad3]

;And another...

[Motion]

;This section lets you simulate keys with a mouse-type devices

[Memory]

;This section is for memory address macros which the following
;sections may depend upon. Changing these values can break your
;game which might constitute cheating

[Memmap]

;Changing this section is not advised for players and may
;break your game or very likely constitute cheating.?

[Editor]

;This section is for dynamically rewriting text on the fly before
;it is drawn to the screen for the player to see. Not to be confused
;with translation or menu customization.


[MenuRx]

;This section is for menu customization

[Dialog]

;Talking messages

wait_to_decide = 2000
wait_to_listen = 1000

do_waiting_icon = yes

[Mixing]

;Audio stuff

[Screen]

;Screen effects

[Static]

;Graphical fixtures

[Bugfix]

;bugs/glitches

[Output]

;Console output

[Module]

;Section for modules to be loaded...

;Sections for each module should be named after the loaded module

[System]

;This section should not be edited by anyone

[Config]

;This section (Config) should not be edited by hand!!
;It is reserved for saving the player's menu settings
[/code]
Reply

#16
For the record I finished op most of this alternative Joypad work yesterday. I was just very perturbed to find out the DX7 drivers just don't seem to recognize the 4th axis on my DualShock adapter. I didn't cut any corners so it will just be a matter of proper testing (like SOM never got) to make sure the more advanced features like macros work. The way I've set things up Shift+another key is a macro, so the support needs to be there on first release I reckon.

I haven't played with simulating analog input yet, and it will be a day or two, but I don't suspect any trouble.

First I will probably implement an alternative old school winmm.lib (Windows Multimedia API -- the pre-DirectCrap api) interface, since that will be easy to do and I know will work. It's not as fancy as DI but does all the stuff you need. Mostly it just won't let you set things like deadzone and saturation, but it has a deadzone operating mode in case one of your sticks are twitchy.

I might also look for better drivers for my adapter. If that doesn't work I'll probably look into setting up DirectX8/9/10 alongside SOM's 7. In theory it shouldn't be a problem for per device input at least.

For anyone interested I will post the code later somehow (the bbs is saying "The message exceeds the maximum allowed length (30000 characters)")
Reply

#17
I added support for the old Windows Multimedia API tonight. It's really a pain to work in, but it's the only drivers that seem to work with my Dualshock adapter. There's no way to make a connection between a DirectInput device and a Multimedia joystick ID. You can't even get the name of the product. I think in XP controllers have numbers that correspond, but they're gone in Vista (in the control panel)

It's possible the DirectInput devices are enumerated in the same order, but I think it's poor practice to count on that. And I have a feeling it's not the case anyway, because Vista still has an option to assign your preferred controller for old games.

So you gotta set do_use_windows_multimedia_interface = yes to use it. This will map the same settings to all of your controllers, which for most people would probably be fine. But if you want to differentiate different controller sections you gotta set windows_multimedia_joystick_number = 1 etc.

Unlike the way SOM makes you choose a controller, this system uses all of your plugged in controllers at once. So you could pick up any of them or use multiple controllers somehow (there are some weird controllers out there... pedals, eye tracking headsets, etc)

Another pain was with DX the adapter sent the 4th axis to the 6th slot, where with the Multimedia API it's the 4th. So you gotta change your settings for that too.


I will play with an analog simulation (I'm already using the sticks but they're all or nothing -- aka digital) before an initial release in the next few days. It's already a huge improvement over SOM's controller setup.


I'd kinda like to know how many of you think analog support is a game feature versus just something optional for the player that wants more precision. I mean support wise it's a huge deal. But analog is also part of the game as well I guess... especially in stealth type games where it's integrated into the movement of the player avatar. Though for SOM I don't suppose that's an issue. Though I just wondered for the first time if it would be possible to to make a 3rd person extension. I think I could make a simple Armored Core game with SOM. Which is usually 3rd person. Though personally I prefer 1st person games. All my top favs are 1st person.

I suppose bare minimum before it can be a "feature" I gotta work the new system into the in-game menu. I've already programmed most of what is needed on the controller side for that. Just not the menu stuff. That reminds me I gotta finish testing the macro support before a release.

EDITED: DX8/9/10 will surely support my pad. So I was wrong to say no other drivers will work. So I will get around to supporting these eventually. Hopefully there will be no trouble in compiling a DLL with all the different libraries in one / running them all simultaneously.
Reply

#18
Hmm analog support for KF. ‎  I assume this means simply being able to use analog controllers to go left and right, forward and backward etc, and not try to modify the SOM code to allow for slower walking or turning ‎  based on how far you pressed the analog stick?
- Todd DuFore (DMPDesign)
Site Founder
Reply

#19
Well it wouldn't be analog if the effect was digital (off/on) now would it?!


I did some initial tests last night just out of curiosity. The way I'm doing it is to just only send a key event every other time SOM requests the keyboard state for half speed for example, then every 3rd time for 1/3rd speed. I'm not sure if there is a timing problem, but my sticks seem a little dodgy. The programming is solid however I'm convinced. It's probably just either my controller or adapter or the Dualshock design in general being cheap. I noticed yesterday playing a PSN game like SmashTV (or Robotron) that even the Sixaxis sticks seem really cruddy for doing 360 type maneuvers. I'm thinking about trying with my Sidewinder (a MS joystick) to see if the integrity is better.

It's not great. Nor is it probably a long term solution. If we could control the speed parameter on the fly (the one you set in the System Editor) you'd probably see much better results. Still, if you want to play with analog sticks, like the way you might be used to playing new games, it really helps to make the sticks feel more responsive. It's unnatural really to use an analog stick with a digital visual feedback response.

I installed some drivers for my adapter. It didn't make the 4th axis show up under DX7, but it added rumble force feedback support. There are probably ways you could integrate that into your game effectively with an extension if you wanted it. There are actually like 4 different kinds of effects which can be adjusted with great sensitivity. I'm kinda surprised I've never played a game that really put the rumble motors to good effect. I'm not sure, but I think maybe you can't dial them up/down while they're on, which might explain why effects in games tend to be very simple.

The biggest jump is between full and half speed, which comes with a kick. Though not unreasonable. If you made the top speed only every other frame, you might get a more level curve, but you could not enforce that realistically. Quarter speed is not so bad, but with my controller I limited it to 3 gates. With a more sensitive controller you might do better. It can make a strobing effect not unlike KF4's which can be visually unpleasant. Walking at slow speed can also be painful because the walking effect tends to go off and on hurky jerky. I don't recommend disabling the effect however, because it's fine at top speed. Combined with SOM's already existing walking collision issues it can be a pain at times. It's definitely a pro and cons thing. For me it's choosing between classic PS1 type controls or an imperfect analog setup. It does better without the walk effect, so it's possible a replacement effect could be added via an extension to better integrate things. Also if you blended the last frame with the current like Shadow of the Colossus, the strobing would largely go away. Both simple/thin effects to add. But again, hopefully we'll get access to the speed parameter eventually instead, but for now, I prefer this to nothing.

I need to do some timing diagnostics to get a precise idea of how SOM is accessing the keyboard relative to the frame rate etc before I will have any final word. Some findings in this area might explain why the knocked out keys might be causing irregular behavior (if it isn't just my controller) ...that will mean revisiting the DirectDraw interface. I haven't decided if I want to take a break from SOM related programming and maybe work on the website here some more / lease out that new host, or what next. Anyway, I will start tidying things up and release some files you can add to your project/som folder to take advantage of the much more flexible/thorough keyboard/controller extension and to play with the analog function. It will just be off or on with whatever final algorithm I find suitable for my own play for now. I will probably disable everything else I've worked on. I actually might shift gears and focus on i18n next. Since that is the biggest qualitative addition to SOM I can think of / would be a welcomed change of scenery.

I'm just happy I won't have to correct SOM's controller configuration every time I turn on now, and as soon as I'm ready I know I can add new keys to SOM as needed.
Reply

#20
(2009-10-27, 08:40 PM)Holy Diver link Wrote: I'm just happy I won't have to correct SOM's controller configuration every time I turn on now, and as soon as I'm ready I know I can add new keys to SOM as needed.

Thats a big plus right there.
- Todd DuFore (DMPDesign)
Site Founder
Reply





Users browsing this thread:
1 Guest(s)