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: Configurable Increased Visibility Distance Mod for B.A.T.  (Read 7568 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5531
Configurable Increased Visibility Distance Mod for B.A.T.
« on: November 04, 2021, 08:29:09 PM »

UPDATE

This is a fully configurable version for B.A.T., just like whistler's original mod for 4.12. It fully replaces my first version, which was limited in that it offered four sets of fixed distance limit values. Delete my previous version. Now you will have full control! Get it here:

https://www.mediafire.com/file/lpah0bublye282l/%2521%2521%2521_Long_Visual_Distance_for_BAT_custom.7z/file

 From the included readme file:


Increasing the visibility distance for objects and effects, for B.A.T. (and perhaps 4.12).


Whistler (of NG-MAP, NG-HUD, NG-CAM and NG-PAL fame) introduced this increased visibility limits mod for 4.12 a few years ago. Since the creation of B.A.T., it was suggested that this approach would not be appropriate or viable due to some new way certain objects' visibility was handled. Very soon after jumping straight from 4.12.2 to B.A.T. 4.0, and noting the similar, limited visibility limits, I adapted this mod for my own B.A.T. 4.0 game. Instead of using the capacity of adjustability via four editable parameters in the [Mods] section of conf.ini, I made fixed values in World.class, based on having settled upon a set that worked well for me. And thus far it's worked as expected.

################################################################################################

Due to the introduction of triggers in B.A.T. 4.1.2, it's necessary to offer this mod in two versions:

- One for B.A.T. 4.1.1 and earlier. This should be OK for non-B.A.T. 4.12 as well, I think.
- One for B.A.T. 4.1.2 and later.

The three classfiles in the root folder (same place as this readme file) are for the LATER B.A.T. versions. If you're still running B.A.T 4.1.1 or earlier (including non-BAT 4.12?), copy and paste the three classfiles from its folder.

These are the three classfiles which comprise World.class:
  8A318408BB7C513E  (this is the main class)
  64F83BC6574C11DE
  949499C0F4E85D88

As a user of mods, you should already have a section in conf.ini (located in your game's root folder) called:

[Mods]

===== In the [Mods] section in conf.ini, paste the following 8 lines of text: =====

;MaxVisualDistance=5000 //- effects?
;MaxStaticVisualDistance=4000 //- objects?
;MaxLongVisualDistance=10000 //- big ships?
;MaxPlateVisualDistance=16000 //- runways?
MaxVisualDistance=20000
MaxStaticVisualDistance=8000
MaxLongVisualDistance=20000
MaxPlateVisualDistance=20000

===== Paste into conf.ini the 8 lines of text above this line =====================

I include 'remarks', preceded by ";" characters ("//" are also used for the same purpose), as reminders of what the stock values are and what the parameters control. The game will not remove or overwrite such lines of text as it executes overwrites to conf.ini, which is handy as you forget things over time. Now, if you like things to be nice and clean, you can certainly dispense with the first four remarks lines, pasting only the last four lines.

The four values supplied above are of course editable to suit your preferences; suggestions are provided below. Note that any change to conf.ini requires to restart the game in order to take effect.

The distance variables, what I think they control, and the stock values (in meters):

  MaxVisualDistance = 5000 - effects?
  MaxStaticVisualDistance = 4000 - objects?
  MaxLongVisualDistance = 10000 - big ships?
  MaxPlateVisualDistance = 16000 - runways?

I first offered a mod that contained four sets of values, which is superseded by this version which now offers you complete control of setting the individual values. Here are those four sets of values (plus stock) I previously supplied and which you might consider as starting points from which to further refine:

  STOCK: 5000, 4000, 10000, 16000

  Shortest: 10000, 8000, 15000, 20000
  2nd Shortest: 15000, 10000, 20000, 20000
  2nd Longest: 20000, 12000, 20000, 30000
  Longest: 30000, 15000, 30000, 30000

I find the "2nd Longest" to work well enough for me. In good part because the longest view distance for certain of my own effects is 20km. You can of course mix things up as you see fit. For instance, if you want only to see smokes at long distance, and keep to the stock limits otherwise, you could set the limits as, say, 20000, 4000, 10000, 16000.

################################################################################################

Note that for effects the max distance as set in a texture's .mat file is the ultimate limiter on visibility distance. For objects such as buildings, both the .mat file and the farthest LOD value in the mesh *might?* need to be altered. If one wanted to boost the visibility distance, the relevant .mat file would have to be extracted from SFS, if not already available in a mod. Then the line

  VisibleDistanceFar 5000

would have the numeric value altered as desired (here being 5000m, or 5km).

If a .mat file adjustment turns out to be insufficient, then in the mesh for the object we would increase the value given to the farthest LOD, which is the last one listed. For example, from one of the Body.msh files for the highway bridge, we have:

[LOD]
200
350
700
900
1500
3500

These numbers are not necessarily directly tied to a specific visibility threshold. That's because the screen pixel pitch and FoV (field of view) play roles as well. (Recall that an object not visible at a wide FoV can pop into visibility when zooming in.) The last, largest number, corresponding to the switching on/off of the lowest detail, farthest LOD, could be increased in increments until the desired result obtains.

I include the Java for this class, in both the early and later B.A.T. versions. The relevant changes made are very near the bottom of the code listings.

################################################################################################

In the Java for B.A.T. 4.1.2 (actually 4.13, which I'm given to understand is applicable for the latest B.A.T.), I had to make a small change in order to get the code to compile. It might have been necessary to do this due to a decompiler error. I hope a more capable Java meister will chime in. Here's the original line (line #501, in method checkViewOnPlayerDied(Actor actor) ) and its altered version...

//            Main3D.cur3D().hookView.set(actorviewpoint, 3F * Main3D.cur3D().getClass().defaultLen(), 10F, -10F);
            Main3D.cur3D().hookView.set(actorviewpoint, 3F * Main3D.cur3D().hookView.defaultLen(), 10F, -10F);

################################################################################################

A last note. Classfiles are strange beasts, in that they can still be read by the game even though residing in lower, child folders. For this reason, to be safe against any strange results it might be wise to keep all unused copies/variations of classfiles outside of the game entirely. That means keeping this full mod stored in some 'external repository', and picking ONLY the three classfiles you need and putting them in this mod's root folder.

################################################################################################

As always, this work is offered for use by any and all, for any purpose, without restriction.


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

SAS~tsisqua

  • Tsisqua Tsigawonisgi, but you can call me Bird!
  • member
  • Offline Offline
  • Posts: 461
Re: Increased Visibility Distance Mod for B.A.T.
« Reply #1 on: November 04, 2021, 09:25:48 PM »

Trying this now, Mr. Weather Technician!

  Let me see if I am understanding this correctly:
I chose to use the longest distance version for the latest BAT. So I created a folder which is a copy of the mod's root (!!!_Long_Visual_Distance_for_BAT), and I put in only the three class files from the version I want to try, and nothing else. I then put that folder in the #WAW3 mods folder. Is that correct, Sir? (And thank you, btw, for this offering ;) I'm excited by the prospect of a little more visibility!)
Bird
Logged
"When you have to kill a man, it costs nothing to be polite." Winston Churchill

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5531
Re: Increased Visibility Distance Mod for B.A.T.
« Reply #2 on: November 04, 2021, 09:45:52 PM »

Bird,
You got it, Park Pontiac!
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

SAS~tsisqua

  • Tsisqua Tsigawonisgi, but you can call me Bird!
  • member
  • Offline Offline
  • Posts: 461
Re: Increased Visibility Distance Mod for B.A.T.
« Reply #3 on: November 04, 2021, 10:32:08 PM »

Bird,
You got it, Park Pontiac!

Ahaha!


And wow . . . that was way more than I expected! This is looking pretty cool so far. No problems, and at first it looked like IL2 GE a bit. Only a teeny tiny FR hit though, instead of what happens to me with GE.

Ah crap, see what you've done?!?! Now I have to stay up and fly all night. ;)

Malta, from 5,000ft.

Logged
"When you have to kill a man, it costs nothing to be polite." Winston Churchill

SAS~tsisqua

  • Tsisqua Tsigawonisgi, but you can call me Bird!
  • member
  • Offline Offline
  • Posts: 461
Re: Increased Visibility Distance Mod for B.A.T.
« Reply #4 on: November 04, 2021, 10:48:32 PM »

Still climbing. I'm noticing some objects have started to disappear from view, and some minor flickering before they vanish. Other objects are still hanging around. Nothing disappointing, Glenn. I'm keeping this.

Logged
"When you have to kill a man, it costs nothing to be polite." Winston Churchill

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5531
Re: Increased Visibility Distance Mod for B.A.T.
« Reply #5 on: November 05, 2021, 01:42:59 AM »

Bomb a big ship, and see the big smoke column out to 20km away.

If you browse the .mat files in the materials and texture folders in my effects mod pack, you'll see the max visible distances specified within. Trace back to see what .eff files point to them, and you'll know what effects can be seen to what distance.

A quick way to peruse a raft of files for a particular parameter's values is to do a "search in files" operation in Notepad++ (free, and highly recommended.) For instance, point the search to the root folder of my effects mod when searching for "VisibleDistanceFar". Every .mat file having this parameter will be returned in a list that will include the numeric value assigned for this parameter. If you want to get fancy, copy this listing, paste it into a spreadsheet (using space and tab as separator characters), perform a bit of a clean-up, then sort by distance, if you wish.

Do the same thing in a search for "MatName"; this will return all .eff file names and the .mat file it points to. You could then match up .eff and .mat files, to see what resource is used by what effect.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

ssn637

  • member
  • Offline Offline
  • Posts: 138
  • Men mean more than guns in the rating of a ship
Re: Increased Visibility Distance Mod for B.A.T.
« Reply #6 on: November 05, 2021, 01:55:53 AM »

Wow WxTech, lovin' this mod!   :)

Awesome stuff! 

You guys are amazing!  Thank you!
Logged

Vampire_pilot

  • member
  • Offline Offline
  • Posts: 7989
Re: Increased Visibility Distance Mod for B.A.T.
« Reply #7 on: November 05, 2021, 02:19:34 AM »

This sounds pretty interesting, thanks for looking into this particular subject!

Atoka220

  • Bomber
  • Modder
  • member
  • Offline Offline
  • Posts: 804
Re: Increased Visibility Distance Mod for B.A.T.
« Reply #8 on: November 05, 2021, 06:44:36 AM »

Ah, finally an immersion enhancer for BAT ;D
Sadly mc pc hates me for this mod, so I'll just use 2nd shortest, a balance between passable framerate and immersion
Tho haven't tried any big missions yet with lot of planes or effects
Logged
There are 2 certain things in life: Death and CTDs

Vampire_pilot

  • member
  • Offline Offline
  • Posts: 7989
Re: Increased Visibility Distance Mod for B.A.T.
« Reply #9 on: November 05, 2021, 08:30:29 AM »

And that's one of the reasons why such a mod can't be made for everyone, it has extreme effects on FPS, depending on the mission.

By the way, I also found it to work on airplane mesh display distance. The mesh - if it has a really long value! - remains visible from much farther.
I can see the Macon fully shaped from 10km out now, island in the sky that she is.

Also, ship smoke visibility distance is greatly enhanced.

So apparently, this mod works, if you have a hardware strong enough

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5531
Re: Increased Visibility Distance Mod for B.A.T.
« Reply #10 on: November 05, 2021, 09:40:11 AM »

Perhaps it's worthwhile to revive whistler's approach, and have the four parameters appear in the [Mods] section of conf.ini. Then the player can fine-tune to suit. If, for instance, one wanted only to have a longer visibility threshold for damage smokes, that parameter could be boosted significantly, while leaving the other three at the stock settings, or increased less significantly. I certainly had no illusions that a limited set of fixed distance values would fill all needs and circumstances.  ;)
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Vampire_pilot

  • member
  • Offline Offline
  • Posts: 7989
Re: Increased Visibility Distance Mod for B.A.T.
« Reply #11 on: November 05, 2021, 10:35:21 AM »

the current fun fact is, the smoke is long visible before any mesh, since the mods are not built with such high values in their meshes. Most come with LOD 5000 *at max*....

And you will not believe how many aircraft I have already handled that had maximum LODs of 500! That's already ridiculously short by normal measures but apparently some "standard setting" for some modders. No idea why.
Pages: [1] 2 3 4   Go Up
 

Page created in 0.086 seconds with 24 queries.