Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

DungeonBlock

Introduction to DungeonBlocks

DungeonBlocks are specific object types utilized within dungeons in Metin2. They are distinct due to their associated lightmap, which enhances the base texture and creates unique visual effects. Unlike the standard .gr2 files used for various assets in the game, these DungeonBlocks have their own file extension.

In Metin2, many objects—including mounts, pets, monsters, weapons, and players—have a .gr2 extension. For instance, we can preview most objects using the Granny Viewer:

Granny Viewer

However, with DungeonBlocks, previewing textures is not possible because these textures are intertwined in a manner that the tool cannot process. As a result, they often appear white:

White Texture Issue

1. Differences from Standard .gr2 Files

Let’s analyze the distinctions in detail.

When we compare the textures in DungeonBlocks, we can see they exist (correct paths), but one specific texture shared by all DungeonBlock objects is invisible, causing the white appearance:

Invisible Texture

The highlighted "light_passC_pole.dds" corresponds to the lightmap that allows the object to overlay a combination of lights and shadows from a separate texture onto the base texture, producing effects not achievable with ordinary objects:

Light Effect

The blue-highlighted squares depict the light derived from this specific texture.

For example, here is an object from the new snake dungeon:

Snake Dungeon Object

While it cannot be seen with textures in the Granny Viewer, it is visible in the world editor.

In the world editor, DungeonBlocks exhibit distinct extensions:

Extensions

  • .prb (Property Building): This is the usual extension for traditional building assets (rocks, houses, bridges).
  • .prd (Property Dungeons): This is exclusive to DungeonBlocks.

Although one might assume that the .gr2 files found in Building assets are the same as those in DungeonBlocks, this is false. Attempting to create a .prd with a .gr2 classified as a Building will result in the object not displaying.

2. Managing Files Within Maps

As you may know, in Metin2, the game loads various objects based on configurations specified in traditional text files. Each object resides in a dedicated folder (property), including DungeonBlocks, which are quite similar to traditional building formats. DungeonBlocks are essentially an extension of Ymir's classic .gr2 models.

Rendering of Buildings

In standard building rendering, the game is designed to handle the 3D model with only one texture applied—specifically, the diffuse map. Shadows are rendered by projecting the shape of the 3D model onto the terrain map based on vertices, applying a dark overlay to produce ambient lighting corresponding to the basics of Metin2:

Building Rendering

Rendering of DungeonBlocks

Conversely, DungeonBlocks are rendered using a second texture (the "light map"). This texture blends with the base texture to achieve complex lighting effects. The shadow rendering for DungeonBlocks is unique: Metin2 invisibly renders a secondary model (with only the vertices hidden), which not only disregards the base shadow rendering but also applies customized light settings. As the maximum light color is white, the alpha value of the textures is ignored, resulting in an overlay color for highlights. Consequently, these objects bypass ambient light even in the world editor—ideal since they should only be visible within the dungeon environment.

DungeonBlock Rendering

3. Considerations

The lightmap likely exists to leverage multiple light sources without altering the base ambient lighting, which could cause significant issues if ignored.

The operations discussed can be found in EterGrnLib/ThingInstance.cpp for standard objects (including buildings), while DungeonBlocks are detailed in GameLib/DungeonBlock.cpp (which uses special calls to the DirectX8 renderer). The map rendering, along with the base shadow, can be found in GameLib/MapOutdoor.cpp.

4. Using 3ds Max

To get started, you will need:

  • 3ds Max (I recommend version 2018)
  • A model for export as a DungeonBlock
  • A computer capable of handling these tasks (preferably one that won’t overheat)

Create a new project and import the object. Once the textures are applied, navigate to the quick controls panel on the right. Head to the Create section (marked with a "+"), then select the Photometric subsection to choose your desired lighting type. I will use Free Light for this example:

3ds Max Free Light

Once the light sources have been placed, go to the top menu, select Rendering, and then click Render to Texture. A window will appear where you can input various parameters. Start by selecting the relevant object:

Render to Texture Window

Important Note: The complexity of the object will affect the rendering time—it may take longer for detailed models. Ensure your computer can manage the load unless you’re okay with some minor malfunctioning.

Once this process completes, you will create the lightmap texture. However, Metin2 has a specific way of reading these textures. You will need to modify the material of the object to connect the primary texture to the lightmap. This must be done for each texture, resulting in the desired configuration:

Material Setup Example

Note: While you can retain default names for materials and textures (like Material #1, Map #1), you must use the naming convention Blend_x for blending operations, or the game will fail to recognize them.

After completing these steps, it’s time to export the object. Recall that exporting a DungeonBlock differs from building. The "Coords per vertex" parameter defaults to one, but for the model to qualify as a DungeonBlock, it must be set to at least two:

Coords per Vertex Change

5. Using the World Editor

Finally, once you’ve exported your object, indicate in the world editor that it is a DungeonBlock:

World Editor Configuration

To summarize, here are a couple of screenshots of an object I used while crafting this guide:

Screenshot 1
Screenshot 2
Screenshot 3
Screenshot 4


This guide aims to provide a detailed understanding of how to effectively create and configure DungeonBlocks within Metin2. Happy creating!

Link to comment
Share on other sites


  • 100% changed the title to DungeonBlocks & LightMaps In MT2: Guide To Setting Up .prd Models

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...