Welcome to symthic forums! We would love if you'd register!
You don't have to be expert in bit baking, everyone is more than welcome to join our community.

You are not logged in.

Hey! If this is your first visit on symthic.com, also check out our weapon damage charts.
Currently we have charts for Battlefield 3, Call of Duty: Black Ops 2, Medal of Honor: Warfighter and Call of Duty: Modern Warfare 3

  • "CaptaPraelium" started this thread

Posts: 226

Date of registration
: Sep 20th 2016

Platform: PC

Battlelog:

Reputation modifier: 3

  • Send private message

1

Friday, October 7th 2016, 11:48pm

RGB (Keyboard) Lighting APIs

Hi all,

A friend recently bought a nice new logitech flashy RGB keyboard (the 810 or 910 I think). To his surprise, a seemingly undocumented feature exists on the keyboard, where the keyboard lighting can take input from the game state... Features such as: Health bar being displayed on Fn keys, reload key flashes when low on ammo, Fn keys flash red/blue when being chased by police, etc etc...

I've been building a custom keyboard and I'd like to include similar features. Now, I can find vendor-specific APIs for programming their specific keyboards (Corsair CUE, Logitech) but.... How are they receiving the game state? Do games call out to some API, which is then used by the vendor software? Or does the vendor software read game state from RAM directly, or.... ?

I can't find any documentation on this at all. Little help?

Miffyli

Symthic Developer

(6,460)

Posts: 3,700

Date of registration
: Mar 21st 2013

Platform: PC

Location: __main__, Finland

Reputation modifier: 16

  • Send private message

2

Saturday, October 8th 2016, 12:25am

That's interdasting. I had one of those Logitech keyboards with LCD screen years ago which supported bunch of games (e.g. TF2 where it showed your stats). However I never thought they would support BF4 too.

I can't anything for sure, but my guess is that game checks for certain drivers and sends certain bits of data to that driver. Direct reading of memory would be way too messy and would require needless updates. However I can't say anything for sure right away. I'd love to know for sure though, so if you find answers please do share.

If I were to made something like this I'd use memory reading, but that falls quickly under "hacking" so I'd not advice you to do it. What kind of "custom keyboard" are you building btw, or is it more like custom LED control?
Links to users' thread list who have made analytical/statistical/mathematical/cool posts on Symthic:
  • 3VerstsNorth - Analysis of game mechanics in BF4 (tickrates, effects of tickrate, etc)
  • leptis - Analysis of shotguns, recoil, recoil control and air drag.
  • Veritable - Scoring of BF4/BF1 firearms in terms of usability, firing and other mechanics.
  • Miffyli - Random statistical analysis of BF4 battlereports/players and kill-distances. (list is cluttered with other threads).
