Jump to content

KSP Multiplayer Proof of Concept Source Code [Very Alpha]


Pwolf

Recommended Posts

For those of you who have been following my work here:

http://forum.kerbalspaceprogram.com/threads/47861-Working-Multiplayer-Proof-of-Concept-with-video-proof

I recently decided to stop working on it for various reasons. I was going to make this big writeup (well, halfway typed it out already actually) to try and garner some motivation by other programmers to take on the task... well it seems like someone else other than myself, or Markus at the LOG project, has done just that:

http://forum.kerbalspaceprogram.com/threads/55835-Kmp-0-22-wip-alpha/

(seriously, if you haven't checked this out yet, go do it now!)

So, I have decided to not do my big writeup and just release the code for everyone to look at and laugh at (It's not very good). That said, I will go over my ideas a little bit:

Basically, my goal was to synchronize the rotation and position of multiple vessels being controlled on different clients over a network. Rotation was easy. Position, as I later discovered was also pretty easy. I realized that all I needed was orbital data. KSP does all the calculations for me, position wise. Because of this, the kraken shouldn't be an issue... My theory is:

The way I understand how KSP renders a vessel is that it will take it's orbital data and plop it where it needs to be around a body. Doesn't matter where in world space it is. If the vessel is within loading distance from the active vessel (your vessel) then KSP will automatically calculate the relative position for you based on the orbit it's in. Since KSP is constantly shifting the reference frame automatically, the position of the other vessels within viewing distance should also shift accordingly without notice. So, using that idea, only updating the orbital data to get the position, the Kraken shouldn't be a problem.

In theory of course. I was not able to test it fully but I was able to fly around another client without issues:

Anyway, enough talk... Bellow you will find the source code. A few things to note: this is all test code. It was never meant to be production quality. The plugin requires a very specific environment in order to run. You cannot compile this and expect it to work out of the box. This code is meant purely for reference and discussion.

I am also not a programmer by trade. I do this stuff in my free time as a hobby. That said, my source is not clean and I'm probably doing a lot of bad things some of you seasoned programmers might cringe at. At best, I hope someone might find what I've done useful. If not, then oh well :P Go check out the actual working plugin and have a blast!

Download Source

License: GPLv3 - Please read ReadMe.txt for more information.

One last bit:

I want to extend a big thanks to those who visited my thread, sent me messages, and watched the videos I released over the past few months. You guys are passionate about this idea and I was glad I was able to spark your interest and hopes. I am sorry I wasn't able to give you all something that was fully playable but I am really stoked to see TheGimp's project and looking forward to what he and Markus' LOG project can come up with. These are very exciting times :)

Edited by Pwolf
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...