[TOOL] DAEnerys - DAE Ship Editor

If I had been paying just slightly more attention, I would have noticed this before. facepalm

Ummm… Multiplying the identity matrix with the returned matrix is unnecessary. You’re essentially multiplying by 1. Much simpler to do this:
Matrix4 matrix = Matrix4.CreateTranslation(translation);
(EDIT: unless you have other things being multiplied into the matrix; but you should still have the first matrix returned just get set to the variable.)

Regardless of that, though, what is happening with the calculations is not a mere translation effect. What is happening is the axes are being projected onto the CAMERA-plane, similar to how any other vector is projected onto the XY/YZ/XZ-planes. It’s just slightly more complicated in our case, because there are more computations that go into the result than just setting Z/X/Y to zero with the standard projections.

1 Like

Sure. It was just pseudo-code meant as an example. :smiley:

Interesting, I really have to dig some more into this. I learn about matrices next year in school, so that’s a good thing. :slight_smile:

What year are you?

Well, you’ll be ahead of the curve, then! :slight_smile:

1 Like

I’m in the 11th year (getting 18 in one week), I am doing the “Abitur” right now. I think you can compare it to the A-Level, but with a bit higher level.

Yay. :wink:

[quote=“radar3301, post:197, topic:540034”][/quote]
’ get modelview matrix
Dim buffer(0 To 15) As Single
GL.GetFloat(GetPName.ModelviewMatrix, buffer)

You actually might be able to get this from Program.Camera.GetViewMatrix().

Also, where is Camera.Update called from? I can’t seem to find it just yet…

1 Like

It’s called from glControl_Update in Main.cs.

I think I’m just going to PM you, lol.

1 Like

Hijackers !! … rsrssrssrs

1 Like

I have to know some things for the previewing of dockpaths.

Preview model
So I thought about letting the user pick an OBJ file that flies along the path, so far so good.
But more data is needed for proper recreation, like the mainEngineMaxSpeed, the rotationMaxSpeed, the accelerationAngle, etc…

The best thing to do would obviously be to let the user also choose a .ship file (or even pick one from a list, because we already parse data paths anyway). We will also need to parse weapons and much more for the other features.
What do you think?

