Jump to content

SWAPR - SWeet Automatic Player Replacement script


Hardcard

Recommended Posts

Nice work Hardcard!

 

I’ll give it a go on my server too. I was considering asking you if we could do statics vice AI, as I’m seeing a significant performance hit that maybe going to statics will alleviate.

Ryzen 7 5800X3D / Asus Crosshair VI Hero X370 / Corsair H110i / Sapphire Nitro+ 6800XT / 32Gb G.Skill TridentZ 3200 / Samsung 980 Pro M.2 / Virpil Warbrd base + VFX and TM grips / Virpil CM3 Throttle / Saitek Pro Combat pedals / Reverb G2

Link to comment
Share on other sites

I’m seeing a significant performance hit that maybe going to statics will alleviate.

 

Statics cause the same performance hit as uncontrolled AI, I'm afraid there's no noticeable difference.

 

An easy way of minimizing performance hit is to place some of the clients inside sheltered spots (if you're using Caucasus map) and then set Sheltered_Replacements to false, so SWAPR won't generate any replacements for them.

It's either that or editing the PILOT names of several clients, so they won't use the SWAPR prefix / suffix.


Edited by Hardcard
Link to comment
Share on other sites

  • 08-30-2019
    • Script rewritten for expanded customization!
    • Added the following extra settings:
      • Replacement_Type: If set to "AI", clients based on FARPs, open terrain and open airbase parking spots will receive uncontrolled AI replacements. If set to "Static", the mentioned clients will receive static replacements instead

 

Hi,

 

I tried the "Static" option, but found that the static replacements are spawn with an incorrect heading, for example here my aircraft is the third on the line, but the remaining statics are heading the other way:

 

61ekeNH.jpg

 

If I use the "AI" option, then the replacements are placed correctly:

 

nApBTNi.jpg

 

I tried "Static" on other missions and found the same issue:

 

cakuCxT.jpg

 

IYSjfaQ.jpg

 

Also, the Harrier in particular is being spawn below the surface, like this:

 

zipYdC6.jpg

 

Other than that, I really love your script, as it feels so much better when the remaining players havent yet connected to the server .. the bases are more populated, like this:

 

(This example is Krasnodar Variable Attack, by Apache600)

 

NaxV8YC.jpg

 

EPbd4B1.jpg

 

Best regards and thanks again for all the effort you've placed on developing this script :)

 

 

Eduardo

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

Statics cause the same performance hit as uncontrolled AI, I'm afraid there's no noticeable difference.

 

An easy way of minimizing performance hit is to place some of the clients inside sheltered spots (if you're using Caucasus map) and then set Sheltered_Replacements to false, so SWAPR won't generate any replacements for them.

It's either that or editing the PILOT names of several clients, so they won't use the SWAPR prefix / suffix.

 

OK, I wasn’t sure but thought I’d try it. Thx!

Ryzen 7 5800X3D / Asus Crosshair VI Hero X370 / Corsair H110i / Sapphire Nitro+ 6800XT / 32Gb G.Skill TridentZ 3200 / Samsung 980 Pro M.2 / Virpil Warbrd base + VFX and TM grips / Virpil CM3 Throttle / Saitek Pro Combat pedals / Reverb G2

Link to comment
Share on other sites

Rudel_chw

 

I think I've managed to solve the spawn heading issue for statics in the last develop version.

 

The buried harrier issue, though... that's pretty weird, can you send me the mission in which the problem is occurring?

 

EDIT: Looks like I've been able to solve the "buried harrier" issue as well, the fix will be included in the upcoming v1.2

 

 

@Everyone

 

SWAPR PnP Hybrid v1.2 will be out in the coming days, it'll include fixes for the issues reported above as well as an early iteration of slot block for MP (thanks to Funkyfranky for suggesting the idea a while back :thumbup:)


Edited by Hardcard
Link to comment
Share on other sites

  • 3 weeks later...

@Everyone

 

Alright boys and girls... SWAPR 1.2 is finally here and it brings slot block with it! :cheer3nc: :drunk: :yay:

 

 

 

OP updated with new videos, timestamps, notes, changelog and links

 

[b]Changes:[/b]
[list]
[*][b]09-20-2019[/b]  
[list]
[*]SWAPR PnP Hybrid v1.2 released!


[list]
[*]Slot block implemented! (MP only, definitely check it out!)


[*]Fixed a problem which caused static replacements to miss the original client's heading on spawn


[*]Fixed the problem of helo replacements spawning half-buried on FARPs


[*]Fixed the problem of harrier replacements spawning half-buried in airbase areas (but not on FARPs... it's DCS' fault!!! :cry:)


[*]Fixed weird issue of single helipads being incorrectly identified as ship airbase objects


[*]Improved replacement checks
[/list]
[/list]
[/list]

 

 

Big thanks to Funkyfranky for the great idea and to Ciribob, Pikes, Wingthor, Rudel, etc. for their invaluable help! :thumbup:

Link to comment
Share on other sites

I’m so glad that you kept relentlessly improving this Script .. I was perfectly happy with the first version, as it was such a big breaktrough to a very old limitation of MP DCS, where the airfields were so empty when not many players were connected to the Server at the same time I did.

 

But you kept improving it, aiming for a greater ease of use and providing more customization options, so that now a Mission crafter need barely more than giving the clients proper names and loading a script .. undeniably easy to add this functions to our MP missions.

 

So, have a heartfelt thank you from myself for creating this Script, I intend to use it on all my MP missions .. Cheers to you.

 

:)

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Unfortunately, i am not able to get it working in multiplayer. SP is no issue but for MP everybody explodes when joining into a slot. I tried to exclude as many variables as possible, i even got all the files and the mission from a mate of mine which worked for him when hosting on DC in MP. But no joy. After a couple of hours i gave up. Any idea what could be the cause? Everything works but despawning of AI or the static object when the client enters the the aircraft.

i5-2400 | 16GB Corsair XMS3 | MSI GTX 970 4GB | 500GB Samsung 850 Evo | TrackIR 5 | TM Warthog | Saitek Rudder Pedals | Windows 10 64 bit

 

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Any idea what could be the cause?

 

I'd check two things:

 

1) The Script for MP has a small difference with the same on SP, this variable needs to be set:

 

