Jump to content

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


Pwolf

Recommended Posts

Also multiple players on the server could cause the need for some hefty hardware for the server, KSP throws a CPU hogging fit when the part count exceeds 250. Having 4-5 players near each-other (close enough that physics is loaded for everyone) could render the sever into a molten pool of expensive metals

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

Link to comment
Share on other sites

(...)

Does anyone know how to actually calculate this? lol. I know you can do this in 2D with relative ease (iirc):

x2 = x1 + cos(angle)*distance

y2 = y1 + sin(angle)*distance

(i think that's right)

(...)

For one thing I'd drop real numbers and switch to complex numbers instead; it allows you to drop most of the trignometry involved (this is why complex numbers are used extensively in electromechanics, and to my knowledge in orbital mechanics as well)

As for the kraken, I'm sure there's lots of ways around the numerical problems but I think the integration with Unity is part of the “problem,†and I'm putting that word in double quotes as we should not forget that despite all the flaws and shortcomings the unity route does seem to succesfully have spawned KSP in the first place, and on multiple platforms as well.

Link to comment
Share on other sites

Sorry if it has been said but why not simply ignore timewarp and only send vehicle position to the server? When a user timewarps, temporarily remove the user's vessels from the server until the user has completed their timewarp, when timewarp is completed vessels appear on the server again in whatever location they are currently in on the client's machine? I can see the only issue with this (critical one anyway) being any vessels between the player who has just timewarped and other players which are currently docked, they could be undocked prior to timewarp perhaps, inconvenient but a small price to pay for the ability to play KSP with others in the community.

Link to comment
Share on other sites

Maybe we could stop warping and start with the problem to get two ships to a point near theirselfs without hyperedit?

but apropos hyperedit...couldnt you abstract it to edit the ships position every second? or would that be too much?

Link to comment
Share on other sites

I can see the mod frustration. Multiplayer discussion will automatically return to timewarping as it's such a big deal. I'd say no time warping withing the SOI of each planet. Outside planetary SOI (thus inside Kerbol's) you'd be in single player mode and can warp as you like. Then you "drop out of warp" and into a planetary SOI. Now we know where "going in and out of warp" came from!!

The demo is cool and an amazing proof of concept and the OP has my blessing to research it further; it's an impressive feat that I'm not capable of. However I think most of the multi player issues are not technical (warp being the most interesting of them) but result more from multiplayer social issues: property destroyed by other players, cheating, harassment, bullying, etc. Even if the technical issues are solved that'll still be a tough nut to crack.

Link to comment
Share on other sites

Multiplayer discussion will automatically return to timewarping as it's such a big deal.

No, its not. Its just the most obvious problem problem for someone thinking about an KspMp for the first time. Also easy enough to be understand by everyone who isn't a programmer with mp-experiences, in contrast to stuff like the Kraken or how to make a proper synchronization. Give me a mp that does everything but timewarp and i'll solve that timewarp for you in a week, max. Timewarp is not an issue at all. No ksp mp project i know of ever made it to a point where timewarp was an issue.

Same with your social problems. The easy solution: Only play with people you can punch in the f..., if they do. Building a "more advanced" solution would be only a little more effort.

Link to comment
Share on other sites

The problem with one user timewarping and the other users, not, all revolves around the fact that everything (except perhaps the sun) is in motion. You cannot just timewarp your craft and have it reappear in the proper position when you're done, because by then, there is no proper position. Your planets and everyone else's planets are in different positions. At that point, you're not in the same universe, and you might as well just be running an in-game chat system, as everything else won't sync back up.

Either everyone warps, or no-one warps. There just isn't a way around that.

-- Smoov

Link to comment
Share on other sites

So coordinate time warps, send requests to other players, everyone has to accept or no one warps. Also perhaps allow any individual player to disengage the timewarp (in case they forgot something or need to maneuver while the other player is on their way to jool).

Link to comment
Share on other sites

that would be covered by using the lowest common setting of everyone involved... so I could set mine at 50x while someone else is still doing local maneuvering at 1x, and then run to the store for smokes, and he can raise his setting to 5x, 10x, 20x, 50x, as he wants while I'm gone without having to wait for me to answer a prompt for permission. My setting my side at 50x already gives my permission for up to 50x.

My end wouldn't be running at 50x at that time, it would just be permissive up to 50x, as there are other clients who are running slower at the time.

-- Smoov

Link to comment
Share on other sites

that would be covered by using the lowest common setting of everyone involved...

And the circle goes on...

Perhaps a multi level design is needed.

Disappear- reappear with orbits linked to SOIs seems to be great for long distance travel, but makes rendezvous very unnatural.

Lowest common/agreed method would work fine for rendezvous between players, but completely rubbish anything apart from surface activity, or the lowest orbits.

Switching between modes would need some thinking out.

If not a technical problem, it's still a big design decision.

Link to comment
Share on other sites

One way that it could work is instead of time warp there could be something more like warp speed. The ships coordinates, velocity, and trajectory of all ships in the game would be synced to the host. When a player goes into "warp" the player drops out of the map, a beam of blurred light or something could appear in the last position, and when the player drops back in the ships position is once again synced to the host. Time warp would not be possible due to the fact that each player is synced to the same time space, if time warp acted more like warp speed then players could get to far away planets without problems.

Link to comment
Share on other sites

As I've stated already, increasing speed/warp can't replace timewarp. The celestial bodies aren't moving so you'd basically just move to them in a straight line. At this point, we should just implement a teleport mechanic since there's no point in using orbital physics anymore. This is an idea i wouldn't do as it removes an important part of the game.

Timewarp is possible in a synced environment. You just have to make sure all clients are synced together after the fact before resuming normal time.

Link to comment
Share on other sites

Timewarp is possible in a synced environment. You just have to make sure all clients are synced together after the fact before resuming normal time.

It's like saying that creating and preserving peace in the middle-east is simple; you just have to make sure that everybody gets along.

The whole syncing thing is the problem. How do you decide to go into warp in the first place? And when to get out? Based on "whoever needs the lowest warping speed?" That makes multiplayer beyond 2-3 players nearly impossible; there will always be somebody who needs to do something where timing is critical.

Edited by Kerbart
Less abrasive
Link to comment
Share on other sites

I'm not saying it's not problematic, I'm just saying that the programmatic function of timewarp (increasing the rate at which game time passes more quickly) in a synced, multi-user/client environment is possible. It may not be practical at first but it will work. This is assuming sync is no longer an issue.

It's not that I don't have a clue, it's that it doesn't matter unless there's something in place to actually test people's ideas. I'm not a game designer, I don't really care what steps users have to take to get to the point where a timewarp actually happens. All I care about is proving that it's possible, in code. I believe it is and I believe I can prove it is but the way things are going I can't even prove that the very basics of syncing positions are even possible. Without that I can't even move past a worthless plugin that just syncs rotations and orbit data.

Link to comment
Share on other sites

um, ok, perhaps we're getting a clash of differing ideas of what the multiplayer would even be.

My thinking is a group of 3 or 4 (or even more) doing something cooperatively on either the same task, or similar tasks, while it seems others are looking for some kind of massively multiplayer 24-hour server for everybody to be on at once.

The latter just isn't practical. If the celestial bodies didn't orbit, and stayed in static positions, no matter how fast you timewarped, then people independently timewarping their orbits around fixed objects wouldn't be an issue.

[edit: It could be possible to implement this on a case by case basis, if someone wanted to run a server with static celestial bodies, accepting giving up some (well, more than some) realism, for the sake of camaraderie. This would make it possible for individuals to timewarp independently, but then you lose a big chunk of what makes KSP fun in the first place.]

The celestial bodies do orbit, however, which effectively puts the player who timewarped, on a different 'map', than the players who didn't. You couldn't keep them in the same instance together. Even if you were just doing a planet and its moons, you still have the same issue. You end up being in a different, incompatible, reality.

It is either all timewarp, or nobody timewarp. Those are the two possible choices. Any other combination, just isn't practical, or possible.

Anyways, working out sync'ing timewarps between players is relatively simple, and probably the easiest part of coding a multiplayer addon. Sharing the rest of the data in a manner that keeps your position on everyone else's computer, accurate, is the harder part. Let them focus on that, instead of trying to keep arguing for something that just isn't going to happen.

-- Smoov

Edited by Smoovious
added another thought
Link to comment
Share on other sites

Well Pwolf, I dont have a clue how to solve the mp timewarp, but I am very impressed with what you have done so far! I would even be happy if a few friends and I could build a space station around a static kerbin together. Keep up the good work!

Edited by Max80well80
spelling mistake.
Link to comment
Share on other sites

It may not be much yet, but it's still more than anyone has managed to accomplish since KSP began, including Squad. I wish you success.

That is the most blatant argument I've ever seen, making multiplayer in Unity3D is NOT hard therefore your statement is false.

Link to comment
Share on other sites

@IndieDev3d: Have you quoted the wrong thing, because your reply makes no sense in that context... who were you talking to?!

PS: I'm still lurking this thread to keep atop of development in this. could be interesting!

Link to comment
Share on other sites

@IndieDev3d: Have you quoted the wrong thing, because your reply makes no sense in that context... who were you talking to?!

PS: I'm still lurking this thread to keep atop of development in this. could be interesting!

*Sigh

Saying that writing a simple plugin is accomplishing more is very, very blatant indeed, Squad made an entire game, multiplayer or not. Oh and one more thing, this isn't twitter, @'s don't work for replies.

Link to comment
Share on other sites

Yes well neither does "reply with quote" so shhhh you. Also saying @name predates twitter and i first started using it on forums. #EnoughSaid (yeah, that one was just for you :) )

true, making a whole game is slightly more impressive then the work done so far - but the next best thing we have for multiplayer attempt is live feed (to my knowledge).

admittedly squad hasn't tried making multiplayer because it isn't something they are interested in. But the post you are quoting is stating that nobody has achieved this before (and offering praise for said accomplishment). Your reply doesn't obey even the most basic laws of logical reasoning

Statement + irrelivent fact = Statement must be false. Hmmmm

If he'd said "OMG making multiplayer in unity 3d is so hard nobody has ever done it..." then your reply would make sense.

But replying to "yay your doing awesome keep it up" with "Psshht thats easy" leads me to believe you are about to bring out your own multiplayer mod? otherwise a more sensible approach would've been to shut up and let the man get the praise - hell i thanked my cleaner for emptying the bin this morning - not because its hard, but because nobody else had done it. If i'd said "yeah well emptying the bin is easy" i doubt she'd have done it again next week.

and a final note: blatant doesn't mean what you think it does. Wrong is more what you are aiming for (i'm guessing, not agreeing)

ANYWAY: that was all off topic entirely so i'm going back to lurking #PeaceOut

EDIT:

ONTOPIC: I agree with devo

It may not be much yet, but it's still more than anyone has managed to accomplish since KSP began, including Squad. I wish you success.

This is the best i've seen for a multiplayer attempt and i wish the OP all the best, and all the fun as he challenges himself, and gets this working - which i'm sure he can do. He seems to know where he wants to take this mod and how to get around the various problems he foresees now. Keep up the good work OP and keeep us posted on developments :)

Edited by shand
adding some on-topic content :P
Link to comment
Share on other sites

I deleted my comment because it was replying to your comment which you deleted and was therefore out of context and wouldn't make sense.

In reply to your last comment:

Fine, but nobody was saying he deserved more praise then the praise for the entire game - that could only be implied from the original comment you quoted if you completely ignored the context. IE: the fact this is a topic about a multiplayer mod, where someone is trying to make MP work despite everybody says its impossible.

And you are still saying that making MP in unity is really easy, which is a tad rude, and very unhelpful.

PS: your website doesn't work - i was hoping to look you up and admire your handwork (out of genuine curiousity - i like clicking links in sigs) but... i can't :(

Link to comment
Share on other sites

In another removed comment did IndieDev3D mention sth like that as a programmer, he has more important stuff to do than create a ksp mp, but might do it anyway.

Does the removal mean you realized that making any game multiplayer isn't compulsory easy, even if it does use Unity? Or is you offer still valid? Any additional dev working on that topic would be awesome imo. Would be interesting if you do come up with good solutions where others including me with definitively some kind of programming or modding experience have not yet found any. At least way more productive than those childish conversations (personal opinion).

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