Page 2 of 3

Posted: Sun Aug 29, 2010 7:53 pm
by Cmdr James
I dont think there is anything particularly special about rock hermits, or rock type, so I dont really see why there should be a difference in laser blocking.

I will do some poking about on my laptop with some extra logging to see if I can replicate and or identify this weird behaviour.

Posted: Tue Aug 31, 2010 10:54 am
by snork
Thanks for explaining, Eric.

and everyone else of course.

Re: Should Rock Hermit asteroids block laser fire?

Posted: Sun Jan 09, 2011 8:41 pm
by Switeck
Ok, I think I know what's happening now!
NPC ships launched from a Rock Hermit or Pirate Cove shoot their lasers through the "mother" station they launched from...but no one else does.
Probably done this way to reduce friendly fire issues?

Similar/related thread:
https://bb.oolite.space/viewtopic.php?f=3&t=8105

Re: Should Rock Hermit asteroids block laser fire?

Posted: Sun Jan 09, 2011 8:47 pm
by DaddyHoggy
If that's true - that's just wrong - whatever way you slice it...

Re: Should Rock Hermit asteroids block laser fire?

Posted: Tue Jan 11, 2011 1:58 am
by Switeck
If my guess is correct, laser pass-through may apply to any station's ships.

Re: Should Rock Hermit asteroids block laser fire?

Posted: Tue Jan 11, 2011 9:03 am
by Eric Walch
Switeck wrote:
If my guess is correct, laser pass-through may apply to any station's ships.
And i think that your guess is correct.

I just browsed trough the code. In Universe at getFirstEntityHitByLaserFromEntity: the trajectory to the first ship in line is calculated. But it first filters out some of the ships in the system:

Code: Select all

	for (i = 0; i < ent_count; i++)
	{
		Entity* ent = sortedEntities[i];
		if (ent != srcEntity && ent != parent && [ent isShip] && [ent canCollide])
		{
			my_entities[ship_count++] = [ent retain];
		}
	}
The problem is in "parent". This is the owner of a ship. Nice to exclude the owner of laser subentities, but stations and escorted mothers are also owners. So if there is an error, its likely here because owners never are put on the evaluation list.

Re: Should Rock Hermit asteroids block laser fire?

Posted: Tue Jan 11, 2011 3:13 pm
by JensAyton
parent should probably be [srcEntity parentEntity] rather than [srcEntity owner], or for more generality it should compare [ent rootShipEntity] to [srcEntity rootShipEntity].

Re: Should Rock Hermit asteroids block laser fire?

Posted: Tue Jan 11, 2011 3:43 pm
by Eric Walch
Ahruman wrote:
parent should probably be [srcEntity parentEntity] rather than [srcEntity owner], or for more generality it should compare [ent rootShipEntity] to [srcEntity rootShipEntity].
Yes, I already has a look at it. There is already a check for being a subentitie in it. When I define the owner than as parent after it was explicit recognised as subentitie, things tested okay:

Image
Before the ship shot completely trough the hermit and with the code I noticed nothing. (I could not see the ship firing). But after moving a bit sideways, I just saw the defender hitting the side of its mother station. So this bug seems to be solved. And I hope no others introduced with it. Using [srcEntity parentEntity] looks even better than my approach, so I test it a bit further.
The observation of Switeck that it were always the station-ships gave the clue away for finding the bug.

1.74 still has the bug that ships fly themselves into the station when I hide behind them. Testing with trunk went better because this bug was fixed there also.

Remains that ships keep shooting when in line of the target, even when the view is blocked. For now I call this a feature. :P

Re: Should Rock Hermit asteroids block laser fire?

Posted: Fri Jan 14, 2011 7:09 pm
by Rebecca
my shots were never blocked by rock hermits! :lol:

R

Re: Should Rock Hermit asteroids block laser fire?

Posted: Fri Jan 14, 2011 7:26 pm
by Cody
Rebecca wrote:
my shots were never blocked by rock hermits!

R
Yeah... BtHS returns... unpredictable as ever.

Re: Should Rock Hermit asteroids block laser fire?

Posted: Fri Jan 14, 2011 7:41 pm
by Rebecca
El Viejo wrote:
Rebecca wrote:
my shots were never blocked by rock hermits!

R
Yeah... BtHS returns... unpredictable as ever.
didnt i kill you? or was it the other way round?

R

Re: Should Rock Hermit asteroids block laser fire?

Posted: Fri Jan 14, 2011 7:44 pm
by Cody
Rebecca wrote:
didnt i kill you? R
Yes... and no!

Re: Should Rock Hermit asteroids block laser fire?

Posted: Fri Jan 14, 2011 7:46 pm
by Rebecca
El Viejo wrote:
Rebecca wrote:
didnt i kill you? R
Yes... and no!
glad thats cleared up then :lol:

R

Re: Should Rock Hermit asteroids block laser fire?

Posted: Fri Jan 14, 2011 8:02 pm
by Cody
Anyone who is puzzled by the last few posts should read this thread in the fiction section.

Re: Should Rock Hermit asteroids block laser fire?

Posted: Fri Jan 14, 2011 10:02 pm
by DaddyHoggy
El Viejo wrote:
Anyone who is puzzled by the last few posts should read this thread in the fiction section.

You will still be confused, but you'll have had a good time along the way.