Mod structure?

Mod structure?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Eaglebird
Posts: 263
Joined: 02 Aug 2005, 23:49

Mod structure?

Post by Eaglebird »

Hey. I've been MIA for quite a while now. I downloaded and reinstalled Spring to see the changes, and I've either forgotten or it's changed, but it seems like spring mods moved from the old "Units, weapons, animations, etc" files and to simple .sd* archives.

To get to the point, I wanted to port my favorite unit pack over to Spring. Regardless of how easy, difficult, or common it is, I'm stumbling to find out how exactly the mod structure is layed out. How does it relate to my hard disk in terms of files, how does spring use it, and, most of all, how do I actually make it work?

On a side note, knowing both what
1) The minimum (working/operable), and
2) The recommended
effort for porting such a pack is or would be, would be both helpful and enlightening.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Mod structure?

Post by smoth »

there are stickies here.. and if you look at the getting started one... that I posted..
User avatar
Eaglebird
Posts: 263
Joined: 02 Aug 2005, 23:49

Re: Mod structure?

Post by Eaglebird »

smoth wrote:there are stickies here.. and if you look at the getting started one... that I posted..
I had seen it, but at the read I gave it, it didn't tell me what I'm asking here.

Also, you have an extra "L" on the end of the link to "Simple Mod Tutorial" :wink:
Rubenes
Posts: 84
Joined: 27 Apr 2005, 14:28

Re: Mod structure?

Post by Rubenes »

Here's an explanation of the mod structure:

- Anims folder: This contains cursor animations. (Required if you do not include the TA base files in your mod)

- Bitmaps: This folder contains pictures for use in CEGs and other stuff, although mostly not in .BMP format, despite what you may think. (Optional)
-- I'm not entirely sure how the structure inside this folder works, but one of the folders inside is the loadpictures folder, which contains the pictures you see when you are loading Spring.

