Documentation Level Editor

[!WARNING]
Only open files in the level editor, that you fully trust! The editor is not secured against malicious code inside the level files!

The level editor will give you a graphical way to create and modify the level files, which are presented by ReverSim.

The level editor provides all functionality required to design new study tasks. However, if you need to make advanced edits or you would like to write an external tool to generate levels, you can refer to our detailed documentation about the level format.

Opening the level editor

You can find the level editor by going to /pre_survey?group=editor, if enabled. In the Docker image the level editor is enabled by default.
If the group index page is enabled inside gameConfig.json, you can also navigate to /index and select the level editor at the bottom of the page.

You should then be greeted by a page that looks like this:

Screenshot of the level editor

Workflow

The general workflow is as follows, however the order here is not mandatory and you will probably need to iterate over earlier steps several times. For step 1 onwards we assume you have opened the level editor.

  1. If you have a certain logic function in mind, it might help to use an external tool to generate a circuit, which you can then replicate inside the editor. We can recommend Logic Friday, it is no longer maintained but an archived version can be used.
  2. Open an already existing level from your local machine (if you want to edit a level on the server you have to download it first) or start from scratch by clicking the Delete all button in the bottom right corner
  3. Place your components, this step becomes a lot easier if you can replicate the circuit generated by a different tool like Logic Friday. All components can be found in the left toolbar, first click on the desired component and then click the target locations on the grid:
  4. Wire everything up:
  5. Play the level at least once to make sure the level can be solved and everything looks as desired. The play button is in the bottom right corner.
    You can return to the editor by solving the level or by pressing the Skip button.
  6. Save the level to your local machine by clicking the Save button. You then need to place it in the levels folder of your server/Docker machine. (The level editor is running on your local machine, the saved levels usually end up in your downloads folder. The level will not be send to the server on its own!)

[!NOTE]
Please make sure to save your level before navigating to a different site or closing the tab/browser. While the editor tries to warn you when leaving the site, it is not guaranteed that your browser will display this warning to you. There is no automatic save feature at the moment and all progress will be lost if you leave the page!

Obfuscated Gates

The intention of obfuscated gates is to complicate the process of reverse engineering the circuit. In this game they are modeled by either showing a different image to the player in case of covert gates, or they show an ink blob for camouflaged gates.

Both options are represented as an orange dab of paint in the left toolbar. You have to place them first and then switch back to select mode to open up the properties panel.

You can not directly set the type to covert or camouflaged, but instead you configure the visualGate and actualGate. The visualGate determines the image that is shown to the player/person reverse engineering the circuit and the actualGate is how the game/silicon actually behaves. If you model reality, the only possible combinations for covert and camouflaged gates are as follows:

Dropdown Menu Covert Gate (values) Camouflaged Gate (values)
visualGate and, or camouflaged
actualGate inverter, identity and, or
Dummy inputs? Yes No

For technical details see the level file documentation.

Dummy Inputs

identity and inverter need an actual covert gate connection. This one wire will determine the input of the gate, all other connections are only visual and have no influence on the input state. You can switch a wire from a normal connection to an actual covert connection by selecting it in wire mode and clicking the Make covert connection button. The wire will then switch from green to orange, indicating the changed connection type.

Configuration

In order to use the level editor, the following two sections must exist inside the gameConfig.json. The level editor is enabled in the default config, to disable it simply remove the "editor": {...} block from the config.

Inside the "gamerules" block the following should be present:

"configEditor": {
    "enableLogging": false,
    "disclaimer": null,
    "competitionShowSkipButton": "always",
    "wrongSolutionCooldown": 0,
    "phaseDifficulty": {
        "Competition": "EASY"
    }
}

Create this block inside "groups" if you want to enable the level editor, otherwise just remove it:

"editor": {
    "ctr": 9000,
    "config": "configEditor",
    "phases": ["LevelEditor"]
}

See gameConfig_example.json and the gameConfig documentation for additional details.

Implementation details

The level editor is implemented as a regular group, which will show two scenes. One of them is the LevelEditor scene which needs to be configured in the gameConfig.json as shown above.
When you press the play button, the client will create a Competition scene with only one local level. After you solve or skip this level, the server responds with the LevelEditor scene again.