Cache-bug does cause ships to explode

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

Moderators: another_commander, winston, Getafix

Makara
Dangerous
Dangerous
Posts: 122
Joined: Sat Oct 17, 2009 6:34 pm

Post by Makara »

Eric Walch wrote:
However, for three subentities the quaternion is defined as (0,0,0,0). This is invalid and can't be normalised. Probably oolite has a backup mechanism that this wrong entry defaults to the (1,0,0,0) when reading in the data, but not when reading the cache. When you open the cache with a plist editor, than open the ship registry key and look for the caduceus alpha, you see that these subentities are stored with a quaternion NaN (not a number).
Hmmm - don't remember that from my version of the Caduceus's shipdata.plist (before I started fiddling with it). Either way, I have actually removed the three cmount subentitites from the caduceus-alpha-player shipdata and still get the explosion problem.

But this takes some time to occur, and if the cache is force flushed (I find turning OXPs off then on is enough) then the same trip can be repeated with no problems.

So it definitely seems to be something cumulative happening in the cache.
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 »

To be able to log some parameters I made the collision less deadly by defining a fuelstation density of 0.0001. When I now hit the fuelstation I bounce back instead of being killed. I added the code below to my test the worldScript

Code: Select all

this.shipCollided = function(who)
{
    log(this.name,"Player Collided with "+ who)
    log(this.name,"My Orientation: "+ player.ship.orientation+ " Other orientation: "+who.orientation)
    log(this.name,"My subents: "+player.ship.subEntities);
    if(player.ship.subEntities)
    {
        for (var i=0 ; i< player.ship.subEntities.length; i++)
        {
            log(this.name,"My subent: "+player.ship.subEntities[i].displayName+", "+player.ship.subEntities[i].orientation);
        }
    }
}
And it generated the next log:

Code: Select all

Player Collided with [Ship "Fuel Station" ID: 442 position: (11155.3, -3709.24, -69648) scanClass: CLASS_STATION status: STATUS_IN_FLIGHT]

My Orientation: (0.937606 + 0.00890373i + 0.00807399j - 0.347492k) Other orientation: (0.999936 + 0.00354944i + 0.0107217j - 0k)

My subents: [Ship "Caduceus Engine" ID: 0 position: (-4.5, -0.5, -60.5) scanClass: CLASS_NOT_SET status: STATUS_INACTIVE],[Ship "Caduceus Engine" ID: 0 position: (4.5, -0.5, -60.7) scanClass: CLASS_NOT_SET status: STATUS_INACTIVE],[Ship "Caduceus mount" ID: 0 position: (0, -2.6, 26) scanClass: CLASS_NOT_SET status: STATUS_INACTIVE],[Ship "Caduceus mount" ID: 0 position: (0, -2.6, 13) scanClass: CLASS_NOT_SET status: STATUS_INACTIVE],[Ship "Caduceus mount" ID: 0 position: (0, -2.6, 0) scanClass: CLASS_NOT_SET status: STATUS_INACTIVE],[Ship "Caduceus Turret" ID: 0 position: (8, -2.7, 26) scanClass: CLASS_NOT_SET status: STATUS_ACTIVE],[Ship "Caduceus Turret" ID: 0 position: (8, -2.7, 13) scanClass: CLASS_NOT_SET status: STATUS_ACTIVE],[Ship "Caduceus Turret" ID: 0 position: (8, -2.7, 0) scanClass: CLASS_NOT_SET status: STATUS_ACTIVE],[Ship "Caduceus Turret" ID: 0 position: (-8, -2.7, 26) scanClass: CLASS_NOT_SET status: STATUS_ACTIVE],[Ship "Caduceus Turret" ID: 0 position: (-8, -2.7, 13) scanClass: CLASS_NOT_SET status: STATUS_ACTIVE],[Ship "Caduceus Turret" ID: 0 position: (-8, -2.7, 0) scanClass: CLASS_NOT_SET status: STATUS_ACTIVE]

