Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Gamedev:Structure: Difference between revisions

From FIGHTORDER
imported>Flozi
update links
imported>Eronoobos
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
= What's an sd7/sdz file? =
= 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.
A mod is presented as an [[sd7]] or sdz file.  This is just a zip file of the individual files comprising the game.
Line 7: Line 8:
sd7 / sdz files are created using 7zip.
sd7 / sdz files are created using 7zip.


= .sdd directories =
== .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.
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.


Line 13: Line 14:
   ln -s ~/projects/caspring/games/zk ~/.spring/games/zk.sdd
   ln -s ~/projects/caspring/games/zk ~/.spring/games/zk.sdd


=='''<code>root of game folder</code>'''==
== Directory Structure ==
==='''<code>root of game folder</code>'''===


[[Modinfo.lua]] and can also contain [[Modoptions.lua]] and [[AI:Development:Lang:Lua|LuaAI.lua]]
[[Modinfo.lua]] and can also contain [[Modoptions.lua]], [[AI:Development:Lang:Lua|LuaAI.lua]], and [[springignore.txt]]


=='''<code>anims\</code>'''<br>==
==='''<code>anims\</code>'''<br>===
image files for [[MouseCursors|mouse cursors]]
image files for [[MouseCursors|mouse cursors]]


=='''<code>bitmaps\</code>'''<br>==
==='''<code>bitmaps\</code>'''<br>===


==='''<code>bitmaps\loadpictures</code>'''<br>===
===='''<code>bitmaps\loadpictures</code>'''<br>====
pictures that will be displayed when the game loads.
pictures that will be displayed when the game loads.


==='''<code>bitmaps\tracks</code>'''<br>===
===='''<code>bitmaps\tracks</code>'''<br>====
images that are used for the [[Gamedev:UnitDefs#Decals|unit tracks]]
images that are used for the [[Gamedev:UnitDefs#Decals|unit tracks]]


=='''<code>features\</code>'''<br>==
==='''<code>features\</code>'''<br>===
.lua files [[Gamedev:FeatureDefs|that define features (wreckage and such)]]
.lua [[Gamedev:FeatureDefs|FeatureDef]] files
Subfolders are allowed.
: 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>==
==='''<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 control the gameplay
[[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>===
[[Game_and_Unit_development#Modeling_.28.3do.2C_.s3o.29|3D files]] such as .3do or .3do to be used by features, units or weapons.
.3do, [[About_s3o|.s3o]] or [[Assimp]] compatible 3D model files
Subfolders are allowed.
: 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>===
[[Game_and_Unit_development#Unit_Scripting.2FAnimations_.28.cob.2C_.bos.2C_.lua.29|animation scripts]] for units
[[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>units\</code>'''<br>==
==='''<code>units\</code>'''<br>===
.lua files [[Gamedev:UnitDefs|that define the units.]]
.lua [[Gamedev:UnitDefs|UnitDef]] files
Subfolders are allowed.
: 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>unitpics\</code>'''<br>==
==='''<code>unitpics\</code>'''<br>===
[[Units:Buildpics|unit preview pictures for buildmenu]]
.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>==
==='''<code>unittextures\</code>'''<br>===
[[Game_and_Unit_development#Modeling_.28.3do.2C_.s3o.29|Textures for the 3D files]] Textures for the 3D models.
.dds, .tga or .png image [[3DModels:Textures|texture]] files.
Subfolders are allowed.
: 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>weapons\</code>'''<br>==
==='''<code>weapons\</code>'''<br>===
files that [[Gamedev:WeaponDefs|define weapons]]
.lua [[Gamedev:WeaponDefs|WeaponDef]] files
Subfolders are allowed.
: 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\

sound files

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.