This will be a focus on ship fitting and what has been done so far. When I last posted, I had managed to get a fitting window display, and that is all. It was simply a list of empty slots on the ship you selected. However, I have implemented some important features including the ability for units to have preset fittings loaded from a file.
On the surface, no it has not changed much. But under the hood there have been massive changes.
Loading Unit Files
Units used to be hard coded into the game, which is a terrible habbit to get into. So, before the project got too complex for me to turn back, I decided to solve this problem.
I have implemented code that parses .unit files and sets up the graphics, slot layouts, all the properties that make a unit. Better yet, all I have to do to add new units is drop a new unit file into a folder instead of editing 4 source code files.
To the left, you can see a sample unit file, for the Sabre class frigate that has served me so well in testing my engine.
You can define every property, even whether or not you want the unit to be alive when it is created (I do not know a use for this yet, but I'm sure there is one).
Most importantly, notice the slots section. My slot layout is similar to the EVE slot layout, except instead of mixing a variety of modules on each slot, each slot has a dedicated task.
For example, high slots are weapons and only weapons. Medium level slots are electronic warfare and defenses. The lower slots are used for structural changes to the ship. Upgrades are hacks that you will be able to install, for example, "This doubles your ship's velocity while cutting its power output by 50%".
Now, when you build a unit this file is quickly parsed. Then, when you view the unit in space, you discover that the slot layout was properly imported! But why? If the game is about fitting your own units, then why are there predefined layouts when the unit is created?
Simple! Imagine your base is under attack and you quickly need to produce some combat ships. The limited fitting of them at deployment allows them to get into the fight quickly. Notice that the low and upgrade slots are empty, which are the most useful ones. They will allow you to make the most fundamental changes to your ships.
You will be able to unfit the prefit modules and fit your desired ones. I want to point out that the fitting given to you by default uses 245 of the 250 GJ of energy the Sabre produces, meaning that you have to modify the fitting substantially if you want a better one.
What will the rules be for fitting ships? Well, first is the issue of fitting on the field. I don't want it! You will only be able to refit your ships under these conditions:
- Your ships are within 1,000km of a manufacturing center.
- Your ships are not engaged in combat and are idling.
More importantly, the following will happen after you hit save fitting:
- The ship will be offline for 2 minutes, as in no shields, propulsion, nothing.
- Fitting a ship will require a temporary energy investment for that 2 minutes of the ship's entire power core. So, if a Sabre produces 250 GJ, 250GJ will be drained from your power supply durring fitting (Note: Your power is in TJ, 1 TJ = 1024GJ).
- If you overfit your ship, you can still use it. However, it will explode later. For every percent you overfit it, you will lose 30 seconds of its 3 minutes of overfit life.
Comments? Questions? Contact me here or at firstname.lastname@example.org !