Giter Site home page Giter Site logo

krpc2's Introduction

kRPC2 - Remote Procedure Calls for Kerbal Space Program 2

ci

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

This is a continuation of the kRPC mod for Kerbal Space Program 1, which can be found here: https://github.com/krpc/krpc

Links for more info

Installing

Requires SpaceWarp/BepInEx to be installed.

Download the release archive and extract it into the BepInEx folder.

Current Status

The mod is a very early work in progress, so don't expect much!

Currently there is a single "service", called SpaceCenter2, with a few properties for basic telemetry.

It works with the existing kRPC client libraries (as it speaks the same protocol). However we don't yet provide generated stubs for clients like C++, C# and Java. It has only been tested using the python client, which does not require generated stubs (it can auto-generate them on connection).

When the game starts, a server is created with RPC port 50000 and Stream port 50001. There is no configuration for this yet - it is hard coded in.

Here's an example in Python, with all the currently available telemetry:

import krpc
conn = krpc.connect()
print(conn.space_center2.active_vessel.orbit.eccentricity)
print(conn.space_center2.active_vessel.orbit.apoapsis)
print(conn.space_center2.active_vessel.orbit.periapsis)

Development

This mod is in the early stages of development - there is lots to do and help is greatly appreciated!

Also check out the contribution guide (for kRPC1, but still applies here).

Building on Linux

  • Install Bazel
  • Create a symlink from lib/ksp2 to where you have Kerbal Space Program 2 installed, so that you have lib/ksp2/KSP_x64_Data/Managed/...
  • Run bazel build //:krpc2
  • The resulting plugin archive is placed in bazel-bin/krpc2-VERSION.zip

Building on Windows

Using Bazel:

  • Install Bazel
    • Ensure you install MSYS2 to C:\tools\msys64 NOT the default path
    • If your user directory contains spaces, the build may not work. If this is the case, create a file called %ProgramData%/bazel.bazelrc containing the following:
      startup --output_user_root="C:/bazel-root"
      
    • If you get permissions errors related to symlinks when building you need to enable "Developer Mode".
  • Put a copy of KSP2 in lib/ksp2 (so you have lib/ksp2/KSP_x64_Data/Managed/...)
  • Run bazel build //:krpc2
  • The resulting plugin archive is placed in bazel-bin/krpc2-VERSION.zip

Using Visual Studio:

  • First you need to setup Bazel (see above for instructions). This is needed to generate a few files that are required to build the solution.
  • Run bazel build //:csproj. This puts all the required files in bazel-bin/csproj/...
  • Open KRPC2.sln.
  • Fetch the remaining dependencies using nuget and build the project.

krpc2's People

Watchers

 avatar

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.