Gamedev:Structure: Difference between revisions
More actions
imported>Abma |
imported>Eronoobos |
||
| (11 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
= Game Structure = | |||
== .sd7 or .sdz == | |||
A mod is presented as an [[sd7]] or sdz file. This is just a zip file of the individual files comprising the game. | |||
You can unzip the sd7 or sdz file by renaming it to .zip, and using a zip tool to unzip it. | |||
sd7 / sdz files are created using 7zip. | |||
== | == .sdd directories == | ||
You can avoid using the archives altogether by storing the whole mod directory structure in an .sdd directory. This is useful for game development because the changes you make are visible without any additional step. | |||
On Linux one can also symlink the development directories from the Spring's mod directory: | |||
ln -s ~/projects/caspring/games/zk ~/.spring/games/zk.sdd | |||
=='''<code> | == Directory Structure == | ||
==='''<code>root of game folder</code>'''=== | |||
[[Modinfo.lua]] and can also contain [[Modoptions.lua]], [[AI:Development:Lang:Lua|LuaAI.lua]], and [[springignore.txt]] | |||
.lua | |||
=='''<code>gamedata\</code>'''<br>== | ==='''<code>anims\</code>'''<br>=== | ||
image files for [[MouseCursors|mouse cursors]] | |||
==='''<code>bitmaps\</code>'''<br>=== | |||
===='''<code>bitmaps\loadpictures</code>'''<br>==== | |||
pictures that will be displayed when the game loads. | |||
===='''<code>bitmaps\tracks</code>'''<br>==== | |||
images that are used for the [[Gamedev:UnitDefs#Decals|unit tracks]] | |||
==='''<code>features\</code>'''<br>=== | |||
.lua [[Gamedev:FeatureDefs|FeatureDef]] files | |||
: Corpse and map-static feature definitions. The corpse files are similar to [[Gamedev:UnitDefs|UnitDefs]] but usually contain a less data, such as what model to use as the wreckage, how much metal the wreck will give if reclaimed, etc. Some games choose to subsume these into the [[Gamedev:UnitDefs|UnitDef]] instead of having separate files.Subfolders are allowed. | |||
==='''<code>gamedata\</code>'''<br>=== | |||
[[:Category:Gamedata|Various files]] that control global things or setup graphic & sound resources. | [[:Category:Gamedata|Various files]] that control global things or setup graphic & sound resources. | ||
=='''<code>icons\</code>'''<br>== | ==='''<code>icons\</code>'''<br>=== | ||
images for [[Icontypes.lua|unit symbols and radar icons]] | images for [[Icontypes.lua|unit symbols and radar icons]] | ||
=='''<code>LuaRules\</code>'''<br>== | ==='''<code>LuaRules\</code>'''<br>=== | ||
various files to make Lua scripts work such as gadget handler | various files to make Lua scripts work such as gadget handler | ||
==='''<code>LuaRules\Gadgets</code>'''<br>=== | ===='''<code>LuaRules\Gadgets</code>'''<br>==== | ||
[[Lua_Scripting|Lua gadgets]]: scripts that | [[Lua_Scripting|Lua gadgets]]: scripts that control the gameplay | ||
==='''<code>LuaRules\Configs</code>'''<br>=== | ===='''<code>LuaRules\Configs</code>'''<br>==== | ||
config files read by Lua gadgets | config files read by Lua gadgets | ||
=='''<code>LuaUI\</code>'''<br>== | ==='''<code>LuaUI\</code>'''<br>=== | ||
==='''<code>LuaUI\widgets</code>'''<br>=== | ===='''<code>LuaUI\widgets</code>'''<br>==== | ||
[[Lua_Scripting|Lua widget]]: scripts that make up the user interface or do other unsynced things | [[Lua_Scripting|Lua widget]]: scripts that make up the user interface or do other unsynced things | ||
=='''<code>objects3d\</code>'''<br>== | ==='''<code>objects3d\</code>'''<br>=== | ||
[[ | .3do, [[About_s3o|.s3o]] or [[Assimp]] compatible 3D model files | ||
: This contains the actual 3D model that units and features use in-game. Most units have a variety of different pieces that are put together in a hierarchy type form (for instance, a tank has a hull, a turret attached to that, and a barrel attached to that). The {{xtaglink|Gamedev:UnitDefs|model}} tag determines what model is used. | |||
[[ | |||
=='''<code>scripts\</code>'''<br>== | ==='''<code>scripts\</code>'''<br>=== | ||
[[ | [[Animation-LuaScripting|.lua]] or [[Animation-CobOverview|.cob ]] animation script files | ||
: This contains all of the animation scripting for the units. Scripts work by calling on pieces of the unit's model to do things, such as rotate a turret to aim at a target, or emit smoke when the unit is damaged. The pieces named in the script file must reflect actual parts of the unit's. | |||
=='''<code>sidepics\</code>'''<br>== | ==='''<code>sidepics\</code>'''<br>=== | ||
[[Sidedata.lua|Faction icons]] read by lobby etc. | [[Sidedata.lua|Faction icons]] read by lobby etc. | ||
=='''<code>sounds\</code>'''<br>== | ==='''<code>sounds\</code>'''<br>=== | ||
[[Sounds.lua|sound files]] | [[Sounds.lua|sound files]] | ||
=='''<code> | ==='''<code>units\</code>'''<br>=== | ||
[[ | .lua [[Gamedev:UnitDefs|UnitDef]] files | ||
: Contains most of the active data that a unit uses, such as its health, a list of which weapons it has, speed, metal/energy cost, whether it is a construction unit or not, so on and so forth. Subfolders are allowed. | |||
=='''<code> | ==='''<code>unitpics\</code>'''<br>=== | ||
.dds or .png [[Gamedev:Buildpics|buildmenu pictures]] | |||
:Unit pictures are those little thumbnails which show up in the build menus of units in-game. They're just a little graphical representation of the unit so people know what they're building when they click it. Assigned via the {{xtaglink|Gamedev:UnitDefs|buildpic}} tag. | |||
==='''<code>unittextures\</code>'''<br>=== | |||
.dds, .tga or .png image [[3DModels:Textures|texture]] files. | |||
: Image files which are stretched over the unit. Texture 1 contains the diffuse and team colour and texture 2 controls reflectivity, specular, glow and 1-bit transparency. Subfolders are allowed. | |||
=='''<code> | ==='''<code>weapons\</code>'''<br>=== | ||
.lua [[Gamedev:WeaponDefs|WeaponDef]] files | |||
: Most units have weapons. The characteristics of these weapons, from its behaviour to how it acts in the air, is determined in the weapon file. Some games choose to subsume these into the [[Gamedev:UnitDefs|UnitDef]] instead of having separate files. Subfolders are allowed. | |||
[[Category:Game Dev]] | [[Category:Game Dev]] | ||
Latest revision as of 21:41, 7 April 2016
Game Structure
.sd7 or .sdz
A mod is presented as an sd7 or sdz file. This is just a zip file of the individual files comprising the game.
You can unzip the sd7 or sdz file by renaming it to .zip, and using a zip tool to unzip it.
sd7 / sdz files are created using 7zip.
.sdd directories
You can avoid using the archives altogether by storing the whole mod directory structure in an .sdd directory. This is useful for game development because the changes you make are visible without any additional step.
On Linux one can also symlink the development directories from the Spring's mod directory:
ln -s ~/projects/caspring/games/zk ~/.spring/games/zk.sdd
Directory Structure
root of game folder
Modinfo.lua and can also contain Modoptions.lua, LuaAI.lua, and springignore.txt
anims\
image files for mouse cursors
bitmaps\
bitmaps\loadpictures
pictures that will be displayed when the game loads.
bitmaps\tracks
images that are used for the unit tracks
features\
.lua FeatureDef files
- Corpse and map-static feature definitions. The corpse files are similar to UnitDefs but usually contain a less data, such as what model to use as the wreckage, how much metal the wreck will give if reclaimed, etc. Some games choose to subsume these into the UnitDef instead of having separate files.Subfolders are allowed.
gamedata\
Various files that control global things or setup graphic & sound resources.
icons\
images for unit symbols and radar icons
LuaRules\
various files to make Lua scripts work such as gadget handler
LuaRules\Gadgets
Lua gadgets: scripts that control the gameplay
LuaRules\Configs
config files read by Lua gadgets
LuaUI\
LuaUI\widgets
Lua widget: scripts that make up the user interface or do other unsynced things
objects3d\
.3do, .s3o or Assimp compatible 3D model files
- This contains the actual 3D model that units and features use in-game. Most units have a variety of different pieces that are put together in a hierarchy type form (for instance, a tank has a hull, a turret attached to that, and a barrel attached to that). The {{#css:
span.mono {
font-family: courier, monospace;
}
span.value {
color: #ff6600;
}
}}model tag determines what model is used.
scripts\
.lua or .cob animation script files
- This contains all of the animation scripting for the units. Scripts work by calling on pieces of the unit's model to do things, such as rotate a turret to aim at a target, or emit smoke when the unit is damaged. The pieces named in the script file must reflect actual parts of the unit's.
sidepics\
Faction icons read by lobby etc.
sounds\
units\
.lua UnitDef files
- Contains most of the active data that a unit uses, such as its health, a list of which weapons it has, speed, metal/energy cost, whether it is a construction unit or not, so on and so forth. Subfolders are allowed.
unitpics\
.dds or .png buildmenu pictures
- Unit pictures are those little thumbnails which show up in the build menus of units in-game. They're just a little graphical representation of the unit so people know what they're building when they click it. Assigned via the {{#css:
span.mono {
font-family: courier, monospace;
}
span.value {
color: #ff6600;
}
}}buildpic tag.
unittextures\
.dds, .tga or .png image texture files.
- Image files which are stretched over the unit. Texture 1 contains the diffuse and team colour and texture 2 controls reflectivity, specular, glow and 1-bit transparency. Subfolders are allowed.
weapons\
.lua WeaponDef files
- Most units have weapons. The characteristics of these weapons, from its behaviour to how it acts in the air, is determined in the weapon file. Some games choose to subsume these into the UnitDef instead of having separate files. Subfolders are allowed.