V1.77

General discussion for players of Oolite.

Moderators: another_commander, winston

User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1375
Joined: Thu Apr 28, 2011 3:17 pm

Re: V1.77

Post by mandoman »

another_commander wrote:
mandoman wrote:
For some reason, the ball turrets on my ship didn't fire when I thought they should, while my mirror enemy had his blazing from the beginning. Why is that?
Turrets on player ships commence firing when all below conditions are met:
- The player has a ship entity targeted
- The targeted ship exhibits hostile behaviour against the player
- The targeted ship is within turret range
Of the three, we can exclude the second one in the case you are describing, since the opponent was firing already at you and therefore was clearly hostile. This means that one or both of the other two conditions were not being met at the time.
I've been out to check on those guidelines. I'm sure that's the way it's suppose to be, but the fact of the matter is that;
a. the ships with ball turrets are firing at me from the beginning, even when I have it picked as my target, but seem to be too far away for my turrets to fire.
b. the hostile behavior que is immediate in most cases, but still no reaction from my turrets.

Oh, they will fire when I "get within range", but while I'm out of range, the same types of ships are nailing me with their ball turrets.
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
Shipbuilder
---- E L I T E ----
---- E L I T E ----
Posts: 877
Joined: Thu May 10, 2012 9:41 pm
Location: Derby

Re: V1.77

Post by Shipbuilder »

If this is the case what is the range of a NPC ball turret ?

Is is more than a ball turret on a player ship ?
The GalTech Industries Corporation - Building ships to populate the galaxies.

Increase the variety of ships within your Ooniverse by downloading my OXPs

Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Re: V1.77

Post by another_commander »

Shipbuilder wrote:
If this is the case what is the range of a NPC ball turret ?

Is is more than a ball turret on a player ship ?
Turrets are the same across players and NPCs and their range is maxed at 6000m.
User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1375
Joined: Thu Apr 28, 2011 3:17 pm

Re: V1.77

Post by mandoman »

I must be delusional.
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6310
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: V1.77

Post by Diziet Sma »

another_commander wrote:
Shipbuilder wrote:
If this is the case what is the range of a NPC ball turret ?

Is is more than a ball turret on a player ship ?
Turrets are the same across players and NPCs and their range is maxed at 6000m.
Even though the range is set to max on my Falcon's turrets, I've never seen them open fire until the target is less than 5000 metres away. A handicap which NPC's don't seem to suffer from.

(and it would be nice if the wiki didn't insist the max weapon_range of a turret was 7500 metres [actually, I'd like to see it increased to 7500m, as per the wiki])
mandoman wrote:
I must be delusional.
You're not.. the turret code does not work as advertised.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: V1.77

Post by cim »

Diziet Sma wrote:
(and it would be nice if the wiki didn't insist the max weapon_range of a turret was 7500 metres [actually, I'd like to see it increased to 7500m, as per the wiki])
Source code says it is 7500m already, so that should be okay.

Hmm... interesting. In my tests it doesn't start firing until the target is at around 5400m ... but having started firing it keeps doing so until the target is back outside 6000m. So, okay, moving in to range the turrets will probably be pointing the wrong way and need to turn to aim ... and testing again with a very slowly approaching target, it does indeed open fire at 6000m as it should.

So the question is, why are the NPC's turrets more likely to be facing in roughly the right direction to start with?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Re: V1.77

Post by another_commander »

Guys, the code works exactly as advertised. I just did this very simple check with the Falcon:
I bought a Falcon, hyperspaced to a new system and spawned a similar Falcon using the Debug Console. Then, I turned and started moving away from it. At some point, it turned red on me and started charging against me, but I had already gained something like 8km distance. Now, I slowly matched speed with it, but not quite, so that it was gaining distance very slowly and I kept monitring the distance indicator, waiting to see when my ship's rear turret would start firing. It started firing immediately once the range fell below 6000m.

