Loading [MathJax]/extensions/Safe.js

Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 4   Go Down

Author Topic: A vexing problem with instrument damage SOLVED  (Read 8029 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6181
A vexing problem with instrument damage SOLVED
« on: January 31, 2017, 08:57:06 AM »

I'd have released my latest Wildcat cockpit mod by now, except I'm in hair-pulling mode over the instrument damage textures--they do not show up at all, ever. Neither for my modded mesh not for the stock mesh when I disable mine (and restart the game, of course, in case anyone might think to suggest that. ;) )

For other planes I've checked out, all is fine.

When I 'un-hide' the Panel_D1.msh in hier.him by entering "//Hidden" (and hide the Panel_D0.msh), the damage textures do all show up, replacing the normal, undamaged ones.

But after oodles of test flights no amount of blasting by the enemy ever brings up a single damaged instrument. The canopy bullet holes, hull holes and oil splats behave as expected, though.

My textures are no larger than 512 pixels square. No error messages show up in log.lst nor in the console listing when I bring it up in the game.

This problem is most vexing. Anyone have any ideas for me to try?
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

western0221

  • Modder
  • member
  • Offline Offline
  • Posts: 6790
  • Live in Japan
    • IL-2 itaki blog
Re: A vexing problem with instrument damage
« Reply #1 on: January 31, 2017, 09:06:51 AM »

Look into your editing cockpit's classfile source code.

It may do visible / invisible status checking and forcing in each damage msh nodes in each 1/60 sec tick() loop.
So, even you set non hidden code to the damage msh node in cockpit's hier.him in commenting-out the line, at the first 1/60 sec of the mission time, the cockpit classfile makes it hidden because of the cockpit is not damaged in java values.
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6181
Re: A vexing problem with instrument damage
« Reply #2 on: January 31, 2017, 10:36:41 AM »

Thsnks for the quick response! A most interesting and potentially promising path to take. If only I was set up to do Java coding! Unfortunately I've not ventured into this sphere of modding.

If this is the source of the problem, why should it occur for just one plane (and a variant) but not others? I have no other Wildcat mod installed; I'm merely building on the stock plane as appears in 4.08 (and most likely 4.09, if not even later versions.)

By the way, when I make the mesh un-hidden in hier.him, it *always* displays the damaged instrument textures. And so if in this forced state of immediate visibility the behavior is reliable, then why not also reliable when I make the mesh hidden, as is the normal state?
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

western0221

  • Modder
  • member
  • Offline Offline
  • Posts: 6790
  • Live in Japan
    • IL-2 itaki blog
Re: A vexing problem with instrument damage
« Reply #3 on: January 31, 2017, 10:45:17 AM »

A temporary testing proposal.

From those hier.him lines:
Code: [Select]
[Panel_D1]
Mesh Panel_D1
Parent _ROOT_
Hidden
Attaching 0 1 0 0 0 1 1 0 0 -0.18219 0.12378 -0.09904

add one temp node
Code: [Select]
[Panel_D1]
Mesh Panel_D1
Parent _ROOT_
Hidden
Attaching 0 1 0 0 0 1 1 0 0 -0.18219 0.12378 -0.09904
[Panel_D1temp]
Mesh Panel_D1
Parent _ROOT_
Attaching 0 1 0 0 0 1 1 0 0 -0.18219 0.12378 -0.09904

This new node "Panel_D1temp" is not controled any by java classfile, maybe always visible.
You can check how it is looked by pilot's eyes.
After checking and you'll satisfied your work, delete that new temp node (or recovering original hier.him file from a backup folder).
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6181
Re: A vexing problem with instrument damage
« Reply #4 on: January 31, 2017, 04:16:46 PM »

I already have verified that things look OK, by putting "//Hidden" in the entry for [Panel_D1], and "Hidden" for [Panel_D0]. In this way the undamaged textures are invisible, and the damaged textures are always seen. (If I leave both un-hidden, they are both seen, flashing rapidly.)

In the extracted hier.him from my 4.08, [Panel_D1] has "Hidden", of which I assume is normal.

