Jump to content

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


Pwolf

Recommended Posts

No idea if this "idea" has been discussed. Only got to page 9.

Why do people timewarp?

Because they are going to a planet far, far away.

Now, MP for me would not be some sort of a global server etc. This ain't Eve online.

MP would be more of a coop with friend(s).

Now, if someone built a 1k part ship and it met yours, it would lag. But people need to build big because they want to go to a planet far, far away. With you!

So the transition between planets is just dead time.

Put in stargates! You want to travel between planets and use timewarp? Play singleplayer.

In MP, you want to build together, explore a system/planet/moon together.

You don't want to lodge a rocket towards empty space while playing with your friend(s). Stargates could be located just inside each planets SoI, destination chosed before transition.

Link to comment
Share on other sites

Alright I'm not a programmer but it seems that I notice several multiplayer system:

1. Player A sends a thruster on command -> Player A computes the movement, and the ship moves -> Player A sends a command to ship in Player B computer, it computes its command, and the ships move (OpenTTD)

2. Player A sends a thruster on command -> Player A computes the movement, and the ship moves -> Player A sends a positional data to ship in Player B computer (author KSP multiplayer)

And here is my suggestion:

3. Player A sends a thruster on command -> It go to a server, computes, and it moves Player A ship -> It send a video/positional data to Player B

And vice versa is true. No one computes the ship, instead the server computes all the stuff and the client acts only like a "dumb terminal" for inputting commands and showing each other ship position. Wait, isn't this is method number 2 but this is using dedicated server instead of listen server?

Well, what if you have a very low bandwidth and/or big latency? You ill not be able to control your ship. Too much latency. The others needs to adapt to you, not you to them. Otherwise a MP will not be playable at all.

With this method we will see exactly the same problems as cloud gaming; and they are why I absolutely hate cloud gaming.

No idea if this "idea" has been discussed. Only got to page 9.

Why do people timewarp?

Because they are going to a planet far, far away.

Now, MP for me would not be some sort of a global server etc. This ain't Eve online.

MP would be more of a coop with friend(s).

Now, if someone built a 1k part ship and it met yours, it would lag. But people need to build big because they want to go to a planet far, far away. With you!

So the transition between planets is just dead time.

Put in stargates! You want to travel between planets and use timewarp? Play singleplayer.

In MP, you want to build together, explore a system/planet/moon together.

You don't want to lodge a rocket towards empty space while playing with your friend(s). Stargates could be located just inside each planets SoI, destination chosed before transition.

Stop for the timewarp issue. It is one of the easiest things to resolve, really ! You might not read it, but we need to stop discussing about that until we have a powerful and reliable multiplayer mod.

1k part ships will not lag if it is just a bunch of parts on positions that get displaced and orientated by a "global" position. You load the craft as a whole, and move it. Physics calculations will not be done, and a GPU loves to eat thousands of triangles, just for breakfast. So it will not be an issue.

Stargates are either a request that might be added to stock KSP, or a way to avoid timewarp, so argument not processed.

Link to comment
Share on other sites

Stop for the timewarp issue. It is one of the easiest things to resolve, really!

This is a bit akin to design an airplane. "Stop the flying issue. Getting the plane to fly is one of the easiest things to resove, really!"

But, before you spend endless hours on putting chairs and an entertainment system inside the cabin, and paint the entire plane, and set up a schedule for your fleet, you do want to have that tiny issue of "does it actually fly" resolved. Before you find out that half of the stuff you did can be thrown out as you have to redesign your craft ("wings? who knew?").

The reason people keep bringing it up is because it is a major dealbreaker if you can't resolve it. And saying "it's easy to resolve" doesn't make it easy to resolve, just like saying "learning to speak a foreign language at native level is easy" doesn't make doing so easy either.

Proper software development is about having a plan on how to develop the software, and while you don't expect to have all implementation details solved at initial design, you should have an idea on how to tackle some of the major issues you're going to encounter. "It's going to be easy to solve" is usually not the right plan. If it's so easy, why not simply write out the plan?

Link to comment
Share on other sites

@Rage097: Card game allow you to easily cheat as well, but still are fun when played with friends.

