Page 1 of 1

Well-aligned multiple lasers

Posted: Sat Nov 14, 2020 4:01 pm
by Norby
When a ship has multiple forward lasers, small targets like escorts often missed by the wing-mounted weapons due to they placed farther from the center line than the width of the target.

There is a way to address this problem: side lasers can be oriented a bit towards to center. Beams can cross the center line for example at 10km forward from the ship, which make them accurate against smaller targets too. In this way all lasers can hit an Adder or Tharglet at once!

To get the orientation numbers you can use Quaternion.xls. Using 31.5m mount width and 10km average target distance, enter 90-inv.tan(10000/31.5) = 0.18 degree into the second yellow input cell next to Y, and X=0, Z=0. The result quaternion is (1.0 0.0 0.0016 0.0) for the left side. For right side laser enter 360-0.18 = 359.82 as Y, which give (-1.0 0.0 0.0016 0.0).

Orientations can not be applied to the weapons inside the ship, but usable on subentities which can hold the side lasers. Here is an example shipdata.plist with the calculated orientations:

Code: Select all

"myship" = {
	name = "My ship with well-aligned multiple lasers";
	frangible = 0; // set to 1 if you want to be able to lose side lasers due to damage or collision
	...
	subentities = ( //forward side lasers in addition to the main laser
		{ subentity_key = "sublaser"; position = "-31.5 0.0 0.0"; orientation = "1.0 0.0 0.0016 0.0"; },
		{ subentity_key = "sublaser"; position = "31.5 0.0 0.0"; orientation = "-1.0 0.0 0.0016 0.0"; }
	);
}

"sublaser" = { //a subentity with laser
	"ai_type" = "nullAI.plist";
	"energy_recharge_rate" = 1.0; //irrelevant if the ship has frangible = 0;
	"forward_weapon_type" = "WEAPON_MILITARY_LASER";
	"max_energy" = 120.0;  //irrelevant if the ship has frangible = 0;
	"model" = "snipergun.dat"; //this need snipergun oxp, or you must add at least a dummy model
	"name" = "Sublaser";
	"roles" = "sublaser";
};
I do not tested it yet. What do you think?

Re: Well-aligned multiple lasers

Posted: Sun Nov 15, 2020 3:03 pm
by Redspear
I've not tested it yet either but I think it's a great idea! :D

I've previously suggested targeting multiple lasers to converge at maximum range. Reason being that no visually awkward crossing of beams would be observable and also no targets would be hit that were a significant distance from the crosshairs at anything other than point blank range.

If you were to adopt that approach then reduced range might make a suitable trade off for multiple lasers.
  • Pro: they converge earlier and are less likely to miss or (potentially worse) hit something else at short range.
  • Con: they don't have as high a range as solitary lasers.
I would love to see something like that and you're probably one of the best (if not the best) equipped to deliver it. More power to you! :D

Re: Well-aligned multiple lasers

Posted: Mon Dec 07, 2020 2:16 pm
by montana05
Norby wrote: Sat Nov 14, 2020 4:01 pm
Orientations can not be applied to the weapons inside the ship, but usable on subentities which can hold the side lasers. Here is an example shipdata.plist with the calculated orientations:

I do not tested it yet. What do you think?
Norby, please correct me if I am wrong, to my understanding if you assign lasers to subentities the positions still need to be according to the main ship. Therefore the orientation, except for turrets, probably doesn't make any difference.

Re: Well-aligned multiple lasers

Posted: Mon Dec 07, 2020 4:25 pm
by dybal
montana05 wrote: Mon Dec 07, 2020 2:16 pm
Norby wrote: Sat Nov 14, 2020 4:01 pm
Orientations can not be applied to the weapons inside the ship, but usable on subentities which can hold the side lasers. Here is an example shipdata.plist with the calculated orientations:

I do not tested it yet. What do you think?
Norby, please correct me if I am wrong, to my understanding if you assign lasers to subentities the positions still need to be according to the main ship. Therefore the orientation, except for turrets, probably doesn't make any difference.
I think they accumulate: the final orientation would be the accumulation of the subentity orientation in the ship model and the ship instance orientation in the "real-ooniverse"-coordinates:

Code: Select all

<final weapon orientation> = <subentity orientation>.multiply(ship.orientation)
I did something similar to calculate the docking bay's orientation (it might be rotated, dock's x aligned with station's y) in a fix to ILS.

orientation is a quaternion, it's multiply method is used to "concatenate" quaternions

In this case, the "concatenation" would be done by the core game when it placed the subentity in the ship and then orientated the whole ship (conjecture, or educated guess, I didn't look for the relevant code)

Re: Well-aligned multiple lasers

Posted: Mon Dec 07, 2020 4:34 pm
by dybal
I see two other possible cons:
  • the weapon becomes hard-coded to the ship, the player can't sell it and buy something else to put there.
  • no ship.weaponPosition, as far as the ship object is concerned, no forwardWeapon... that might break some OXPs (SniperLock Plus, for one, will not be able to work the weapon parallax out.)

Re: Well-aligned multiple lasers

Posted: Mon Dec 07, 2020 5:47 pm
by Redspear
I think the idea I posterd here (under reimagined multiple lasers), whilst far from flawless, should result in the desired effect 9 times out of 10.

So an 'invisible' central laser does all the damage whilst the false side lasers (visual effects) get all the credit for doing so.
If the side lasers are neither positioned excessively far apart not granted too much range then, by converging at their maximum range, they would display adequately in most encounters i.e. they would appear to converge upon what the real central laser actually hit.

Re: Well-aligned multiple lasers

Posted: Tue Dec 08, 2020 12:06 am
by montana05
dybal wrote: Mon Dec 07, 2020 4:34 pm
I see two other possible cons:
  • the weapon becomes hard-coded to the ship, the player can't sell it and buy something else to put there.
  • no ship.weaponPosition, as far as the ship object is concerned, no forwardWeapon... that might break some OXPs (SniperLock Plus, for one, will not be able to work the weapon parallax out.)
Well, for player ships I usually use the subentities as a dummy, the positions are still defined at the ship. Any adaption of the oriantation therefore would become useless. I will give it a test for NPC's today, my current vector ships WIP include one with 3 front lasers (50 m seperated) but not able to hit an Anaconda :lol: