damage textures again

using damage textures with new ship models -> trek.exe basics; support/discussion/questions

Moderator: thunderchero

User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7933
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: damage textures again

Post by thunderchero »

Spocks-cuddly-tribble wrote: Wed Jan 25, 2023 4:54 pm Have you ever tested the three unknown HOB GLfloat at 0x3C?
no as I said I asked for files, but all I did was open zip file

but doing a quick look at a vanilla hob my first guess would be start point of different sections? if integer not float

ship data, damage data, animation data

Edit; here is what I posted Dec 23, 2010

0x00003c (54 CD 00 00) file size -16
0x000040 (8C 09 00 00) start of polygon data? new models start with (00 00 00 00)
0x000044 (74 58 00 00) start of "b gif" polygon data?

by the way I was just looking at all the PM's between me and QD on damage texture there is a lot of data I don't understand lol

edit; to make the wing rotate back you might be able to use this type of script lol
here is testf16.ans from full source "Falcon4\flyer\ObjTools\object"

Code: Select all

ANSVar {
    int     starttime;      // variable to hold the animation started time
    float   currenttime;    // must be defined in float to avoid overflow
    int     curyaw, angle;
}
ANSInit {
    starttime = time;   // set the start time
}
ANSCode {
    currenttime = time - starttime;     // get time difference
    curyaw = currenttime * 2.048;       // rotate yaw at 45 deg/sec

    curyaw %= 16384;
    if (curyaw > 8192) curyaw = 16384 - curyaw;  // to make the wing rotate back

    angle = curyaw - 4096;
    DOFRotate[0] = angle;
    DOFRotate[1] = angle;
    DOFRotate[2] = angle;
    DOFRotate[3] = angle;
    DOFRotate[4] = curyaw;
}
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7933
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: damage textures again

Post by thunderchero »

Hi

since rebuilding the ragnar model did not help with MUM crash I thought while I have new model in construction I would give adding damage a go again.
thunderchero wrote: Fri Feb 06, 2015 4:19 pm the slot number in creator is very important
slots 1 - 16 are main phaser slots (16 max)
slot 17 is 48 byte space between types
slots 16 - 30 I think are b.gif phaser slots or maybe plasma (12 max)
slot 31 is 48 byte space between types
slots 32 - 43 are for damage slots (12 max)
1. I setup slots 32 - 39 (8 total) I am hoping I have info above correct. :wink:
2. I used the "put" tools to place first slot on hull properly. this is not too hard to do, but takes some time moving grid into position.
damage.jpg
damage.jpg (430.28 KiB) Viewed 2042 times
other than place other slots on hull not sure what else I need to do?
do the damage slots need to be part of bsp? right now I am adding them after bsp have been added.
I don't think I need to add scar.gif at any point. I think that is all done by trek.exe code.
I guess all I can do is test.

EDIT;
I got the model into game, but I still must be missing something almost 50% hull damage on test model and no damage spots showing.

also 1 strange thing I noticed I have 24 slot object 8-8-8 (named slot 1-8, 18-25, 32-39) after conversion in hob file at 0x000024 of hob file it has 27 00 00 00 (39) the last number on slot object :shock:
so may need to relabel damage slots?
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7933
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: damage textures again

Post by thunderchero »

Hi

well back to back posts... I was going to edit last post but posted too long ago. :wink:

After digging though vanilla files I think we have trek.exe phaser slot data and hob file data backwards. :shock:

example hh1_a.hob
here is what I am thinking now
at 0x98 start of damage data 48 bytes x 16 (max) damage slots (uses polygon)
at 0x3c8 start of phaser slot data 48 bytes x 16 (max) phaser slots (uses vertex)

Note; new ships models start phaser data around 0x98 (location changes due to how many textures) then goes directly to model data.

trek.exe phaser data
here is what I am thinking now
0xC = number of damage slots
0x14 = number of phaser slots
0x20 = damage slot (16 max) -> meaning of different default values?
switches maybe incorrect also?

presumed trek.exe phaser data info

Code: Select all

