jediminer543

[KSP 1.0.5] [BDA 0.10.X] BDDMP [WIP]

Recommended Posts

BDDMP

What is BDDMP

BDDMP is a mod that was initially created by dsonbill, that I then adopted, that allows for the use of BDArmory weapons in DMP. This mod redistributes BDA, as it needs to add hooks to calls.

This mod should be compatible with BDA Addons, but I can make no guarantee, especially if they use a custom DLLs, and may crash due to the changes to BDA code, however, I am working on fixing that.

This mod works through judicious use of the DMP API, as well as a modification to the BDA DLL in order to detect events, such as part destruction.

Features

  • Missile Sync
  • Damage Sync
  • Explosion Sync
  • Flares
  • Tracers
  • MANY BUGS

WIP

  • Implement Turret Rotation

BUGS

  • Missiles may not correctly remove themselves on detonation, as I am leaving missile control to DMP (each missile is a vessel, and DMP syncs vessels easialy, but doesn't destroy them)
  • Others can hijack your craft
  • Damage can be done to a craft if in different subspace

TODO LIST

  • Implement Better Missile Sync
  • Implement Laser Beam Sync
  • Improve Tracer Sync

Download, Source & License

Licensed under CC0 with the Modified BDArmory licensed under CC BY-SA 2.0

All of the BDArmory parts were made by BahamutoD, and I have done nothing with them

Sources:

Modified BDArmory

BDArmory Multiplayer Patch

Download:

Stable (ish) (Redists BDA)

Installing

Download DLLs and Paste into GameData

The mod contains all the BDArmory files, so BDArmory isn't needed

Footnotes

If you want to know something, ask it - There's no harm in asking, just remember a am a person and can't always answer immediately.

Also if you want to know something and I'm not around, then you can test it yourself

Old Post

Spoiler

BDArmory Unofficial Multiplayer Patch

WARNINGS

This will contain bugs

BahamutoD has nothing to do with this mod

I've just patched to the new BDA so expect bugs. And stuff to work incorrectly.

 

A fork of Dsonbill's BDDMP Mod

 

About

This mod allows for the use of BDArmory weapons in DMP, through the judicious use of the DMP mod API and lots of hooks added to BDArmory. This is under active development and will change frequently.

What this mod does

This mod captures event from BDArmory on one client, using a modified version of BDArmory. It then

sends these messages to other clients through the DMP mod interface, where the other clients unpack it

and apply the changes.

NOTE: this mod requires all clients (Only some may work, or may kill server horribly) to use it, however requires no changes to the server-side.

Features

Currently Working (Stable)

 

  • FX Sync
     
  • Tracers
  • Flares

 

 

Currently WIP (Unstable)

 

 

  • Missiles

 

 

Todo (Under active development)

 

  • Bug Squashing
  • Turret Rotation
  • Lasers

 

 

Known Bugs

 

 

  • Packet drop will cause tracers (or other features occasionally) to stop responding
     
  • Missile Hang (Freeze on remote without exploding) (DMP Issue)
  • Vessel Dupe on Missile Launch/Damage (DMP Issue; cantfix)
  • Remote Spectators can control Weapons via BDA toolbar

 

 

Download, Source & License

Licensed under CC0 with the Modified BDArmory licensed under CC BY-SA 2.0

All of the BDArmory parts were made by BahamutoD, and I have done nothing with them

Sources:

Modified BDArmory

BDArmory Multiplayer Patch

Download:

Stable (ish) (Redists BDA)

Installing

Download DLLs and Paste into GameData

The mod contains all the BDArmory files, so BDArmory isn't needed

 

Change log

(Done using Commit IDs until stable enough to release)

b29f36f

 

 

  • Updated to BDA 0.9.X
  • Turret Rotation NYI, As is lasers
  • All else working to some degree
  • Anti-Cheat is also NYI

 

d55c4bf

 

  • Externalized turret rotation to separate hook
  • Reduced tracer update frequency to reduce server load (updates at 1/3 the rate)
  • Stopped BDA Manager from being able to be opened while not in control (spectating or vessel in past)

 

27bbb74

 

 

  • Implementation of flares
  • Preliminary on anti cheat (NYI, but code mostly there)

 

eed0544

 

  • Reformatted code for easier debugging
  • Implemented Missile Damage Sync (Servers already handle missiles, this transfers damage)

 

17dc620

 

  • Fixed Turret Rotation (Turrets not being deployed)
  • Fixed tracer offset

 

13c716a

 

 

  • Improved tracer stick (no more hovering tracers)
     
  • Added upper frequency limit to turret rotations (Hopefully reducing de-sync)

 

ba8b246

 

  • Improved Tracer Sync Code

 

bd8022c

 

  • Improved Turret Rotation Sync
  • Improved Laser Sync

 

0776755

 

  • Implemented Laser Sync

 

 

AQ

(When you only have 6 replies (2 of which are your own) then frequently is out of the question)

Q. I found a bug (Yes this is a statement, but its going here anyway)

A. Please either post it below or add it as a GitHub issue. If said bug involves crashing (of the KSP type not the Lithobraking type) then post logs (found in the folder with a name like this: 2015-07-30_103422) and post both logs (error.log & output_log.txt).

Q. Will this work with BDArmory Expansions

A. Assuming that they use the BDArmory code and don't use their own plugin (check for a DLL) then yes, otherwise probably not. Post any non-working mods an I'll see what i can do.

 

Footnotes

If you want to know something, ask it - There's no harm in asking, just remember a am a person and can't always answer immediately.

Also if you want to know something and I'm not around, then you can test it yourself

I am inept in-terms of spelling, so please don't complain about mistakes and helpfully point them out.

Edited by jediminer543
Better Formatting

Share this post


Link to post
Share on other sites
Just a question....does this work with BD Armory expansions?

Assuming that they use the default API then yes, if they use there own then no.

EDIT: Most of them (All the ones I checked) use the default API so should work

Edited by jediminer543
More Info

Share this post


Link to post
Share on other sites

Do missiles work with this? Or flares?

Share this post


Link to post
Share on other sites

I'm adding this to CKAN, and I'm just wondering if you plan on modifying BDarmory beyond just BahaTurret.dll (if more files will change, we'll install the mod in a different way)

Share this post


Link to post
Share on other sites
I'm adding this to CKAN, and I'm just wondering if you plan on modifying BDarmory beyond just BahaTurret.dll (if more files will change, we'll install the mod in a different way)

Currently there is no reason to change any other files and a can't foresee any reason why this would be so (if other things need changing then there's always module manager). Currently the DL contains all the BDArmory files.

Do missiles work with this? Or flares?

I have just implemented missiles, flares probably won't work (Unless DMP is doing voodoo-magic) and I'll implement them soonâ„¢ (either tonight or tomorrow).

Also I'm lagging behind on updating this forum post, so check kerbal stuff description and change-log as it will be updated faster (normally)

Edited by jediminer543
Spelling

Share this post


Link to post
Share on other sites

Maybe you could set it up where flares are random? Like when DMP detects a craft deploying flares, there's a certain chance the missile will lose lock or something.

Share this post


Link to post
Share on other sites
I'm adding this to CKAN, and I'm just wondering if you plan on modifying BDarmory beyond just BahaTurret.dll (if more files will change, we'll install the mod in a different way)

What's its name on CKAN? I can't find it...

Share this post


Link to post
Share on other sites
Maybe you could set it up where flares are random? Like when DMP detects a craft deploying flares, there's a certain chance the missile will lose lock or something.

From a code standpoint, syncing flares is reasonably simple. When they are created they are given an initial position and rotation with a random velocity. To create them on the remote end all I need to send is this data, and then have it create one with a from this.

The final result should be working flares, however implementation requires lots of code, and probably some combination of them, so all the flares make it to the remote end.

The rest of the mod works on similar logic.

Edit: However, due to my body's need for sleep, it will have to be released tomorrow (check back late morning).

EDIT2: Flares are now in

Edited by jediminer543
Mod update

Share this post


Link to post
Share on other sites
What's its name on CKAN? I can't find it...

Adding, not added. I needed the info from the author before moving forward (thx for the quick reply jediminer). I expect to have the mod added to CKAN within 24 hours.

Share this post


Link to post
Share on other sites
Adding, not added. I needed the info from the author before moving forward (thx for the quick reply jediminer). I expect to have the mod added to CKAN within 24 hours.

Thanks.

Share this post


Link to post
Share on other sites

Does it work well enough for slow things like up to 120m/s?

Because then fighting with biplanes on FAR would be amazing.

Share this post


Link to post
Share on other sites
Does it work well enough for slow things like up to 120m/s?

Because then fighting with biplanes on FAR would be amazing.

The mod syncs in effectively two components, damage and effects. Damage, the important thing in dog-fighting, should always sync correctly (unless the server drops the packets). Effects often have more issues, so tracers may be buggy or an explosion may be generated in an incorrect place. However they should be synced enough for you to dog-fight, it may just take some getting used to.

And speed shouldn't be an issue as one of my test vehicles was a rover with a top speed of ~10m/s; the issues you will encounter will be due to latency and network speed. FAR may cause issues, but shouldn't assuming all clients have it (and I would probably recommend disabling aerodynamic failure as DMP can have issues with that).

Apologies, in advanced for any spelling or grammatical mistakes as i woke up ~15 minutes ago.

Edited by jediminer543

Share this post


Link to post
Share on other sites

Oh so you actually sync the damage and the projectiles are just a secondary representation, interesting.

On my tests DMP worked well with FAR, when a craft randomly exploded it would respawn.

I am just concerned if my client making the other plane explode will sync and make him actually explode or only effects of the weapons are synced?

This is important, esp. for taking off, as some parts of DMP are not super consistent yet.

Also, what happens if a desynced projectile hits me when it shouldn't?

Edited by tetryds

Share this post


Link to post
Share on other sites
Oh so you actually sync the damage and the projectiles are just a secondary representation, interesting.

I couldn't really come up with a better way of doing it. Syncing the rays would have all the same effects, but it seemed a little more accurate to do it this way? Maybe jediminer543 will change this?

Also, what happens if a desynced projectile hits me when it shouldn't?

This should not be possible, as all damage and effects are temporally correct in the code. You also can't harm vessels that have been altered in the future.

Share this post


Link to post
Share on other sites
I couldn't really come up with a better way of doing it. Syncing the rays would have all the same effects, but it seemed a little more accurate to do it this way? Maybe jediminer543 will change this?

I wouldn't want to change it, DMP has too high of a tendency of dropping packets, and damage is the thing that is best synchronized by the mod, and also the highest priority thing to synchronize. What i may end up doing though is packing all damage in that update into a single message, similarly to what i have done with flares (as flares are also highly important), however this then increases the data being sent each update. It is the most poorly coded part of the mod an I may patch it either today or tomorrow.

Would it be possible to put this into a separate thread or would the unity anti-threading rules apply?

Also, what happens if a desynced projectile hits me when it shouldn't?

I'm currently syncing projectile in a very poor way of updating them with the coords of the remote end every frame. I'm probably going to change this, to sync them every few frames with a velocity update but need to devise a good way of doing so. Currently if a projectile de-syncs, it sticks in the air and should disappear after 20 seconds.

Edit: Mod updated

Features: reduced tracer update frequency, separate turret rotation and to stop the use of the Toolbar GUI to hijack other peoples guns.

Edited by jediminer543

Share this post


Link to post
Share on other sites

Update to new BDA pending, currently on holiday though so testing

I can't seem to find ir on CKAN...

Yes, someone else said they were making a CKAN config, but it would appear they never finnished it. I will work on one after patching to BDA 0.9.X

Edited by jediminer543

Share this post


Link to post
Share on other sites
Mmm, this plugin messes whit my DBarmory, i lose the menu of the mod, and i lose some parts, such as the Weapons Manager

Which version of the mod are you using? If you are trying to use the latest version of BDArmoury then it will fail, as I havent yet updated it. It also shouldn't be used for a single player install as it is heavily interlinked to the DMP api, meaning it may cause issues if it isnt active.

However all the parts should still be there, so I don't know what you've done with your install

Share this post


Link to post
Share on other sites
It also shouldn't be used for a single player install as it is heavily interlinked to the DMP api, meaning it may cause issues if it isnt active.

This is really something I should have fixed before I stopped working on it...

There is a variable in the client that will tell you if it is connected - best way I can figure of making this safe for single player is to have an enabled bool for the BDArmory DMP plugin/all functions check if client is in the connected state.

Let me know if you need help doing this - though I highly suspect you have this all under control and already knew exactly what to do :)

Share this post


Link to post
Share on other sites

If I may be of assistance, the mod is missing a few parts from the newest versions of BDArmoury. Namely, we have these:

AWACS Detection Radar
ECM Jammer
TWS Locking/ Large Detection RADAR
AMG-88 HARM Missile
JDAM Mk. 83 Bomb
Radar Data Receiver
The three radomes
Smoke countermeasure
Targeting camera

I hope this helps!

Share this post


Link to post
Share on other sites
If I may be of assistance, the mod is missing a few parts from the newest versions of BDArmoury. Namely, we have these:

AWACS Detection Radar
ECM Jammer
TWS Locking/ Large Detection RADAR
AMG-88 HARM Missile
JDAM Mk. 83 Bomb
Radar Data Receiver
The three radomes
Smoke countermeasure
Targeting camera

I hope this helps!

Yes, thanks for the list. Unfortunately though, as this add-on requires the rewriting of the core BDA code, I am have to entirely rewrite the BDA side of the plugin and account for changes. Add that to the fact that I'm on holiday (without a computer to test on) thus updating the mod is impossible at the moment. However I am returning to my fully armed development environment soon, and the mod will hopefully (baring large scale issues) be updated by next Saturday, and probably before then.

you have no idea how long i have waited for this! https://www.facebook.com/groups/combatksp/ this is my server, befiore the collisions were occaussionally okay, but just one question, i would like to verify in a single post, do missiles and turrets both work at the momet? and flares?

Flares, turrets and missiles should all work. Missiles and turrets will occasionally de-sync, but damage is synced by a separate process, to reduce loss. Flare de-sync (usually caused by a client launching several flares and causing the server to drop the packets) may cause some issues, but I have tried to mitigate them as best as possible. Tracers (the bullets from the turrets) have been and seem to persist in being an issue. While the damage is unaffected, it may cause confusion for people trying to find the cause of there damage

This is written late at night, so apologies for spelling and grammatical errors.

EDIT: Patching is now in progress, Stand by

Edited by jediminer543
Patching

Share this post


Link to post
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.