Zh-tw/Source SDK Files and Directory Structure: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
m (Multipage removal)
 
(16 intermediate revisions by 9 users not shown)
Line 1: Line 1:
With the latest SDK release, the default directory structure will be changed to remove the restriction of having to save your game content into the \sourcesdk directory tree. This document explains how the Source SDK directory structure is set up.
{{LanguageBar}}
{{Dead end|date=January 2024}}


=The directory structure explained=
<h1>Source SDK中檔案與資料夾結構</h1>
隨著最新的SDK發行,原本預定的資料夾結構位置已經移除了將內容儲存在\sourcesdk資料夾下的限制。這份文件將說明Source SDK的資料夾結構。


The SDK directory structure is now set up so that game content directories are separated from game sources directories.
=說明資料夾結構=


* <i>Game content</i> files are the actual files necessary to run the game — textures, maps, models, etc.
SDK資料夾結構已經設定成遊戲內容資料夾從遊戲來源資料夾分開。
* <i>Game sources</i> are the files that are used to create that game content (the "source" of the game content).


This table explains some of the different game content and game source file types in the SDK:
* '''遊戲內容'''的檔案是實際上會被用來執行遊戲用的 - 材質、地圖、模型等等。
* '''遊戲來源'''的檔案是用來創造遊戲內容用的(遊戲內容的「資源」、「來源」)。


{|
這份表格將說明SDK中各種不同的遊戲內容檔案型態和遊戲來源檔案型態:
! File type         || Description           || Location
 
{| class=standard-table
! 檔案型態         || 描述           || 位置
|-
|-
| <code>.VMF</code>              || Map source files.                                   || <code>sourcesdk_content\<game name>\mapsrc</code>
| <code>.VMF</code>              || 地圖來源檔案。                                   || <code>sourcesdk_content\<遊戲名稱>\mapsrc</code>
|-
|-
|<code>.TGA .TXT</code>          || Texture source files.                               || <code>sourcesdk_content\<game name>\materialsrc</code>
|<code>.TGA .TXT</code>          || 材質來源檔案。                               || <code>sourcesdk_content\<遊戲名稱>\materialsrc</code>
|-
|-
|<code>.SCN .SMD .QC</code>      || Model source files.                                 || <code>sourcesdk_content\<game name>\modelsrc</code>
|<code>.SCN .SMD .QC</code>      || 模型來源檔案。                                 || <code>sourcesdk_content\<遊戲名稱>\modelsrc</code>
|-
|-
| <code>.BSP</code>              || Map content files — compiled game maps.            || <code><game name>\maps</code>
| <code>.BSP</code>              || 地圖檔案(內容)-已編譯過的地圖來源檔案。
|| <code><遊戲名稱>\maps</code>
|-
|-
| <code>.VMT .VTF</code>        || Texture content files — compiled game textures.    || <code><game name>\materials</code>
| <code>.VMT .VTF</code>        || 材質檔案(內容)-已編譯過的材質來源檔案。
|| <code><遊戲名稱>\materials</code>
|-
|-
|<code>.MDL .VTX</code>          || Model content files — compiled game models/props.  || <code><game name>\models</code>
|<code>.MDL .VTX</code>          || 模型檔案(內容)-已編譯過的模型、道具來源檔案。
|| <code><遊戲名稱>\models</code>
|}
|}
The following image shows the default locations for these files and folders:
下面的圖顯示這些檔案、資料夾預設的位置:


[[Image:developer-contentfolders.jpg]]
[[File:developer-contentfolders.jpg]]


{|
{| class=standard-table
| '''Steam Install Directory'''      || The location where you've installed Steam.
| '''Steam Install Directory(Steam資料夾)'''      || 這是您安裝Steam的資料夾
|-
|-
| '''Game Content'''                || The game content is here, with all the files necessary to run each game under each game directory.
| '''Game Content(遊戲內容)'''                || 遊戲內容的位置在這裡,所有執行遊戲所必要的檔案(在其遊戲的資料夾中)。
|-
|-
| '''SDK Tools'''                    || The location of the applications necessary to create and compile SDK content.
| '''SDK Tools(SDK工具)'''                    || 這位置是SDK用來建立或編譯遊戲來源成遊戲內容的程式工具區。
|-
|-
| '''Content Sources'''            || Directories for each of the types of game content sources are here, with a set of directories for each game you want to create content for. '''SDK sample content is also stored here.'''
| '''Content Sources(遊戲來源)'''            || 各種遊戲來源的位置,用來建立遊戲內容的存放區。'''示例也放在這裡。'''
|}
|}


