Skip to main content

"resources" Array

In DOOM Eternal, each map has a list of .resources and .streamdb files that will be loaded in the map itself. With this feature, you can tell the game to load other .resources and/or .streamdb files in maps. You can also tell the game to stop loading .resources or .streamdb files that are loaded by default in maps.

Structure

The basic structure of the "resources" array is below:

{
	"resources":[
		{
			"name":"",
			"remove":,
			"placeFirst":,
			"placeBefore":,
			"placeByName":""    
		}
	]
}
  • name (string) (required) - the name of the file to load, e.g. "e5m1_spear.resources"
  • remove (bool) (optional) - if set to true, the file specified by the name property will be removed from the map. Defaults to false if not set.
  • placeFirst (bool) (optional) - if set to true, the file specified by the name property will be loaded with the highest priority in the map. Defaults to false if not set.
  • placeBefore (bool) (optional) - if set to true, this resource will be loaded before the resource named in the placeByName property. Defaults to false if not set (meaning it will be loaded after). 
  • placeByName (string) (optional) - used with placeBefore to control the order in which resource files are loaded. For example, setting "placeBefore":true and "placeByName":"e1m1_intro.resources" will cause the file specified by name to be loaded with a higher priority than e1m1_intro.resources.

If neither placeBefore nor placeByName are set, then the asset will be loaded last, with the lowest priority.

Example Usage

The most common use of this feature is to give custom map/level creators access to assets that aren't normally available in a map. For example, you can tell the game to load e5m1_spear.resources (and the required .streamdb files) within another level, such as e1m1_intro.

By doing this, a person modifying the e1m1_intro map can then freely access files/entities from e5m1_spear.resources, the same as if they existed in e1m1_intro already. This would allow you to use DLC AI such as spirits (and many other things) in e1m1_intro, where they normally can't be used.

Below is a sample .json snippet that loads the e5m1_spear.resources and .streamdb files.

{
    "resources":[
        {
            "name":"e5m1_spear.resources"
        },
        {
            "name":"gameresources_6_1.streamdb",
            "placeBefore":true,
            "placeByName":"gameresources_0_4.streamdb"
        },
        {
            "name":"gameresources_0_6.streamdb",
            "placeBefore":true,
            "placeByName":"gameresources_0_4.streamdb"
        },
        {
            "name":"gameresources_1_8.streamdb",
            "placeBefore":true,
            "placeByName":"gameresources_0_4.streamdb"
        },
        {
            "name":"gameresources_2_2.streamdb",
            "placeBefore":true,
            "placeByName":"gameresources_0_4.streamdb"
        },
        {
            "name":"gameresources_3_2.streamdb",
            "placeBefore":true,
            "placeByName":"gameresources_0_4.streamdb"
        },
        {
            "name":"gameresources_4_3.streamdb",
            "placeBefore":true,
            "placeByName":"gameresources_0_4.streamdb"
        },
        {
            "name":"gameresources_5_3.streamdb",
            "placeBefore":true,
            "placeByName":"gameresources_0_4.streamdb"
        }
    ]
}

How Do I Know Which Files to Add?

First, take a look at this spreadsheet (note: there are multiple tabs at the bottom): https://docs.google.com/spreadsheets/d/10R5fWKGyqPuCPdueqKeCYycHETSHg0QeFOCbWIQZUCY/

This spreadsheet contains the list of the default .resources and .streamdb files that are loaded in all the game's maps. So, let's say that we want to have access to all the assets in e5m1_spear.resources in e1m1_intro.resources. The first thing we need to do is find the "e5m1_spear" map name in the spreadsheet, using the "map name" column.

You will see that the map name appears multiple times. This is because the map loads multiple .resources and .streamdb files. In the "file name" column you will see the names of the files that are loaded in the map. The order of the files matters. It actually goes from bottom to up, so the files at the bottom are loaded first during the map loading process, and the files at the top are loaded last. This means that the files at the top override the others (if they share files in common). This is what we refer to as load priority.