- Features: You stick the .TDF files for features here. (Optional if you don't want corpses)
This folder has 2 subfolders:
-- all worlds: This folder seems to be used for buildable features (DTs)
-- Corpses: You stick the .TDF files for your corpses here

- Gamedata: Many files in this folder are necessary for gameplay. (Required)
-- Sidedata.tdf: This file defines your factions, their commanders and what units can build what. (Required)
-- Moveinfo.tdf: This file defines the footprints and how steep slopes your units can climb. (Required) Can be replaced by a LuaDef.
-- Modrules.tdf: Seems to define some things, like if AA shoots at crashing aircraft or hovers are transportable. (Optional)
-- Resources.tdf: Defines various things, like trees, smoke and graphics for weapon explosions. (Optional)
-- Sounds.tdf: This file defines the sounds your units make. Oddly, this file is required, but you can make it contain bogus stuff and Spring doesn't care. (Required)
-- Icontypes.tdf: This file defines what icons appear when you zoom out all the way. (Optional I think)
-- particles.tdf: Defines whether nanospray is team coloured or not. (Optional)
-- explosion_alias.tdf: Defines various explosion generators.
(Optional)
-- Explosions folder: This folder contains various TDF files, which define the CEGs in your mod. You can name the TDF files as you want and have as many as you want, but they all need to contain the same structure.

- Icons: This folder contains the icons your units will have when zoomed out.

- LuaRules: Contains LUA gadgets for your mod. (Optional)

- LuaUI: Contains LUA code to alter the GUI. (Optional)

- LuaCOB: Contains LUA code to enable LUA calls from unit scripts.
(Optional)

- lups: Contains the LUA particle system, not sure what it actually does :P (Optional)

- Objects3D: You stick the .3do or .s3o files for your units in here.
(Required)

- scripts: You stick the scripts for your units in here.
(Required)

- sidepics: This folder contains 16x16 pictures, one for each faction. This is the icon that appears in the lobby when you choose a faction.
(Required)

- sounds: This folder contains .wav files, all the sounds you want to use in your mod. (Optional)

- unitpics: Stick the buildpics for your units in here. (Required unless you want nice grey buildpictures)

- units: This folder contains the .fbi files for your units. Seems to be replaceable by a LuaDef. (Required)

-unittextures: Not sure actually what this folder it's use is, it seems to contain UVmaps for various things. (Optional I guess?)

-Weapons: Contains .TDF files that define the weapons in your mod. Can be replace by a LuaDef. (Optional if you want a very peaceful mod :P)

-Armor.TXT: Seems to be fairly useless, take a look at other mods to see what to stick in there.

- Modinfo.tdf: This defines the actual name of the mod, it's description, and its dependencies.

Ok, that's it I think. I may have missed out some advanced features, please tell me which then.
Last edited by Rubenes on 01 Jun 2008, 14:53, edited 1 time in total.
User avatar
rcdraco
Posts: 781
Joined: 22 Nov 2006, 02:50

Re: Mod structure?

Post by rcdraco »

Rubenes wrote:-- explosion_alias.tdf: Defines various explosion generators.
(Required)
I don't have one in any of my mods, it's not required.
User avatar
Eaglebird
Posts: 263
Joined: 02 Aug 2005, 23:49

Re: Mod structure?

Post by Eaglebird »

So, it's pretty much exactly like the old .ufo and hpi files, with added folders for other functions?

Seems simple enough :P
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Mod structure?

Post by Argh »

ExplosionAlias.tdf used to be required, for games / mods that did not call Spring core files as dependencies. It is no longer required even for that purpose.
So, it's pretty much exactly like the old .ufo and hpi files, with added folders for other functions?
Yeah... kinda. Meh, the real answer to that is incredibly long and unwieldy. But yeah, if you think about it that way, you're on the right track. You can't just dump the files and have it work, though, not by a long shot.
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: Mod structure?

Post by [Krogoth86] »

Rubenes wrote:- Bitmaps: This folder contains pictures for use in CEGs and other stuff, although mostly not in .BMP format, despite what you may think. (Optional)
-- I'm not entirely sure how the structure inside this folder works, but one of the folders inside is the loadpictures folder, which contains the pictures you see when you are loading Spring.
In the gamedata folder the ressources.tdf file is responsible for assigning names to specific images (which you type in there with the respective folder) so when you for example use a texture in a CEG you just give the "name" you gave the texture and its location gets looked up via the ressources.tdf ...

Besides the loadpictures folder you're free to put the files in any folder you want...
Rubenes wrote:- LuaCOB: Contains LUA code to enable LUA calls from unit scripts.
(Optional)
LuaCOB is dead i.e. in the upcoming versions it won't work anymore. You can port your work on this sector more or less easy into something compatible to LuaRules which will replace it...
Rubenes wrote:-Armor.TXT: Seems to be fairly useless, take a look at other mods to see what to stick in there.
It's extremely useful. In the armor.txt you define damage groups i.e. if you want a weapon to deal a special amount of damage to a special group of units you handle over the wanted damage value with the armor name. The armor.txt consists of a list of armor types where each type gets assigend by giving the unitname of the respective unit followed by a =99; where the 99 is totally random and has no meaning - it's just about assigning a number so the engine knows this unit should be part of the group...

Hint:
Currently every unit can be in just one armor group. If you put a unit in multiple groups the last entry in the armor.txt will override all the others...
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Mod structure?

Post by FLOZi »

*would like to point out that (hopefully) come next version you can avoid the TDF format entirely in favour of lua*
User avatar
rcdraco
Posts: 781
Joined: 22 Nov 2006, 02:50

Re: Mod structure?

Post by rcdraco »

I would rather scrap bos/cob then get rid of TDF.

TDF is a thing where ANYONE can understand it, eliminating it is like eliminating the smf format, some people won't be able to learn sm3, or it will be really hard. Like me learning any programming language... I barely know bos/cob how the hell am I gonna learn lua.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: Mod structure?

Post by trepan »

rcdraco:

1. Your wish may be granted (BOS/COB)

2. lua files are included in the base archives
for TDF compatibility (parse_tdf.lua makes it
quite easy).

3. There are few languages out there that are
simpler to learn (for the functionality), than lua.
Also, if you are writing your own definition files,
you don't need to know all of the lua syntax.
Just stick to the basic lua table definitions
(which do not have the limitations that TDF has,
ex: all characters can be used in lua strings).
TDF's "enumerate by key name" is also sad.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Mod structure?

Post by zwzsg »

Eaglebird wrote:it seems like spring mods moved from the old "Units, weapons, animations, etc" files and to simple .sd* archives.
If a .sdz, rename it to .zip then open with WinZip
If a .sd7, rename it to .7z then open with www.7-zip.org
Oh, joy, the old "Units, weapons, animations, etc" files are back!

(In reality, you don't even need the renaming part, and the 7zip program can open plain .zip too, but it was easier to explain that way)
User avatar
rcdraco
Posts: 781
Joined: 22 Nov 2006, 02:50

Re: Mod structure?

Post by rcdraco »

I have no friggn' clue what trepan said.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Mod structure?

Post by FLOZi »

He said you're an idiot.

You won't be forced to use lua if you prefer TDF.
You won't be forced to use TDF if you prefer lua.
Post Reply

Return to “Game Development”