Terrain sample – DayZ

From Bohemia Interactive Community
Revision as of 00:18, 25 April 2023 by Lou Montana (talk | contribs) (Text replacement - "Category:DayZ:Terrain_Editing" to "{{GameCategory|dayz|Terrain Editing}}")
Jump to navigation Jump to search


Overview and requirements

This page gives an overview of the terrain sample, part of the DayZ Sample package, available at DayZ Samples GitHub repository here.

dayz te utes sample.jpg

Requirements:

  • DayZ and DayZ Tools package installed.
  • Prepared work-drive using WorkDrive app.
    • Choose a path for Work Drive in DayZ Tools Launcher > Settings (uncheck default if you want to use custom).
    • Drive letter has to be to P:\ (because of the paths in the sample terrain project).
    • Use DayZ Tools Launcher > Tools > Extract Game Data to prepare data on your work-drive.
    • Please note that the process of extracting game data takes some time and should be executed after each major game update to make sure extracted game data reflect current state in the game.
  • Correctly setup Buldozer for Terrain Builder:
    • Terrain Builder > Tools > Preferences... > Buldozer
      • .exe file path is set to DayZ_x64.exe (from your DayZ installation)
      • Launch parameters are -buldozer -window -nopause -mod= -profiles=P:\Buldozer -name=Buldozer
      • Data directory is P:\
    • Terrain Builder > Tools > Settings > User settings
      • Data directory is P:\

Terrain sample contains following items:

Using the sample

  1. Make sure you have everything correctly setup (see requirements).
  2. Extract downloaded terrain sample into samples directory on your work-drive (if you dont have samples directory, create one in advance).
  3. Run Terrain Builder from the tools launcher and load following file samples\test_terrain\source\utes.tv4p.
  4. Loading process should take few seconds after which you should see the Utes terrain loaded in Terrain Builder.
  5. Make sure your Terrain Builder is correctly setup (look into buldozer setup for more info on how to configure Terrain Builder for Buldozer).
  6. Click the clapperboard icon in the upper toolbar to run Buldozer (3D preview).

Packing the sample

Terrain needs to be binarized and packed before trying it in the game. Sample terrain is divided into 5 folders, 4 of which are meant to be packed separately (and in defined order). Source folder is not needed to be packed (all of the relevant game data is in the other folders). This folder division is recommended as terrain data are usually quite big (and numerous) and makes packing process faster (you are not forced to always repack everything). Pack the terrain sample in following order:

  • samples\test_terrain\world - folder with exported wrp file and world config file
  • samples\test_terrain\data - folder with terrain texture data
  • samples\test_terrain\ce - folder with default Central Economy files
  • samples\test_terrain\navmesh - folder for a navmesh file (contains pre-generated navmesh, any changes to the terrain will require re-generation!)

For the packing itself, it is recommended to use Addon Builder from the DayZ Tools package (open DayZ Tools Launcher to run it). Here is what you need to setup prior the packing in Addon Builder:

  • Addon source directory - path to one of the aforementioned folders.
  • Destination directory or filename - where the result packed pbo will end up.
  • Check Binarize and Binarize all textures.
  • In options, make sure you have a proper path for temp folder selected and path to project folder to be equal where your work-drive folder is physically located. Also make sure that *.xml and *.nm extensions are part of the List of files to copy directly.

Or look directly at this picture to see how to setup Addon Builder:

dayz te utes pack.jpg

Where F:\DayZSourceModding is equal to the physical path to your work-drive, the same path that you have set in DayZ Tools Launcher earlier (DayZ Tools Launcher > Settings > Path to the Project Drive).

After checking and setting all of the things in Addon Builder, you are ready to pack the sample terrain. Keep in mind that all of the three folders need to be packed separately.

How to run the sample

All three output pbos are required to be moved into a mod-folder. Create a folder called for example @Samples in your game directory. Inside this folder, create a folder called Addons and the pbo files in it. Add @Samples folder as a local mod in DayZ Launcher and select it afterwards.

Now that you have packed files in place, there is one more thing that needs to be prepared in order to try your terrain in the game and that is a mission. Mission is first and foremost a folder, which has to follow a format of mission_name.terrain_name, so for the case of sample terrain, its mission_name.utes (terrain_name equals to a CfgWorlds class name in the config of the sample terrain - in samples\test_terrain\world\config.cpp). This folder can be located anywhere on your pc and you can use the -mission=path parameter (from the launcher all parameters tab). Mission folder needs to have an init.c file inside, which you can create by simply creating a text file and then renaming the extension to .c. Copy paste following into newly created file:

void main()
{
    // economy init (optional - uses default files from samples\test_terrain\ce)
    CreateHive();
    GetHive().InitOffline();
 
    // player init
    vector spawnPos = "3372 0 3090";
    Entity playerEnt = GetGame().CreatePlayer(NULL, "SurvivorF_Eva", spawnPos, 0, "NONE");
    PlayerBase player = (PlayerBase) playerEnt;
    GetGame().SelectPlayer(NULL, player);
};

Assuming you have the local mod @Samples and the mission parameter set in your DayZ Launcher, hit the play button and enjoy Utes!

What next?

You may want to check other pages on this wiki, such as Buldozer setup and controls, generating navmesh and Central Economy setup on custom terrains.