Page 2 of 3

Re: Carrier Docks

Posted: Sun Jan 22, 2012 11:02 am
by Zieman
mandoman wrote:
Zieman wrote:
I had similar displacement problems when I started making Far Arm ships Titan, and the solution was to move those displaced subents up in the .plist, to reside there before turrets.
So, I'm pretty sure your problem goes away by just moving the dock-entry up in your shipdata.plist, like this:

Code: Select all

		subentities = 
			(
			"example_dock 0 0 -850 0 0 1 0",
			"example_subent_a 0 0 360 1 0 0 0",
			"example_subent_b 0 0 375 1 0 0 0",
			"example_turret 79.55 192.05 314.0 0.8451 0.4978 -0.0990 0.1681",
			"*FLASHER* 0.0 0.0 650 240 0 0 64",
			"*FLASHER* 0.0 0.0 -750 270 0 0 200"
			);
I don't use that format. The Wiki said that all of the plist type scripts were heading to ns, and away from xml, so I just learned to do it in the ns. I think I see what you are doing with it in that example, though.
Funny. My example is nextstep format, I've always used it since XML is so bloated and hard to read.
I just use the older way of defining subentities in ns, it saves space compared to new way, but is not necessarily as easy to read.

Re: Carrier Docks

Posted: Sun Jan 22, 2012 11:16 am
by Zieman
mandoman wrote:
Well, I put the subent entry for the dock ahead of the ball turret entries, but the dock is still hanging faithfully out in front of the ship. It really looks screwy, and I wish I knew how to fix it. :roll:
Could you send me the files, so I can have a look. Lookin at this fragment:

Code: Select all

{
                        type = "standard";
         is_dock = "true";
         subentity_key = "andricodred_dock";
                        port_dimensions = "931.072 x 284.350 x 666.750"; <------ three decimal places
                        tunnel_corners = "4";
         position = (0.0, 242.3, 635.8);
         orientation = (1, 0, 0, 0);
         }
the dock seems to be really big (931x284x667^3 oometers vs. standard 250x192x64 oometers^3), and the position is 242 oometers above and 636 oometers in front of ship center. Don't know if that's too much or too little (don't know your carrier's dimensions). Ah, one thing: when you determine the dock position, do you have the main model correctly centered in your modelling program?

EDIT: remove the "port_dimensions"-key, just thought that it screws your dock big time. IIRC for a working dock you need:
- dock model (.dat)
- corresponding entry in shipdata.plist
- subentity-entry using thedock entry inside the carrier(or station)'s entry in shipdata.plist
And port_dimensions is a key not longer used, position, orientation and actual model dimensions take care of that functionality with much more control and possibilities for every aspect.

Re: Carrier Docks

Posted: Sun Jan 22, 2012 12:10 pm
by Eric Walch
Zieman wrote:
remove the "port_dimensions"-key, just thought that it screws your dock big time. IIRC for a working dock you need:
....And port_dimensions is a key not longer used, position, orientation and actual model dimensions take care of that functionality with much more control and possibilities for every aspect.
Yes, in the first place belong port_dimensions and tunnel_corners in the carries definition and not in the subent definition. At the current location they are just ignored. So, the good thing is that this will not be a source of your troubles.

And as Zieman writes, you should just remove the port_dimensions altogether. It is just a key needed when your ship does not has a dock subentitie at all.

Re: Carrier Docks

Posted: Sun Jan 22, 2012 2:29 pm
by mandoman
Wildeblood wrote:
mandoman wrote:

Code: Select all

{
                        type = "standard";
			is_dock = "true";
			subentity_key = "andricodred_dock";
                        port_dimensions = "931.072 x 284.350 x 666.750"; <------ three decimal places
                        tunnel_corners = "4";
			position = (0.0, 242.3, 635.8);
			orientation = (1, 0, 0, 0);
			}
I've noticed three decimal place precision in other shipdata fragments you've posted in the past. Do you really need millimetre precision? Would doing those precise calculations hurt my poor computer?
If you are referring to the port dimensions, I just got those numbers from the .dat file, so I probably wouldn't need three decimal precision. I've been learning to round up, or down lately. I use to think that the more precise the position, the closer whatever I'm trying to place would be to where it belongs on the ship, but that isn't so, as you probably already know. I learned from Killer Wolf that I would need to mess with the measurements until I got the position as close as I could. Sorry if those numbers are too many for your computer, though I don't know why numbers, of numbers should bother a computer. :wink:

Re: Carrier Docks

