How to place scar1.hob on hull

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

Moderator: thunderchero

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

How to place scar1.hob on hull

Post by thunderchero »

Hi Everyone,

placement is done all in creator 3.0, since many do not have this software I am only going cover the basic placement.

1. placement area must be flat or you will get display issues as view point goes past scar1.hob
2. all matrix adjustments are calculated from center of scar1.hob, not center of model.
3. scar1.hob is always oriented the same direction, the view point is from front of model (before matrix adjustments)

here is my "phaser_damage_slots.flt" file.
phaser_damage_slots.zip
(3.66 KiB) Downloaded 101 times
This file only has the single vertex slots
1 - 8 phaser slots
32 - 39 damage slots
damage slots have an extra 4 point polygon that is only used during calculation and deleted before conversion.

I will start with the placement of slot32
here is where I plan on putting scar in this case p438 (make note of polygon id)
1.jpg
1.jpg (310.21 KiB) Viewed 4363 times
next use the "trackplane from face" and make grid as small as possible 0.1000
2.jpg
2.jpg (870.99 KiB) Viewed 4363 times
with smaller grid this will allow you to place damage vertex on any cross point on grid. so I will select as close to center as possible.
select the polygon and vertex in slot32 then select maneuver/translate, in new window set to "to point" and select cross point on grid for slot32 vertex. and select "ok" to close translate window.
3.jpg
3.jpg (831.93 KiB) Viewed 4363 times
now the slot32 vertex and polygon are in position.
next we need to center the grid on the slot32 polygon.
use 'trackplane from face" and select the slot32 polygon. then use "trackplane from vertex" then select the closest cross point on grid to the center of the polygon. now the red cross lines are in center of the slot32 polygon. click ok to close track from vertex window. using the "grid smaller" button make grid as small as possible.
4.jpg
4.jpg (306.07 KiB) Viewed 4363 times
next using the "rotate grid" adjust roll, pitch, yaw until grid is same angles as model surface in this case
0 roll
84 pitch
-3 yaw
to get these value you just need to watch movement and slowly adjust until it is level with surface
note; the cross point was slightly under surface that is ok scar1.hob uses vertex on top of surface.
5.jpg
5.jpg (254.71 KiB) Viewed 4363 times

now you can delete the slot32 polygon (not the vertex)
select slot32 object and use "insert transformation matrix" in new window
select "rotate point" and add after
again select "rotate point" and add after (you need 1 for each change pitch and yaw)
select "scale" and add after
6.jpg
6.jpg (267.07 KiB) Viewed 4363 times
select top rotate point
first lets add pitch value 84 degrees
set all in center column to 0.00 (center point of scar1.hob)
j to 1.0000 (100% change to pitch)
set rotation to desired value (84 degrees)
7.jpg
7.jpg (62.72 KiB) Viewed 4363 times
select second rotate point
next yaw value -3 degrees
set all in center column to 0.00 (center point of scar1.hob)
k to 1.0000 (100% change to yaw)
set rotation to desired value (-3 degrees)
8.jpg
8.jpg (64.64 KiB) Viewed 4363 times
time to set scale
set all in center column to 0.00 (center point of scar1.hob)
Y = should always remain 1.00000 making scar thicker or thinner has no effect
change X and Z to desired size reference polygon is 0.500 x 0.500, I used sizes from .2 -> .5 in test model Ragnar.
9.jpg
9.jpg (58.53 KiB) Viewed 4363 times
after that you still need to move the slot32 (with vertex) into the same bsp plane as the location polygon p438.
select p438 on model and center click in hierarchy view to center hierarchy view on p438
note; moving slot32 is tricky on large models.
10.jpg
10.jpg (308.04 KiB) Viewed 4355 times
repeat for the rest of damage slots save and convert
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: How to place scar1.hob on hull

Post by Tethys »

What happens to p17 and p9 when you move slot32 into the p438 panel? I see there is a line still, but no data. Is it possible to create a subpanel under slot32, using the same steps used to create slot32, to achieve the switchable damage texture you mentioned on another post?

Looking at the hierarchy, parent is bsp1214; you should open bsp1208 and bsp1215 and maybe you get lucky? I have no idea what all is going on there but it looks like more than what BotF needs for a ship model in my opinion. I wish we knew more about these bsp entries.
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7848
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: How to place scar1.hob on hull

Post by thunderchero »