@Kerbart: There are dozen plans. The easiest: Same time&warp on all clients. Other more advanced ones like the one intended to use by the LOG project will require a little more effort, but still are not a problem (I'm sure you did some research before suggesting that we should again write it down ?). The reason people keep bringing it up is because because it is the only major issue that they can understand. Only a tiny fraction for readers can imagine how difficult e.G. a proper synchronization can be and of those a lot will know that joining a discussion makes little sense unless they spend a reasonable time figuring out how KSP works internally. So all thats left are new players joining the discussion about the very obvious issue: Timewarp. And no, that does not make it any more constructive to repeat that all over again.

Link to comment
Share on other sites

This is a bit akin to design an airplane. "Stop the flying issue. Getting the plane to fly is one of the easiest things to resove, really!"

It's not, though. You're basically saying that timewarp is the single most important part of multiplayer, everything else is just aesthetics, and that if you can manage that, everything else will be easier.

In my opinion, there's enough challenge accurately synchronizing data between multiple players that the level of timewarp becomes just one more piece of data that needs to be synchronized. If you can't synchronize ship positions/velocities well enough to allow for the level of interaction you want, then timewarp is moot. If you can synchronize the data, then you're just deciding how to decide on the level of timewarp, which is a UI problem, not likely to be less manageable than the synchronization issues.

This isn't to say that timewarp may ultimately prove to be "the" deal breaker to multiplayer, but that result isn't likely to be the case, and if it is, it will be because of UI issues, not technical ones.

Link to comment
Share on other sites

Yeah, timewarp isn't like trying to get an airplane to fly. It's more like not being able to fly, and worrying about the autopilot, so you don't have to fly long distances yourself. Also, on the multiplayer issue, could unity's floating point inaccuracies make it impossible, or difficult, to merely have both ships being calculated on both computers at the same time? What I mean is, is there a chance that if both computers are doing the positional calculations based on burns, that there may be a few inaccuracies, and that, over time, the two ships will be in completely different locations in either client, simply due to the low amount of positional accuracy available?

And finally, I would much rather be able to play with friends in LKO than not being able to do any MP because we can't get over the timewarp issue. In all honesty, long voyages are mainly solitary, anyway, and I don't know how many friends would want to timewarp to Jool without getting bored/losing interest.

Edited by Exsmelliarmus
Link to comment
Share on other sites

The way I'm handling it, the server is just a middleman that broker's data to and from clients. The server itself isn't do a lot of number crunching, all the physics are still handled on the client side... that said, if there were 4 players right next to each other, the clients would be melting :P

Aha, But couuldn't you do it onlive style? Example:

P1 and P2 are having fun!

P1's physics are calculated by his PC,then sent over to P@'s computer as data, no calculating required. P2's PC does the same thing.

Basically, P1 and P2's pc's work together to calculate everything!

Link to comment
Share on other sites

And finally, I would much rather be able to play with friends in LKO than not being able to do any MP because we can't get over the timewarp issue. In all honesty, long voyages are mainly solitary, anyway, and I don't know how man friends would want to timewarp to Jool without getting bored/losing interest.

To be honest, I think the only way timewarp would work well as a game mechanic in multiplayer KSP is when a few friends get together to do a specific mission together. "Hey, lets do a multiship colonization mission to Duna!" would work because once everyone gets their ships into orbit, you can say "OK, everyone do your transfer burn on your next orbit, then we'll timewarp till we reach the first place for course corrections.", "Hey, let's all pick a planet and send a lander there!" wouldn't, and the idea of a persistent world gaming environment where several people do unrelated stuff in the same world would be right out.

Aha, But couuldn't you do it onlive style? Example:

P1 and P2 are having fun!

P1's physics are calculated by his PC,then sent over to P@'s computer as data, no calculating required. P2's PC does the same thing.

Basically, P1 and P2's pc's work together to calculate everything!

While I suspect that this is more viable than having one computer do all the calculations, assuming non-trivial ships, it brings issues of it's own. If one of the computers has to run in slower than real time due to part count, then both of them have to slow down by the same amount and at the same time.

Synchronization is just touchy. For example, if you're trying to dock two craft in LKO, they may not be moving very fast relative to each other, but they can be moving over 2 km/sec relative to their SoI, so even just 0.01 a second of jitter in the sync means craft bouncing around 20m, which would make docking kind of hard. Sending craft-relative info may work better in that case, but not in others.

Don't get me wrong, I wouldn't mind seeing multiplayer in KSP, and I do follow things like this, I just don't see it as easy as some people think it should be.

Link to comment
Share on other sites

Wouldn't it be better to have, say, the server manage controlled ship location/velocity/rotation? Physics can, as someone suggested, be handled on a per-ship-per-player basis (One player's computer handles the physics for his/her ship. Changes in velocity/rotation or parts such as link failures or collisions with non-player controlled parts, are sent to server, compared to expected values, and relayed to other clients)