+0x0 = name of Hob file
+0x4 = number of plasma slots
+0x8 = plasma slot switch on = 0 off = 1
+0xC = number of phaser slots
+0x10 = phaser slot switch on = 0 off = 1
+0x14 = number of damage spots
+0x18 = damage spot switch on = 0 off = 1
+0x1C = exe scale
+0x20 = phaser/plasma slots (16 max) -> meaning of different default values?
in my test model it looks like it is firing phaser from where I placed damage polygon.
if this is happening as I am thinking, the test model is attempting to display damage on a single vertex (no area to display)
but this would explain current model not displaying damage.

So back to the drawing board on ship conversion when I find more time.

Edit;
and looks like I am correct :shock: "And I am really shocked"
boom.jpg
boom.jpg (348.7 KiB) Viewed 2024 times
Phaser slots were placed in center of deflector? if you look close it is there
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: damage textures again

Post by Flocke »

thunderchero wrote: Thu Mar 02, 2023 12:01 am Phaser slots were placed in center of deflector? if you look close it is there
Wow, that indeed is a shocking find! :shock: :shock:
Now fix all the phaser slots...
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1926
Joined: Sun Apr 27, 2008 2:00 am

Re: damage textures again

Post by Spocks-cuddly-tribble »

thunderchero wrote: Wed Mar 01, 2023 4:34 pmother than place other slots on hull not sure what else I need to do?
do the damage slots need to be part of bsp? right now I am adding them after bsp have been added.
I don't think I need to add scar.gif at any point. I think that is all done by trek.exe code.
I guess all I can do is test.

EDIT;
I got the model into game, but I still must be missing something almost 50% hull damage on test model and no damage spots showing.

also 1 strange thing I noticed I have 24 slot object 8-8-8 (named slot 1-8, 18-25, 32-39) after conversion in hob file at 0x000024 of hob file it has 27 00 00 00 (39) the last number on slot object :shock:
so may need to relabel damage slots?
Problem is I don't know. They might even have used a special hob converter for BotF (QD said BotF HOBs have deviations from other HOB files)?

My info is just about Creator tools able to auto-calculate values for the transformation matrices (9 * four byte floats in the HOB discused in this project thread). So basically it's just about finding the right 9 foats in the FLT file (8 byte double float IIRC) and placing then converted to four byte floats in the HOB damage slots.

thunderchero wrote: Thu Mar 02, 2023 12:01 amAfter digging though vanilla files I think we have trek.exe phaser slot data and hob file data backwards. :shock:
All trek.exe codes seem to confirm to old trek.exe ship slot analysis and I tested the phaser firing arc values at +20h. :wink:
Just sorting order of the phaser firing arc values is unclear and +4/+8 has no code (unused feature).
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7933
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: damage textures again

Post by thunderchero »

Spocks-cuddly-tribble wrote: Thu Mar 02, 2023 7:22 am All trek.exe codes seem to confirm to old trek.exe ship slot analysis and I tested the phaser firing arc values at +20h. :wink:
Just sorting order of the phaser firing arc values is unclear and +4/+8 has no code (unused feature).
I don't know anything anymore, so you maybe maybe correct. This maybe just my conversion process is all wrong and giving me false/mis-leading info?

but something strange is going on here. :wink:

using the vanilla hh1 (galaxy class) as an example;

we know hh1 has multiple damage spot at least 5 (4 display 1 on destruction)

at 0x98 of hh1_a.hob it has 12 x 48 bytes

at 0x3c8 it only has 1 x 48 bytes (if this is damage data it should have at least 5 x 48 bytes) this is what I don't understand.

problem is in game I can see hh1 fire from at least 2 phaser spots on model, so 0x3c8 can not be phaser data (torpedo spot?) but some vanilla models have 2 x 48 bytes 0x3c8

so yes I am confused. :???:
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7933
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: damage textures again

Post by thunderchero »

Here is a little update,
I am still very confused about my posts above.

I did some more testing today, progress?

