Should Rock Hermit asteroids block laser fire?

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post 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.
User avatar
snork
---- E L I T E ----
---- E L I T E ----
Posts: 551
Joined: Sat Jan 30, 2010 4:21 am
Location: northern Germany

Post by snork »

Thanks for explaining, Eric.

and everyone else of course.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Should Rock Hermit asteroids block laser fire?

Post 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
Last edited by Switeck on Sun Jan 09, 2011 9:07 pm, edited 2 times in total.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Re: Should Rock Hermit asteroids block laser fire?

Post by DaddyHoggy »

If that's true - that's just wrong - whatever way you slice it...
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Should Rock Hermit asteroids block laser fire?

Post by Switeck »

If my guess is correct, laser pass-through may apply to any station's ships.
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: Should Rock Hermit asteroids block laser fire?

Post 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.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Should Rock Hermit asteroids block laser fire?

Post by JensAyton »

parent should probably be [srcEntity parentEntity] rather than [srcEntity owner], or for more generality it should compare [ent rootShipEntity] to [srcEntity rootShipEntity].
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: Should Rock Hermit asteroids block laser fire?

Post 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
User avatar
Rebecca
Deadly
Deadly
Posts: 219
Joined: Tue Oct 28, 2008 8:47 pm
Location: Behind you!
Contact:

Re: Should Rock Hermit asteroids block laser fire?

Post by Rebecca »

my shots were never blocked by rock hermits! :lol:

R
Image
Becca the Hermit Slayer, and part-time unpredictable avatar assassin.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Should Rock Hermit asteroids block laser fire?

Post by Cody »

Rebecca wrote:
my shots were never blocked by rock hermits!

R
Yeah... BtHS returns... unpredictable as ever.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Rebecca
Deadly
Deadly
Posts: 219
Joined: Tue Oct 28, 2008 8:47 pm
Location: Behind you!
Contact:

Re: Should Rock Hermit asteroids block laser fire?

Post 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
Image
Becca the Hermit Slayer, and part-time unpredictable avatar assassin.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Should Rock Hermit asteroids block laser fire?

Post by Cody »

Rebecca wrote:
didnt i kill you? R
Yes... and no!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Rebecca
Deadly
Deadly
Posts: 219
Joined: Tue Oct 28, 2008 8:47 pm
Location: Behind you!
Contact:

Re: Should Rock Hermit asteroids block laser fire?

Post by Rebecca »

El Viejo wrote:
Rebecca wrote:
didnt i kill you? R
Yes... and no!
glad thats cleared up then :lol:

R
Image
Becca the Hermit Slayer, and part-time unpredictable avatar assassin.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Should Rock Hermit asteroids block laser fire?

Post by Cody »

Anyone who is puzzled by the last few posts should read this thread in the fiction section.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Re: Should Rock Hermit asteroids block laser fire?

Post 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.
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
Post Reply