Turret firing through ship

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Zieman
---- E L I T E ----
---- E L I T E ----
Posts: 680
Joined: Tue Sep 01, 2009 11:55 pm
Location: in maZe

Turret firing through ship

Post by Zieman »

Oolite test 1.73.4, WinXP Pro SP3 32bit:

Is the plasma turret's firing arc always a full hemisphere?

I'm making an OXP, and there's a special version of one ship - the special version has 3 turrets. 2 of them seem to behave as expected (placed rear, facing aft), but the 3rd one (placed top, facing forwards and 30 degrees up) ignores the ship - it tracks targets and fires at them through the ship's hull too. :shock:

Is there any way of restricting the firing arc?
...and keep it under lightspeed!

Friendliest Meteor Police that side of Riedquat

[EliteWiki] Far Arm ships
[EliteWiki] Z-ships
[EliteWiki] Baakili Far Trader
[EliteWiki] Tin of SPAM
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

I think the firing arc is hardcoded, and is somewhere in the neighbourhood of 120 degrees. Make sure that your turret is positioned and--more important--orientated correctly in the direction you wish your turret to fire into.

For me your problem sounds as if you haven't orientated your turret, but are using a backwards firing turret. If you mount that on the front side of your ship, you will get a result like you have.
User avatar
Zieman
---- E L I T E ----
---- E L I T E ----
Posts: 680
Joined: Tue Sep 01, 2009 11:55 pm
Location: in maZe

Post by Zieman »

Oh I have orientated the turret all right. I just didn't think it would fire through the ship it belongs to.

Image

The green turret works as intended, firing arc indicated by blue.

Purple one fires as indicated by red lines (& light red area), what I thought it would do is indicated with yellow lines (& light yellow area).
...and keep it under lightspeed!

Friendliest Meteor Police that side of Riedquat

[EliteWiki] Far Arm ships
[EliteWiki] Z-ships
[EliteWiki] Baakili Far Trader
[EliteWiki] Tin of SPAM
User avatar
ClymAngus
---- E L I T E ----
---- E L I T E ----
Posts: 2508
Joined: Tue Jul 08, 2008 12:31 am
Location: London England
Contact:

Post by ClymAngus »

out of interest does your ship go BANG! when you try and refuel it?
User avatar
Zieman
---- E L I T E ----
---- E L I T E ----
Posts: 680
Joined: Tue Sep 01, 2009 11:55 pm
Location: in maZe

Post by Zieman »

ClymAngus wrote:
out of interest does your ship go BANG! when you try and refuel it?
Nope.

Caduceus does (hacked a savegame to test it).
...and keep it under lightspeed!

Friendliest Meteor Police that side of Riedquat

[EliteWiki] Far Arm ships
[EliteWiki] Z-ships
[EliteWiki] Baakili Far Trader
[EliteWiki] Tin of SPAM
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

I did the research on this, but forgot to answer. Oops!

The field of fire of a turret is a cone whose aperture is just over 156.926 °, centred on its original facing. (The angle is irrational because the actual definition in code is that the cosine of the half-aperture is 0.2; cos⁻¹ 0.2 ≈ 78.463 ° ≈ 1.3694 rad.) Currently no attempt is made to avoid firing through the ship. This will not be fixed for MNSR since our only ray-object collision testing code is based on octrees, which are not sufficiently fine-grained for this type of test.

For modelling purposes, a cone whose height is one tenth of its diameter has a slightly larger aperture (157.398 °) and makes a good stand-in. (A larger aperture is desirable because cones in 3D modellers are generally polygonal approximations inscribed in the cone rather than fully filling it out.)
User avatar
Zieman
---- E L I T E ----
---- E L I T E ----
Posts: 680
Joined: Tue Sep 01, 2009 11:55 pm
Location: in maZe

Post by Zieman »

Hey, this is good to know!
Thanks!
...and keep it under lightspeed!

Friendliest Meteor Police that side of Riedquat

[EliteWiki] Far Arm ships
[EliteWiki] Z-ships
[EliteWiki] Baakili Far Trader
[EliteWiki] Tin of SPAM
Post Reply