Posted: Sun Jan 22, 2012 2:49 pm
by mandoman
Zieman wrote:
Could you send me the files, so I can have a look.
Yeah. What all do you want? Do you want me to compress the oxp, and upload it to Box for you to get, or what?
Zieman wrote:
the dock seems to be really big (931x284x667^3 oometers vs. standard 250x192x64 oometers^3), and[/s] the position is 242 oometers above and 636 oometers in front of ship center. Don't know if that's too much or too little (don't know your carrier's dimensions). Ah, one thing: when you determine the dock position, do you have the main model correctly centered in your modelling program?
Yeah, I realise that it is huge. I wasn't sure if that mattered, or not. The ship itself is huge, but the next one I have in mind is even bigger. I have the ship centered as well as I can in Blender, but I admit that because of the size, it may not be perfectly centered by any means.
Zieman wrote:
EDIT: remove the "port_dimensions"-key, just thought that it screws your dock big time. IIRC for a working dock you need:
- dock model (.dat)
- corresponding entry in shipdata.plist
- subentity-entry using thedock entry inside the carrier(or station)'s entry in shipdata.plist
And port_dimensions is a key not longer used, position, orientation and actual model dimensions take care of that functionality with much more control and possibilities for every aspect.
Okay. I only put it in there recently. The Wiki said it wasn't necessary, but I was just trying possible options to see if they made a difference. It didn't. My original listing didn't have either the port dimensions, or the "4 corners" entry.
Eric Walch wrote:
Yes, in the first place belong port_dimensions and tunnel_corners in the carries definition and not in the subent definition. At the current location they are just ignored. So, the good thing is that this will not be a source of your troubles.

And as Zieman writes, you should just remove the port_dimensions altogether. It is just a key needed when your ship does not has a dock subentitie at all.
I'll do that right away. I was just trying different things, thrashing about in the dark, as the saying goes.

Re: Carrier Docks

Posted: Sun Jan 22, 2012 3:20 pm
by Zieman
mandoman wrote:
Zieman wrote:
Could you send me the files, so I can have a look.
Yeah. What all do you want? Do you want me to compress the oxp, and upload it to Box for you to get, or what?
Yeah, that would be great.

Re: Carrier Docks

Posted: Sun Jan 22, 2012 3:36 pm
by mandoman
Zieman wrote:
Yeah, that would be great.
Here it is. Hope you can see the problem, because I'm not even coming close. I even tried repositioning the model in Blender to see if I could get more accurate xyz points, but it didn't help.

http://www.box.com/s/p3zcsllx5ep8vevekxg7

Re: Carrier Docks

Posted: Sun Jan 22, 2012 6:45 pm
by Zieman
Ok, I've now gone through the models & shipdata.

The dock model was really screwed up when I imported it to Wings 3D (the polygons were several hundred Oometers off-center).

Main model wasn't really centered either, and it is not completely symmetrical (left-right symmetry) + some faces were a bit funny...

Exhaust definitions in shipdata.plist had one value too many and the turret orientations vere funny.

I have centered the dock, fixed many issues with the main model and amended shipdata.plist to reflect these changes & fix said oddities.

I'll test my changes once more, and the upload the OXP for you to grab it back.

P.S

is this carrier really supposed to be so fast - 0.38 LM seem a wee bit quick for such a big ship...

Re: Carrier Docks

Posted: Sun Jan 22, 2012 6:54 pm
by Eric Walch
Zieman wrote:
Main model wasn't really centered either, and it is not completely symmetrical (left-right symmetry) + some faces were a bit funny.
Very visible when displaying bounding boxes. (Pause, x) one side had a length of about 27000 metres :)

Re: Carrier Docks

Posted: Sun Jan 22, 2012 7:03 pm
by mandoman
Zieman wrote:
Ok, I've now gone through the models & shipdata.

The dock model was really screwed up when I imported it to Wings 3D (the polygons were several hundred Oometers off-center).

Main model wasn't really centered either, and it is not completely symmetrical (left-right symmetry) + some faces were a bit funny...

Exhaust definitions in shipdata.plist had one value too many and the turret orientations vere funny.

I have centered the dock, fixed many issues with the main model and amended shipdata.plist to reflect these changes & fix said oddities.

I'll test my changes once mora, and the upload the OXP for you to grab it back.

P.S

is this carrier really supposed to be so fast - 0.38 LM seem a wee bit quick for such a big ship...
My only defense is that it was my first attempt at anything that big. I have actually been working on the model itself the whole time I've been testing it in the game. If you think was screwed up when you got it, you should have seen it about a month ago. Anyway, thanks for straightening it out. I knew it wasn't aligned perfectly, and could tell other features were off, but I guess I never could figure out what the problems were. As for centering, well I have it centered in Blender the best I know how, so I don't know what to say about that. I've been studying the Wings3D, and may try building ships in there instead of Blender. It's hard to change, though, because I have become very familiar with Blender.

