Alright, tackled some more code. Cleaned up the designing process so a ship should gain a fixed amount of experience, be "promoted" to design the ship, and then loose that same experience and have its level reset for old fashioned promotions. I still need to find a way to include the starting ship so that it gets a chance to be designed. Combat has been changed to go by the amount of +attack% promotions. I might add more to the promotions XML to properly implement lasers/projectiles/guns (As well as tweak a few other things), but for now this will do.
For armor, the +defense value is what it provides in terms of damage reduction (multiplicative, so armor 1 and armor 2, each providing 10%, would mean the ship takes 81% damage). However, each armor component counts as 4 components when a component gets busted. Therefore, if a ship with no armor looses a component, it will be 1/6 chance of being the bridge. If a ship with armor looses a component, it will be a 1/9 chance of being the bridge. I should either allow more components (which would subsequently require level 4 and 5 promotions, or the means to acquire promotions multiple times rather than using the I, II, III, etc system), or allow a bit more lee way with utility slots so every ship isn't 3 weapons + 1 engine + 1 armor.
For the moment, the means of "destroying" components eludes me. That is, the ability to fetch the name of a component to use string addition and add in the destroyed version. Perhaps it would be a simple matter to make the destroyed versions require the regular version and iterate over the list looking for that cue.
Design wise, I also haven't quite figured out how repair will work... As space is quite crowded, requiring units to be on a "city" to repair components wouldn't be too difficult. One thing I could do is make ships "free" and "instantaneous" to build, but require time and money to repair to working status. Oh, and I still haven't thought about how to "save" designs to save the tedious work of designing every ship. Then the AI will need to learn how to design ships, too.
As for different ship sizes, larger ships will be represented by larger strengths. Damage essentially works on the matter of [damage * attacker / defender] strength. However, chance of hitting will be based on another formula, a bit in reverse. That is, chance of hitting will be something like [defender strength / (attacker strength + defender strength)], though I'll have to work the math out. In essence, I strive to encourage a diverse fleet makeup of fighters, defense/invasion vessels (that rough size), destroyers, cruisers, and battleships.
I have not yet worked out how technology will factor into all of this. I might add in shields after all as a early to mid game tech, replacing armor for damage reduction but not giving the advantage of protecting other valuable components. With more customization of the XML, promotions themselves could be made to upgrade with technology (actually, easiest solution would be to have a pre- and post- techonlogy versions where, upon discovering the tech, python goes through and swaps them out - Or, actually leaves them as is and force players to retrofit).
So many details to work out, but for now I need to focus on getting the combat engine finished, even if it's static.