Page 1 of 1

Still having probs w/ docks >:-/

Posted: Fri Jun 17, 2011 6:28 pm
by Killer Wolf
I dunno what it is. i made a long tunnel for an asteroid and a separate dock and it worked, i try a similar approach now and die instantly trying to enter the tunnel.

but aside from that, as per the other thread, i've got a long dock box (733 long), i modelled it so that the Origin's about 70 from the rear wall, used the subent attributes to shift the dock into the correct position, and i'm still activating the docking procedure at what seems like the 70/60/whatever% distance through the front door. i thought it was supposed to be the origin position of the dock?
also, although my Position attributes shift the dock to the correct position, when i look at the red bounding box, it's misaligned by a fair bit from the dock model itself (down and to the right, Z position seems right).


ta....

Re: Still having probs w/ docks >:-/

Posted: Sat Jun 18, 2011 6:32 am
by ADCK
Could be that either the dock or the stations model wasn't centred before exporting, just an idea.

Re: Still having probs w/ docks >:-/

Posted: Sat Jun 18, 2011 10:08 am
by Eric Walch
Killer Wolf wrote:
..but aside from that, as per the other thread, i've got a long dock box (733 long), i modelled it so that the Origin's about 70 from the rear wall, used the subent attributes to shift the dock into the correct position, and i'm still activating the docking procedure at what seems like the 70/60/whatever% distance through the front door. i thought it was supposed to be the origin position of the dock?...
I think that I told the wrong thing in that other thread. In the code for docking there is only a check for the position, not for the size. I also changed the port origin of some double sized dredger docks to the middle of the dock. The docking still started near the entrance.

Today I looked in the code that sets up the dock. On setUp of a dock entity, the code compared the origin of the dock with its dimension. If the origin is not at the entrance, the code moves the 'port_position' used for later calculations to the entrance. Result is that 'port_position' can be different than the subentitie position itself and is always at the entrance.
A bit of a pity that it is handled that way. It removes the flexibility to define your own docking position in big docks. But you still can simulate it by adding a second, normal subentitie in front of the dock.

Re: Still having probs w/ docks >:-/

Posted: Sat Jun 18, 2011 1:20 pm
by Killer Wolf
hmmm.

i did have a workaround, based on the Scavenger asteroid i built ages ago - model a long entrance tunnel adn put a dock entity at the back of it. trouble is, it doesn't work for my station. i can't figure it out, cos i d/l'd Cmdr McLane's OXP again and got into the asteroid no bother : w/ my station, it flat out doesn't work. if i define the tunnel as a dock, i trigger the dock action at the entrance. if i don't define it as a dock, it doesn't let me fly in. yet, no probs w/ the Salvage gang. i can't figure it out.

Re: Still having probs w/ docks >:-/

Posted: Sat Jun 18, 2011 2:26 pm
by Eric Walch
Killer Wolf wrote:
it doesn't let me fly in. yet, no probs w/ the Salvage gang. i can't figure it out.
Strange. Maybe you defined the dock in a way that Oolite thinks the entrance is at the other side. In reality, is Oolite ignoring any collision detection in the whole area in front of the dock, with a diameter of the dock (+ a certain percentage). Any object that is part of the station, you should be able to fly trough.

Try flying in the station on the other side. It will probably be difficult to figure out were you are exactly at the opposite side of the dock. But if that is possible, you have a clue.

Re: Still having probs w/ docks >:-/

Posted: Sat Jun 18, 2011 2:31 pm
by Killer Wolf
not sure how i could have done that, it's all modelled as i usually do and all the bounding boxes look ok.

Re: Still having probs w/ docks >:-/

Posted: Sat Jun 18, 2011 3:41 pm
by Commander McLane
The dock seems to not be placed correctly. I activated the bounding boxes, and the red dock is sitting on top of the tunnel, not inside the tunnel.

Then I aligned with the red box (not the tunnel!), flew towards it and docked without problems. In other words: I could fly through the wall and above the tunnel. But flying through the tunnel is impossible. This is because collision detection is only de-activated right in front of the dock.

