Jump to content

[0.21] GHud - Adds displays to built-in screen on Logitech G19/G510 keyboards (v1.2)


BGog42

Recommended Posts

Well, I've actually (mostly) sorted out the problem with the stuttering. It's not completely gone but much reduced. I'm just gonna send you a pull-request on GitHub, I hope that's fine (but I also just give you a patch-file if you prefer).

What I've done is changed the LCD update from using Update() to a Coroutine. It's not called on every frame draw, but only in defined intervals. I've also split them up between 'idle' and 'active', so it doesn't try to update so often when it's not needed, and it only clears the LCD once (and not on every call).

I'm actually still interested to find out why not doing anything there takes so long, might have another look tomorrow unless you have a clear idea?

Link to comment
Share on other sites

No idea why you are seeing jitter, I don't get any. Yes the call was in Update but it was limited to doing lcd draws only 5 times per second or so. I've been planning to move it to either fixed update or a coroutine with a yield waitforseconds. Thats great that you coded it up. I'll take a look at your pull request and get it in. But note that it was not doing LCD ops every frame but only checking the delta time and returning.

Link to comment
Share on other sites

Yea, I'm quite aware that you were only doing that every 200ms, but whenever it did happen it introduces a visually intrusive 'jump' for some reason (I can upload a short video or something showing this, just for demonstrations sake). So since I was changing it anyways, it's now only called every 200ms (or whatever you set wait_active to) or 2s respectively (when not active --> wait_idle). Less overhead on the main thread is always better, as CPU is almost always the limiting factor for this game. And even when it is called and there is nothing to display, it only clears the LCD once now and not every time (since that's what was causing these jumps for me). All in all it's a tiny patch, excluding comments it's maybe 20 lines or something of actual code (so not really counting { and }).

I know that you were not really doing anything even when the 200ms were up, clearing the LCD is just writing the string to the bitmap and showing it (for every 'lcd-screen'? just once? didn't look into weather a 'Device' was an actual device or a screen, like orbit, target, ...). I'm just as baffled as you are as to why that would cause such hiccups, as the normal code writes to the LCD much more frequently and doesn't cause this as far as I can tell. No idea why....

Link to comment
Share on other sites

Thanks Creat, I'll take a look at your patch.

The reason there is code for handling "every lcd-screen" is because I test by plugging in a G19, G510 and a G18 at the same time and making sure they all work. Most users will have just one screen.

Link to comment
Share on other sites

  • 1 month later...

Hello, and thank you for writing this mod. It's great when a game can use the LCD screen on the G19 keyboard. However, I haven't been able to get it to work, after carefully following the directions and even trying it on a clean install of .24. I am using Windows 7 Professional 64 bit OS, but running the 32 bit version of KSP. I do not see the "Initializing" message on the LCD, and the GHud program doesn't appear in the LCD's "Switch to Program" menu. However, it does appear in the Programs list in the Logitec LCD Manager program, where it is check-marked to be Enabled. I even tried disabling all the other programs using the LCD, to avoid conflicts. I've tried everything I can think of, and I'm sure the files are in the right locations. I tried it on .23.0, but got the same results. I'm very stumped, as all the other KSP mods and LCD display programs are working. Thank you for any help anyone can give, to get this mod working for me.:confused:

Link to comment
Share on other sites

I'm having the same problem as Scorptrio.

I downloaded the mod a few days ago when I got my G19s, added it to one of my KSP copies, and the game would crash when I tried to start it. Pretty sure it was the most current version of KSP but I'm not 100% sure. Anyways, I just chalked it up to the dozens of mods I had installed and since I hadn't run the game in a while I decided I would start fresh sometime later and try it then. During this time I WAS seeing GHud on the keyboards LCD and was able to launch it.

Anyways, today I decide I want to try out the new B9 Aerospace pack, and do a completly fresh install of KSP. I installed a few other mods, KW rocketry, Mechjeb, Astronomers Visual Pack, and Hotrockets. Now I'm having the same issue as Scorptrio, GHud will not show up on my G19s display, but it will show up in the logitech software.

This is using the current version of KSP at the time of writing, Windows 8.1 x64, trying x32 and x64 versions of the game.

Thanks to anyone that can help!

Edit: Nevermind, downloaded a more current version off of Curse and it works great!

Edited by Guest
Link to comment
Share on other sites

  • 2 weeks later...

Love this mod. It's just not the same playing on a system without it.

Have you seen the latest Logitech gaming keyboard, lots of potential for additional information displays etc. in Kerbal with that one...

http://www.gizmodo.co.uk/2014/09/logitech-gs-mad-new-gaming-keyboard-pairs-with-your-smartphone/

I can just imagine remote docking camera displays, kerbal engineer information etc. on something like that the only thing is I can't program to save my life so I'm reliant on the work very talented people such as those on this forum to maximize the potential of peripherals like these.

My G15 keyboard is on the way out now unfortunately but I'll be looking very closely at this new one.

Link to comment
Share on other sites

I'm having the same problem as Scorptrio.

Edit: Nevermind, downloaded a more current version off of Curse and it works great!

I have the latest version from Curse, and I even tried running KSP from the C: drive, in its "native folder," hoping that maybe having it on the D: drive, was the cause of the problem. I still get no indication at all that the plug-in is installed at all (it is, and correctly.) If anyone has any other ideas, I'm all ears. Thank you. ;.;

Link to comment
Share on other sites

  • 3 weeks later...

Still works great with .25!

I haven't read through the whole thread yet, so forgive me if this has been brought up before, but it might be handy for it to display dV , and even stage dV both in flight as well as in the VAB/SPH. A part counter might be handy as well in the VAB/SPH screens. Overall, though,. I'm just thankful that this exists. I bought a Logitech G510s just o I could take advantage of it, over a Corsair K70 RGB.

Link to comment
Share on other sites

  • 1 month later...

Further to my request a few posts back regarding support for the new Logitech G910 keyboard, the latest version of the Logitech Gaming Software intergrates ARX control support and should allow a mobile phone/tablet to be used as a second display even with the older keyboards like my G15 or potentially keyboards with no display at all.

The phone/tablet needs to have the ARX app installed (free) and be on the same network as the PC in order to work.

If ARX support could in any way be integrated i think it would be a way to bring this superb mod to more people.

Your continued work on this fantastic mod is very much appreciated, can't imagine playing Kerbal without it now.

Link to comment
Share on other sites

  • 2 weeks later...

Hi guys.

First, Bgog, let me say this mod looks awesome.

I might install it on my 8.1 x64 Windows just to try it.

But that's not the reason why I'm writing here.

As far as I can remember, I always used G15 (had 3 of them, first one milk, second got coca cola, and third got sold.), and now I have had the G19 for some years.

I love this keyboard, and it's always been a duty for me to make it work perfectly before using any OS I use.

On windows, you use Logitech Gaming Software, and personnally, I always disabled all the programs of it, and only left an additionnal one, that I find is the best customisation you can have on those keyboards (I'm putting the link out there for those who have these Logitech Gs kerboards, go check it out !! --> LCDHost)

Right now, I'm running Kubuntu 14.04 x64, for several reasons (one of them is running the x64 KSP with no problems --> working 7Go KSP), but still have this 8.1 installed for some games.

Anyways, let me get to the point :

LCDHost is the best, but I can't seem to make it work on Ubuntu. So, there was this plugin that was working kind of the same way, named Gnome15, working on all Ubuntu and Debian distros.

For some unknown reasons, the site has been down for the last month, but I still have the libs if you want, I posted them on the official Kubuntu forums.

This soft allows plugins, and it looks like they are easily written.

Maybe it could allow an easy portage from Windows to Linux ?

I don't know coding, but I wanted to share the experience I've acquired with all those years with this keyboard :).

Remember, Windows users, go try LCDHost !!! You won't regret it ! It adds as a program in LGS Menu, so easy to remove if not wanted.

Oh, and one last thing : here is the link to the now famous Color Cycling script, I pasted it in a pastebin, so that you can try it (In LGS, in the menus, you can insert a script. Just paste that, and try it !! Commands are in the script :D)

Link to comment
Share on other sites

  • 3 months later...
holy sheitz, that is freakin awesome. Cant wait to see what you do with it next, as well on the g19 version what does the graphics do when you go into interplanetary space? and it would be awesome if the g19 had a larger screen for that information.....

I have the Logitech G19S and will be running that app with the Custom control pad for KSP. With this I feel I would have a great experience. Having all the important info at my finger tips and have some better control. I hope this combination will work well:)

I haven't tested it yes as I am busy updating to the .90 update.

~Z~

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
I too am experiencing this issue on my G19. I would love to see this mod updated for KSP 1.0 :)