My subent: Caduceus Engine, (0.474839 - 0i - 0j - 0.495397k)
My subent: Caduceus Engine, (0.474839 - 0i - 0j - 0.495397k)
My subent: Caduceus mount, (1 - 0i - 0j - 0k)
My subent: Caduceus mount, (1 - 0i - 0j - 0k)
My subent: Caduceus mount, (1 - 0i - 0j - 0k)
My subent: Caduceus Turret, (0.430527 - 0.1469i - 0.688315j - 0.565057k)
My subent: Caduceus Turret, (0.430527 - 0.1469i - 0.688315j - 0.565057k)
My subent: Caduceus Turret, (0.430527 - 0.1469i - 0.688315j - 0.565057k)
My subent: Caduceus Turret, (0.686284 - 0.566312i + 0.431142j + 0.14974k)
My subent: Caduceus Turret, (0.686284 - 0.566312i + 0.431142j + 0.14974k)
My subent: Caduceus Turret, (0.686284 - 0.566312i + 0.431142j + 0.14974k)
This all seem to be valid data.
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

Eric Walch wrote:
To be able to log some parameters I made the collision less deadly by defining a fuelstation density of 0.0001. When I now hit the fuelstation I bounce back instead of being killed. I added the code below to my test the worldScript
This all seem to be valid data.
Thank you very much for testing this! Is it also possible to extent this to provide info about the size in addition to position and orientation? I'd like to give it a try with such logging during my flights...

I really do have the impression that I do also get hit much more seldom by NPCs when I load Oolite with shift to flush the cache - I've never before been able to fly between the beams of a Wolf, GriffKrait and so on (except for the time when I did fly the Merlin).

Screet
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 »

A little further testing:

- I added the fuel stations at the witchpoint (nr 1 and nr 2). Both I could repeatedly pass in both directions.

- I added a third one a bit away. From that one I bounced back when trying to enter from the backside but I could pas without problems when entering from the planet side. I repeated this several times.

- I went back to nr 1 and 2. Both were passable without restrictions.

- Back to nr 3. Same behaviour as before. I bounce back from the backside but can pass from the planet side.

- I added a fourth station. This one I could pass from both sides but back to nr 3 gave me the old behaviour.

This leads me to believe it is more something about the station than about the caduceus that becomes wrong.


The trick to do some testing is setting the density incredible small. This is because with collisions the damage is proportional with the mass you collide with. I tried to enter at several angles but nothing worked for that bad station.
Last edited by Eric Walch on Wed Oct 28, 2009 5:31 pm, edited 1 time in total.
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

Eric Walch wrote:
This leads me to believe it is more something about the station than about the caduceus that becomes wrong.
Hmmm...that's really strange what you report there, as if the position/orientation of the station could be a problem.

I've had serious trouble with explosions not-so-really-close to BlackMonk monasteries and especially the modified trade outpost from Trident Down. The Cataclysm hive also does cause problems...but why? At least, if it's something with the station, it's not that Fuel station only.

Screet
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 »

OK, another test with the bad station.

I did

Code: Select all

player.ship.subEntities[0].remove()
Nothing changed until I removed the last subentity. Than I could pass.

With only the last turret present I still bounced:

Code: Select all

Player Collided with [Ship "Fuel Station" ID: 454 position: (7195.17, -3651.95, -60010.3) scanClass: CLASS_STATION status: STATUS_IN_FLIGHT]

My Orientation: (-0.0242302 - 0.00596072i - 0.00940651j + 0.999644k) Other orientation: (0.999969 + 0.00702108i + 0.00360434j - 0k)

My subents: [Ship "Caduceus Turret" ID: 0 position: (-8, -2.7, 0) scanClass: CLASS_NOT_SET status: STATUS_ACTIVE]

My subent: Caduceus Turret, (0.656686 - 0.320458i - 0.625977j - 0.27244k)
Still no strange values for that entitie in the log.
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

Eric Walch wrote:
Nothing changed until I removed the last subentity. Than I could pass.
The very strange thing is that the Caduceus subentities are all within the general bounds of the ship, thus they shouldn't be a problem at all as other parts of the ship would have contact first. The wings are wider, the nose further forward and the fin further up...and since the wings also go down a little, the turret below the hull should also not be any problem?!?

