Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

New Mod Available - Lagless/Lesslag Drills

Discussion in 'Released and WIP Mods' started by DanP, Apr 26, 2015.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. DanP Trainee Engineer

    Lagless Drills mod

    I accidentally posted about this in the wrong forum earlier. If a mod would please delete that post in the main modding forum, I would appreciate it.

    I just released the first functional iteration of the new lagless/lesslag drill mechanics I created for my server, Cutthroat Survival. The new mechanics disable the stock drilling system for the vanilla drills, taking over for them completely, and they provide a very significant performance improvement over the stock drill mechanics. On all of my tests, it has been a night and day difference.

    On our tests, large mining ships that previously dropped sim speed to 0.15-0.25 server-wide now maintain a steady 0.85-1.00, tending toward the higher end of that range, depending on each user's machine.

    The Steam workshop page is here

    There are a few caveats with this mod in its current state, and I would be happy to find out if it is possible to fix these with the Space Engineers API:
    • In order for the drills to work, you must toggle them on and off using the hotbar or control panel
    • The drills do not function with the CTRL key or the mouse buttons even though animation and sounds are playing
    • The drills do not send puffs of dust everywhere
    • The drills do not play sounds when they hit the asteroid
    I put a lot of work into this because I know it's a huge problem on many, many servers, so the more people who can benefit from it, the better. I will be updating shortly to add some sort of login notice informing users that CTRL/Mouse will not work for drilling.

    Also, note:
    The new system may conflict with drill mods, trying to use both systems at the same time and causing additional lag. I will implement a fix for this over the next few days, leaving drill mods to use the stock mechanics.
    Last edited: Apr 27, 2015
  2. Ulfsark Master Engineer

    If you dont mind sharing, just wtf did you do to make them different? o_O
  3. DuneD Junior Engineer

    Making them thick less often I guess. Changed it so they update each 100TH frame ? Thats why you need to toggle them on and off, why they dont play any sounds or create any particle effect.
  4. DanP Trainee Engineer

    I set the range and offset values for the vanilla drills to 0, then I wrote a script mod that handles all of the actual mining by finding the asteroid, determining what's in it, clearing it out, spawning the appropriate ores according to the amounts in their definition (uranium drops less than iron, etc), and collecting any ores in that area. Its tick is indeed less frequent than the norm--one per second.
    Last edited: Apr 26, 2015
  5. Urablahblah Apprentice Engineer

    Interesting. I sure hope you're able to work out mouse input and sound effects at some point. That would make the mod a must-have.
  6. DanP Trainee Engineer

    I have been trying, but I am not so sure it is possible. There is a property on IMyShipDrill called IsWorking that returns true when you toggle the drill on and off, but this value does not change when you use the mouse. I have not been able to find one I can access that does.

    I did find another class that looks like it might work, but I have no way to be sure and no way to access it:

    That one has a property called IsDrilling, but again, I cannot find any way to coax the system into giving me access to that via script mod.
  7. Urablahblah Apprentice Engineer

    Ah. Yes I've noticed that the game handles IsWorking separate from mouse input. Kinda odd. IIRC they added the drill's on/off toggle after they already worked with the mouse, so maybe they created a different system for the toggle. Some of the ways Keen programs seem a little hacky sometimes.
  8. DanP Trainee Engineer

    It's been updated:
    • Fixed a bug in multiplayer and dedicated server that caused drills to collect ore proportionate to the number of players online
    • Increased base ore spawn amount to be closer to vanilla
    • Added randomness to ore spawn amount to be closer to vanilla
    • Increased cycle frequency from once every 1.0 seconds to once every 0.75 seconds to be closer to vanilla
      • Note that reduced cycle frequency is not the source of the mod's performance gains
  9. DanP Trainee Engineer

    Another update:
    • Drill target area properly aligned with the center of the drill
    • Drill target area translation between world space and asteroid space is better handled
    • Drill target area in asteroid space now has a spherical shape, resulting in smoother edges
    The end result is a much smoother feeling and looking drilling experience than prior versions of the mod, without significant behavioral differences based on drilling angle.
    Last edited: May 16, 2015
Thread Status:
This last post in this thread was made more than 31 days old.