Tethys wrote: Sat Dec 16, 2023 6:29 pm What happens to p17 and p9 when you move slot32 into the p438 panel? I see there is a line still, but no data. Is it possible to create a subpanel under slot32, using the same steps used to create slot32, to achieve the switchable damage texture you mentioned on another post?
when you move slot32 they move with slot32 (slot32 hierarchy is collapsed in image)
Tethys wrote: Sat Dec 16, 2023 6:29 pm Looking at the hierarchy, parent is bsp1214; you should open bsp1208 and bsp1215 and maybe you get lucky?
get luck how? you already know where the polygon damage spot is placed on top of, placing it anywhere else would cause even more flickering or not to display at all.
Tethys wrote: Sat Dec 16, 2023 6:29 pm I have no idea what all is going on there but it looks like more than what BotF needs for a ship model in my opinion. I wish we knew more about these bsp entries.
the code reads bsp planes to tell game engine what polygons to display in front of a polygon that might not be visible from that angle.

if game used z-buffer no bsp planes would be needed at all.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: How to place scar1.hob on hull

Post by Tethys »

I am currently doing some independent research wrt to binary space partitions, as they are called, it seems like you can in fact have bsp2/bsp2a or alternate. Question is.. does BotF support it? I have currently 5 tabs, various sources, opened and maybe after some reading might be able to come up with some options.

Does Falcon 4.0 use damage textures for their aircraft? I am not sure but I suspect there are some happening, but more like an explosion damage so probably a little more complex as the polygon might be dynamic (moving)?
get luck how? you already know where the polygon damage spot is placed on top of, placing it anywhere else would cause even more flickering or not to display at all. the code reads bsp planes to tell game engine what polygons to display in front of a polygon that might not be visible from that angle.
Making an exact duplicate of slot32 is not possible? How about building a hierarchy from slot32 downward so when additional damages are taken, the scar 'grows' and changes (by way of new bsp scar placing atop the old one, slightly larger, and more defined in shape).

Also, do you know what functions p17 and p9 have wrt slot32 and the damage event?

Related but a little off topic: I've been reading the bsp plane can be used to create a bump map. I don't think BotF will benefit currently from a bump map because of how low quality our models are. It would probably look very silly :roll:
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: How to place scar1.hob on hull

Post by Tethys »

This is the first resource I have opened and am skimming. This one tells about the BSP creation, bump mapping, and "Representation of Polyhedra" but it is very small and not very informative, but is demonstrating the process visually.
http://www0.cs.ucl.ac.uk/staff/j.kautz/ ... SPTree.pdf

Question: How many planes can be used for one polygon (p438) ? Any plane which crosses the co-planar is split, if that makes any sense. What happens if you try to have 2 root planes?

Edit: Reading on a forum suggests the BSP "blocks out" parts of the models to reveal the face underneath, quick shape blocking. I imagine this what is happening in BotF that a part of the hull (polygon shape in this case) being removed from texture/model and the scar1 being shown under the removed portion of the hull. This hypothesis goes in hand with your "dead hulk" theory about what the devs had planned if they had more time. Adding and subtracting the bsp is apparently pain in the ass. Reading more, thinking more. Edits to come.

Edit: Second resource I am skimming looks to be quite informative. Perhaps it will help us go. :wink: Page 10: Partitioning Tree as a Hierarchy of Regions https://www.cs.cmu.edu/afs/andrew/scs/c ... torial.pdf
"For curved objects, the regions c o n v e r g e
in the limit to the curve/surface. Truncating the tree produces an approximation, ala t h e
Taylor series approximations of functions."
"Beam-tracing can also be used to efficiently compute shadows. All of this requires as a basics operation an algorithm for merging two trees."
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7848
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: How to place scar1.hob on hull

Post by thunderchero »

Tethys wrote: Sun Dec 17, 2023 8:51 am it seems like you can in fact have bsp2/bsp2a or alternate. Question is.. does BotF support it
I doubt it, creator would need to support it and I have not seen those options in creator.

with simple models (vanilla borg cube 6 polygons) you don't even need bsp planes, if polygons are sorted properly. :wink:
Tethys wrote: Sun Dec 17, 2023 8:51 am Does Falcon 4.0 use damage textures for their aircraft?
yes but iirc it uses starbase type of damage texture.
Tethys wrote: Sun Dec 17, 2023 8:51 am Making an exact duplicate of slot32 is not possible?
in creator yes it is possible but would require different/higher slot number to display after smaller damage area. placement in bsp planes of new/larger damage might need to be before or after slot32?
Tethys wrote: Sun Dec 17, 2023 8:51 am Also, do you know what functions p17 and p9 have wrt slot32 and the damage event?


the vertex is just the center point of damage texture, (matrix values rolls, rotates and scales texture into position)
the polygon is deleted before conversion (I used polygon only to see proper placement before conversion)
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1883
Joined: Sun Apr 27, 2008 2:00 am

Re: How to place scar1.hob on hull

Post by Spocks-cuddly-tribble »

Hi Tethys,

the hob (creator) data just determines position, orientation, scale and rotation based on model centerpoint/direction (12 four byte floats each damage spot). First three is coordinates other nine 3D transformation matrices (creator is just needed to display and calculate those).