Screet
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 »

Screet wrote:
The very strange thing is that the Caduceus subentities are all within the general bounds of the ship, thus they shouldn't be a problem at all as other parts of the ship would have contact first. The wings are wider, the nose further forward and the fin further up...and since the wings also go down a little, the turret below the hull should also not be any problem?!?

Screet
It must be something different, but related. Again I spawned stations until I found one I bounced with. Again removed all subs until the last one. Then with:

Code: Select all

player.ship.subEntities[0].position = [0,0,0]
player.ship.subEntities[0].orientation = [1,0,0,0]
I changed some values of the subs and now I could pass.

But after setting back position and orientation I still could pass.


Thinking: could it be the inverted w component for the player? I assume the w-component should not be inverted for subs, only for the ship, but are they handled correct in collision calculation?
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 »

I still think it is an Oolite collision bug. The same bug that causes some ships explode in the external GRS station docks.

That turrets are so much affected it just because they turn a lot and are more likely to adapt the orientation that leads to a false collision trigger. It certainly is no cache bug as it is to selective to certain stations and is fixed by in-game removing the turrets. Or by changing their orientation with the console. (Street, you should really use the console. It opens a lot of ways to manipulate test ships while in-game)

However, with all my tests I noticed the ship never bounced when entering the fuel-station from the planet side. Can those that have problems confirm this? This at least allows turreted ships to use the fuel stations by entering them from the right side.

Finding a bug in the collision code will be a crime. I put a lot of time in trying to understand that code in version 1.71, but one must first have the mathematical model it is based on.
User avatar
Zieman
---- E L I T E ----
---- E L I T E ----
Posts: 680
Joined: Tue Sep 01, 2009 11:55 pm
Location: in maZe

Post by Zieman »

Eric Walch wrote:
However, with all my tests I noticed the ship never bounced when entering the fuel-station from the planet side. Can those that have problems confirm this? This at least allows turreted ships to use the fuel stations by entering them from the right side.
I tested this with 2 different turreted ships, Caduceus Alpha & Tanker SE (one of the ship's I'm making for an OXP).
Results:
Caduceus seems to be able to enter the Fuel Station from the planet side.
Caduceus almost* invariably explodes if it tries to enter the Fuel Station from deep-space side.
* if you've already flown through the station, it doesn't seem to matter which way you enter it
Tanker SE can enter the Fuel Station both ways, no problems at all.
...and keep it under lightspeed!

Friendliest Meteor Police that side of Riedquat

[EliteWiki] Far Arm ships
[EliteWiki] Z-ships
[EliteWiki] Baakili Far Trader
[EliteWiki] Tin of SPAM
Chrisfs
---- E L I T E ----
---- E L I T E ----
Posts: 433
Joined: Sun Sep 20, 2009 10:24 am
Location: California

Post by Chrisfs »

Out on a joyride last night with my Caduceus, a number of dogfights ended with a ship crashing into me. (space bar moments). Now I was trying to pass them close so the turrets could get a shot as they passed by, but the number of times I died by collision was far more than I was used to.
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

Chrisfs wrote:
Out on a joyride last night with my Caduceus, a number of dogfights ended with a ship crashing into me. (space bar moments). Now I was trying to pass them close so the turrets could get a shot as they passed by, but the number of times I died by collision was far more than I was used to.
Well, even with higher collision warning distance some ships really like to commit suicide, like ATU Vipers.

However, if you simply want to use the turrets, you might want to change your tactics:

A turret does need some time to change it's orientation so that it can shoot at an enemy ship. If you let them pass by on high speed and very closely, they won't be able to do much.

I often use one of these:
1) Target a ship for the turrets and then fight some other ship with my front/rear laser.
2) Target a ship and when it's about to pass me, switch to the side laser and use yaw to keep the ship in a position where both my side laser and the turrets can hit it.

Especially 2 does reduce the possibility of crashes - but it's the opposite move as to what you do: It requires to turn away from the closing ship so that the side has a better aim!

Screet
Post Reply