Jump to content

I'm making a multiplayer Mod and would like to discuss some possible implementations


Recommended Posts

Dear god don't shoot me, but I'm making another multiplayer thread. I really am working on this mod, and have hopes of finishing it. I have no intention of supporting more than 4 players at a time, and I'm totally fine with that restriction.

So here's the major technical challenges I see and possible solutions to them:

Time Warps:

Just do a locking system ... solved. User initiated warp at speed x for game time x which is roughly real time x. Upon every other player accepting the player will have full control of warp for the alloted x game time seconds (could just be set to next maneuver node for easy timing). People will have to wait and communicate, but really so what? Some scenarios will automatically disable time warp like : craft under acceleration, craft has periapsis in atmosphere, craft is undergoing SOI change, etc. This is all about communication and not playing with dicks.

Observation Mode:

In order multiplayer to be fun and not just wainting in boredom, players should be able to warp to other player controlled vessels as a spectator. This way synchronizing warps won't be such a pain because you can just see what your friends are doing while you wait. Honestly don't see any major obstacles with this one, just sit down and code the thing.

Controlling physics for multiple vessels:

This is easy enough if you say each player controls their own vessel and any other vessels/debris on rails are split up evenly and calculations offloaded to separate players. This will become more of a problem as two player controlled vessels are close enough to each other that the vessel is rendered to the scene (I believe this is 2.5km). As the game physics can slow down what an actual second is the easiest way to fix this is just forcing all other players to slow themselves down to the slowest player. This shouldn't be hard in theory as it's just a matter of syncing the Systems Universal Time between all players.

KrakensBane:

This may be unsolvable. Basically the Space Kraken is caused from floating point errors which accumulate the farther you are from Origin, or moving faster than Origin. Both times the delta V or delta R are shifted to move you with the Origin (your vessel becomes Origin basically, or the Origin moves with delta V away from you). So the obvious issue of how can you have multiple Origins becomes an issue.

My current idea which may be impossible is for each player to control their own Origin/Origin speed so that their craft is always stable. As long as these offset values are passed between each client, every ship and celestial body can be remapped from the other clients coordinate system to your coordinate system ( a basis change on a cosmic scale ). Since each player deals with their own physics for their controlled craft and simply passes its vector properties (position speed etc) to the other players KrakensBane is a moot point for everything but your own controlled vessel.

Anyway I'm slowly researching and coding the project and I honestly believe a usable multiplayer for atleast 3 people and probably 4 is completely doable given enough time, but I'd like to know if any of these solutions are viable and any other alternatives / things I'm totally ignoring and are game-breaking.

Link to comment
Share on other sites

Dear god don't shoot me, but I'm making another multiplayer thread. I really am working on this mod, and have hopes of finishing it. I have no intention of supporting more than 4 players at a time, and I'm totally fine with that restriction.

So here's the major technical challenges I see and possible solutions to them:

Time Warps:

Just do a locking system ... solved. User initiated warp at speed x for game time x which is roughly real time x. Upon every other player accepting the player will have full control of warp for the alloted x game time seconds (could just be set to next maneuver node for easy timing). People will have to wait and communicate, but really so what? Some scenarios will automatically disable time warp like : craft under acceleration, craft has periapsis in atmosphere, craft is undergoing SOI change, etc. This is all about communication and not playing with dicks.

Observation Mode:

In order multiplayer to be fun and not just wainting in boredom, players should be able to warp to other player controlled vessels as a spectator. This way synchronizing warps won't be such a pain because you can just see what your friends are doing while you wait. Honestly don't see any major obstacles with this one, just sit down and code the thing.

Controlling physics for multiple vessels:

This is easy enough if you say each player controls their own vessel and any other vessels/debris on rails are split up evenly and calculations offloaded to separate players. This will become more of a problem as two player controlled vessels are close enough to each other that the vessel is rendered to the scene (I believe this is 2.5km). As the game physics can slow down what an actual second is the easiest way to fix this is just forcing all other players to slow themselves down to the slowest player. This shouldn't be hard in theory as it's just a matter of syncing the Systems Universal Time between all players.

KrakensBane:

This may be unsolvable. Basically the Space Kraken is caused from floating point errors which accumulate the farther you are from Origin, or moving faster than Origin. Both times the delta V or delta R are shifted to move you with the Origin (your vessel becomes Origin basically, or the Origin moves with delta V away from you). So the obvious issue of how can you have multiple Origins becomes an issue.

My current idea which may be impossible is for each player to control their own Origin/Origin speed so that their craft is always stable. As long as these offset values are passed between each client, every ship and celestial body can be remapped from the other clients coordinate system to your coordinate system ( a basis change on a cosmic scale ). Since each player deals with their own physics for their controlled craft and simply passes its vector properties (position speed etc) to the other players KrakensBane is a moot point for everything but your own controlled vessel.