I have been tinkering around with the source code for this mod a bit, and it looks like the reason that the G19 is having issues is due to some changes that have been made to the Kerbal API. When I open up the Visual Studio solution, I found that the plugin would not compile due to an error on line 143 of OrbitGraph.cs. The offending line is:

atmos_dia = dia + (orbit.referenceBody.maxAtmosphereAltitude * 2)

This may not be the only issue, but it is the first and most obvious one I have found so far. I am tinkering around with the source code a bit in the hopes that I can get this plugin working, but so far I have not had much in the way of luck. If I do manage to get it working, I will post an updated version of the GHud.dll file for the community to use until we get some official word on the status of this plugin from the developer.

Link to comment
Share on other sites

I am tinkering around with the source code a bit in the hopes that I can get this plugin working, but so far I have not had much in the way of luck. If I do manage to get it working, I will post an updated version of the GHud.dll file for the community to use until we get some official word on the status of this plugin from the developer.

I played around with this plugin most of yesterday and part of today as well, and with a bit of work I finally managed to get it working for my Logitech G19. Since I don't have a Logitech G15 or another such black-and-white display keyboard, I don't know if my changes will effect users of those devices, but for other G19 users like myself I have posted an updated version of the plugin files to MegaFileUpload.com, which you can snag from the following link: http://www.megafileupload.com/2gLf/GHud.7z

