Jump to content

Working Multiplayer Proof of Concept with video proof [No Longer In Production]


Pwolf

Recommended Posts

For the last few weeks I've been working on a proof of concept for KSP Multiplayer capabilities. I've read a few threads on this forum about the topic: from players and developers. Most of them seem to say it's not possible. At this point I'm keen to believe my fellow programmers. The past few weeks have been a mix of excitement and disappointment. That said, I have managed to create a Multiplayer plugin for KSP... sort of. Watch the video (skip to 00:20 if you don't want to wait) and come back (more information in the video comments):

What you just watched is in fact two clients interacting with each other over TCP/IP. It is also just two vessels rotating in space. But, it's multiplayer by definition! Which brings me what this actually is meant to be. As mentioned, this project was meant to be a proof of concept. I never expected, or still expect, to see something robust and actually working. I don't really believe it's even possible at this point without some changes to the engine itself. I also don't know enough about how KSP handles vessel positions and orbits to say "yes it will work" or not. This is also a learning exercise for me to get familiar with the APIs and also learn a thing or two about client/server interaction.

So why am I even posting about this? To a degree I want people to see this and feel hopeful, even if I just got your hopes up for nothing. This is also something I've been working on for some time and just wanted to share it with the community, even if it never actually comes to anything. Most, if not all, the MP related threads out there never really have anything to show. I wanted to show the community something.

UPDATE 9/23/2013

I made a video describing the issues I was facing... and then I figured it out so I made another video instead:

Good things to follow, I'm sure.

UPDATE 10/30/2013

I am no longer working on this project... I have released my source code here: http://forum.kerbalspaceprogram.com/threads/56056-KSP-Multiplayer-Proof-of-Concept-Source-Code-Very-Alpha

There are two other Multiplayer related projects you should all check out:

LOG Multiplayer Project

KMP

Edited by Pwolf
Added last update with link to source code and other MP projects.
Link to comment
Share on other sites

This. Wow. That is really awesome :)

I hope for both you and all of us, that it is going to work. I am sure I can talk on behalf of most of the community when I say that we really, really, want multiplayer. But you proabably already knew :P

Link to comment
Share on other sites

I think there would different ways you could do this, I mean you could maybe have it so that if the host timewarp's then so does the client or if he could make it so that when everyone tries to time warp then you can time warp. Similar to how minecraft is when sleeping online you both have to get into your beds to skip through the night.

Link to comment
Share on other sites

I think there would different ways you could do this, I mean you could maybe have it so that if the host timewarp's then so does the client or if he could make it so that when everyone tries to time warp then you can time warp. Similar to how minecraft is when sleeping online you both have to get into your beds to skip through the night.

There are many things limiting timewarp in KSP, it's not as simple as 'the host decides when to timewarp': think of the limitations in timewarp when you're in low orbit around a body, or when you're in an atmosphere! I did discuss the issue with Mu once and the only viable way to make timewarp work is to convert time to speed, creating a 'speed warp' instead. Ofcourse the Kraken does not like those speeds so then you run into yet another problem, besides the Kraken the physics dictate that your trajectory depends on your speed so you can't exit speed warp when making a transfer to another body etc.. etc...

Long story short: this is a very hard issue to solve.

Link to comment
Share on other sites

I think it would be safer if a player wants to time warp it first queries the other player(s) if its ok to time warp. When everyone is fine then it would time warp. Would hate to be doing a critical move and all of a sudden ZOOM Murphy's law just popped up and time warps my craft into pieces.

Link to comment
Share on other sites

Time warp is really simple. You just don't allow it. Why would you in a multiplayer game anyway? If there is a dedicated server running it, you can just leave and it will put you on rails like a time warp but at normal speed. You come back when you need to do a maneuver. And you now have control of your entity again. Or you could go back to the VAB to build another. Or you could make a car and go to Kerbtown.... See what I'm getting at? There is no need for time warp.

People get really creative about ways why something can't work. They need to put that energy into thinking up ways that it can.

