Which mod to use if I don't use Arduino?
I want to make a ksp controller from a external USB MIDI controller (M-Audio Axiom Air Mini 32).
I've already got code to read inputs from it (written in Rust). At first I though about making it a virtual xbox 360 controller. But using a mod will probably give me a better control over how inputs are mapped to game actions.
Which mods do you recommend for inter-process communication? I'm thinking about using krpc right now, but I've read that simpit might be a better option.
I also don't want to use arduino, simply because I don't have one.
Posted Jan 2, 2021, 12:51 PM UTC
It depends on what the controller looks like to KSP. If it just sends input, I'd suggest mapping those inputs to the relevant keys and joysticks in KSP control panel. For more advanced stuff, you need to provide some detail as to the IO system of the controller. You could run some code with kRPC to look for keyboard input as well, but Simpit and KSPSerialIO both expect input via serial ports (they normally use the USB as a serial port, but you don't have to).
It sends MIDI messages, which KSP (unsurprisingly) doesn't see. I can communicate with serial ports in Rust, just need to find docs on what protocol simpit (or kspserialio) uses.
I am afraid I am unable to help your on the specifics, as I always relied on the code supplied to KSPserialIO for communications. But I think you would be able to find what you need(packet format, chksums) in the source code for the Arduino that is supplied with the plugin. Arduino is a dialect of C, so I think you will be able to read it. As for Simpit, I never got around to use it.