I look forward to seeing your changes. Thanks. Oh, as for the speed, that wasn't set in stone, and in fact I haven't paid any attention to much of the other aspects of the shipdata.plist except the subentities for quite a while. I think it is actually the max speed of the ship I originally designed this ship from, called the Andricothere. I've still got to get that one done as well. I came closer to getting the dock into place on that one, but never could get it to sit in the slit facing the right angle, and direction.
Eric walch wrote:
Very visible when displaying bounding boxes. (Pause, x) one side had a length of about 27000 metres :)
Sigh! Maybe I should just dump the dang thing. Don't know if my player ships are right either, as I build them in the same way I built this one. :(

Re: Carrier Docks

Posted: Sun Jan 22, 2012 8:19 pm
by Zieman
Don't worry mandoman, you'll get the hang of it soon enough.

I just tested the fixed version, and it seems to work ok (hope the turrets' placement is ok for you, had to do some quesswork there...).

Here it is:
http://www.box.com/s/n7gx94h2efaop9vn3nhl
EDIT: I included an Excel spreadsheet (not made by me, IIRC found it via the Wiki...) for calculating Quaternions right for subent orientation.

And a couple of pics.

first pic shows how the main & dock models related to each other at first (imported both to Wings 3D):
Image

in the second pic I've successfully docked with the carrier:
Image

Re: Carrier Docks

Posted: Sun Jan 22, 2012 8:34 pm
by Zieman
BTW:
http://wiki.alioth.net/index.php/Shipdata.plist
is a MUST reference for ship-makers.

For example, in this particular (Andricodred.oxp) shipdata.plist:

Code: Select all

"has_heat_shield" = yes; 
does nothing, but

Code: Select all

heat_insulation = 2;
would give the ship the equivalent of player's EQ_HEAT_SHIELD equipment.
For slow ships that may sun-skim, you might want to give a higher value.

Re: Carrier Docks

Posted: Sun Jan 22, 2012 10:22 pm
by mandoman
Thank you very much for your help. It looks like I need to go back to school. Won't be releasing any more ships any time soon. They are probably all screwed up like this one was.

Re: Carrier Docks

Posted: Sun Jan 22, 2012 10:32 pm
by mandoman
Zieman wrote:
(hope the turrets' placement is ok for you, had to do some quesswork there...)
What was wrong with how I had the turrets arranged? I admit they weren't in position just right yet, but I was working on them.

You certainly nailed it, that's for sure. How did you get the dock into position? That is something I've been puzzling over now for several weeks.

I have that quaternion calculator. The problem I have is determining on which axis to use, given any particular turret. If you are figuring from their own XYZ axis', how do you figure them in relation to the ship, and the position on the ship which you wish to place them? They look great, by the way. That wasn't what I was trying to do, but I actually like your design better, so thanks again. :)

Re: Carrier Docks

Posted: Sun Jan 22, 2012 11:12 pm
by Zieman
mandoman wrote:
What was wrong with how I had the turrets arranged? I admit they weren't in position just right yet, but I was working on them.
Nothing was wrong with your turret placement. I jus forgot to note where they were supposed to be. And when I moved the main model, I forgot to note how much in which direction. So I had to do some guesstimates, based on the original turret position data. Turret facings looked funny to me, and there I took the liberty of turning them to point roughly along that face's normal where each turret is positioned on.
mandoman wrote:
You certainly nailed it, that's for sure. How did you get the dock into position? That is something I've been puzzling over now for several weeks.
Thanks :).
Dock position kinda fixed itself, once I centered the dock model. Then it was just fine-tuning the placement.
The lesson to learn here: always make sure that any model you do is centered in the modelling program before you export the model to .obj (& convert to .dat). This means that the origo is near the model center (not necessarily center of the model's bounding box - more like center of mass), and preferably the model's center line is positioned on x-axis 0 (= zy plane). Moving the subent to correct position is done by the ship's subentity -entry (position key) in shipdata.plist.
mandoman wrote:
I have that quaternion calculator. The problem I have is determining on which axis to use, given any particular turret. If you are figuring from their own XYZ axis', how do you figure them in relation to the ship, and the position on the ship which you wish to place them? They look great, by the way. That wasn't what I was trying to do, but I actually like your design better, so thanks again. :)
No probs, glad you like :).
Once I get the ship model ready (centered/balanced & exported), I note the coordinates of where I want to place subents in Wings 3D (for some subents, you have to take the subent's dimensions in account). Then I figure out if the subents need rotating. Basically, any model's z-axis + is front. If you want to have a turret face a bit left, you need to yaw it left (= rotate counter-clockwise around the y-axis), which is achieved by giving the correct orientation-quaternion.