Cover image of Potential Data Loss Caused by Entity-class Changes

Attention Modders!

We wanted to inform you of some changes that might impact modders, especially terrain and scenario makers. Please note: As a matter of good practice, it's extremely important to regularly back up your work so that you will not lose data due to unforeseen changes. In this guide, we will show you how to avert potential data loss caused by entity-class changes.

Worlds (.ent-files) in Arma Reforger consist of multiple grouping layers (.layer-files) in which the information about the placed entities is saved. Sometimes, game and/or community mod updates rename or remove classes and prefabs, which can result in your worlds not loading correctly anymore.

Data Loss Explained

Inside the .layer files, you will see a sequential structure like the one below. Each entity is loaded in the order they are listed in the file. The relevant named entity "MigrationExample" of type "SomeEntity" is somewhere in the middle of a larger layer file.

SCR_DestructibleBuildingEntity : "{54E4045E67826963}PrefabLibrary/Structures/Houses/Shed_02_big_V2.et" {
 coords 10.69 2.496 14.876
}
SomeEntity MigrationExample { <----------------- Troublesome entity
 coords 67.617 32.795 8.393
}
SCR_DestructibleBuildingEntity : "{7E1D03679B76043D}PrefabLibrary/Structures/Houses/Shed_01.et" {
 coords 26.34 9.852 -2.639
}

If the entity class type "SomeEntity" was renamed or removed and you attempt to load this world, any entity coming after it will NOT be loaded as the process stops there. Unless you paid close attention to the console output you might not immediately notice that some of the objects are missing. If you then modify and save your world, the entire layer file is overwritten, permanently deleting the information about the unloaded entities. The only way to recover this information is through backups or version control software like SVN or GIT, which we recommend you use for all your workbench projects!

We are working on an update to the tools to avoid this data loss (e.g. automatically ignoring faulty entries), but please pay attention and make sure to regularly update your work until that is delivered. We will keep you updated about this topic.

Identifying if World Data has Problems Loading

Just loading the world does NOT modify your data, so you can safely attempt to open your worlds in the World Editor after an update and look out in the console for error messages like these:

WORLD        : Entities load @"{F3D711ED7A8A0619}MigrationExample/MigrationExample.ent"
 WORLD        : Entity layer load @"MigrationExample/MigrationExample_Layers/default.layer"
  WORLD     (E): Unknown class 'SomeEntity' at offset 3848(0xf08)

This lets you know that the entity class "SomeEntity" is not known anymore. To be able to see the messages, make sure showing errors is enabled in the console and WORLD is an active filter if you have any set.

Fixing the Problem

To make the world Ioad correctly again, you need to edit the .layer files manually with a text editor. The goal is to update the names if they have a new equivalent or to remove the entity otherwise. You must do this for every occurrence in all your layers.

SomeEntitywithNewClassName MigrationExample { <----------------- We changed the class name to the new one
 coords 67.617 32.795 8.393
}

When removing an entity, ensure you remove the entire block enclosed by the curly braces.

SCR_DestructibleBuildingEntity : "{54E4045E67826963}PrefabLibrary/Structures/Houses/Shed_02_big_V2.et" {
 coords 10.69 2.496 14.876
} <----------------- The faulty entity is now gone
SCR_DestructibleBuildingEntity : "{7E1D03679B76043D}PrefabLibrary/Structures/Houses/Shed_01.et" {
 coords 26.34 9.852 -2.639
}

We recommend you use a text editor like Notepad++ or Visual Studio Code, which can visually collapse the "blocks" for you, making it easier to remove them correctly as a whole.

Of course, if you have any further questions or issues, we recommend you visit our forums and official Discord Arma Platform, where fellow community members and developers might be able to assist you.

Published on 

We want you for our mailing list!

We offer great content once a month just for you!