collision detection
Moderators: winston, another_commander, Getafix
- maik
- Wiki Wizard
- Posts: 2028
- Joined: Wed Mar 10, 2010 12:30 pm
- Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)
collision detection
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...
- Commander McLane
- ---- 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:
Just to repeat my mantra (well, one of my mantras): Oolite's collision detection sucks!
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.
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.
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
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?
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
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.
Also there is something similar usable in AIs, depending on how you want to go about it.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Commander McLane
- ---- 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:
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.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?
You can easily blow up the strongest ships by colliding them with something very small with a ridiculously high energy (and recharge rate).
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
Ah.Commander McLane wrote: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.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?
You can easily blow up the strongest ships by colliding them with something very small with a ridiculously high energy (and recharge rate).
This is why I don't oxp - and why, recent, foolish attempts, have stalled also immediately...
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: collision detection
Related to this problem is why they came so close together in the first place: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...
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;
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
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.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Cmdr James
- Commodore
- Posts: 1357
- Joined: Tue Jun 05, 2007 10:43 pm
- Location: Berlin
Re: collision detection
Do they still shoot through the pirate cove with lasers and hit you?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,
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
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.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.
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.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: collision detection
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.Switeck wrote:Do they still shoot through the pirate cove with lasers and hit you?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,
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.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Killer Wolf
- ---- E L I T E ----
- Posts: 2278
- Joined: Tue Jan 02, 2007 12:38 pm
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
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.another_commander wrote: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 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?