If any other users give this fix a try and have issues, post a reply here and I will see if I can figure out the problem. In the meantime, I would love to hear back from the original mod author about the status of this mod moving forward. After playing in the code for awhile I have a few other ideas for additional functionality that could be added I would be interested in collaborating over. I would even be willing to take over future maintenance of this mod if the original author is no longer interested in developing it further.

Link to comment
Share on other sites

I played around with this plugin most of yesterday and part of today as well, and with a bit of work I finally managed to get it working for my Logitech G19. Since I don't have a Logitech G15 or another such black-and-white display keyboard, I don't know if my changes will effect users of those devices, but for other G19 users like myself I have posted an updated version of the plugin files to MegaFileUpload.com, which you can snag from the following link: http://www.megafileupload.com/2gLf/GHud.7z

If any other users give this fix a try and have issues, post a reply here and I will see if I can figure out the problem. In the meantime, I would love to hear back from the original mod author about the status of this mod moving forward. After playing in the code for awhile I have a few other ideas for additional functionality that could be added I would be interested in collaborating over. I would even be willing to take over future maintenance of this mod if the original author is no longer interested in developing it further.

Its working properly for me on a g15.

Thanks for doing what I could not! :cool:

I'd love to see more development on this too.

Super useful!

Link to comment
Share on other sites

I played around with this plugin most of yesterday and part of today as well, and with a bit of work I finally managed to get it working for my Logitech G19. Since I don't have a Logitech G15 or another such black-and-white display keyboard, I don't know if my changes will effect users of those devices, but for other G19 users like myself I have posted an updated version of the plugin files to MegaFileUpload.com, which you can snag from the following link: http://www.megafileupload.com/2gLf/GHud.7z

If any other users give this fix a try and have issues, post a reply here and I will see if I can figure out the problem. In the meantime, I would love to hear back from the original mod author about the status of this mod moving forward. After playing in the code for awhile I have a few other ideas for additional functionality that could be added I would be interested in collaborating over. I would even be willing to take over future maintenance of this mod if the original author is no longer interested in developing it further.

