collision detection

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

Moderators: winston, another_commander, Getafix

User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2028
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

collision detection

Post by maik »

On 1.73 I just witnessed a Navy Frigate pass through a Thargoid Type 1 Carrier. In fact, the Thargoid carrier just swung around like a bat and should have hit the Navy vessel like a ball but it didn't happen. Sorry for the noise in case this is fixed in 1.74, I just didn't take the time to upgrade and check all my OXPs for new versions yet...
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 »

Just to repeat my mantra (well, one of my mantras): Oolite's collision detection sucks! :evil:

And as a helpful hint I'll add one of Ahruman's mantras: And it's not going to change before the next stable release. :?

So, in the meantime, we all have to live with some collision detection oddities. These come basically in two flavours: (a) one of two ships spontaneously explodes, although they haven't visibly touched each other, or (b) two ships visibly pass through each other, without any of them taking damage. That's the case you witnessed. I am more annoyed about the other one, as it is an obstacle for scripting. But, anyway, we have to live with it.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Is there anyway to check via js for sudden drops in energy levels of ships you're interested in - and thus boost them up - to stop them exploding?
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

There's the ship script function this.shipCollided(otherShip) which may be usable to detect the collisions and do the energy boost.

Also there is something similar usable in AIs, depending on how you want to go about it.
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 »

DaddyHoggy wrote:
Is there anyway to check via js for sudden drops in energy levels of ships you're interested in - and thus boost them up - to stop them exploding?
There is a caveat: if you boost up the energy of the one "colliding" entity, you may end up with the other (now weaker one) blowing up.

You can easily blow up the strongest ships by colliding them with something very small with a ridiculously high energy (and recharge rate).
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Commander McLane wrote:
DaddyHoggy wrote:
Is there anyway to check via js for sudden drops in energy levels of ships you're interested in - and thus boost them up - to stop them exploding?
There is a caveat: if you boost up the energy of the one "colliding" entity, you may end up with the other (now weaker one) blowing up.

You can easily blow up the strongest ships by colliding them with something very small with a ridiculously high energy (and recharge rate).
Ah.

This is why I don't oxp - and why, recent, foolish attempts, have stalled also immediately...
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
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: collision detection

Post by Eric Walch »

maik wrote:
On 1.73 I just witnessed a Navy Frigate pass through a Thargoid Type 1 Carrier. In fact, the Thargoid carrier just swung around like a bat and should have hit the Navy vessel like a ball but it didn't happen. Sorry for the noise in case this is fixed in 1.74, I just didn't take the time to upgrade and check all my OXPs for new versions yet...
Related to this problem is why they came so close together in the first place:

According to the code, that is deliberate :!: The code reads:

Code: Select all

- (void) setProximity_alert:(ShipEntity*) other
{
	if (isStation || (other->isStation)) // don't be alarmed close to stations -- is this sensible? we dont mind crashing into carriers?
		return;
In other words, ignore any proximity alert with stations. Seeing the comment is was noted already that this check could have implications with carriers. This also explains why you could hide behind a station and the opponent would just crash into the station. Something that was mentioned before.

I stumbled over this again when doing some minor fixes with the proximity alert during combat and noticed my fixes had no effect when hiding behind a station :cry:

The main reason stations are excluded is probably to not disturb the launching or docking procedure. For docking it is easy to also do a check for the dockingInstructions being present.

My preliminary test now show that the attacker backs off when he ends up with a station in front, blocking its way. There are certainly some other issues coming up when working on this, but basically this might get improved for 1.75

Also tests with a pirate-cove went well. When hiding at its back, the launching ships no longer turn around and smash into the rock, but go into a collision-avoindance mode and first make distance with the rock, while when I wait in front of the station, they immediately start shooting at me.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

I am pretty sure I added the comment that it doesnt seem right.

I presume this is so that it is possible to dock, but I imagine it should be modified to check for an AI in a docking state. I didnt change it because I thought it looked pretty deliberate.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: collision detection

Post by Switeck »

Eric Walch wrote:
Also tests with a pirate-cove went well. When hiding at its back, the launching ships no longer turn around and smash into the rock, but go into a collision-avoidance mode and first make distance with the rock,
Do they still shoot through the pirate cove with lasers and hit you?
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Cmdr James wrote:
I am pretty sure I added the comment that it doesnt seem right.

I presume this is so that it is possible to dock, but I imagine it should be modified to check for an AI in a docking state. I didnt change it because I thought it looked pretty deliberate.
Okay, I committed my changes to trunk as r3757. I left the first test for being a station itself in, meaning that carriers still not check for proximity_alert. Changing that could disturb carriers when launching a ship and I didn't want to change anything there.

I did change the second part of the test where the other ship is a station. Now, after the change, only docking ships don't get a proximity_alert and ships in "behaviour == BEHAVIOUR_FLY_TO_DESTINATION" what is the behaviour of the majority of the launching ships. Ships in that behaviour normally have an explicit check in their AI to avoid obstacles, so that seems safe.

And not all behaviours do react on a proximity_alert. I had only a few situations left were launching ships entered a "BEHAVIOUR_AVOID_COLLISION" but I think all are dealt with it now in the current commit. And when there would be a ship launching in BEHAVIOUR_AVOID_COLLISION, that is not be a big problem either as it would just fly away from the station.
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: collision detection

Post by Eric Walch »

Switeck wrote:
Eric Walch wrote:
Also tests with a pirate-cove went well. When hiding at its back, the launching ships no longer turn around and smash into the rock, but go into a collision-avoidance mode and first make distance with the rock,
Do they still shoot through the pirate cove with lasers and hit you?
Not testes, but they probably still do because that is independent code. I did however confirm that ships can shoot through the station and I can't understand from the code that it can happen. :o
According the code it can happen when shooting from within the bounding box of the station. e.g. when still in the docking port, but your screenshots did suggest the ships fired from further away.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2278
Joined: Tue Jan 02, 2007 12:38 pm

Post by Killer Wolf »

"Not testes," :-D

here : why can ships shoot through stations? how come the player can't? I always get Fuged and jumped on my cops. Or *is* my beam also going through and i just can't see it?
Zireael
---- E L I T E ----
---- E L I T E ----
Posts: 1396
Joined: Tue Nov 09, 2010 1:44 pm

Post by Zireael »

Good question.

Is there a way to get rid of kamikaze pilots (Fer-de-Lances, mostly) in future releases? Make them pull up earlier?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Zireael wrote:
Good question.

Is there a way to get rid of kamikaze pilots (Fer-de-Lances, mostly) in future releases? Make them pull up earlier?
We did this already. It's been ages since I last got rammed by a pirate on injectors (or without injectors, for that matter).
Zireael
---- E L I T E ----
---- E L I T E ----
Posts: 1396
Joined: Tue Nov 09, 2010 1:44 pm

Post by Zireael »

another_commander wrote:
Zireael wrote:
Good question.

Is there a way to get rid of kamikaze pilots (Fer-de-Lances, mostly) in future releases? Make them pull up earlier?
We did this already. It's been ages since I last got rammed by a pirate on injectors (or without injectors, for that matter).
Not true in 1.74.2. I'm flying a Python Class Cruiser, got rammed by another PCC twice, by a Mamba once, and a lot of times by FdLs. FdLs did have injectors, the others didn't. Annoying as hell in any case.
Post Reply