As to why it appears that turrets don't fire before the target is at something like 5km away, this probably is because if the player moves towards the target and the target moves towards the player, by the time the AI has ordered the turret to start firing, the apparent distance is at somewhere between 5600-5400m. The actual moment the turret starts is at 6km, but it's the fact that the two ships move towards eachother that creates a false impression (or at least that's what I think happens). Also, sometimes when you are chasing a ship with a rear turret, it may appear that it continues to fire at you even past the 6km mark, but again this is a false perception. The last shot is fired just before going past 6km distance, but that last shot arrives at the player's ship when said distance has opened past the turret hold fire point.

In all my tests so far, the turrets work precisely as they are supposed to.
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6310
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: V1.77

Post by Diziet Sma »

Ok.. so it seems that, at least when not in the rapid-moving heat of combat, things do work as intended.. which only leaves the question of how/why is the range capped at 6000m, when that is given as the default range in the wiki, and the maximum of 7500m in both the code and the wiki, never comes into play? (and yes, I've tried setting weapon_range to 7500.. doesn't work..)
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6310
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: V1.77

Post by Diziet Sma »

another_commander wrote:
As to why it appears that turrets don't fire before the target is at something like 5km away, this probably is because if the player moves towards the target and the target moves towards the player, by the time the AI has ordered the turret to start firing, the apparent distance is at somewhere between 5600-5400m. The actual moment the turret starts is at 6km, but it's the fact that the two ships move towards eachother that creates a false impression (or at least that's what I think happens). Also, sometimes when you are chasing a ship with a rear turret, it may appear that it continues to fire at you even past the 6km mark, but again this is a false perception. The last shot is fired just before going past 6km distance, but that last shot arrives at the player's ship when said distance has opened past the turret hold fire point.
One tactic I've used is to come to a halt, spin the rear of the Falcon towards the NPC, and wait for them to come to me.. the range is usually close to 5000m before the turret opens fire, so it's not simply a matter of closing speeds, or relative speeds..
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
CmdrLUke
Deadly
Deadly
Posts: 170
Joined: Sun Aug 31, 2008 3:23 pm

Re: V1.77

Post by CmdrLUke »

another_commander wrote:
Guys, the code works exactly as advertised. I just did this very simple check with the Falcon:
I bought a Falcon, hyperspaced to a new system and spawned a similar Falcon using the Debug Console. Then, I turned and started moving away from it. At some point, it turned red on me and started charging against me, but I had already gained something like 8km distance. Now, I slowly matched speed with it, but not quite, so that it was gaining distance very slowly and I kept monitring the distance indicator, waiting to see when my ship's rear turret would start firing. It started firing immediately once the range fell below 6000m.

As to why it appears that turrets don't fire before the target is at something like 5km away, this probably is because if the player moves towards the target and the target moves towards the player, by the time the AI has ordered the turret to start firing, the apparent distance is at somewhere between 5600-5400m. The actual moment the turret starts is at 6km, but it's the fact that the two ships move towards eachother that creates a false impression (or at least that's what I think happens). Also, sometimes when you are chasing a ship with a rear turret, it may appear that it continues to fire at you even past the 6km mark, but again this is a false perception. The last shot is fired just before going past 6km distance, but that last shot arrives at the player's ship when said distance has opened past the turret hold fire point.

In all my tests so far, the turrets work precisely as they are supposed to.
Are the extra guns on Hydras, Basilisks, and Rattle Cutters "ball turrets"? Because those definitely fire on me with all guns from way beyond 5-6km....
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: V1.77

Post by cim »

CmdrLUke wrote:
Are the extra guns on Hydras, Basilisks, and Rattle Cutters "ball turrets"? Because those definitely fire on me with all guns from way beyond 5-6km....
They're fixed additional lasers, and have the same range as a normal laser of that type.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: V1.77

Post by Eric Walch »

Diziet Sma wrote:
(and yes, I've tried setting weapon_range to 7500.. doesn't work..)
Do you use the correct syntax? Because you only can add the max_range parameter with the new subentitie structure as advertised on the wiki.

EDIT: Just tested it again. The NPC falcon also uses the turrets between 6000 and 7500 meters if I raise weapon_range to 7500. It was a bug in Oolite 1.74 that fire_rate, weapon_range were set back to the default values after having been read in correctly, but it was fixed in 1.75. And as just tested, it still works as advertised with 1.77. The falcon only uses turrets at targets behind him. So make him flee, than start following him on injectors, and as soon you are within 7500 meters, the red plasma bolts start to appear.
(Not tested with falcon player but I see no reason why it should be different.)

You do need the new subentity definitions though:

Code: Select all

			{
				"subentity_key" = "bweed-falcon-turret";
				type = "ball_turret";
				position = (0.0, 6.5, -9.5);
				orientation = (0.25, 0.75, 0, 0);
				"weapon_range" = 7500;
			},
			{
				"subentity_key" = "bweed-falcon-turret";
				type = "ball_turret";
				position = (0.0, -6, -9.5);
				orientation = (0.25, -0.75, 0, 0);
				"weapon_range" = 7500;
			},
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Re: V1.77

Post by another_commander »

One thing to remember (and I did not make it clear earlier, sorry about that) is that the distance checked for the turrets to start firing is not the same as the one displayed on the distance indicator on the HUD. The distance indicator shows distance to the bounding box edges where collision detection occurs, not distance to the center of the entity. This can be misleading when using just the HUD to judge distances. I did another test and documented it with screenshots, which I hereby present.

Before anything else, be aware that the code does allow the turrets to start firing just slightly beyond 6km (at +1%, i.e. 6060m) distance. For the test I used the Mamba with barrel code, published by cim in another thread related to frangible subentities. I replaced the barrel subentity with a ballturret, gave the Mamba a pirateAI and set its max speed to 0 to make life easier for me. Then I fired at it to make it my enemy and started testing.

First screen shows me approaching the Mamba. Note distances displayed on screen and on console. They are different and the console one is the one that matters. My actual distance as far as turrets are concerned is 6060.53m.
Image

Now I take one more little step, distance closes to 6058.81 and... here we go. The Mamba has just started firing the turret at full blast.
Image

I hope the above explains how and why it works as expected and why the distances can be sometimes misjudged. I have not tested what happens if the turret weapon range is set to the theoretical 7500m maximum but I believe Eric covered this already in his earlier post. Still, if there are unclarified points, feel free to ask.
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:

Re: V1.77

Post by Commander McLane »

CmdrLUke wrote:
Are the extra guns on Hydras, Basilisks, and Rattle Cutters "ball turrets"? Because those definitely fire on me with all guns from way beyond 5-6km....
A ball turret fires plasma balls. A laser fires a beam. The difference between a slowly moving ball and a continuous beam should be quite obvious.
CmdrLUke
Deadly
Deadly
Posts: 170
Joined: Sun Aug 31, 2008 3:23 pm

Re: V1.77

Post by CmdrLUke »

Commander McLane wrote:
CmdrLUke wrote:
Are the extra guns on Hydras, Basilisks, and Rattle Cutters "ball turrets"? Because those definitely fire on me with all guns from way beyond 5-6km....
A ball turret fires plasma balls. A laser fires a beam. The difference between a slowly moving ball and a continuous beam should be quite obvious.
It sure is, once you know that a "ball turret" fires "plasma balls." It is quite a reasonable assumption that a ball turret could be a laser turret with a "ball mounting" that can swivel, yes?
Post Reply