As for time warp, I think a voting system (along-side a vote-kick system) would be best. Perhaps to cut on network chatter, the updates on location/velocity could be scaled with the warp speed.

Now, to clarify some things: Expected values would be calculated server-side in a similar fashion to what KSP does if you have another craft running on, say, MechJeb with autopilot on, while you control another ship.

The maximum time-warp would have the same limitations as KSP currently has; the player with the lowest time-warp sets the limit for all other players. When voting, They can vote for any of the presets (1x, 5x, 25x, etc) up to the maximum and also for a duration. This duration can be overridden by a players change in altitude or from a player lowering time-warp.

To simplify the transmission of physics values, I wonder if it would be possible to have parts that are moving in the same speed and direction with the same rotation, I.E. firmly fastened parts that do not wobble, to be grouped and have the values for the group transmitted.

My only concern is this: How will docking be handled, once the crafts have docked? Since you can't (Or rather, shouldn't) have 2 people controlling the same craft, what would happen?

Now, this is all speculation by someone who doesn't know jack about networking games, so take it how you will (Or not at all)

Link to comment
Share on other sites

synch's between machines has been researched and dealt with ever since the first MP saw light. Why would suddenly synch on KSP be any different from other games, hmm?

Now, I could try to explain my point with variouse scenarios. But someone, somewhere, will just point out that "that's not ksp, that's (insert fictional game)"

games with airplanes etc. Does not have a problem with synch. Spaceship game has no problem. Racing games, fps/rts games, mech/tank games has no problem with synch. Why is KSP the special kid that can't do what other does?

and besides, what do people mean when they talk about MP on KSP?

I would just play together with friends on a world shared by noone else. LAN, coop, call it what you want.

Or did people want MP on KSP to be like Eve Online?

Link to comment
Share on other sites

Why is KSP the special kid that can't do what other does?

Its not about KSP. Its about offering an MP as a Mod. I'm not aware of many Games/Mods that do so. Just have a look at JC2 MP... that is in development for years, now...

Link to comment
Share on other sites

synch's between machines has been researched and dealt with ever since the first MP saw light. Why would suddenly synch on KSP be any different from other games, hmm?

Because KSP wasn't designed with MP in mind, and a lot of the design decisions at the code level would have to change. One of these decisions is the design that the craft that the player is currently controlling is the center of the universe, and you can't have multiple centers of the universe.

Now, I could try to explain my point with variouse scenarios. But someone, somewhere, will just point out that "that's not ksp, that's (insert fictional game)"

games with airplanes etc. Does not have a problem with synch. Spaceship game has no problem. Racing games, fps/rts games, mech/tank games has no problem with synch. Why is KSP the special kid that can't do what other does?

How many of those games involve speeds of 2 km a second where variation of less than a single meter can make or break a mission? How many of those games involve enough computation that they can't realistically all be done on the server computer? For that matter, how many of those games would cope with a computer that can't run the current simulation in real time? These are just a few of the issues that make KSP almost the perfect storm for a game that is hard to make multiplayer, even without the design decisions that make it harder.

and besides, what do people mean when they talk about MP on KSP?

I would just play together with friends on a world shared by noone else. LAN, coop, call it what you want.

Or did people want MP on KSP to be like Eve Online?

I hope not, I don't see any way for KSP to function as an MMO. The kind of sync that we're talking about should be possible on a LAN, but I don't see it happening as soon as you try to cross the internet.

As for LAN multiplayer, I'm not saying that it can't be done. I'm saying that if it weren't difficult, one of the multiple programmers that have tried to implement MP KSP would have succeeded. It's not like the only people to have taken up the challenge were teaching themselves programming while trying to achieve this.