How dockpaths really work
My basic understanding of the system is the following:

  • The ship moves from one segment to another as fast as it can (depending on the mainEngineMaxSpeed and the speed parameter of the last segment, accelerating and braking with the speeds of mainEngineAccelTime and mainEngineBrakeTime?
  • A segment is marked as reached when the distance between the segment and the ship is equal or lower than the tolerance of the segment.
  • The ship rotates to represent the segment rotation with the speed of rotationMaxSpeed, the acceleration rotationAccelTime and the braking speed rotationBrakeTime if UseRot is enabled on the segment?
  • The ship starts to move to the next segment if it is equal or lower than accelerationAngle rotated away from the segment rotation? (Only if CheckRot is enabled?)

Or does it just interpolate between the rotations and positions of each segment?
Do we even need any values from the .ship file?

I will probably have to do the most stuff by trial-and-error, but if anyone has something to contribute, do it.

1 Like

Unless GBX has changed something, in CFHod times no info was needed from SHIP files. Regarding dockpaths it was all related to the HOD file. Wait for confirmation of other modders …

1 Like

But CFHodEd never showed you how the ship would really dock in-game. :sweat_smile:
It didn’t even displayed a custom mesh for you to look at.

EDIT: Or do you mean that the in-game implementation did not use any of these values?

Ah, ok, now I got where you wanna reach. So, you want to animate dockpaths in DAEnerys, where the user can select different ships to simulate? That would be cool.

2 Likes

Definitely would be a cool feature to load ship files, but I think for the initial pass just picking an DAE to move along the path as the max posted speed using a lerp for velocity and rotation would be good enough to make sure that the path doesn’t clip through the ship or has the wrong flags set. Maybe setting a max speed and rotation (which could be loaded from a .ship I guess) I would be fine with an ‘ideal’ dock path simulation first (that’s all maya had was pure animation) and then get BitVenom or one of the other devs to chime in on how the ships actually follow the paths as a second pass. I’m sure there are all sorts of bizarre cases using sliding and thrusters that will take up a lot of time to get right so having something basic sooner will be preferable.

How dockpaths really work
My basic understanding of the system is the following:

The ship moves from one segment to another as fast as it can (depending on the mainEngineMaxSpeed and the speed parameter of the last segment, accelerating and braking with the speeds of mainEngineAccelTime and mainEngineBrakeTime?
A segment is marked as reached when the distance between the segment and the ship is equal or lower than the tolerance of the segment.
The ship rotates to represent the segment rotation with the speed of rotationMaxSpeed, the acceleration rotationAccelTime and the braking speed rotationBrakeTime if UseRot is enabled on the segment?
The ship starts to move to the next segment if it is equal or lower than accelerationAngle rotated away from the segment rotation? (Only if CheckRot is enabled?)

this seems like what it is doing in game, the ships tend to headlong crash into the tolerance and then correct to move back to the region around the dock path node. I haven’t looked closely at 2.0 patch behavior to see if this changed from classic (I think I saw things about batching of dock paths and reworking of the exit logic)

1 Like

Error with the example KAD_Swarmer.DAE when lighting is active:

Log:

Info,  T16844: Load C:\daenerys\DAEnerys\bin\Debug\resources/joint.ply
Info,  T16844: Found a matching importer for this file format
Info,  T16844: Import root directory is 'C:\daenerys\DAEnerys\bin\Debug\resources\'
Info,  T16844: Entering post processing pipeline
Info,  T16844: Points: 0, Lines: 0, Triangles: 1, Polygons: 0 (Meshes, X = removed)
Error, T16844: Failed to compute tangents; need UV data in channel0
Info,  T16844: JoinVerticesProcess finished | Verts in: 354 out: 280 | ~20.9%
Info,  T16844: Leaving post processing pipeline
Info,  T16844: Load C:\daenerys\DAEnerys\bin\Debug\resources/icosphere.obj
Info,  T16844: Found a matching importer for this file format
Info,  T16844: Import root directory is 'C:\daenerys\DAEnerys\bin\Debug\resources\'
Error, T16844: OBJ: Unable to locate material file icosphere.mtl
Error, T16844: OBJ: failed to locate material Material, skipping
Info,  T16844: Entering post processing pipeline
Info,  T16844: Points: 0, Lines: 0, Triangles: 1, Polygons: 0 (Meshes, X = removed)
Info,  T16844: CalcTangentsProcess finished. Tangents have been calculated
Info,  T16844: Leaving post processing pipeline
Info,  T16844: Load C:\daenerys\DAEnerys\bin\Debug\resources/icon.obj
Info,  T16844: Found a matching importer for this file format
Info,  T16844: Import root directory is 'C:\daenerys\DAEnerys\bin\Debug\resources\'
Error, T16844: OBJ: Unable to locate material file icon.mtl
Error, T16844: OBJ: failed to locate material None, skipping
Info,  T16844: Entering post processing pipeline
Info,  T16844: Points: 0, Lines: 0, Triangles: 1, Polygons: 0 (Meshes, X = removed)
Info,  T16844: CalcTangentsProcess finished. Tangents have been calculated
Info,  T16844: JoinVerticesProcess finished | Verts in: 6 out: 4 | ~33.3%
Info,  T16844: Leaving post processing pipeline
OpenTK initialized.
'DAEnerys.exe' (CLR v4.0.30319: DAEnerys.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll'. Cannot find or open the PDB file.
Info,  T16844: Load colladaBlenderFix.dae
Info,  T16844: Load colladaBlenderFix.dae
Info,  T16844: Found a matching importer for this file format
Info,  T16844: Found a matching importer for this file format
Info,  T16844: Import root directory is '.\'
Info,  T16844: Import root directory is '.\'
Warn,  T16844: Collada: No material specified for subgroup <> in geometry <COL[Root]-lib>.
Warn,  T16844: Collada: No material specified for subgroup <> in geometry <COL[Root]-lib>.
Warn,  T16844: Collada: No material specified for subgroup <> in geometry <ETSH[EngineShape1]-lib>.
Warn,  T16844: Collada: No material specified for subgroup <> in geometry <ETSH[EngineShape1]-lib>.
Info,  T16844: Entering post processing pipeline
Info,  T16844: Entering post processing pipeline
Info,  T16844: Points: 0, Lines: 0, Triangles: 12, Polygons: 0 (Meshes, X = removed)
Info,  T16844: Points: 0, Lines: 0, Triangles: 12, Polygons: 0 (Meshes, X = removed)
Error, T16844: Failed to compute tangents; need UV data in channel0
Error, T16844: Failed to compute tangents; need UV data in channel0
Skipping one or more lines with the same contents
Skipping one or more lines with the same contents
Info,  T16844: CalcTangentsProcess finished. Tangents have been calculated
Info,  T16844: CalcTangentsProcess finished. Tangents have been calculated
Info,  T16844: JoinVerticesProcess finished | Verts in: 6510 out: 3202 | ~50.8%
Info,  T16844: JoinVerticesProcess finished | Verts in: 6510 out: 3202 | ~50.8%
Info,  T16844: Leaving post processing pipeline
Info,  T16844: Leaving post processing pipeline
Material 'MAT[Kad_SwarmerThruster]_SHD[thruster]' added.
Material 'MAT[Kad_Swarmer]_SHD[ship]' added.
Material 'MAT[Kad_Swarmer_autogen_1]_SHD[ship]' added.
Material 'MAT[Kad_Swarmer_autogen_2]_SHD[ship]' added.
Material 'MAT[Kad_Swarmer_autogen_3]_SHD[ship]' added.
Material 'MultiMat_0' added.
Material 'MultiMat_0_ncl1_1' added.
Material 'MultiMat_0_ncl1_2' added.
Mesh 'COL[Root]Mesh' added.
Mesh 'ETSH[EngineShape1]Mesh' added.
Mesh 'MULT[P2Swarmer]_LOD[0]_TAGS[DoScar]Mesh' added.
Mesh 'MULT[P2Swarmer]_LOD[0]_TAGS[DoScar]Mesh' added.
Mesh 'MULT[P2Swarmer]_LOD[1]Mesh' added.
Mesh 'MULT[P2Swarmer]_LOD[1]Mesh' added.
Mesh 'MULT[P2Swarmer]_LOD[2]Mesh' added.
Mesh 'MULT[P2Swarmer]_LOD[2]Mesh' added.
Mesh 'MULT[P2Swarmer]_LOD[2]Mesh' added.
Mesh 'MULT[P2Swarmer]_LOD[3]Mesh' added.
Mesh 'MULT[P2Swarmer]_LOD[3]Mesh' added.
Mesh 'MULT[P2Swarmer]_LOD[3]Mesh' added.
1 Like

Hmm… what is your graphics card?
Is this the only DAE where this happens?

I think it has to be something with the navlight, because it emits light on the host mesh.
Try the kus_supportfrigate, the same thing should happen there if I’m right.

On HWAT_BEN_FFWar.dae:

With lighting enabled:

Without lighting enabled:

I don’t have any other DAEs to test…

1 Like

The Kushan Support Frigate is in [EXAMPLE] Ships #3.

Well, I don’t know how this thing is supposed to look, so it does not help much. :smile:
And please tell me your graphics card.

Intel HD Graphics 5500


Every DAE I load is black with lighting enabled.

1 Like

Yup, seems to be the same issue like this guy has:


Okay, then your driver doesn’t like something in the lighting calculations.
I still think that it’s the struct (or the array) for lights in the fragment shader that causes this.
Too bad that I don’t have an Intel card here. :frowning:

You will have to disable the lighting on that card for now…

I’ll look into it…

1 Like