But in the downloaded hier.him included in the F4F-4 repaint (as part of a large number of cockpits) available here at SAS, there is NO "Hidden" entry for [Panel_D1]. This seems odd to me, because other stuff like glass damage, oil splats and hull holes are "Hidden". (Hier.him was not included in the -3, presumably because it did not include my new N-2 gun sight, whereas the -4 did include my Mk. 8.)

Such discrepancies do nothing to allay my confusion. ;)

I already know that my textures are OK when I make them always visible, replacing the undamaged ones.

I just want to ensure that they behave properly and become visible when the game's damage modeling code commands. I have added some new elements to improve things, and need to know they cause no problems.

With even the stock Panel_D1.msh not working as it should, I have the wonder if my textures are at fault. But I can't see why this should be so, if they display correctly when I un-hide them. And they're not unlike other damage textures in numerous other cockpit repaints.

Maybe I should just release my mod package and see what happens for other users?
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6181
Re: A vexing problem with instrument damage
« Reply #5 on: January 31, 2017, 09:59:09 PM »

Now I'm wondering if this could be a factor.

In Panel_D0 I added several new elements, principally glass textures that float 3mm above the dial faces. The more usual practice is to include such elements in an existing .mat file, as an additional layer. But this approach can only place such doubled up textures in the same plane, not separated by a distance as I wish to model things.

So, could it be that by adding elements not specifically 'initialized' or otherwise defined in the cockpit class file that this inhibits the replacement of the undamaged textures with the damaged ones?

I suppose I could test this theory by adding some stuff to a mesh known to work fine and see what results...
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 24053
  • Taking a timeout
    • STFU
Re: A vexing problem with instrument damage
« Reply #6 on: January 31, 2017, 11:33:09 PM »

Panel_D0 is the undamaged panel mesh.
If you want to add some materials or textures to the damaged panel, you have to do it on Panel_D1.
This is the Java code for a damaged Wildcat panel:
Code: [Select]
        if((fm.AS.astateCockpitState & 0x40) != 0)
        {
            mesh.chunkVisible("Panel_D0", false);
            mesh.chunkVisible("Panel_D1", true);
            mesh.chunkVisible("Z_CylTemp1", false);
            mesh.chunkVisible("Z_Altimeter1", false);
            mesh.chunkVisible("Z_Altimeter2", false);
            mesh.chunkVisible("Z_Speedometer1", false);
            mesh.chunkVisible("Z_TurnBank1", false);
            mesh.chunkVisible("Z_TurnBank2", false);
            mesh.chunkVisible("Z_Climb1", false);
            mesh.chunkVisible("Z_RPM1", false);
            mesh.chunkVisible("Z_AirTemp1", false);
            mesh.chunkVisible("Z_Fuel1", false);
            mesh.chunkVisible("XHullDamage4", true);
        }

For non-Java-guys:
If the panel gets damaged, hide "Panel_D0" and show "Panel_D1" instead.
At the same time, hide these gauges since their damaged version is part of the "Panel_D1" mesh, that's because the gauges are broken and don't need to be animated anymore: Cylinder Temp, Altimeter, Speed gauge, Turn&Bank indicator, Variometer, RPM gauge, Temperature gauge, Fuel gauge.
Finally, show the "XHullDamage4" mesh which most probably shows some additional damage around the panel.

Best regards - Mike
Logged
Don't split your mentality without thinking twice.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6181
Re: A vexing problem with instrument damage
« Reply #7 on: February 01, 2017, 01:39:04 AM »

Mike,
Thanks a bunch for the extra insight!

I probably did not make myself clear before. I was mentioning the undamaged Panel_D0.msh only in the context of the *possibility* of the new elements I added there being a fly in the ointment when they were to be removed and replaced by the damaged versions.

For instance, I've created a completely new GP_02_2.tga and .mat, which create a separate set of cover glasses positioned 3mm above the gauge faces for those contained in GP_02.tga. The same scheme applies for other of the gauge graphics. I undertook to do this so that the needles were actually *under* glass, not floating above the glass as is the case when just a single texture represents the gauge face and its glass.