Thanks you very much for stepping in while BGog42 is away. I also had a quick look, but couldn't get it to run immediately and didn't have the time to check why...

I had previously migrated the code from using update(), which is called on every frame, to a coroutine, which is called in much slower intervals and (mostly) prevented some severe stutters for me. Basically, we don't need the small LCD to refresh on every real frame, a much slower rate is perfectly fine. Please note that I didn't update the tests in the project, but that should be quite trivial as well.

If you want to read about why I did that and what I did, it's in this thread and starts round about here.

Unfortunately, he never got around to merge my pull request, but it's basically ready to go. You can just merge it if you want, and if you need (for whatevery reason) I can also send you a .patch file, or you can just have a look at my fork of the repository (the only changes are those mentioned).

It would also be nice if you could put your source code up somewhere (GitHub?) so others can have a look at it (and/or help with the project). If you had a GitHub, I could merge the changes myself and all you'd have to do was click a button to apply them ;)

Link to comment
Share on other sites

It would also be nice if you could put your source code up somewhere (GitHub?) so others can have a look at it (and/or help with the project). If you had a GitHub, I could merge the changes myself and all you'd have to do was click a button to apply them :wink:

Unfortunately I am rather unfamiliar with using GIT (I use TFS in my regular development routine), so I am not quite sure how to go about "properly" contributing my code to the main repository, though I will spend a little bit of time later looking into this :D I have to be honest though... when working with the source I found it to be (no offense to the original developer) a complete mess, so I spent a bit of time on my end taking some ownership of the code base and doing a ton of refactoring and general code cleanup. I moved many classes into their own files, renamed a bunch of variables, changed the access levels of several of the raw fields that were being used, and in general modified the code to suit my own tastes and conventions. These changes, while having little functional impact on the plugin, are a radical departure from the original code base that I downloaded.

While many of the changes that I made were for my own piece of mine (for example, I renamed all private fields so that the name is proceeded by an underscore), I made still more changes just so that I could get a better handle on the code base to understand what was going on and make it easier to use and expand upon. Now that I have a very basic understanding of how the plugin is composed and how it does its job, I would like to several additional displays that contain various bits of information, and I have done a bit of refactoring that will (hopefully) make the addition of any new displays a bit easier to implement. Having said all of that, I would be far more comfortable merging my changes to the code base with the main source if I were to discuss this with the original developer first. If, after a time, the original developer doesn't respond that there will be further development on this plugin, I would likely create an independent fork of the repository to continue forward development on my own.

This plugin has a LOT of potential for those players who use a keyboard with an appropriate display, and even without the addition of new features I find it to be extremely useful. There are, however, many situations that I believe this plugin could be put to use that would add to the overall utility of the plugin and to the experience that the user has while using it. Some plugins, such as MechJeb, offer many varied display windows that contain different stats, and in many cases similar displays could instead be sent to the keyboard display (saving a bit of real estate on the screen). I actually just picked up my G19 this month, so I am still a bit unfamiliar with all aspects of developing plugins for it, and working with the GHud plugin has been a good introduction into how to do so. I am also rather unfamiliar with the Kerbal API, so again I find that working with this preexisting source code to be a rather good introduction to the topic. Hopefully as I continue to tinker with it for my own enjoyment I will be able to add a few additional useful features as well.

In the end, I will wind up sharing back any new feature that I do wind up implementing, though as I mentioned earlier I would like to collaborate with the original developer as opposed to simply picking up on their work, though if this plugin is not going to be carried further by the original developer than I would be willing to continue developing it for awhile independently. Still, I don't like to step on the toes of my fellow code-monkeys. I will spend a little time today looking into using GitHub and Git for making my code changes available, though it may take me a few days to actually get around to posting anything up there. I am simply comfortable using TFS as my personal source code repository (and I use the self-hosted TFS version so that the repository is on my personal machine instead of in the cloud), so making changes to my standard workflow may take a few days to fully integrate into my development activities. I will post here later if and when I do manage to get the code changes I have been making posted online for others to look over.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...