Link to comment
Share on other sites

Time warp is really simple. You just don't allow it. Why would you in a multiplayer game anyway? If there is a dedicated server running it, you can just leave and it will put you on rails like a time warp but at normal speed. You come back when you need to do a maneuver. And you now have control of your entity again. Or you could go back to the VAB to build another. Or you could make a car and go to Kerbtown.... See what I'm getting at? There is no need for time warp.

People get really creative about ways why something can't work. They need to put that energy into thinking up ways that it can.

So.... that 60 day transfer to Duna that you wanted to do........ oh, and your mid-course burn is going to be at 3:17am the Tuesday after next, make sure you set your alarm.

If you don't allow timewarp at all, then even Minmus is too far away to seriously aim for, and the Mum would be more than most people would bother with. And if you set off for Eeloo right now, you'll be there for Christmas.... that's Christmas 2014.

Timewarping at the lowest rate of any player is the only idea that holds up to any scrutiny. People who say you can use speed instead of time acceleration are displaying a fundamental failure to grasp orbital mechanics - if you set up an intercept with Jool, then tell your game that you are moving 10 times faster, you'll get there a LONG time before Jool does.

But there are hosts of other issues - do you pause time if someone is in the VAB designing a craft? Or do you allow max time acceleration?

If you allow time acceleration, what if they had maneuvers planned.... or what if they are putting together a rescue mission for either a craft that has life support, or is grazing the atmosphere, or tumbling slowly into the sun.

And even then, what if you are trying to head to Jool, and the other player is setting up a Mun-base, or playing around on Laythe, and isn't warping more than a day or so at a time.... you could end up waiting real-time hours, days, weeks for your craft to get there.

Don't get me wrong, I love that this is being developed, and the idea of multiplayer is a very interesting and popular one, but.... there is a reason that Squad isn't going anywhere near it, and nobody has ever seriously posited that the comms and interaction in realtime was unfeasible. But unless you have a solution to the timewarp issue, you have a problem.

Edited by Crater
Link to comment
Share on other sites

Time warp is really simple. You just don't allow it. Why would you in a multiplayer game anyway? If there is a dedicated server running it, you can just leave and it will put you on rails like a time warp but at normal speed. You come back when you need to do a maneuver. And you now have control of your entity again. Or you could go back to the VAB to build another. Or you could make a car and go to Kerbtown.... See what I'm getting at? There is no need for time warp.

This is A solution - it wouldnt be a good enough solution for most people though.

its fine for mun and minmus (ish), but for interplanetry missions you can easily be looking at a year of ingame time, its highly doubtful a server would remain up for that time. at this stage its highly doubtful there would be no savebreaking updates in that time!

Of course this could be a limitation thats irrelivent.

equally with the lowest common warp idea, thats all well and good but A) you'd HAVE to have kerbal alarm clock. B) you would not be able to do what payload says, you wanna go to duna? well you have to wait while bob messes around on the mun in his rover, and if you leave you may come back to your ship zooming past its target.

The problem isnt that people arent creative about how to get it to work, its a simple matter of if you want things to exist in the same universe they need to be on the same timeline, and for servers bigger than "me and my friend" that means they need to be consistant (to allow planning) and flexable (to allow moderately long flights).

The best solution i have seen is the passive multiplayer - where the gaming experience was shared, but you werent influencing each others game.

Whelp: ninja'd :)

Link to comment
Share on other sites

How about we let the OP develop his example and see how he comes up with a solution rather then discuss it ourselves :)

the problem is timewarp - we've given our suggestions and our responses to suggestions, now we let the guy under the bonnet see what he thinks works.

the only reason to lock the thread would be a repeat of old discussions, i think we've summerised the old discussions and are done now.

OP back to you keep up the (genuinely) good work and show us where you go!

Link to comment
Share on other sites

What happens if you fire the engine?