=使用SDK資料夾結構的例子=


=Examples of using this SDK directory structure=
這邊有實際的例子,說明這結構是如何使用:
 
Here are some practical examples of how this structure is used:


== Compiling a CS:S map: ==
== 編譯一個CS:S地圖: ==


# Launch the '''Hammer''' level editor, which is launched from the '''SDK Tools Directory'''.
# 在SDK Tools(SDK工具)資料夾中執行'''Hammer'''關卡編輯器(工具)。
# Save the map as a .VMF into the <code>cstrike\mapsrc</code> directory, which is under '''Content Sources'''.
# 將地圖儲存成.VMF到'''遊戲來源'''<code>cstrike\mapsrc</code>資料夾裡。
# Compile the map inside Hammer. The map is compiled as a .BSP and automatically placed in the <code>cstrike\maps</code> '''Game Content''' directory.
# 在'''Hammer'''裡面編譯此地圖。這地圖被編譯成.BSP,並自動的放到'''遊戲內容'''下<code>cstrike\maps</code>資料夾裡。


==Creating a texture for Half-Life 2: Deathmatch:==
==建立一個新材質給Half-Life 2: Deathmatch:==


# Create a texture in an image editing application, and save it as a .TGA in the <code>hl2mp\materialsrc</code> directory, which is under '''Content Sources'''.
# 用影像編輯程式建立一個圖,將其儲存成.TGA,並放到'''遊戲來源'''下<code>hl2mp\materialsrc</code>資料夾裡。
# Compile the texture with <code>Vtex.exe</code>, which is in the '''SDK Tools Directory'''.
# 在SDK Tools(SDK工具)資料夾中執行<code>Vtex.exe</code>來編譯.TGA。
# The texture is compiled as a .VTF and automatically placed in the <code>hl2mp\materials</code> '''Game Content''' directory.
# 材質會被編譯成.VTF並被自動的放到'''遊戲內容'''<code>hl2mp\materials</code>資料夾裡。
# Create the .VMT material file with a text editor, and save it in the <code>hl2mp\materials</code> '''Game Content''' directory.
# 用文字編輯器建立一個.VMT材質描述檔,並將其存到'''遊戲內容'''<code>hl2mp\materials</code>資料夾裡。


==Creating a model for Half-Life 2:==
==建立一個Half-Life 2的模型:==


# Create a model in Softimage|XSI EXP, and export it as an .SMD in the <code>hl2\modelsrc</code> directory, which is under '''Content Sources'''.
# 使用塑模軟體(如:Maya、3DsMAX、XSI EXP)建立一個模型,將其匯出成.SMD到'''遊戲來源'''下<code>hl2\modelsrc</code>資料夾裡。
# Create the .QC model definition file with a text editor, and save it in the <code>hl2\modelsrc</code> directory, which is under '''Content Sources'''.
# 使用文字編輯器建立一個.QC模型描述檔,並將其存到'''遊戲來源'''<code>hl2\modelsrc</code>資料夾裡。
# Compile the model with <code>Studiomdl.exe</code>, which is in the '''SDK Tools''' Directory.
# 用SDK Tools(SDK工具)資料夾中執行<code>Studiomdl.exe</code>,編譯.SMD與.QC。
# The model is compiled as a .MDL and automatically placed in the <code>hl2\models</code> '''Game Content''' directory.
# 模型將編譯成.MDL並自動的放到'''遊戲內容'''<code>hl2\models</code>資料夾裡。


For in-depth descriptions of these procedures, see the appropriate section of the Source SDK Documentation.
想要更深入的了解這些程序,參見Source SDK的文件。


[[category:Source_SDK_FAQ]]
{{Uncategorized|date=January 2024}}


{{otherlang:zh-tw}} {{otherlang:zh-tw:en|{{PAGENAME}}}},
{{ACategory|Files}}
{{ACategory|Source SDK FAQ}}

