Ambrosia Garden Archive
    • Build fighters from spare parts


      I've been making steady improvements to my Fighter Loadouts system. No serious changes, mostly consolidation of resources, and a cleaner layout in the outfitter.
      (If you're not familiar with it, it is basicaly a way to have one main fighter bay that can hold a variety of different fighters. In addation, you can change the armament of your exsisting fighters at any outfitter without having to buy new ones.)

      But I did manage to add a major part.

      The ability to build various fighters from spare parts and components.

      One of the neat features of the fighter bay system, is that you can build in certian requirements for various fighter groups and variants.
      Like, if you wanted to use a particular loadout you might need some sort of bay upgrade.
      Or, maybe a certian class of fighter needs a bay ugrage to service its advanced flight electronics.

      Well, one of these bay upgrades has become a Fighter Construction Factory.
      It's not cheap or small, but it gives you the ability to construct fighters when you are far from home.

      See, in addition to simply purchasing more fighters you could sacrifice some space to hold the factory, plus a number of tons of Spare Fighter Parts.

      The advandage to doing this twofold.
      First, you don't have to know which class of fighter you'll need in the future. You decide what to build when you need it.
      Second, the Spare Parts take up much less space than the fighter itself. So where a light fighter might 20 tons, and need 25 tons of space to operate, the spare parts to build a new one might only take up 10 tons of cargo space.

      The spare parts are sold in 10 ton chunks (1 outfit is 10 tons). Depending of the size of the fighter you may need to use 1, 2, 3, or even 4 outfits worth of spare parts. Of course, it may take a couple of days to build the new fighter. (And during that time, crons check to make sure you have enough spare parts. If you don't, you don't get to build one.)

      Interestingly, I only had to add 2 outfits to add this functionality, from the demo fighter bays system. The Factory, and the Spare Parts. (Well, some misn and crons too)
      Though some of the savings was becaue of the earlier mentiond consolidation. I combined the "Sell (fighter type)" with another outfit, and that freed up those outfits to become the "Build (fighter type)" outfits.

      Edit: Er, I guess I shoud mention that the spare parts functionality isn't currently part of the Fighter Loadouts plug. At the moment, it's a part of a TC in development.

      This post has been edited by Desprez : 31 March 2006 - 10:36 AM

    • That's pretty damn cool, D.

    • I had wanted to make it so that there were different classes of fighter bays too.

      Such that, maybe you could have a minimal, standard, and large fighter bay.
      The minimal bay takes up very little space, but simply doesn't have the services to support more than a couple fighters, and only those of a small size.
      The standard bay can handle most fighter sizes, but gets a limit of 20 fighters.
      And the large bay has no limits.

      This ties in well with the construction concept, as dissassembled fighters don't count towards your bay fighter limits. So perhaps you can only service a limited number of fighters, but you have fill your cargo holds with spare parts and materials to use as fighter space becomes available.

      But it just seemed like I wasn't going to be able to make it work that way. I'd have to track maximum fighter limits across multiple weapons, while still allowing those limits to change depending on how many, and which bays are installed, and a host of other problems...

      Well I got that functionality working now. I'm using a token system where each bay grants a certian number of tokens, and you can't add a fighter unless a token is present. (or unless you have the large bay)

      This had to be combined with the construct fighters ability, and required some fancy footwork when also coordinating with the replacing lost fighters routines. See, when a fighter dies, there is a tool to reconstruct how many launchers are needed for the fighters you have left. Now the tokens had to be cleared out, re-given, and then subtracted by the new amount of fighters.

      Just to let you know, this is quite scalable. I've been playing with this system, and its currently at 13 different classes of fighters, with 96 different possible loadouts amongst them. Different bays, and bay upgrades, grant different access to fighter classes and various loadout possibilities, all combined with the construction abilities.

      Now I realize that I went a bit overboard here, but I guess I just wanted to see if it was managable with many variants of fighters. I don't think any reasonable plug is going to need quite that many fighters.

      There's no getting around the fact that you need a weapon resource (96) and 2 outfits (192) for every fighter variant. The clearing of space for lost fighters routines are a bit bulky, and weigh in at 7 crons per class (7x13=91) That's the bulk of the resource usage though. Aside from that, all of the special functions are handled at the fighter class level. So I only need 13 crons to control selling, 13 crons to control building, etc. There are a few other misns, crons, weaps, and outfits sprinkeled around, but comparatively speaking, they're only minor resourse usage.

      If anyone thinks it's worthwhile, I'll update the Fighter Bay Loadouts example to reflect the new functionality.

      This post has been edited by Desprez : 09 April 2006 - 05:58 PM