Nothing. The video is only showing rotational data being sent to clients from the server (even though the clients are sending position and orbital data as well). I did a small test with position but it didn't work very well. There are a bunch of factors I didn't take into consideration during that particular test so I need to play with it more.

the main problem still is "what happens when you timewarp"

that has been and always will be the sticking point both technically and design wise.

To be completely honest, part of my goal for this was to make sure the basics were possible. There's a lot of focus on timewarp and other aspects of the game but no one really focuses on the basics: how do I move a vessels in space? Without that basic idea, timewarp is useless anyway. So, for my own goals, timewarp isn't even on my list of things to do.

there is a reason that Squad isn't going anywhere near it, and nobody has ever seriously posited that the comms and interaction in realtime was unfeasible. But unless you have a solution to the timewarp issue, you have a problem.

I think Squad has their own goals in mind. Im sure if they didn't have to worry about making the game they could figure out a way to make this all work. They're a smart group and they have a great modding community to get ideas from. Even if no one ever makes it happen here, I'm sure those guys would figure it out, if willing. That said, the timewarp issue is a big issue but for now I'm just worrying about the basics. If and when the time(warp) comes, i'll tackle that issue, if I can.

How about we let the OP develop his example and see how he comes up with a solution rather then discuss it ourselves :)

If the mod's allow it, I'm all for discussion... I know there are a lot of threads about this already but I think discussion is important to get these ideas out and figure out what might be the best way to handle certain situations. There may not be one solution to the timewarp issue... we may have to take into consideration multiple scenarios and implement differently based on individual situations. Let's just be civil and not beat a the dead horse though. As mentioned above, timewarp isn't something I even want to think about working on right now. Lets worry about the basics and go from there.

Link to comment
Share on other sites

Could you test this, with removing time warp completely and putting in the Anti-matter/Warp mod? Maybe even talk with that mod dev to see if he could mod the mod, to make it so, you can convert power or something, to power a warp drive, to make it auto set the vessel in question up by increments of 10 fold in speed, while making it a static physics object some how, so you can't turn, etc, gotta warp in the direction, keep the "deflector dish" or something going, to bounce away particles, if you don't it removes the static and lets the kraken get at your vehicle going however fast? or something of the like, just as another "viable" multiplayer test, even if you made a simple on that allowed two computers through LAN or other means could play together, or something. Would be amazing.

Edited by Joel Dryden
Link to comment
Share on other sites

Guys please not another "Timewarp" discussion. Yes, timewarp is solvable, but doing it properly will require a lot of work.

I have to admit that my multiplayer project did not have something like this to show off, since i spend most of my time yet doing network and serialization stuff (always wanted to try implementing it myself, but ofc thats not reasonable unless its a private project for "fun"). Anyway, i nonetheless already did a lot of research. Doing a multiplayer should be possible (for me), but doing so properly will require a lot of work. And i'm not even talking about the timewarp stuff. Here are my mayor problems:

- Proper synchronization and collision. My plan is to skip collision, at least for now. That also makes it not very important to a proper sync. But bocking will require some work.

- Syncing PartModules. Though I think that is somehow doable, i'm not sure how "exact" it will be

- Mods. Especially stuff like KAS won't work, unless you rework them or make sure your MP-Mod will support it. MechJeb or simple PartModuls should be easy, though.

Anyway, nice work! I hope you continue you project. Competition is always good for the "customers" (you players), and i don't really trust those "log"-stuff to end in sth useful^^

Link to comment
Share on other sites

It's a common misconception that timewarp is "the" problem with multiplayer. It's not. I don't know why people just love to moan about how timewarp is this huge intractable problem, but they should really stop.

I've often said that positional synchronization is a larger challenge, but judging from the video it at least looks like you've solved that issue better than those who've come before you (i.e. khyperia with his Kestrel project). I'm not sure what to say about state synchronization (e.g. for partmodules). I think it's possible, but you've got to get everything just right. That said, I suspect many mods would function just fine under any framework that also synchronizes stock behavior. (Mods that store data manually won't work, but that's an outdated method anyway.)

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