I am trying to make a mod where I alter the way of ship designs. I find it a bit weird that every ship from a tiny interceptor to a gigantic titan uses the same equipment of the same size. Means a fighter has the same cannons like a battleship. Same for shields and armor and everything else. I'm also sick of putting 100+ cannons on my custom designs or having all my AI designed ships equiped with shields just because thats the defense system with the highest value (good idea with the bestdefense type but bad execution dear dev team!). Its just anoying.
So here the idea, I made subclasses of the weapons and defenses. Small, Medium and Large. And huge for the Doom Ray just to reflect the deadliness of this weapon.
First I altered the ShipHullStatDefs.xml to create better fitting ship sizes. That worked verry well. Game accepted the new file without a crash.
My next step was to create the equipment for the ships. Therefore I created in the ComponentClassDefs.xml new classes for weapontypes. (For exaple beamweaponsmall; beamweaponmedium; beamweaponlarge.) I altered and created the shipcomponents in the ShipComponentDefs.xml. I changed the component mass, the damage inflicted and the type of the component to the new class. (from beamweapon to beamweaponsmall)
With this, I altered the blueprints in ShipBlueprintDefs.xml to create the desired ship designs. Means tiny and small ships with small equipment, medium ships with medium equipment and large and huge with large equipment.
I used folowing stats for the diferent sizes. small equipment-> mass 5 damage 5; medium-> mass 100 damage 100; large-> mass 500 damage 500. I used this values to prevent capital cannons from being placed on tiny ships. As you see the damage to mass ratio is the same. I only want to place few bigger gunns on large ships.
My first problem apeared when I started the game. My definition of the subclass was not accepted by the game. I had to change all the entries back to beamweapon. So my blueprints are using now the old entries again.
The new values are accepted by the game and the weapons are created so you can use them in the designer. Now I have shipclasses with my own size and components in three different sizes. So far so good.
Now the new problem. The AI is kind of stupid by using my newly created equipment. Since the large weapons have more damage(value) than the small or medium, the AI is trying to put them on every design. Because thats what I was trying to prevent the size is to big and the equipment doesn't fit. Instead of chosing the next best weapon, which is the next size down, (as described earlier the damage to mass ratio is the same no matter the size.) the AI decides to leave the space empty. Now it creates ships with no weapons but 20-200 free room.
Any ideas how to get this problem fixed? Or how to alter equipment class and type so the game accepts it and the AI can use it? The idea with the small, medium and large class could solve the problem of the AI if I could get it into the game.
Many thanks in advance