Special Aircraft Service

Please login or register.

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

Author Topic: Stearman (as from BAT 4.2.1) compass fix  (Read 2642 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Online Online
  • Posts: 5931
Stearman (as from BAT 4.2.1) compass fix
« on: December 29, 2022, 06:24:46 PM »

UPDATE, Dec 30, 2022:  This release completely supersedes my earlier one, and is named differently so that it resides higher up in your mods listing in order that the included classfiles do not get ignored. Delete the old mod, if you have it!

The Java has been corrected for the proper compass card I provide, and also incorporates a delayed response as well as bank/pitch limits to free rotation.

The 'dirtiness', surface normals and obscuration by intervening objects for the compass glass is fixed.

-----------------END of UPDATE--------------------


A screenie from the mesh viewer utility (hence the magenta external skin). Of note:
- New (dirty) glass cover, with lubber line.
- Correct conical taper on the card.
- The card has more polygons for smoother roundness.
- Improved texture on the card.
- Number order is now correct (but does the card spin the wrong way?)
- Instead of the former nearly 180 degrees being seen, the more correct ~120 degrees is visible.





Get it here (This is a differently named archive, replacing the first; delete your older version):

https://www.mediafire.com/file/l3roq0bx6137zrf/%25210_Stearman_compass_fix.7z/file


From the included, updated readme file:

Stearman magnetic compass fix, for Asura's new cockpit introduced in B.A.T. 4.2.1
---------------------------------------------------------------------------------

IMPORTANT NOTE! Due to now including class files, I've renamed the folder so that it will reside above any B.A.T. folders containing the same classfiles. This means that the old mod is completely superseded, and should be deleted.

This archive replaces my first. (I should have thought ahead and named it appropriately.)

==================================================================================

FIRST ROUND, Dec 29, 2022

This little mod began as a fix for a misplaced digit on the magnetic compass card.

While addressing that, it was discovered that the numbering was reversed. (It remains to see if the rotation direction is correct or not!) And on top of that, the scale was doubled and repeated, meaning the 360 degrees was divided into 720 degrees!


While on this task, I decided to:
- Improve the card texture
- Give the card the correct conical taper common to magnetic compasses
- Enlarge the card so that the correct ~120 degrees is seen through the window (as opposed to near 180 degrees previously)
- Supply a new glass window upon which the lubber line is present (to facilitate a more accurte reading)


The two .him files are present only bacause the larger compass cards required to push them farther inside the instrument, lest they protrude outside.


The two Body.msh files have only had the CAMERA and CAMERAAIM hooks moved a little farther forward. If you don't like this, simply remove:
  Body.msh
  BodyC.msh

==================================================================================

SECOND ROUND, Dec 30, 2022

Upon receiving the necessary plane folder and classes so as to install this plane into my B.A.T. 4.0 game I could address the compass code in the cockpit classes.

To compensate for both the doubled (720 degree) scale and it's reversal in printing, I removed the compensatory -0.5 factor in the update method. Now the rate and direction of compass card rotation is correct.

I've implemented a check on bank and pitch angle; when either exceeds 45 degrees the compass card locks in position until said angle decreases.

I've implemented hysteresis, or a slowed response common to fluid-filled magnetic compasses.

-------------------------------------

The compass glass texture has had the 'dirtiness' reduced in intensity. And my formerly incorrect surface normal orientation (which caused the intensity of the 'dirtiness' to be strongest at inappropriate illumination angles) is fixed.

-------------------------------------

The corrected CompassGlass.mat file now has

  tfTestZ 1

Which makes the glass properly lie behind any obstructors in front of it.

-------------------------------------

The Pit2.mat file, applying to the texture for inside-the-cockpit structures, has had the specularity reduced from 0.3 to 0.15, as in

  Specular 0.15  //0.3

If you don't like this, and want to go back to the original, make this line read

  Specular 0.3

-------------------------------------

The six classfiles comprise the two cockpit classes. I include the two cockpit java files, with my changes documented.

In the cockpit classes I added the 6dof code, so as to increase the limits in most directions over those for the default ranges. You can now move about a bit more freely.

==================================================================================


WxTech
Dec 30, 2022

Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

mechanic

  • member
  • Offline Offline
  • Posts: 140
Re: Stearman (as from BAT 4.2.1) compass fix
« Reply #1 on: December 29, 2022, 07:45:55 PM »

Alas, it appears that the changes you have made eliminate the cockpit altogether in BAT 4.2.2 Hotfix3.



Unfortunately, I do not know (at least don't remember) how to locate the cockpit class files for you, but here is the LogLst error:

LOG Error:
Code: [Select]
NTERNAL ERROR: Can't open file '3DO/Cockpit/PT-17/CompassGlass.mat'
WARNING: object '3DO/Cockpit/PT-17/CompassGlass.mat' of class 'TMaterial' not loaded
INTERNAL ERROR: Material: Can't load 'CompassGlass.mat'
INTERNAL ERROR: Material: Can't load 'CompassGlass.mat'

java.lang.RuntimeException: INTERNAL ERROR: Material: Can't load 'CompassGlass.mat'

at com.maddox.il2.engine.HierMesh.Load(Native Method)
at com.maddox.il2.engine.HierMesh.<init>(HierMesh.java:596)
at com.maddox.il2.objects.air.Cockpit.<init>(Cockpit.java:751)
at com.maddox.il2.objects.air.CockpitPilot.<init>(CockpitPilot.java:366)
at com.maddox.il2.objects.air.CockpitPT_17.<init>(CockpitPT_17.java:71)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at com.maddox.il2.objects.air.Aircraft.createCockpits(Aircraft.java:3340)
at com.maddox.il2.objects.air.Aircraft.load(Aircraft.java:2601)
at com.maddox.il2.game.Mission.loadAir(Mission.java:1324)
at com.maddox.il2.ai.Wing.load(Wing.java:143)
at com.maddox.il2.game.Mission.loadWings(Mission.java:1095)
at com.maddox.il2.game.Mission._load(Mission.java:667)
at com.maddox.il2.game.Mission.access$600(Mission.java:124)
at com.maddox.il2.game.Mission$BackgroundLoader.run(Mission.java:412)
at com.maddox.rts.BackgroundTask.doRun(BackgroundTask.java:155)
at com.maddox.il2.game.MainWin3D.loopApp(MainWin3D.java:108)
at com.maddox.il2.game.Main.exec(Main.java:422)
at com.maddox.il2.game.GameWin3D.main(GameWin3D.java:235)
1>mp_dotrange FRIENDLY DOT 14.000001 COLOR 6.0000005 RANGE 6.0000005 TYPE 6.0000005 ID 6.0000005 NAME 6.0000005 ALTICON 0.1 ALTSYMBOL + ALTCOLOR 0
1>mp_dotrange FOE DOT 14.000001 COLOR 6.0000005 RANGE 6.0000005 TYPE 6.0000005 ID 6.0000005 NAME 6.0000005 ALTICON 0.1 ALTSYMBOL + ALTCOLOR 0
Mission: QuickQMBPro/BAT_SandsOfTimeR/BAT_SandsOfTimeRrednone00.mis is Playing
ObjState.finalize: Object of com.maddox.il2.objects.air.CockpitPT_17 NOT destroyed
Time overflow (0): speed 0.75757575
INTERNAL ERROR: HierMesh: Can't find chunk 'Water_D0'
INTERNAL ERROR: HierMesh: Can't find chunk 'Goertz_D0'
warning: no files : music/inflight


p.s. I am great fan of watching you work magic with your various BAT effects.
Logged

WxTech

  • Modder
  • member
  • Online Online
  • Posts: 5931
Re: Stearman (as from BAT 4.2.1) compass fix
« Reply #2 on: December 29, 2022, 07:53:04 PM »

I overlooked the inclusion of CompassGlass.mat!!! It seems I can barely do a job without some little screw up.  ;)

Archive updated.


If one doesn't want to re-download, and is comfortable creating a file, here's the content of CompassGlass.mat
Code: [Select]
[ClassInfo]
  ClassName TMaterial
[General]
  tfDoubleSide 0
  tfShouldSort 0
  tfDropShadow 0
  tfGameTimer 1
[LightParams]
  Ambient 1.0
  Diffuse 1.0
  Specular 0.1
  SpecularPow 32
  Shine 0.0
[Layer0]
  TextureName CompassGlass.tga
  PaletteName
  Frame 0.0
  VisibleDistanceNear 0.0
  VisibleDistanceFar 10000.0
  TextureCoordScale 0.0 0.0 1.0 1.0
  ColorScale 1.0 1.0 1.0 1.0
  AlphaTestVal 0.0
  tfNoDegradation 1
  tfWrapX 1
  tfWrapY 1
  tfMinLinear 1
  tfMagLinear 1
  tfMipMap 0
  tfBlend 1
  tfBlendAdd 0
  tfTestA 0
  tfTestZ 0
  tfUpDateClear 0
  tfModulate 1
  tfNoTexture 0
  tfAnimatePalette 0
  tfAnimateSkippedFrames 0
  tfNoWriteZ 1
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Online Online
  • Posts: 5931
Re: Stearman (as from BAT 4.2.1) compass fix
« Reply #3 on: December 29, 2022, 08:05:35 PM »

I might add that due in part to doing this stuff with a spreadsheet, I was beavering away on this little job all day, for about 9 hours.  ;)
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

