Jump to content

DarkMultiPlayer 0.3.8.0 [KSP 1.12.0]


godarklight

Recommended Posts

I just thought of an idea that could solve an annoying problem.

People like to watch each other as they do stuff. One fun thing is to be piloting a space station and watch someone come in to dock with you. But in practice we've NEVER gotten this to work because even when the two clients are synced to the same time, they keep "arguing" with each other over the exact position of the station. It keeps teleporting around once a second or so, jumping several meters this way, then several meters that way, and so on, making docking with it impossible (and deadly when it happens to jump to a position superimposed with the incoming ship and BOOM.)

The problem seems to be caused by the fact that one client, let's call it the "passive" one, is piloting the station and the small changes it makes with full physics on cause the on-rails calculation of its position that the other client sees, the "active" one, to be all over the place.

To fix this, would it be possible to allow a player to put the camera on a vessel but choose to lock himself out and be passive (as if someone else was controlling the vessel even though they aren't) and treat the ship like it was on rails but at 1x speed? You know how when you go to 5x rails speed you are able to swing the camera around and look at things but you cannot touch the ship? Is there a way to enable that rails mode but have it doing that at 1x speed? That way the "passive" player's client won't be constantly messing with the position of the station and making it jump around. Only the "active" player's client would be in charge of choosing both the ship and the station's positions.

Link to comment
Share on other sites

godarklight, when running DMP for first time, but before connecting to a server, when I attempt to Resume a save game, I get a save game invalid error, which delete is the only fix for (update and cancel crash KSP) but will reoccur on game restart since the default DMP save game persistent file is not recognized by Resume Game. This can be prevented by either requiring the user to simply connect to a DMP server prior to running a save game (as I think you assert somewhere in your documentation), or simply creating the following persistent.sfs file in the default DarkMultiPlayer save folder when DMP is accepted by the user on first-run:

persistent.sfs

GAME
{
version = 0.24.2
Title = DarkMultiPlayer
Description =
linkURL =
linkCaption =
Mode = SANDBOX
Status = 1
scene = 5
flag = Squad/Flags/kerbin
launchID = 1
PARAMETERS
{
FLIGHT
{
CanQuickSave = True
CanQuickLoad = False
CanAutoSave = True
CanUseMap = True
CanSwitchVesselsNear = True
CanSwitchVesselsFar = True
CanTimeWarpHigh = True
CanTimeWarpLow = True
CanEVA = True
CanIVA = True
CanBoard = True
CanRestart = True
CanLeaveToEditor = True
CanLeaveToTrackingStation = True
CanLeaveToSpaceCenter = True
CanLeaveToMainMenu = False
}
EDITOR
{
CanSave = True
CanLoad = True
CanStartNew = True
CanLaunch = True
CanLeaveToSpaceCenter = True
CanLeaveToMainMenu = False
startUpMode = 0
craftFileToLoad =
}
TRACKINGSTATION
{
CanFlyVessel = True
CanAbortVessel = True
CanLeaveToSpaceCenter = True
CanLeaveToMainMenu = False
}
SPACECENTER
{
CanGoInVAB = True
CanGoInSPH = True
CanGoInTrackingStation = True
CanLaunchAtPad = True
CanLaunchAtRunway = True
CanLeaveToMainMenu = True
}
DIFFICULTY
{
MissingCrewsRespawn = True
AllowStockVessels = True
}
}
MESSAGESYSTEM
{
flash = False
}
}

I believe simply creating this default persistent.sfs file during first-run acceptance of DMP will avoid the nasty error when a fearful user first checks their save games first before even bothering to connect to a DMP server and thus having the game populate the persistent.sfs with recognizable Resume Game values. I am also sure your better knowledge of save game syntax might be able to reduce this even further, but at least I know adding this persistent.sfs to the save folder DarkMultiPlayer, prior to running DMP for the first time, will avoid the error. In my KSP Essentials Mod Pack I may have to require users to do the same if not fixed in DMP first-run. FYI.

Edited by inigma
Link to comment
Share on other sites

I've finished writing the (very basic and hacky) admin command pipe. With the experimental version below, you can run commands from chat (as long as you are an administrator!). An example command to run the dekessler would be '/admcmd dekessler'.

All attempts, successful and failure, will be logged to the server.

Git Fork: https://github.com/dsonbill/DarkMultiPlayer/tree/master

Binaries download: https://mega.co.nz/#!ypsUCDjb!O24FTA--dav9zIyD6ykC7LeIFqnXePipUAFZL2RLeKs

This should be considered experimental atm (but what isn't? ;) ).

Edited by dsonbill
Changed the protocol version in the binaries to stop any mischevious errors from using my hack with an unsupported client.
Link to comment
Share on other sites

I'm looking to host my server online and not on my computer. I'm new to this so I have no idea where to look or what I should look for. All I do know is that I would preferably like the hosting site to host for free. If I can't host it for free I don't want it to break the bank. Any help would be amazing!

Link to comment
Share on other sites

@uncle natzer: Generally when hosting with a company, you need to have a dedicated server in order to afford the bandwidth and high message capacity of running a game server; most VPN packages have sanctions against game servers in the service contract, mainly because of the high amount of packet traffic you will create. Your standard dedi has around 31.7Mbit/s of bandwidth (at least mine does) and can easily handle a game server (see http://www.aqua-calc.com/rate/bandwidth-calculator for a proper calculator to see the conversion from Mbit/s).

I use serverpronto: their dual core has 5TB (approx. 15.96Mbit/s), which is probably enough. I thought I had 5TB, but I guessed a little low. You can pack a lot more onto these servers though; DMPserver is not tasking on the hardware, and bandwidth is the main concern.

Edited by dsonbill
Link to comment
Share on other sites

Is there a way, when spectating another player, to slave your clock to theirs so when they time warp or phys warp you just automatically jump ahead with them? Having to constantly watch for the sync times when someone else does rendezvous or docking and thus is warping a lot can be really error-prone.

Link to comment
Share on other sites

@dsonbill: Commented on your PR, it's a good start, but DMP code is by no means fantastic or neat :P. It gets a little crazy in DMPClient where i have to work around KSP weirdness, and I'm starting to suspect KSP weirdness is a direct result of unity weirdness (positions / velocities / rotations are all float instead of double, hence KrakensBane and FloatingOrigin)

@longbyte1: Thanks for helping @Korkin :)

@Steven Mading: Forcing yourself into spectate mode seems like a good idea, as it also gives the ability for pilots to release control and give it to a spectator. Adding this into the 0.1.6 todo list.

Slaving the clock sounds like an important feature to have, spectators should automatically slave to the pilot as well... The warp system will get some love (a near-rewrite perhaps?) for 0.1.6.

@inigma: Thanks for pointing that out, however instead of shipping a persitent.sfs like KMP, I should just be able to create a new Game() object in KSP and save that to a persistent.sfs file. I'll knock that one over today as it's beyond easy to fix.

@uncle natzer: As far as I know there isn't any hosting companies that actually host DMP (I'd be very surprised as there's a ton of competition already with the public servers), but maybe one of the other public server admins may host one - join IRC (link in sig) and ask :)

DMPServer should be very light on ram and CPU (it should constantly look idle), but bandwidth has always been a near-exponential thing as it has to relay nearly every message to everyone else.

Edited by godarklight
Link to comment
Share on other sites

Slaving the clock sounds like an important feature to have, spectators should automatically slave to the pilot as well... The warp system will get some love (a near-rewrite perhaps?) for 0.1.6.

I see potential for a problem if it's not a toggle option but instead is always on when you spectate. You might not realize the other pilot was going to move your clock forward, and were only intending to look for a bit and then switch back to your own work - which is now ruined because you missed your window and can't rewind the clock. I figure just have a button for "lock sync" versus a button for "once sync". "once sync" works like sync does now - it just jumps you forward, whereas "lock" sync would jump you forward and then keep jumping you forward with that person when they do. Maybe a little padlock button next to the sync button - click the padlock to lock the sync.

Link to comment
Share on other sites

@godark: I'm going to go ahead and close the PR, as I'm working on RegisterChatCommand() at the moment, and a separate console window. The window will be a bit of work for me to pull of, so feel free to go at it yourself if I end up too slow for you.

EDIT: I've got it working beautifully now, just like CommandHandler; output is still in the current chat window, but what should the tag be for the system?

Right now it looks like this:

COM$: help - Displays this help

Here is the commit: https://github.com/dsonbill/DarkMultiPlayer/blob/a95df5160bad4d16adceb7962b9ffe7e1f9f904d/Client/ChatWorker.cs

For normal people: allows plugin developers to add chat commands without hacking the client

For some shenanigans: Ever tried to load in a few more asteroids?

(3000)

2hs68p3.png

After restarting and lowering asteroid count to 100: http://i58.tinypic.com/34fi040.png

Magic dupes! The moral of this story is, don't go over ~200 asteroids, and don't lower the amount once you've got the vessels synced.

The view from the field: http://i59.tinypic.com/343j7k9.png

Honestly, I would just leave it at 30.

100 Asteroids: http://i58.tinypic.com/zxqhlh.png

Edited by dsonbill
Changed the other images to links for giantness.
Link to comment
Share on other sites

@Steven Mading: The GUI's will need to be cleaned up in a nice way in order to do this still, but it sounds like a great idea. I'd still prefer spectators to follow pilots automatically though, perhaps an option that's enabled my default.

@PaidLeber: Probably not, otherwise we'll run into the thousands-of-kerbals-to-sync problem again :(. KSP's crew generator starts to hang the game with many kerbals as it's a while loop that keeps generating names until it's unique, the VAB and runway also lock up for 30 seconds with ~2000 kerbals in the crew roster...

@Kenobi McCormick: Dracofunk is correct - DMP handles mods quite well because it chooses *not* to handle them :P. DMPModControl.txt on the server is the file that specifies what can or can't be in GameData/ - You can autogenerate it by pressing on the options window in DMP and clicking "Generate DMPModControl.txt", then moving it from the KSP folder to the DMPServer folder.

Note: Plugins/ are for server side plugins, of which there are *very* few at the moment. Eventually it's going to give other mods the ability to change DMPServer or DMPClient as they see fit.

@dsonbill: I have no idea how you've picked up on this so quickly, but that chat rework looks *very* close to what I had in mind (thanks). Also "COM$" is going to create many questions for DMPUsers, it's probably best to use @Server or @consoleIdentifier up the top right side of the tabs next to "Leave" (to seperate them from PM's), or use no prefix and push the server console I/O through it. I'll need to do that rework though :).

Also player names are authenticated, so any ClientObject that is authenticated = true *is* who they say they are. We'll have to change that authentication system though, it's just a *tiny* bit dodgy atm :P.

Also, before I accept your PR I'll need to make you aware of something first, DMP needs a licence change because any mod that tries to use DMP-dev's plugin system *has* to be either a GPL project, or considered a GPL project (due to linking), which is simply ridiculous. I'm leaning towards LGPL as it does what I want (keeps forks open so I can steal good bits back :D, I don't care about attribution), although there's also arguments for MIT/BSD, but I'm not as fond of that licence.

When I write the plugin reflector that will be public domain so people can incorporate it if needed.

Also, definitely come hang out in #DMP, I usually reply much faster there :). (Everyone is welcome - #DMP isn't just for me, other devs or server admins)

Link to comment
Share on other sites

@Kenobi McCormick: Dracofunk is correct - DMP handles mods quite well because it chooses *not* to handle them :P. DMPModControl.txt on the server is the file that specifies what can or can't be in GameData/ - You can autogenerate it by pressing on the options window in DMP and clicking "Generate DMPModControl.txt", then moving it from the KSP folder to the DMPServer folder.

This is what I meant by 'handles mods'. 'Tis all I wanted to know, and that sounds WAY easier than how KMP handled it. I want to set up something over lan for myself and my better half/roomate to derp around with, and possibly coop missions to Duna or something.

Link to comment
Share on other sites

EDIT: I've updated the logging, and therefore the picture. Tags are a bit cleaner, and no server logging goes through Console.WriteLine, but the console still reads for command-line input. Darklight might change this at some point. You can also toggle client debug messages by entering '/debug'.

May I present to you, the chat command and server console window:

28vaavm.png

Edited by dsonbill
Link to comment
Share on other sites

First of all: I love this mod!! Excellent work!

I would like to report a bug that I experience:

When I am in the VAB or the Hangar and klick the "load" button, the menu does not appear. However, the menu must be there as i can only proceed by clicking where the menu would be and choose a craft to be loaded. This craft is then actually loaded. I just can't see the menu and thus can't see what I am loading!

This does NOT happen in a regular game without DMP.

I am on the newest version of both KSP and DMP.

Mods:

- MechJeb

- Active Texture Management

- DMP (obviously)

Thanks for reading.

Link to comment
Share on other sites

First of all: I love this mod!! Excellent work!

I would like to report a bug that I experience:

When I am in the VAB or the Hangar and klick the "load" button, the menu does not appear. However, the menu must be there as i can only proceed by clicking where the menu would be and choose a craft to be loaded. This craft is then actually loaded. I just can't see the menu and thus can't see what I am loading!

This does NOT happen in a regular game without DMP.

I am on the newest version of both KSP and DMP.

Mods:

- MechJeb

- Active Texture Management

- DMP (obviously)

Thanks for reading.

I had that problem. What you need to do is:

1. When in VAB or SPH click on + on Dark GUI to show all players.

2. Click Craft tab up top, then your name.

3. You will see a list of your craft or it might be empty? Regardless click upload.

4. Now you will see a list of all your saved craft. Click them all so they are greyed out. They are loaded on server.

5. Don't close out these windows yet, go to KSP in game load button. Now you can see and load your craft.

6. Once loaded you can close out all Dark windows.

You have to do this each time you join the server. I do each time I load a craft, just in case. This is the best way to get this to work.

Link to comment
Share on other sites

Hey guys,

before i say anything, let me make clear, that this is the best mod out there so far :D

I've got one question tough... will it be possible to have two players viewing the same IVA at the same time, when Groups/Vessel Permissions are availiable?

This combined with mods like RasterProp would make a insanely realistic Mun mission (or simmilar) possible...

Just climb in the capsule with two friends controlling map, altitude, fuelflow etc. and fly to Mun in IVA only.

(You could also have a guy sitting in MapView, like a Mission Control)

Just curious...

Anyway keep up the awesome work :cool:

Link to comment
Share on other sites

I had that problem. What you need to do is:

...

This is the best way to get this to work.

Thanks that actually works.

Another thing: With the newer versions, I can't "Abort flight" anymore. Is that a feature or a bug? Why is that?

Also, the random violent explosions when meeting with another play on the Mun still happen to me. It's fun though :D:P:cool:

Link to comment
Share on other sites

I just setup a private server for me and some friends. So far so good. I have a couple of questions though.

Reputation: if setting server to career it seems all players have their own money and science pools, but the reputation pool is shared. Is this by design? We had someone intentionally kill a LOT of kerbals and ruined everyone's rep. It was no big deal in just swapped to Science mode instead of career. Everyone's happy again.

Question around behavior and mods. I'm concerned about use of these specific mods:

RemoteTech2, KAS, TAC LS

Can anyone share any experiences with these and DarkMP?

Link to comment
Share on other sites

Another question about Career contracts:

I'm hosting, if a friend connects and accepts a contract, will his contract time still count down when he's not connected to the server, or does the individual player's clock only start ticking if they're connected?

If the former, wouldn't it be better/is it possible to have an option to share contracts between players?

Link to comment
Share on other sites

I just setup a private server for me and some friends. So far so good. I have a couple of questions though.

Reputation: if setting server to career it seems all players have their own money and science pools, but the reputation pool is shared. Is this by design? We had someone intentionally kill a LOT of kerbals and ruined everyone's rep. It was no big deal in just swapped to Science mode instead of career. Everyone's happy again.

Question around behavior and mods. I'm concerned about use of these specific mods:

RemoteTech2, KAS, TAC LS

Can anyone share any experiences with these and DarkMP?

KAS with DMP is unfortunately a guaranteed duplicate ship explosion after linking pipes, transferring a resource, unlinking pipes, and exiting the server. On server re-connect the Tracking Center displays vessel duplicates. Unless you Recover all duplicates, opening any one of them will cause duplicate vessels to appear in another, leading to a physics explosion. Not good. Its consistent and duplicatable. I've not found a work around yet. I recommend DMP test for KAS presence and treat ship spawning differently so as to avoid such explosions. Actually, I wonder if DMP could be made to determine if a vessel has been duplicated within the space of another, and automatically remove the duplicate vessel before loading it in Tracking Center, or before physics load. godarklight, what do you think of this brainstorm - a DMP duplicate vessel detection auto-removal-of-the-newest-vessel workaround?

Link to comment
Share on other sites

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