List of DLLs that have been updated:

These DLLs match Medieval Engineers 0.7.2.8CBFD2!

Please make sure Keen has not released another update, all of these DLLs will break in that case.

VRage.Steam.dll VRage.Game.dll Sandbox.Game.dll MedievalEngineers.Game.dll

How to install

Please make a back-up of your existing DLLs before switching to these!

These DLLs go into Steamapps/common/MedievalEngineers/Bin64

Medieval Engineers stuff that was fixed:

(14-05-2020) Physics not resting - Sir_Moodz (Peaceman)

There is a bug where grids get pinged by gravity and wake up while they should continue to stay at rest. This can negatively affect performance and grid stability. Affected DLL: Sandbox.Game.dll Server side relevant: Yes - Improves server performance and grid stability. Client side relevant: Yes - Subtly improves client performance and grid stability.


In MyGridRigidBodyComponent.UpdateGravity() replace:
if (this.RigidBody.Gravity != vector)
with
if ((this.RigidBody.Gravity - vector).LengthSquared() > 0.000001f)

(27-04-2020) Crash during destruction - Equinox

There is a crash when you destroy large blocks (blocks larger than 1x1x1 grid cell). Affected DLL: VRage.Game.dll Server side relevant: Yes Client side relevant: Yes This is caused by fracture pieces not having any collision shapes. In MyGridPhysicsShapeComponent.Regeneratecell() method, in the middle of the cellModification.Additions loop, change it into this code:


foreach (MyGridPhysicsShapeComponent.CellBlockAddition cellBlockAddition in cellModification.Additions)
{
    if (cellBlockAddition.Block.Model is VRage.Models.MyFracturedCompoundModel fracturedModel && !System.Linq.Enumerable.Any(fracturedModel.CollisionShapes))
        continue;
    HkShape item = this.GenerateBlockShape(cellBlockAddition.Block);
    list.Add(item);
}

(27-04-2020) Duplicate blocks added - Equinox

There is a bug that causes the same block collision shape to get added multiple times. This doesn't cause any user-visible issues, but may negatively impact performance on dedicated servers. Affected DLL: VRage.Game.dll Server side relevant: Yes Client side relevant: Probably This is caused by the modifications list not getting cleared prior to deserialization. In MyGridPhysicsShapeComponent.Deserialize() method, just before the foreach, add this code:


m_sparseGridModifications.Clear();

Blueprint screen - Gwindalmir

There is a bug where the screen freezes when you click a blueprint that has no mods required. This is caused by an error in the blueprint screen logic. In MyBlueprintDetailController LoadBlueprintData() method, at the end, before creating the query, it should test if the required mods count is larger than 0. If not, skip the workshop query.

Affected DLL: Medieval.Game.dll Server side relevant: No Client side relevant: Yes

Action Tracker

In MyActionTrackingSystem's DamageApplied, change MyBlockComponent to MyGridDataComponent. Affected DLL: Medieval.Game.dll Server side relevant: Yes - Fixes entire action tracking system, client side wont see difference without this. This also fixed Watchdog damage reporting. Client side relevant: Yes - Fixes compass action tracker

Grid Destruction - IsIndestructible

In MyGridDestructionComponent's Serialize method the game writes to IsIndestructible rather than having IsIndestructible be written to the object builder Affected DLL: Medieval.Game.dll Server side relevant: Yes - Fixes saving of grid destruction settings, allowing the IsIndestructible flag to work properly. Client side relevant: No

Anything involving mods, blueprints, and the downloading and display thereof

In MyWorkshop.cs, in UpdateMod(), resetEvent.WaitOne() gets stuck; the reset event is never set. Cancelling the download and clicking join again will leave this worker thread permanently stuck. Restarting the game will probably leave ME.exe permanently stuck too. Affected DLL: Sandbox.Game.dll Server side relevant: No Client side relevant: Yes - This fixes the download mods in the server browser getting stuck, and it makes the dialog no longer say downloading 3 of 2 mods. Solution: 1. In MySteamWorkshopItem, in Download() replace the section that checks for Downloading and DownloadPending with the following:


if (State.HasFlag(MyWorkshopItemState.Downloading) || State.HasFlag(MyWorkshopItemState.DownloadPending))
{
    OnItemDownloaded(MyGameServiceCallResult.Pending, Id);

    int timeOut = 0;
    while ((State.HasFlag(MyWorkshopItemState.Downloading) || State.HasFlag(MyWorkshopItemState.DownloadPending)) && timeOut <= 30000)
    {
        System.Threading.Thread.Sleep(1000);
        timeOut += 1000;
        State = (MyWorkshopItemState)SteamUGC.GetItemState(m_itemId);
    }

    if (State.HasFlag(MyWorkshopItemState.Downloading) || State.HasFlag(MyWorkshopItemState.DownloadPending))
    {
        OnItemDownloaded(MyGameServiceCallResult.Fail, Id);
        return;
    }
}

2. In MyWorkshop.cs, in UpdateMod(), turn resetEvent.WaitOne(); into resetEvent.WaitOne(new TimeSpan(0, 1, 0)); This gives it a timeout, meaning the thread wont get stuck indefinitely. It also means the mod wont have downloaded correctly. A better solution is to add a boolean return code:


private static bool UpdateMod(MyWorkshopItem mod)
{
    mod.UpdateState();

    if (mod.IsUpToDate())
        return true;

    bool modDownloadResult = false;
    using (var resetEvent = new AutoResetEvent(false))
    {
        MyWorkshopItem.DownloadItemResult onDownloaded = (result, id) =>
        {
            if (result == MyGameServiceCallResult.OK)
                MySandboxGame.Log.WriteLine("Mod download successful.");
            if (result == MyGameServiceCallResult.Pending)
                return; // Will be called again with error or finished.
            else
                MySandboxGame.Log.WriteLine(string.Format("Error during downloading: {0}", result));

            resetEvent.Set();
        };

        mod.ItemDownloaded += onDownloaded;
        mod.Download();

        // Wait for download to finish.
        modDownloadResult = resetEvent.WaitOne(new TimeSpan(0, 1, 0));

        // Remove listener.
        mod.ItemDownloaded -= onDownloaded;
    }

    return modDownloadResult;
}

3. (Optional, but nice while we're at it) In MyWorkshop, in DownloadModsBlocking(), change numMods from string to int. Silly optimization. Then, at the end of the Workers.ForEach() call, replace the SetProgressMessage with the following snippet:


m_asyncDownloadScreen.SetProgressMessage(MyTexts.GetString(MyCommonTexts.ProgressTextDownloadingMods) + " " + Math.Min(counter, numMods) + " of " + numMods);