mechanic

  • member
  • Offline Offline
  • Posts: 140
Re: Stearman (as from BAT 4.2.1) compass fix
« Reply #4 on: December 29, 2022, 08:25:44 PM »

...and Bob's-Your-Uncle. Inserting the new CompassGlass.mat file did the trick. The cockpit and new corrected compass dial are working in BAT 4.2.2 Hotfix 3. Brilliant! Thanks!

 

Logged

mechanic

  • member
  • Offline Offline
  • Posts: 140
Re: Stearman (as from BAT 4.2.1) compass fix
« Reply #5 on: December 29, 2022, 08:32:19 PM »

oops, not so fast. Just noticed in the screenshot I took that the lubber line is floating above the compass dial.
Logged

WxTech

  • Modder
  • member
  • Online Online
  • Posts: 5931
Re: Stearman (as from BAT 4.2.1) compass fix
« Reply #6 on: December 29, 2022, 08:48:34 PM »

oops, not so fast. Just noticed in the screenshot I took that the lubber line is floating above the compass dial.

Unless there's some different way in which the transparency is handled in your install, the lubber line is 'printed' on the glass cover, and so is seen to be slightly in front of the compass card.

Now, because I don't have the plane and cockpit classes (and the external plane model, either), I can't test things in my game. It's possible that the .mat file might require one or more tweaks. I know that the mesh viewer utility does not always handle textures (and more so those having transparency) the same way as the game does.