Latest revision as of 11:12, 12 July 2024

English (en)Español (es)Français (fr)日本語 (ja)Polski (pl)Русский (ru)中文 (zh)中文(臺灣) (zh-tw)Translate (Translate)
Dead End - Icon.png
This article has no Wikipedia icon links to other VDC articles. Please help improve this article by adding links Wikipedia icon that are relevant to the context within the existing text.
January 2024

Source SDK中檔案與資料夾結構

隨著最新的SDK發行,原本預定的資料夾結構位置已經移除了將內容儲存在\sourcesdk資料夾下的限制。這份文件將說明Source SDK的資料夾結構。

說明資料夾結構

SDK資料夾結構已經設定成遊戲內容資料夾從遊戲來源資料夾分開。

  • 遊戲內容的檔案是實際上會被用來執行遊戲用的 - 材質、地圖、模型等等。
  • 遊戲來源的檔案是用來創造遊戲內容用的(遊戲內容的「資源」、「來源」)。

這份表格將說明SDK中各種不同的遊戲內容檔案型態和遊戲來源檔案型態:

檔案型態 描述 位置
.VMF 地圖來源檔案。 sourcesdk_content\<遊戲名稱>\mapsrc
.TGA .TXT 材質來源檔案。 sourcesdk_content\<遊戲名稱>\materialsrc
.SCN .SMD .QC 模型來源檔案。 sourcesdk_content\<遊戲名稱>\modelsrc
.BSP 地圖檔案(內容)-已編譯過的地圖來源檔案。 <遊戲名稱>\maps
.VMT .VTF 材質檔案(內容)-已編譯過的材質來源檔案。 <遊戲名稱>\materials
.MDL .VTX 模型檔案(內容)-已編譯過的模型、道具來源檔案。 <遊戲名稱>\models

下面的圖顯示這些檔案、資料夾預設的位置:

Developer-contentfolders.jpg

Steam Install Directory(Steam資料夾) 這是您安裝Steam的資料夾
Game Content(遊戲內容) 遊戲內容的位置在這裡,所有執行遊戲所必要的檔案(在其遊戲的資料夾中)。
SDK Tools(SDK工具) 這位置是SDK用來建立或編譯遊戲來源成遊戲內容的程式工具區。
Content Sources(遊戲來源) 各種遊戲來源的位置,用來建立遊戲內容的存放區。示例也放在這裡。

使用SDK資料夾結構的例子

這邊有實際的例子,說明這結構是如何使用:

編譯一個CS:S地圖:

  1. 在SDK Tools(SDK工具)資料夾中執行Hammer關卡編輯器(工具)。
  2. 將地圖儲存成.VMF到遊戲來源cstrike\mapsrc資料夾裡。
  3. Hammer裡面編譯此地圖。這地圖被編譯成.BSP,並自動的放到遊戲內容cstrike\maps資料夾裡。

建立一個新材質給Half-Life 2: Deathmatch:

  1. 用影像編輯程式建立一個圖,將其儲存成.TGA,並放到遊戲來源hl2mp\materialsrc資料夾裡。
  2. 在SDK Tools(SDK工具)資料夾中執行Vtex.exe來編譯.TGA。
  3. 材質會被編譯成.VTF並被自動的放到遊戲內容hl2mp\materials資料夾裡。
  4. 用文字編輯器建立一個.VMT材質描述檔,並將其存到遊戲內容hl2mp\materials資料夾裡。

建立一個Half-Life 2的模型:

  1. 使用塑模軟體(如:Maya、3DsMAX、XSI EXP)建立一個模型,將其匯出成.SMD到遊戲來源hl2\modelsrc資料夾裡。
  2. 使用文字編輯器建立一個.QC模型描述檔,並將其存到遊戲來源hl2\modelsrc資料夾裡。
  3. 用SDK Tools(SDK工具)資料夾中執行Studiomdl.exe,編譯.SMD與.QC。
  4. 模型將編譯成.MDL並自動的放到遊戲內容hl2\models資料夾裡。

想要更深入的了解這些程序,參見Source SDK的文件。

Wikipedia - Letter.png
This article has not been added to any content Wikipedia icon categories. Please help out by Wikipedia icon adding categories.
January 2024