The code I'm using as a basis for this discussion can be found
here, and is based on a recent download of HEAD. It's almost done, just needs to be checked over.
I do not see the point to replacing init_ship_entry when the modder can already override all of the variables that it sets as they please.
Can you point out where this is possible? I'm sitting here, looking at my copy of HEAD ship.cpp, and all of the values in init_ship_entry look like they're hard-coded. Maybe I'm just missing it.
Also, parse_template calls init_ship_entry in order to have a working ship_info entry before it parses the template. So I'm not replacing it.
I also don't think it's a good idea to go back and re-implement required fields or, worse yet, implement some kind of dual parsing code where the fields are *sometimes* required, and *sometimes* optional.
Nothing has been re-implemented. If it weren't for a need of informative warning messages, I could code this feature in such a way as to have the same code do 99% of the parsing (Everything other than "$Name:") for both ship classes and templates. As it is, I had to copy parse_ship into parse_template, but all the actual parsing code is exactly the same.
As you yourself said, parse_ship only has one required field, and that is "$Name:". The code for templates works the same way.
If used properly, templates don't seem like they would solve the issue. General consensus seems to be that you would have templates like "Shivan Bomber" or "Terran Gas Miner". Those sound more like ship types, to me (rather than ship classes).
Yes, but do ship types allow you to specify certain default settings to apply to just ships of that type? Yes, the prevalent use of these would seem to be similar to ship types or species, but those systems don't allow a moder to specify default ships.tbl values for each type/species (Except for thruster color).
There are also uses for this that are not directly related to ship types. For example, "Arwing" and "Inanimate Object" aren't ship types, but they're the templates I used when I went through and redid SoL's ships.tbl to use templates*.
Those also wouldn't let you take an entry from a TC or mod, tweak it a little, and then use it in your minimod or campaign without having to worry about it getting made inconsistent in the next revision. And if the TC or mod decided to change the templates, you'd still be stuck altering the ship for each revision.
Even with a ship copy feature, you're still stuck altering the ship for each revision. The fact that all the changes would get copied over wouldn't prevent the new tables from screwing up mission balance, difficulty levels, even making some missions impossible, depending on your campaign/minimod.
Let's say that someone has made a mod, with two opposing sides, "Terrans" and "Vasudans". You want to make a minimod in which a third side, "Shivans", shows up, and the "Vasudans" splinter into two groups, one of which helps the good guys, and one of which, "HoL", helps the "Shivans".
So you're making this minimod, and you want the "HoL" ships to be worse off than the good "Vasudan" ships, to help the player out. So you use copy ship, and half the maneuverability of all the "HoL" ships.
A few months after you release, the person who made the main mod decides the "Vasudans" are too hard, and reduces the maneuverability of all the "Vasudan" ships to one fourth of what they had. Now, your "HoL" ships are better than their "Vasudan" counterparts. You still have to alter your mod, even though you used copy ship.
Please note that, in Nuke's original suggestion, his reasons are thus:
but when you step back and look at maybe a tc, where the values are completely different. like in a tc like btrl. it would be nice to have a default fighter, a default bomber, ect. this not only makes the tc easier to develop, but it makes balance a hell of easier, since only values that are different will be shown in the tbms. it also has the added bonus of a facter tc development pipeline, as your not writing of redundant table code.
All of these are valid reasons to implement templates. If your only objection is that templates don't do
enough, then I'm not sure that's a good reason not to do them.
*BTW, End result of use of 2 templates on SoL ships.tbl: Templated version had 498 fewer lines and was 20.7 KB smaller (a 20% reduction from the regular version).