local Game_Mode = "MP"

 

... its easy to test the mission on SP and then forget to change this variable when moving the mission over to the Server.

 

2) The server needs to have the "SWAPR_Server_Hook_1_2.lua" stored on the /Saved Games/DCS/Scripts/Hooks/ folder, and this Script has to have the same suffixes as the Swapper Script used on the mission, for example on mine I use this suffix:

 

local SWAPR_Prefixes = { "_Client" }

 

 

Best regards

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

SWAPR - SWeet Automatic Player Replacement script

 

 

Best regards

 

 

Thanks for the input, but unfortunately not the answer here. Everything is set up as it should and has been check more than 10 times i guess :noexpression:. As I said, I even got the files and the mission from somebody who got it working properly and that did not change anything. So it seems to be related to my system?! MP is set, hook script is in place and correctly modified, clients are properly recognized. I was able to not die like 2 times out of ~50 while hopping through the slots doing my different testings but i did not change anything and also was not able to reproduce that.

 

 

 

Kind regards


Edited by SkipperSMG

i5-2400 | 16GB Corsair XMS3 | MSI GTX 970 4GB | 500GB Samsung 850 Evo | TrackIR 5 | TM Warthog | Saitek Rudder Pedals | Windows 10 64 bit

 

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Thanks for the input, but unfortunately not the answer here. Everything is set up as it should and has been check more than 10 times i guess :noexpression:. As I said, I even got the files and the mission from somebody who got it working properly and that did not change anything. So it seems to be related to my system?! MP is set, hook script is in place and correctly modified, clients are properly recognized. I was able to not die like 2 times out of ~50 while hopping through the slots doing my different testings but i did not change anything and also was not able to reproduce that.

 

 

 

Kind regards

 

In testing, are you actually running it on your dedicated server and joining from a separate client, or are you hitting fly in the mission editor?

 

It works on my dedicated server, but only I think if I join with a separate client.