I had to move position of slot objects in flt (damage/phaser -> phaser/damage)
90.jpg
90.jpg (242.45 KiB) Viewed 1986 times
the damage spots are 90 degrees off and not correct size, but close to the correct placement on hull and only display with hull is damage. (displaying 3 of 8 spot at 45% damage)

I am not sure what it will take to fix these issues.

possible fixes
1. map polygon with scar.gif for size issue?
2. rotate image 90 degrees? to fix rotation error

EDIT;
Facepalm...
I am amazed what I did displays any scar image.
in current test above I added a polygon for scar1 spot. but I just realized I only need a dof with transformation matrices since scar1.gif uses scar1.hob

EDIT 2;
I have had zero luck using DOF's. crash on combat load with log
File: objlist.cpp, Line: 970, switchIndex < anim -> TotalSwitch
from log above I guess I can try using a "switch" next.
and yes I set trek.exe phaser slot for damage (without setting slot damage info, crash with no log)
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7933
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: damage textures again

Post by thunderchero »

Well I have had no progress,
this is the best I have gotten
Image

this is the basic object (placeholder) with either vertex or polygon (makes no difference)
object requires correct name to display starting at "slot32"
trek.exe slot at 0x14 needs correct damage spot total to display

adding scale or transformation matrix has no effect of position of scale
when using polygon if I flip surface damage still faces forward on model
DOF I have been unable to test, due to converter stops writing file whenever dof is part of flt (missing script?)

I am not sure what I can even try at this point.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7933
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: damage textures again

Post by thunderchero »

90.jpg
90.jpg (271.47 KiB) Viewed 1944 times
1. using insert transformation matrix /rotate point
rp.jpg
rp.jpg (69.45 KiB) Viewed 1944 times
2. using insert transformation matrix /scale
scale.jpg
scale.jpg (65.84 KiB) Viewed 1944 times
3. placing object in proper bsp plane to display properly.

#3 explains why the slots are not at top of file like I expected.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: damage textures again

Post by Flocke »

nice!!! :up:
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7933
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: damage textures again

Post by thunderchero »

Thanks,

while I see this as a victory, everything still is far from known.

My example model all damage spots added were parallel to X and Y vectors this make rotation very simple.

from all my test the scar1.hob with no matrix changes will always display with face forward (X - 0.0, Y - 0.0 and Z - 0.0 with no rotations at location of vertex used) this needs to be confirmed though. If this is the case spots placed on angles will take some math to calculate rotation.

scale values are found in vertex info, so you just need to copy X, Y, Z values and set desired scale.

adjusting second damage spot only took 5 min
2.jpg
2.jpg (266.75 KiB) Viewed 1931 times
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7933
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: damage textures again

Post by thunderchero »

new model posted, and will start new how to topic later.

but from what I found placement will be limited to flat face areas, due to scar1.hob will not bend for angles.

Off topic..

I found this looking at using switches.

just think if developers would have had more time...

They might have added "dead" ships, this was part of falcon source code files. :smile:
1701.jpg
1701.jpg (644.73 KiB) Viewed 1913 times
dead.jpg
dead.jpg (643.06 KiB) Viewed 1913 times
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: damage textures again

Post by Flocke »

thunderchero wrote: Wed Mar 08, 2023 11:36 am just think if developers would have had more time...

They might have added "dead" ships, this was part of falcon source code files. :smile:
in say two years I hope we'll go beyond :grin:
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7933
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: damage textures again

Post by thunderchero »

Just wondering if anyone uses this project would it be possible to use an array of different textures? example use scar0-9.hob randomly.
Untitled-1.jpg
Untitled-1.jpg (184.48 KiB) Viewed 1895 times
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2403
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: damage textures again

Post by Tethys »

Try putting duplicate entries for each different scar in same positions as the rest? You might need a way to tie each set of 10 together so that when one is chosen, it cannot display a new damage texture in the location with one already present (sandwiching). How are the damage spots named? I'd like to see the program in more detail if possible. Perhaps just send me a current copy of the project (rag) flt and program that way I can start experimenting as well ;)
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
Post Reply

Return to “using damage textures with new ship models -> trek.exe basics”