Version 0.2 Demo
Changes:
Completely re-wrote itNow uses a JSON file for extra metadata used for ship instancing and behavior.
This is getting much closer to becoming a utility mod, this provided download is to just demonstrate the concept and how various components work.
It is now set up such that the Sprite displayed in the refit and campaign fleet should look the same instead of just the part.
As before there are two damage models.
The first model is the typical model that is already in Star sector, there is unified flux and hit points which is shared amongst all of the ship segments so when one ship segment is damaged in the next frame the damage is redistributed amongst all the other ship parts.
The other damage model is the subcomponent model, in this case damage is isolated to that particular component, when that subcomponent is disabled it's position is no longer relative to the host ship and is free to float around..
With the current system I have a host ship with use both unified segments or subcomponent segments at the same time this means that you can have components that can be shot off as well the central hub which has a unified damage model.
I am using the weapon slot ID as well is the weapon in the weapon slot as meta data for instancing the ship segments and a JSON file for their behavior. So to instance a station part called that has a variant called engineering_standard, you make a weapon with the same name and inserted in the hidden weapons slot that has a prefix of MULTI which is then used to identify which damage model that it uses. The position of the weapon slot is then used as the centre position for the ship segment relative to the host ship each frame.
New Demo version:
DownloadI haven't redone the multi-ship-Collision (collisions amongst multi-ships) for the newest code tree yet as I'm still working on the core code, but the core code is very nearly complete.
There are still design restrictions to having a multiship that I simply cannot work around at the moment:
+Vanilla Autofire AI will not fire 'inside' or over the top of another subship as it will see there are other parts in the way. You would need to use a custom AutoFire AI to get around this, this cannot be changed on the fly, but I have put in the request.
+ To be able to have weapons 'fire over the top' the projectile needs to be of a NO_FF collision class, I may leave it to the mod authors to implement a projectile swapping at certain distances back to FF or under certain conditions for their weapons depending on how they want their projectiles to behave.
+ Using beam weapons cannot be used where they need to 'fire over the top' as there is no 'NO_FF' collision class
+ I haven't tested RAY or RAY_FIGHTER collision class yet, but you may need to limit or prevent people using these weapons
+ If using weapons on the host ship that are 'inside' the bounds of another UNI/SUB ship, you may wish to restrict it to built-in because of
A) Vanilla behavior Autofire
B) Vanilla projectiles collision class
The point being you cannot currently rely upon Vanilla projectiles or Autofire. I have tried grabbing and replacing projectiles each frame, but it seems that projectiles can be spawned by a weapon and collide with an FF class in the same frame...so trying to change it after the fact is pointless right now.
+ Although in a preliminary sense I have observed enemy AI multiships retreating properly, the same cannot be said for a player multiship. I still need to set it so that a player multiship that is retreating is properly picked up.
+ Still need to do
++ Buff sharing
++ Applying speed based upon all engines across the entire ship that are still active
++ Have not tested multiple levels of multi-ships. That is you have a root ship spawns a host ship that further spawns more parts. One level should be enough for now...
++ UNI segment Ships will sometimes vent flux even when you are not.
+ Another rather unavoidable bug with UNI ships where health/flux is shared is that health is rebalanced only *after* damage is already done. So for a uniship ensure that health is significant enough so that any given alpha strike will not completely blow up your ship. Once any single UNI ship segment is destroyed, the rest are destroyed with it.
+ Another unavoidable situation is your multiship potentially being completely vaporised on destruction. Imagine what is effectively a ripple effect, one ship explodes, killing the one next to it which vaporises the one that damaged it...which disables another...which explodes...vaporising another etc. I cannot really change the damage of ship death explosions.
There are probably a few other things...but yeah...nearly there.