Sorry if your name wasn't on the list, I honestly can't recall all names : ( . Nudge me if you want to be included

  • "CaptaPraelium" started this thread

Posts: 226

Date of registration
: Sep 20th 2016

Platform: PC

Battlelog:

Reputation modifier: 3

  • Send private message

3

Saturday, October 8th 2016, 6:07pm

After looking into this further, with your hint, I think I've figured it out... Maybe.

It seems as though you're dead on the money. There is a DLL provided with the logitech devices, and when you register it, it inserts a registry key with the DLL's location. It seems that the game actually has to directly support that specific manufacturer's peripherals by locating this DLL using that key, loading, and making calls to it..... So, while the devs may implement this for a Logitech, that doesn't mean it'll work on say, a Corsair.. or vice versa. Corsair has their own DLL and a rather different API.

One hint that supports this theory is that an open source project exists, which converts the logitech DLL calls to effect LEDs on the corsair (GitHub - VRocker/LogiLed2Corsair: A DLL to convert Logitech LED API calls to Corsair RGB keyboard). I'd very much like to make something similar for, say, the WS2801, but I do have fears that I might be heading for a ban hammer if I do something that looks hack-ish, like causing the game to load a logitech DLL that isn't really a logitech DLL. I could contact EA/DICE and ask them if it would be considered acceptable, but I'm not exactly confident. I suspect they'll say, "What? Something something API DLL you want to modify the game or something? Disallowed."

I had intentions of a more ergonomic gaming-centric keyboard (non-staggered columns, thumb clusters a la ergodox/kinesis (for BF1 infantry sprint+crouch goodness, as well as vehicles (sprint+reverse)), diamond rather than inverted-T movement keys, etc) but was thinking about going all-out and making a sort of 'cockpit sim' for planes and tanks. Guess that's off the cards :(

Really disappointed that it's such a closed, proprietary implementation. Sucks for everyone involved.

Miffyli

Symthic Developer

(6,460)

Posts: 3,700

Date of registration
: Mar 21st 2013

Platform: PC

Location: __main__, Finland

Reputation modifier: 16

  • Send private message

4

Saturday, October 8th 2016, 7:31pm

Hmm... unless you inject something to the game and/or hook functions, you shooould be clear. If you just have "bogus" Logitech driver DLL somewhere which gets loaded by the game, I don't think that would trigger bans. At worst the BF will reject the DLL because it has different fingerprint or something. Again, I am not 100% sure about all this, but at least GTAV seems to work fine with the project you linked.

I've had ideas for custom keyboard lighting too but my keyboard doesn't even have 3rd party drivers for controlling LEDs (3-4 years old). I would probably do some naughty little memory reading and put values from there to keyboard LEDs or something :whistling:

Really disappointed that it's such a closed, proprietary implementation. Sucks for everyone involved.

Indeed... And this is not the worst of it: People have to reinvent wheels all. the. bucking. time just because of some closed code. There has been some news about defining all software patents as "bad" (and maybe even invalidating them), which would be gloooorious, but apparently nothing like that is not going to happen :(.
Links to users' thread list who have made analytical/statistical/mathematical/cool posts on Symthic:
  • 3VerstsNorth - Analysis of game mechanics in BF4 (tickrates, effects of tickrate, etc)
  • leptis - Analysis of shotguns, recoil, recoil control and air drag.
  • Veritable - Scoring of BF4/BF1 firearms in terms of usability, firing and other mechanics.
  • Miffyli - Random statistical analysis of BF4 battlereports/players and kill-distances. (list is cluttered with other threads).
Sorry if your name wasn't on the list, I honestly can't recall all names : ( . Nudge me if you want to be included

VincentNZ

Holy War? No Thanks.

(2,133)

Posts: 2,616

Date of registration
: Jul 25th 2013

Platform: PC

Battlelog:

Reputation modifier: 15

  • Send private message

5

Saturday, October 8th 2016, 8:46pm

I always wondered, is a lighted keyboard anything more than a gimmick? I mean you are usually looking at the screen when playing anywhere and should have perfect knowledge where the keys are, would you notice the Reload-Light flashing at all? Or would it support you in a way? It would have to be really bright, too, wouldn't it?

If it was like the ambilight things behind the monitor, I could see this working. Generally my experience with any lighting on game devices is very low. I use a Steelseries mouse that has lighting, but that I do never notice either.

Miffyli

Symthic Developer

(6,460)

Posts: 3,700

Date of registration
: Mar 21st 2013

Platform: PC

Location: __main__, Finland

Reputation modifier: 16

  • Send private message

6

Saturday, October 8th 2016, 9:23pm

@VincentNZ
To be honest I have found RGB keyboards more distracting than anything with their animations, but it would be a cool gimmicky thing to do anyways.

That said: The lighting from LEDs can really improve the immersion. On PS4 you have the LED behind the controller which can be controlled by game, and in Outlast the LED flashes along the nightvision to further emphasize the "blinking" of the view, and in some other games it turns red when you get more bloody-screened. Doesn't work for keyboards though, since they are too visible.
Links to users' thread list who have made analytical/statistical/mathematical/cool posts on Symthic:
  • 3VerstsNorth - Analysis of game mechanics in BF4 (tickrates, effects of tickrate, etc)
  • leptis - Analysis of shotguns, recoil, recoil control and air drag.
  • Veritable - Scoring of BF4/BF1 firearms in terms of usability, firing and other mechanics.
  • Miffyli - Random statistical analysis of BF4 battlereports/players and kill-distances. (list is cluttered with other threads).
Sorry if your name wasn't on the list, I honestly can't recall all names : ( . Nudge me if you want to be included

  • "CaptaPraelium" started this thread

Posts: 226

Date of registration
: Sep 20th 2016

Platform: PC

Battlelog:

Reputation modifier: 3

  • Send private message

7

Monday, October 10th 2016, 1:50am

@VincentNZ Yeh well I initially felt the same - I mean, you have your hands over the keys anyway and you're looking at the screen, right? ... I mean my RGB mouse, I program it to dim the lights when I'm gaming to avoid distracton.

And then I got to thinking, well, the LEDs don't have to be *in* the keyboard. I was thinking about things like an RGB LED strip on the back of the monitor, to light up the wall behind it (red when bloody-screen, flashing when taking damage, a 'fire' when the vehicle is disabled, etc) ... Then I was thinking heck, it doesn't even have to be LEDs, or even lighting, providing feedback....

Trouble now is, because of the implementation, I can't really do much. I could tinker with those logitech DLLs, but then... My actual logitech devices are going to be an issue. Here's hoping DirectX 12.1 has some kind of 'game-state-export API' ;)

Thanks for the tips though guys!