Anyway I'm slowly researching and coding the project and I honestly believe a usable multiplayer for atleast 3 people and probably 4 is completely doable given enough time, but I'd like to know if any of these solutions are viable and any other alternatives / things I'm totally ignoring and are game-breaking.

I wish when I read one of these multiplayer threads, there was a new idea in it. Every challenge and solution you posted has been plugged more times than a cheap hooker :(

If it could be done, the brains that fill this board would have done it by now one would think.

Link to comment
Share on other sites

Wow thanks for the encouragement, I'm looking for why my solutions won't work as looking at the code this should all be feasible.

I was encouraging to people the first 236,994 times I replied to the other mountains of threads that existed on this exact same topic before the forum wipe :) sorry, all this has been discussed so many times before. We'd love multiplayer but I can't see it happening.

Edited by Devo
Link to comment
Share on other sites

Most of the issues have been solved in terms of UI and general process behavior. What you posted is the same compilation of notes that I had been distributing for some time now, collected from what was perceived to be the best features suggested each time someone brings up the multiplayer subject.

The real technical hurdle remaining is the ability to move multiple vessels simultaneously.

So far nobody has made any progress in that, due in no small part to KSP rendering the effective 'universe' as a 2.5km radius sphere with the active vessel at its center. All objects outside that radius are on rails, with some like planets never leaving their rails.

I wish you luck in this endeavor. Aside from that unknown of how to control multiple vessels, the amount of code required to make this work properly will be quite significant and take a long time to implement. You should really start right out with a SVN or Git system for development so that other people can help, because doing it all by yourself is going to mean taking a very long time.

Edited by OdinYggd
Link to comment
Share on other sites

Well still gonna keep trying but thanks I guess

Well as long as each player maintains there own universe and constant syncing happens I don't see the issue

If people are actively working on multiple vessels I'd love to help

Thanks for the insightful comments on the issue... I have another few coders that can help me and will definitely open a git when I reach a decent jumping off point

Edited by OdinYggd
Link to comment
Share on other sites

Time out just a second.

Before you get carried away, you should probably get in the habit of using the forum's edit button when nobody else has replied since your last reply.

I'll merge your previous posts, but please avoid double posting.

Also, you would do well to equip yourself with a C# compiler such as Monodevelop or Visual Studio .net, and learn to make simple plugins with it before undertaking something as complex as this.

Link to comment
Share on other sites

I really haven't been ripping notes this is just what I've thought up the past few days and the forum wipe has made research hard

I'm a professional software engineer and have a basic chat system in place

Sorry for the double posts replying on my phone atm

Edited by notcomplex
Double post
Link to comment
Share on other sites

It's not so much a matter of ripping notes as that's largely the same concepts that have been circulated for some time. A number of well known mod authors were involved in coming up with those methods, as well as the input from a lot of people over time as they have been discussed.

Warping is initiated by requesting warp. All players have 15 seconds to click deny warp- which would allow someone who is close to a maneuver or in an unsuitable situation to refuse the warp, triggering a 2-5 minute cooldown.

Assuming nobody refuses, after all players have pressed accept or timed out, the players who pressed accept are taken to a screen where they can select warp duration, with shortcut keys to SOI change, apoapsis, periapsis, and maneuver nodes. Players who timed out are presumed to be afk, and are not prompted for warp parameters.

Once everyone has entered their settings, warp then takes place as a function of the lowest common denominators of speed and duration followed by a 2-5 minute cooldown so whoever reached their destination first can perform their maneuver.

I do like the idea of having an observation mode, but it should be an opt-in feature so that people who don't necessarily want to be watched can fly without being observed.

From my perspective of it, I don't think multi-vessel physics is even relevant. Each client calculates its own physics and provides that information to the server. Same thing with Krakensbane. The challenge is converting the resulting coordinate stream into objects on other client screens, and having those objects being updated while on rails.

Already the KLF plugin is lightyears ahead of other multiplayer systems, as it shows moving markers on the map where other vessels are. But at this time it doesn't actually put a vessel at that location, it merely draws a moving market on the map view.

Link to comment
Share on other sites

I am disappoint and disapprove of this plan. Because the moment someone makes a functioning multiplayer mod, someone will implement weapons into it and soon we'd be more preoccupied with dodging thrown knives and Nazi zombies on Gilly than we would be with producing functioning rockets

Link to comment
Share on other sites

I am disappoint and disapprove of this plan. Because the moment someone makes a functioning multiplayer mod, someone will implement weapons into it and soon we'd be more preoccupied with dodging thrown knives and Nazi zombies on Gilly than we would be with producing functioning rockets

And who says that won't be fun?

Anyway, if the plugin is a success, I'll be all over it.

Link to comment
Share on other sites

I am disappoint and disapprove of this plan. Because the moment someone makes a functioning multiplayer mod, someone will implement weapons into it and soon we'd be more preoccupied with dodging thrown knives and Nazi zombies on Gilly than we would be with producing functioning rockets

That actually sounds like more fun.