Random different scar files is a trek.exe project (all HOB features need trek.exe code):

You can replace the 5th byte in scar1.hob string with 0x30+random-X at asm 49FB29 (extra code needed), but I doubt it will work as intended.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: How to place scar1.hob on hull

Post by Tethys »

So by default, BotF exe can only select one scar per location? Cheaty way sounds to be creating multiple scar polygons per location and hope BotF does not choose them in sequence... if it does, a workaround is to increase the size of the scar per amount of damage the ship takes (as would be assumed the sequence happens). 16 slots, you can have 4 scars and 4 locations on a model for damage to happen. Light damage: Small scars. Medium damage: Scars a little bigger. Medium heavy damage: Scars biggest. Heaviest damage (ship ~1hp): New scar type = Biggest scar with little ones surrounding it.

Greetings SCT :up:

I read in previous post that the damages will show more scars as the ship becomes more damaged. It makes sense. So the 4x4 scar thing would go something like this?:

Slot32 smallest scar, slot33 location smallest, slot34 smallest, slot35 smallest > make each small scar happen before a larger one on the model
Slot36 larger, slot37 larger, slot38 larger, slot39 larger > make each larger scar happen as ship is taking more damages
Slot40 largest, slot41 largest, slot42 largest, slot43 largest > same as above
Slot44 new, slot45 new, slot46 new, slot47 new > slot32,36,40, and 44 share location, same for the rest.

Alternatively you could do 3 different scar sizes on 5 locations using 15 slots and the 16th slot could be a huge scar in a new location. :up:

Another option is having slot36 scar become active before slot35 scar so it would be assumed that you would just swap their locations so the small scar happens after the first scar becomes enlarged.

Question: What is the significance of p438? Is it just one of many locations which can be used to place a scar? What if I wanted to place the scar on the opposite side of the saucer underneath? Or on the rear side of the saucer? p438 still? I reread the first post and it assumes any polygon location can be used? As long as the scar is placed into the same plane in the hierarchy as pxxx it is good, correct? I suspect my above theory would work but you might have to resize or rescale the scar.hob for the smaller scar, or texture.. Another thought is what if you put the children scars into the plane with p17 and p9 under slot32? My guess is that both scars might appear simultaneously. Only testing would know for sure.
Last edited by Tethys on Sun Dec 17, 2023 1:31 pm, edited 1 time in total.
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1883
Joined: Sun Apr 27, 2008 2:00 am

Re: How to place scar1.hob on hull

Post by Spocks-cuddly-tribble »

Extending/modifying the hob slot data should require unrealistic trek.exe and MPR overhauls.

I think depending on the [health ratio] or hull damage percentage vs max number of damage spots in the ship hob it 'fills' the displayed spots in order of the slot IDs: viewtopic.php?p=58404#p58404 So big/small displayed damage spot scale has nothing to do with real damage ratio.

But you might be able define new trek.exe code for different random scars for the same spot (size/scale still via slot data).

Things get laborious if you want them not random but defined for each slot (extra trek.exe data needed like the phaser slot bitmask values).
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: How to place scar1.hob on hull

Post by Tethys »

Sorry, I was under the impression there was 16 damage slots, rereading that topic I see there are only 12. So, 4 scar locations, and 3 scar sizes. Or 6 scar locations, 2 sizes.

I do have another question: Is it possible to select more than one polygon for the scar to appear on? Spread it over a wider range of the model? Ctrl and click the polygons nearby and include them? :???:
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7848
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: How to place scar1.hob on hull

Post by thunderchero »

Tethys wrote: Sun Dec 17, 2023 12:49 pm Question: What is the significance of p438? Is it just one of many locations which can be used to place a scar?
Is it just one of any location, that polygon had a large area and polygons surrounding p438 were very close to the same plane.

main problem with even wasting time on damage texture is they can not contour to a surface (vanilla models have same issue), so if damage area is bigger than polygon area it will flicker and not display properly. so to me not worth effort any more.

now the bugged starbase damage could be interesting if texture transparences worked. you could have ships with holes blown out, missing/destroyed nacells ect.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: How to place scar1.hob on hull

Post by Tethys »

thunderchero wrote: Sun Dec 17, 2023 1:58 pmso if damage area is bigger than polygon area it will flicker and not display properly. so to me not worth effort any more.
So then you start with a very small scar, perhaps not even a scar but just a discoloration at first. Prominent enough to be seen as damage but not penetrating the hull. From there your layer on top the current scar and when damage occurs in sequence, the scar changes from a discoloration to a scar. I think it would be kinda neat, but then every ship would need to have them added and well that seems like it would take a number of years for one person to successfully complete.
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”