Ryzen 7 5800X3D / Asus Crosshair VI Hero X370 / Corsair H110i / Sapphire Nitro+ 6800XT / 32Gb G.Skill TridentZ 3200 / Samsung 980 Pro M.2 / Virpil Warbrd base + VFX and TM grips / Virpil CM3 Throttle / Saitek Pro Combat pedals / Reverb G2

Link to comment
Share on other sites

In testing, are you actually running it on your dedicated server and joining from a separate client, or are you hitting fly in the mission editor?

 

It works on my dedicated server, but only I think if I join with a separate client.

 

 

I let it run on the my dedicated server. And somehow, don't ask me why, it started working. I restarted my PC a couple of times and suddenly it was working. i haven't touched anything. This **** will drive me crazy some day :music_whistling:

i5-2400 | 16GB Corsair XMS3 | MSI GTX 970 4GB | 500GB Samsung 850 Evo | TrackIR 5 | TM Warthog | Saitek Rudder Pedals | Windows 10 64 bit

 

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

I let it run on the my dedicated server. And somehow, don't ask me why, it started working. I restarted my PC a couple of times and suddenly it was working. i haven't touched anything. This **** will drive me crazy some day :music_whistling:

 

Better to be lucky than good!

Ryzen 7 5800X3D / Asus Crosshair VI Hero X370 / Corsair H110i / Sapphire Nitro+ 6800XT / 32Gb G.Skill TridentZ 3200 / Samsung 980 Pro M.2 / Virpil Warbrd base + VFX and TM grips / Virpil CM3 Throttle / Saitek Pro Combat pedals / Reverb G2

Link to comment
Share on other sites

Just for knowledge after having a discussion with Hardcard on Discord:

 

 

I do have one issue and it's with the latest OB as of this posts date, latest moose dev. along with SWAPR 1.2 set to MP (with hooks file placed in the hooks dir).

As soon as SWAPR loads I get this error in the logs:

2:16:36 PM.614 ERROR DCS Mission script error: : [string "c:\Users\admin\Google Drive\05. Lynx\Missions\Scripts\SWAPR\SWAPR_PnP_Hybrid_v1_2.lua"]:720: attempt to index local 'ClosestAirbase' (a nil value)

 

Moose loads 1 sec after mission start, swapr 15 seconds in.

 

 

The error seems to depend on a change in Moose dev. (if I understood correctly) and Hardcard has given me a temporary workaround by using a slightly older version on Moose (the one included in the SWAPR download package) and that is working a-ok from my testing!

Link to comment
Share on other sites

The error seems to depend on a change in Moose dev. (if I understood correctly)

Yup, but should be fixed now in the very latest dev Moose.lua (as of 60 seconds ago ;)).

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

I tried this script yesterday using the newly released MOOSE.lua and when I spawn in, there is an immediate explosion.

 

Are we limited to one unit per group with this script?

 

Please, post your mission file here.

 

Also, did this happen in a MP environment? If so, were you hosting or connecting to a dedicated server?

 

Also, did you get scripting errors in dcs.log? If so, could you post dcs.log as well?

Link to comment
Share on other sites

Please, post your mission file here.

 

Also, did this happen in a MP environment? If so, were you hosting or connecting to a dedicated server?

 

Also, did you get scripting errors in dcs.log? If so, could you post dcs.log as well?

 

It is a MP mission on a dedicated server but the mission is one that has a lot of moving parts using MOOSE and MIST that has gone through many iterations prior to SWAPR being tested.

 

I built a new mission this morning with same MOOSE file and SWAPR script and put it on my server and it works well. So this issue is not in the MOOSE version or the SWAPR script I edited.

 

If I run into the issue again I will try to narrow down the cause. For now all seems to be working and I don't want to send you off on a bug hunt.

 

 

 

 

EDsignaturefleet.jpg

Link to comment
Share on other sites

It is a MP mission on a dedicated server but the mission is one that has a lot of moving parts using MOOSE and MIST that has gone through many iterations prior to SWAPR being tested.

 

The standard MIST isn't fully compatible with SWAPR, try this fixed version instead:

 

https://1drv.ms/u/s!Ai6cuX3YQI26hcdK_gSYnKGK8JrXXw?e=dzzLJP

 

:)

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...