Link to comment
Share on other sites

Well I'll post an update demoing some actual stuff in a few weeks and as a general reach out to the modding community for help. Thanks a ton to OdinYggd for implying a lot of the things I am trying to implement are possible.

Link to comment
Share on other sites

Please dont cancel this mod like kessler or kermageddon i would really like a mod like this where me and my friends could for example have large turn based space battles

Kessler and Kermageddon was just a way to share save files. They didn't do actual multiplayer.

Link to comment
Share on other sites

So far nobody has made any progress in that, due in no small part to KSP rendering the effective 'universe' as a 2.5km radius sphere with the active vessel at its center. All objects outside that radius are on rails, with some like planets never leaving their rails.

Has anyone achieved controlling multiple vessels simultaneously within the 2.5km limit?

Link to comment
Share on other sites

Nope, but really as long as each client does the physics for its own vessel this shouldn't be drastically different than trying to dock two ships in single player (one just gets movement updates from the other clients)

As the game isn't that graphically intensive I'm hoping this won't cause an absurd amount of lag. This is all speculation though :/

Also I think I'll be able to use a lot of Dead Reckoning as the courses of vessels are predetermined Kepler orbits.

If anyone wants a nice explanation, I believe Unity supports this already so it shouldn't even be that much coding overhead (Did I mention that I love Unity's ease of use so far!)

http://www.gamasutra.com/view/feature/3230/dead_reckoning_latency_hiding_for_.php

Edited by notcomplex
Link to comment
Share on other sites

i get how you want to do this. World of tanks does like that. The clients stream the position of their tank to the others, and the code is made to update the positions of the others as much as possible, plus a few bells and whistles to hide some jittering. The problem is, as long as the other's vessels are far away, you just need to stream the position to display, and the velocity, so the game can make up for a short stop of the update stream. The problem is that when you are close, you cant do that. you would need to stream position, velocity, acceleration, momentum, commands to flaps and stuff. That does not seem too easy to do :/ but i agree i do see a way too. I hope i had some more time so i could collaborate.

Link to comment
Share on other sites

I was thinking about that, since things like Docking ports and Flaps are just animations, sending just the commands (ie open/close dock) and having the other player call them may be best, all this feels like additional caveats and nothing game-breaking/impossible to do. Control surfaces may pose a real issue though, but who cares if they aren't really synced.

Link to comment
Share on other sites

I've always thought that one of the best ways to do it was to do it how KLF is currently working. IIRC, KLF simply takes user A's orbital information, and plasters it on user B's map, however, it doesn't take their actual information, but simply determines where they'd be on the users' maps. That way, time warp isn't necessarily an issue, although it would look a bit funky.

Link to comment
Share on other sites

I personally think most ppl are interested in multiplayer for combat. Why not just focus on some way for two (or more) ppl get two ships into a similar orbit a few kilometres from each other - no warp, no spaceport. Just two ships and a surrender button. I reckon you'd have a winner on your hands there :)

Link to comment
Share on other sites

I've always thought that one of the best ways to do it was to do it how KLF is currently working. IIRC, KLF simply takes user A's orbital information, and plasters it on user B's map, however, it doesn't take their actual information, but simply determines where they'd be on the users' maps. That way, time warp isn't necessarily an issue, although it would look a bit funky.

I suggested that once, people complained that users would have different ejection angles. Also a player you pass through a moon in another players game if the moon is in a different spot.

That said there is no point in posting these threads unless you have code, even a proof of concept...

Link to comment
Share on other sites

Your best bet would be to make something similar to what Minecraft has setup. Where everyone has the ability to fly and launch everyone's designs. This would allow you to gather a community of people each with there own strengths and weakness. As for mods you could make it where the mods are saved to the host server or to each client. This may take a bit more coding but Minecraft being a similar style of game play, taking something that works and modifying it to work for KSP would make your life a lot easier. Of coarse you would have to get their permission or write your own code to have the same effect which ever suits your needs.

Link to comment
Share on other sites

  • 1 month later...

Yea like how i'm having problems docking certain parts of my station. I'm great at building but not so much at docking. Although I can land things.

On the comment on someone making combat, That could be interesting still, I'd like to see career mode have a competitive co-op. Your competing say for the K-Prize which is basically getting different achievements before everyone else to get a influx of money. Multiple people can work in one of say 3 agencies on Kerbal competing for their agency. But if you say, need a rescue mission to get a kerbal from an accident in space, you can offer a reward.

Another fun part is with the mining mods/etc, being able to trade. The space station I'm working on right now is at 2m meters orbit around kerbin, designed to be a refueling station, and refinery. Designed to be ran by one kerbal, but habitation for say 20+. Then base rovers which i'll land on the mun, and use the refueling station to send those out to other planets.

Multiplayer could also unlock doing superstructures both in space and on planets. Say a new launch platform that takes multitudes of flights and people working together to build to reduce fuel use. Or making a scale replica of the Enterprise.

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