A screen shot in close-up detail would be helpful. Actually, the full plane and classfiles would be the best solution for me.  😀
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Online Online
  • Posts: 5931
Re: Stearman (as from BAT 4.2.1) compass fix
« Reply #7 on: December 29, 2022, 08:55:38 PM »

mechanic,
Your small screenshot is too tiny for me to see anything, and clicking on it only brings me to the hosting site; I can't get a bigger version.

I'm wondering if the glass texture, whose size is a bit bigger than the window opejing, is seen through the compass face instead of having the edges hidden behind the perimeter of the opening. A close-up screenie should reveal if this is the case. And put the Sun somewhat behind you for better lighting.  ;)

Other than that, does the card rotate correctly and put the correct tick mark in line with the lubber line?
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

mechanic

  • member
  • Offline Offline
  • Posts: 140
Re: Stearman (as from BAT 4.2.1) compass fix
« Reply #8 on: December 29, 2022, 09:41:40 PM »







Here are two enlarged pictures. One is the screenshot, the other has the lubber line circled for clarity.

The compass card rotates, the new lettering and ticks are clear, and eyeballing it, the lubber line seems to line up with the tick marks on the card,  but:
1. When turning port from a north heading the compass shows a track to the East rather than West - so the compass headings are reversed
2. There is no West cardinal at all
3. Heading "East"  through the South cardinal and then coming up to what be the West, the compass briefly and barely shows 24,,21,, then just jumps to the North cardinal. The same occurs if the direction is reversed. So there is no real 360-degree cycle on the compass.

Hope this is helpful, but it sounds like you really are going to need the full plane and class files to work the spread sheet. That I will have to leave to others to retrieve for you.  Again thanks for all your efforts. I will be happy to keep testing.

Logged

WxTech

  • Modder
  • member
  • Online Online
  • Posts: 5931
Re: Stearman (as from BAT 4.2.1) compass fix
« Reply #9 on: December 29, 2022, 10:21:13 PM »

mechanic,
In your screenshot it appears the front cockpit compass glass texture is appearing through the hull, and the rear cockpit glass is not seen at all. It should be fixable by judicious tweaking of the .mat file.

Far more concerning is the odd card behavior. I can't see what would have changed, assuming the stock one turned freely/properly. I merely made a new mesh, which should  be able to turn in the same manner as the old one.

I'll just have to await the gift of a plane extraction in order to delve properly into this...
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Willyp

  • member
  • Offline Offline
  • Posts: 101
    • Military Arms Photos
Re: Stearman (as from BAT 4.2.1) compass fix
« Reply #10 on: December 30, 2022, 09:01:52 AM »

Wx, not sure if this is what you need but I did a "dump" in a stock BAT 4.2.1 hotfix3, Stearman, only things I saw were the 3do folders for the plane and cockpit, found no fm or class files in the dump (but never did this before so not sure what I'm doing lol). Here's a link for the zip download https://www.mediafire.com/file/iv58pc57uwjad9z/PT17_Stearman.zip/file hopefully this is what you need, let me know, and Thanks for all you do for all of us!

Disregard link above, go to reply #14 new download w/class files included there. Sorry, tried to change it here but I couldn't get it to take.
Logged
Intel I9-9900K 4ghz CPU, Nvidia 2080Ti 11gb GPU, 64Gb DDR4-3200ram, 2Tb SSD boot, 4Tb SSD, 2Tb SSD, 8Tb 7200rpm HDD+32Gb Intel Optane

Epervier

  • 4.09 Guardian Angel !
  • SAS Team
  • member
  • Offline Offline
  • Posts: 9507
  • I'm French and Rebel_409! Nobody is perfect!
    • Some tinkering here
Re: Stearman (as from BAT 4.2.1) compass fix
« Reply #11 on: December 30, 2022, 10:43:22 AM »

Wx, not sure if this is what you need but I did a "dump" in a stock BAT 4.2.1 hotfix3, Stearman, only things I saw were the 3do folders for the plane and cockpit, found no fm or class files in the dump
:D
The Classes are in "#WAW3\Classes-BAT\com\maddox\il2\objects\air" !
The FMs are in "#WAW3\Classes-FMs" or in buttons (#WAW3\STD\gui\game) !
Logged
If your results do not live up to your expectations, tell yourself that the great oak was once an acorn too. - Lao Zi -
Pages: [1] 2 3   Go Up
 

Page created in 0.031 seconds with 27 queries.