Giter Site home page Giter Site logo

krpc2's Introduction

kRPC - Remote Procedure Calls for Kerbal Space Program

ci docs

kRPC allows you to control Kerbal Space Program from scripts running outside of the game, and comes with client libraries for many popular languages.

Contributing

Contributions to kRPC are very welcome. Please refer to this guide.

KSP2

kRPC is coming to KSP2! Notice: I am not actively developing this, due to lack of time. If you would like to contribute PRs or take over the project please get in touch on Discord.

You can find it in the new kRPC2 repository here: https://github.com/krpc/krpc2

Links for Developers

krpc2's People

Contributors

djungelorm avatar dmadisetti avatar garydeco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

krpc2's Issues

Add Issue Templates

Add Issue templates mirroring those added to krpc to maintain organization.

Build fails for current KSP v0.1.3.1 due to missing library

What happened?

When trying to build under WSL/Windows 11 the build aborts due to missing libraries. Current KSP2 does not come bundled with USD.NET.dll or in fact any USD libraries.

appenz@Dragon2022:~/dev/krpc2/ > bazelisk-linux-amd64 build //:krpc2                                               ~/dev/krpc2
INFO: Analyzed target //:krpc2 (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/appenz/dev/krpc2/server/BUILD.bazel:6:15: Compiling server failed: missing input file '//lib:ksp2/KSP2_x64_Data/Managed/USD.NET.dll'
ERROR: /home/appenz/dev/krpc2/server/BUILD.bazel:6:15: Compiling server failed: missing input file '//lib:ksp2/KSP2_x64_Data/Managed/USD.NET.dll'
ERROR: /home/appenz/dev/krpc2/server/BUILD.bazel:6:15: Compiling server failed: missing input file '//lib:ksp2/KSP2_x64_Data/Managed/USD.NET.Unity.dll'
ERROR: /home/appenz/dev/krpc2/server/BUILD.bazel:6:15: Compiling server failed: missing input file '//lib:ksp2/KSP2_x64_Data/Managed/USD.NET.Unity.dll'
ERROR: /home/appenz/dev/krpc2/server/BUILD.bazel:6:15: Compiling server failed: missing input file '//lib:ksp2/KSP2_x64_Data/Managed/Unity.Formats.USD.Runtime.dll'
ERROR: /home/appenz/dev/krpc2/server/BUILD.bazel:6:15: Compiling server failed: missing input file '//lib:ksp2/KSP2_x64_Data/Managed/Unity.Formats.USD.Runtime.dll'
ERROR: /home/appenz/dev/krpc2/server/BUILD.bazel:6:15: Compiling server failed: 3 input file(s) do not exist
ERROR: /home/appenz/dev/krpc2/server/BUILD.bazel:6:15: Compiling server failed: 3 input file(s) do not exist
Target //:krpc2 failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /home/appenz/dev/krpc2/server/BUILD.bazel:6:15 Compiling server failed: 3 input file(s) do not exist
INFO: Elapsed time: 0.101s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
FAILED: Build did NOT complete successfully

How can someone else reproduce it?

Build with bazelisk-linux-amd64 build //:krpc2

What is your environment?

  • Windows 11
  • WSL
  • Install Mono via apt-get
  • Install bazelisk as binary install

Anything else we need to know?

Would love to contribute to this project, but not a Unity expert.

Configuration saving

And functionality to save server settings in a config file so that:

  • Settings are persisted
  • Settings can be edited manually without the game running (useful for testing tools)

Packaging

Add bazel rules for building the release archive.

This can also be used to publish build artifacts from the ci workflow.

Basic vessel control

Add RPCs for basic controlling of a vessel.

See https://github.com/krpc/krpc/blob/main/service/SpaceCenter/src/Services/Control.cs

  • Control constructor (created by Vessel.Control property)
  • Control.Pitchv
  • Control.Roll (instantaneous and trim)
  • Control.Yaw (instantaneous and trim)
  • Control.SAS
  • Control.SASMode
  • Control.SpeedMode
  • Control.RCS
  • Control.Gear
  • Control.Brakes
  • Control.Lights
  • Control.WheelThrottle (instantaneous and trim)
  • Control.WheelSteer (instantaneous and trim)
  • Control.Throttle
  • Control.ActivateNextStage

Use reference libraries for KSP2 in CI builds

CI workflow builds currently fail, due to the KSP2 DLLs not being available.

We can't distribute these DLLs as is, as that is a breach of Private Division's copyright.

What we can do is something similar to krpc1, where we use "stripped" versions of the KSP2 DLLs. They could also be encrypted (with the encryption key only accessible to the ci workflow)

[Bug] Reloading a save file leaves client hanging

Behavior:
Loading a save file after the first time causes the client to hang.

Expected Behavior:
Client should start new connection with the current running instance.

Maybe this has something to do with pausing and starting? Either way, manual testing is needing a total restart of the game.

[Feature Request] Testing Scaffolding

I think unit tests are great. Manually testing these endpoints, but it would be nice to ensure we have reproduciblilty. Not sure how this works with the stripped versions of KSP? I also think there likely has to be a bit more in place to actively do proper testing

Change build system so you don't need to copy large files

The Kerbal Space Program 2/KSP2_x64_Data directory is ~33GB. Currently the build system requires you copy this directory to lib/ksp2/KSP2_x64_Data/... in order to build the project. This is unreasonable -- what if you don't have much disk space? (On Linux this is less of an issue as you can use a symlink, more of a problem on Windows)

We should change this to require Kerbal Space Program 2/KSP2_x64_Data/Managed directory to be copied to lib/ksp2/Managed/.... This is only ~50MB

@GaryDeco sound good to you?

Basic flight telemetry

Add basic telemetry to Flight class. This functionality depends on reference frames, so is blocked by #17

See https://github.com/krpc/krpc/blob/main/service/SpaceCenter/src/Services/Flight.cs

  • Vessel.Flight(referenceFrame) to construct instances
  • Vessel.Velocity
  • Vessel.Speed
  • Vessel.HorizontalSpeed
  • Vessel.VerticalSpeed
  • Veseel.CenterOfMass
  • Veseel.Rotation
  • Veseel.Direction
  • Veseel.Pitch
  • Veseel.Heading
  • Veseel.Roll
  • Vessel.Prograde
  • Vessel.Retrograde
  • Vessel.Normal
  • Vessel.AntiNormal
  • Vessel.Radial
  • Vessel.AntiRadial

Basic reference frames

Add basic reference frames. This is a complex one, and is depended on by a lot of other functionality. Instances of this class don't expose any RPCs to the client, but they do have an "internal api" that is used by other parts of space center (e.g. getting the position, or rotation of the frame relative to world space).

See https://github.com/krpc/krpc/blob/main/service/SpaceCenter/src/Services/ReferenceFrame.cs

To start just add these three main ones:

  • ReferenceFrameType.Vessel
  • ReferenceFrameType.VesselOrbital
  • ReferenceFrameType.VesselSurface

With the following methods/properties:

  • Transform
  • Position
  • Rotation
  • Up
  • Forward
  • UpNotNormalized
  • ForwardNotNormalized
  • Velocity
  • PositionFromWorldSpace
  • PositionToWorldSpace
  • DirectionFromWorldSpace
  • DirectionToWorldSpace
  • RotationFromWorldSpace
  • RotationToWorldSpace
  • VelocityFromWorldSpace
  • VelocityToWorldSpace

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.