Ultimately, I'd like to know that I can do the same for the damaged gauges, especially when the cracks in the glass would partially obscure the underlying needle. It looks awful to have a fully visble needle floating *above* the broken glass!

I take it that as soon as a gauge state indicates it's broken, the moving part or parts associated with it are simply not drawn. And I assume there is code which controls each gauge, or perhaps a subset of gauges, individually, so that not all are busted at the same moment. In other words, the *entire* contents of Panel_D1.msh to not completely replace Panel_D0.msh in an instant, but instead parts of it 'take over' more and more as damage continues to be inflicted. Or am I wrong?

Now, my ultimate question is this. Does adding brand new elements to Panel_D0.msh and Panel_D1.msh, such as the aforementioned GP_02_2.tga/.mat, cause problems? Or can one add all manner of new stuff willy-nilly? Or will Java code have to be written?

My concern stems from the suspicion that resources must be defined so that the code knows which stuff to switch off and which stuff to replace it with. If the engine has not been 'told' that GP_02_2 is related to GP_02, how would it know to handle the former as part of the latter, simultaneously?

And further insights (no need for an exhaustive epistle; a clue or two will do) would be most appreciated. Thanks again, Mike!
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 24053
  • Taking a timeout
    • STFU
Re: A vexing problem with instrument damage
« Reply #8 on: February 01, 2017, 09:39:59 AM »

Actually the whole panel gets damaged at once, as do all gauges listed above.
When you put additional damage meshes a few millimeters "on top" of the panel mesh, then it's quite likely that the "working" gauges are even some millimeters above your new mesh.

The damage code works like this:
The whole undamaged panel gets hidden and the damaged one is shown instead.
The gauges listed get hidden at the same time, all at once, and instead of the original gauges a static drawing is shown, consisting of the damaged panel mesh and it's textures.
The gauges become fixed part of the damaged panel and are not animated anymore.
To be precise, the animation still takes place, but on the undamaged, hidden gauges, and therefore you cannot see it anymore.

If you want to try damage meshes and textures, I would do it like this:

Rename your panel_d1.msh to panel_do.msh (and keep the original panel_d0.msh in a safe place).
Open the cockpit's hier.him and set all gauges to "hidden" which would become invisible when the panel gets damaged.

Now your damaged panel should show up right on spawn time.

Best regards - Mike
Logged
Don't split your mentality without thinking twice.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6181
Re: A vexing problem with instrument damage
« Reply #9 on: February 01, 2017, 02:43:34 PM »

I have already verified that the damaged gauges textures are looking as intended, by simply hiding _D0 and unhiding _D1. Upon spawning all damaged gauges textures are drawn. In like manner, to check hull holes, glass holes and oil splats, I just unhide those meshes. In this way I can assess instantly the full state of maximum damage when checking for correctness of placement and such.

Does your suggested method of renaming _D1 to _D0 result in a difference in the way stuff is drawn? I know it's only for checking, which I can already do via the hiding/unhiding of the two panel meshes in hier.him.

If I can see my work when I deliberately force its visibility, why can it not ever display during gameplay, when I'm certain the conditions are present (plane shot to scrap metal, with *every* other damage graphic drawn)? This is what's wrinkling my brow.

I'm on the verge of releasing version 3 as it is, and see what users encounter. It might just be some corruption in my installation? Maybe if I had a cockpit class file to try out?
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

karo

  • member
  • Offline Offline
  • Posts: 111
Re: A vexing problem with instrument damage
« Reply #10 on: February 01, 2017, 03:59:56 PM »

I think that you should release it and wait for a feedback from users. No worries! We will put it to the complex test for you ;)
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6181
Re: A vexing problem with instrument damage
« Reply #11 on: February 01, 2017, 04:53:19 PM »

I just disabled all my Wildcat mods, going back to stock, and *still* the instrument damage textures never show up when I get shot to ribbons.

Can anyone confirm that their Wildcat is behaving correctly in this respect? Ideally another 4.09 diehard, but for *any* version will make a good start. ;)
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)
Pages: [1] 2 3 4   Go Up
 

Page created in 0.039 seconds with 20 queries.