Jump to content

How to get Information from the Game


GalaxG64

Recommended Posts

Greetings fellow Kerbonauts,

I have recently read an article in the german Chip magazine concerning the Raspberry Pi, and in it there was a project that used an Arduino Leonardo (not quite a Raspi) to build a custom Kerbal controll interface, with nice metal swiches, and levers and cotroll Input for rotational and translational movement.

I really liked the idea and I was planning on taking it s step furthur, maybe evan implementing a real world navball and a small LCD screen reading f.e the time to Apoaps and\or the time to node and maybe other information like Fuel level, consumption rates and other stuff normaly displayed on screen.

I am "quite" experianced with coding for an microcontroller like an Atmega 328 but that is manly C or Assembler code so I should be able to program all of that without running into to many prblems. And I planned on using a Keyboard protocoll to relay information to KSP, so the Swiches an levers should work.

My main problem is retreaving the Information from the game to be able to process or display it for I have no Idea how the Game is internally structured or how to access the various variables, or in C# I think stuff like that are called Classes and where to find what, so thats why I'm here.

Thanks alot for reading and excuse my spelling, I have never been good at that. :)

Link to comment
Share on other sites

Hey, welcome to the forum.

There's two existing mods that are popular for simpits and controller hardware: Telemachus uses a web socket to get data in and out of the game, and KSPSerialIO uses a serial link over the Arduino's USB connection.

They both output a lot of very detailed telemetry information. And also have a protocol for inputting control data. I'd suggest adopting one or the other for your project, and dropping the idea of keyboard emulation for simplicity's sake.

There are quite a few hardware projects on the forums, most of them using one of those mods. Have a look at the custom hardware/simpit repository thread, and look for the [Hardware] tag in the Fanworks forum. Lots of ideas and inspiration to be found.

And make sure you start a thread in the Fanworks forum for your project!

Link to comment
Share on other sites

Thanks alot. It seems to be a better Idea to use the Serial IO mod, than to emulate a Keyboard. I however found the Idea of maybe writing a mod myself kind of cool, so I wanted to know, where I could find the required documentation, or a tutorial that coveres the KSP API (Ill learn C# with the help of books and learning by dooing other smaller projects). Thanks again

Regards,

Alexander Becker

Bavaria Germany

Link to comment
Share on other sites

For that, you want to have a look at the Mod Development Links Compilation post in the Add-On Development forum. The plugin development section has a series of links to API docs and info on how to get a development environment set up. I haven't written anything from scratch, but following the docs there got me set up to contribute to a few other addons.

Good luck!

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...