To do it right will take either the devs focusing on rewriting the parts of the game that make MP difficult to implement (which means that they're not working on other stuff), or a lot of work by the modding community, and it's far from certain that it can be done that way.

Link to comment
Share on other sites

So in the end, it all boils down to how KSP is programmed and unity itself?

If so, then yes, abandone all hopes of MP. The devs could (maybe have allready?) just state the fact by saying that they would have to remake the game (hopefully on another engine).

So instead of wanting and discussing MP, we should all make a wish to Santa for KSP 2.

I'll gladly give them 50 dollars for a game in alpha that supports 64bit, multithreading and MP.

Or atleast that it will have those functions in due time.

Link to comment
Share on other sites

So in the end, it all boils down to how KSP is programmed and unity itself?

Other than lack of multiple physics threads, I'm not sure the MP issue can be blamed on unity (as in I don't know, not that I know that unity itself isn't an issue), but yes, from what I've read while following various MP mod attempts, much of the difficulty is on how KSP was programmed. It's along the same issues as making a single-threaded program multi-threaded. In a single-threaded program, it's fairly common to do things that assume that the running code is the only thread and therefore requires no locking or semaphores to ensure that things don't get changed in the middle of a function without that function's knowledge. Changing code written to run as a single-threaded program to multi-threaded isn't trivial in the case of non-trivial programs unless you're doing a half-assed multi-threaded implementation with global locking, because assumptions that are valid in a single-threaded program are no longer valid in a multi-threaded program. The same thing is true between single player games and multiplayer games, assumptions can break.

As for any limitations placed by unity, the devs have already ruled out changing engines beyond updating to newer versions of Unity. We switched to a much more recent version of Unity back in 0.18.3/4, and the devs are currently evaluating the latest Unity update.

Link to comment
Share on other sites

We're still talking about that timewarp thing as if it's a problem that needs to be solved?

I think I'm going to try and post a new video some time in the next few days showing what issue I'm currently trying to get around in hopes someone here can come up with a possible solution or at least an explanation as to why it's happening. Just got back from a mini-vacation so I have a bit of motivation in me now. Hopefully I can try and get this thread on topic rather than just talking about timewarp all the time -_-

Link to comment
Share on other sites

Hmmm, because the Timewarp problem...

could perhaps not be something done like in the Warpengene mod by Fractal_UK?

http://forum.kerbalspaceprogram.com/showthread.php/43839-0-21-Warp-Drive-Space-Solar-Nuclear-Antimatter-Pack-Version-0-3-2-%28Alpha%29

I do personal not know how his warpengene does the Warpdrive.

But it works without using the timewarpfunction.

This would (at least) allow a timewarp on "straight" paths (for long distances where you do not need to change your flightpath)

Link to comment
Share on other sites

Cool, pwolf, I don't think I'll be of much help, but I'll do my best, as I'm sure everyone else will as well. So, at the moment, are the two vessels merely told to be x distance apart, or do you have them in matching orbits?

Also, how difficult would it be to allow one vessel to split into two, and have one player control each half? Because, honestly, that would be the majority of how I would use multiplayer - eg. Based on early shuttle designs, where one half boost to orbit while the other half lands at the runway?

Edited by Exsmelliarmus
Link to comment
Share on other sites

So, at the moment, are the two vessels merely told to be x distance apart, or do you have them in matching orbits?

I'll go into this when I make the video. I believe there's a big misunderstanding/miscommunication about what I've actually been able to do versus what people think I've actually done based on the one video I showed. In a nutshell, I haven't done much at all and don't deserve a whole lot of credit or praise. I will go into more detail when I make the video.

Also, how difficult would it be to allow one vessel to split into two, and have one player control each half?

I don't think it would be that difficult at all. Depending on how one would implement MP, you could simply add the detached vessel to a list of controllable vessels other players can take over.

Edited by Pwolf
typo
Link to comment
Share on other sites

Good luck with the new thread. Maybe if you state up-front in large letters that the timewarp discussion is inappropriate for the thread, mods can remove posts that threaten to derail the thread.

In a nutshell, I haven't done much at all and don't deserve a whole lot of credit or praise.

Your video is the only time I've seen state synchronisation of any kind between multiple instances of KSP. That's worthy of praise in my book. "One small step for a man..."

Link to comment
Share on other sites

The forums were taken down again and restored after getting hacked shortly after they went online. I had to repost as well, lol.

Looks good, only the head-heavy rotating looks a bit weird, or does this come from the shipdesign itself?

This is a function of the basic-ness of the code. I will fix this in the future as I iron things out.

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