The oddity is that the blue box of the dock-subentity does seem to be correctly placed at the end of the tunnel.

Re: Still having probs w/ docks >:-/

Posted: Sat Jun 18, 2011 4:09 pm
by Commander McLane
Some screenshots for illustration.

First a view from directly outside the tunnel of the Hathor station (click to enlarge):
Image

For comparison, this is what a Salvage Gang looks like. Note that this time the blue bounding box for the docking entity is placed above the plane, and the red docking area is placed correctly behind the tunnel. Nevertheless, the texture of the docking entity appears in the red box, not in the blue one:
Image

It gets even odder for a Seedy Space Bar. The red docking box is completely detached from the model, and protrudes into space at an odd angle. It even moves together with the turret it is aligned with (for reasons that are a complete mystery to me). Yet docking takes place in the blue-boxed docking entity.
Image

I find Oolite's handling of docking bays very odd, to say the least. I have not the slightest clue how this all comes to pass.

Re: Still having probs w/ docks >:-/

Posted: Sat Jun 18, 2011 4:37 pm
by Killer Wolf
in true Annoy-wolfie tradition, it's suddenly started working. i think i just change things so many times the game gets confused and just decided it'll be far easier to just do what i want.

McL, i have seen some VERY strange bounding box behaviour in this struggle. While testing the Nephthys, i added a dock box that enveloped the end of the tunnel. A couple times after that tho, the red bounding indicated the length of the tunnel model :-/ a bit more fiddling, and the red box showed the dock size, yet i had no blue box at all for the tunnel and yet it happily let me fly down and dock. i'm putting that down to shipdata typos, i guess, cos after further fiddling, everything seemed fine.
i then binned all the Hathor shipdata, copied the Nephthys one, and it didn't work :-D Again, after some tidying and a name typo that i think was clashing w/ the Nephthys OXP, it worked. so all is fine. until it decides to fk w/ me again.

anyways, ta all for your contributions.


edit - McL ~ what's up w/ that first screenie - why can't i see anything of the walls/floor? i thought it might be the brightness of my monitor here but it looks totally pitch black/missing? bck wall looks bright and clear enough.

Re: Still having probs w/ docks >:-/

Posted: Sat Jun 18, 2011 5:02 pm
by Commander McLane
Killer Wolf wrote:
edit - McL ~ what's up w/ that first screenie - why can't i see anything of the walls/floor? i thought it might be the brightness of my monitor here but it looks totally pitch black/missing? bck wall looks bright and clear enough.
It's because I had the sun directly in my back. Therefore full light for the walls I was looking at, and no light for the perpendicular walls.

Re: Still having probs w/ docks >:-/

Posted: Sat Jun 18, 2011 5:25 pm
by JensAyton
Commander McLane wrote:
Some screenshots for illustration.
I don’t think they tell us very much. :-) The bounding box rendering broke at some point, and I made a note but never fixed it. (It doesn’t work right for the default stations any longer.) It’s entirely possible the docking bounding box was never constructed correctly, since I probably only tested on a few stations back when I implemented it.

Re: Still having probs w/ docks >:-/

Posted: Sat Jun 18, 2011 7:18 pm
by Commander McLane
Ahruman wrote:
Commander McLane wrote:
Some screenshots for illustration.
I don’t think they tell us very much. :-)
At least they told me that something is broken. I just didn't know that it was the bounding box rendering. :wink:

Re: Still having probs w/ docks >:-/

Posted: Sat Jun 18, 2011 9:28 pm
by Eric Walch
Killer Wolf wrote:
in true Annoy-wolfie tradition, it's suddenly started working.
I'm glad to hear it is working now.

I just did a test with a dock at the side of a station. I wanted to do that for some time now. When looking at the code, some months ago, I got the impression that the docking code should work for docks on any side of the ship in any position and orientation. And it seems to work. The only thing that is fixed to the z-axis is the suppression of collision detection in front of the dock, not the docking itself.
But it might be possible that without the suppression of collision detection along the z-axis, some ships will crash on the normal collision detection while docking at a side-mounted dock. (And docking will become a challenge on rotating stations :P )