SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH4 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=219)
-   -   [REL] 20mm Gun Sight Mod (https://www.subsim.com/radioroom/showthread.php?t=147930)

Krishna 02-07-09 10:10 PM

[REL] 20mm Gun Sight Mod - Updated Ver 1.1
 
This is my first ever SH4 mod, so be gentle :P

Bought SH4 & U-Boat missions last week, but have some 3D / modding experience so decided to fix something about the 20mm single's gun sight as I was having some issues with target visibility after getting caught wanting to shoot the damn gnats buzzing around down.

I've made the following changes to make the use of the 20mm AA Gun more useable, without affecting realism. (Hopefully the zoomed view is actually more realistic now than the "nose on" position of the original)

* Now has "thinned" sight struts.
* Moved the "Aiming Pin" to allow better visibility of the crosshairs
* Changed the initial/zoomed positions to reduce the "nose on the sight" issue of the zoom position.
* Calibrated the view so the sight is accurate @ 1000 yards.

http://img136.imageshack.us/img136/9...un1ape4.th.jpg

http://img136.imageshack.us/img136/6...un2akv2.th.jpg

I'm not sure if this gun was modded before I installed TMO163, so can't say whether it'll work on stock 1.4/1.5 until either it's tested or I learn more about what TMO changes, so feedback would be greatfully received, it was made partly out of my own necessity, and partly as a learning experience for import/export of 3D into SH4, hope somebody else finds it useful.

You can download here, just unzip to your mods directory and install with JSGME.

http://files.filefront.com/13241807

Thanks to WEBSTER for the suggestions for version 1.1, and to akdavis for his farsight mod so I could learn how to change the camera positions.

Krishna.

Webster 02-07-09 10:50 PM

well a while back i asked about that gun and a really nice guy made a mod just because i asked about it. it was done by "akdavis" who did something with the clip distance so your nose isnt pressed against it, there was a minor issue with the tub view so i think it needed a little more refining. i never understood what values he was changing but even though it wasnt perfect i was happy with what he did at the time because the gun was usable finally.

maybe if you get together with him and putting your mod and his together would get a thinner gunsight from your version and fine tune the proper view distance with his.

this is his mod link http://files.filefront.com/20mm+sing.../fileinfo.html

and this is the thread about it http://www.subsim.com/radioroom/showthread.php?t=137027

Krishna 02-08-09 12:01 AM

Thanks, I'm looking into camera position data at the moment, I'd hoped to tweak the zoom levels to achieve similar, basically having a further out "scan" view for scanning the sky, and then use the 2nd zoom level for an "aim" view that was less "nose on the sight" than the current zoomed view.

I tried to do this through cameras.dat, however it doesn't seem to let you use fractions for the zoom levels, only whole numbers, I'll look into camera positions more tomorrow.

Cheers.

K.

donut 02-08-09 12:37 AM

Nice Ideas

Krishna 02-08-09 12:45 AM

Got it!, I can see how akdavis did it with the 20mm dat file now, and leave the cameras.dat alone (MUCH preferred, too many camera.dats to clash with).

The position is a little too far back for my liking on akdavis's mod, but tomorrow I'll definitely have a finished version with my thinner struts, and a further back position that is somewhere between the two, so one view will be further back for scanning (But not as far back as the twin) and the zoomed view for aiming/firing will be somewhere between the current default and zoomed.

But nearly 6am now, so really should get some sleep. :P

Watch this space :)

Krishna 02-08-09 08:22 AM

Updated version now available, details in Original Post. (Thanks WEBSTER!)

Webster 02-08-09 01:12 PM

Quote:

Originally Posted by Krishna
Updated version now available, details in Original Post. (Thanks WEBSTER!)

looks great, very nicely done, i added it to my "game fixes only mod" assuming its ok with you?

now can you find a way to make the planes appear bigger at distance so you can see them sooner? you can hear them long before you ever see them and i think if you can hear them you should also be better able to see them. they seem to pop out of nothing sometimes and it would be nice to see a speck coming in on the horizon.

its like they suddenly get big just before they are ready to dive on you but i think they should start getting bigger sooner than that. its like the middle stage between tiny and full size is being skipped.

Krishna 02-08-09 01:38 PM

Quote:

Originally Posted by WEBSTER
looks great, very nicely done, i added it to my "game fixes only mod" assuming its ok with you?

Cheers & Sure, I'm honored :P

Quote:

now can you find a way to make the planes appear bigger at distance so you can see them sooner? you can hear them long before you ever see them and i think if you can hear them you should also be better able to see them. they seem to pop out of nothing sometimes and it would be nice to see a speck coming in on the horizon.

its like they suddenly get big just before they are ready to dive on you but i think they should start getting bigger sooner than that. its like the middle stage between tiny and full size is being skipped.
That sounds like a LOD (Level Of Detail) handling issue, and could be performance related, I don't see such a jump as the LOD switching happens fairly far out for me, what spec PC / game settings are you running? - It certainly wouldn't be an easy fix as often the LOD handling will be hardcoded into the game or use specific gfx driver functions.

I'll certainly give it a look, although the LOD data is likely to be model (aircraft) related rather than camera related, so may well depend on the mods installed, certainly not a fix I'd recommend putting into general distribution.

K.

Krishna 02-08-09 01:56 PM

Found it for you, You can find the LOD settings for the aircrafts in their dat file in their respective directories under \data\air, open with S3D and look for the following:

Node 7 --> *aircraft name_MainFrame* --> 9. UnifiedRenderControler --> 10. UnfiedRenderControler

Select this node and in the property tree you'll see 2 different keys you can change:

MediumLODDistance = 15 (On mine, TMO & RSRD installed)
LowLODDistance = 80

These values are in Decimeters (1 = 10 Meters)

Just change them to further out, so put your LowLODDistance at 120, and your MediumLODDistance at 80 and you should move the LOD switching positions much further back, This WILL likely have an effect on performance, as one reason for switching to different LOD's is so unseen / redundant polygons are not rendered unnecessarily.

Not tested it, but try it and see how you go Submarine School's "Convoy Attack" is a good quick AA test, there may well be a global LOD setting somewhere I've not seen, or worse a hardcoded value somewhere but hopefully not and this will be enough.

K.

Webster 02-08-09 02:15 PM

Quote:

Originally Posted by Krishna
Found it for you, You can find the LOD settings for the aircrafts in their dat file in their respective directories under \data\air, open with S3D and look for the following:

Node 7 --> *aircraft name_MainFrame* --> 9. UnifiedRenderControler --> 10. UnfiedRenderControler

Select this node and in the property tree you'll see 2 different keys you can change:

MediumLODDistance = 15 (On mine, TMO & RSRD installed)
LowLODDistance = 80

These values are in Decimeters (1 = 10 Meters)

Just change them to further out, so put your LowLODDistance at 120, and your MediumLODDistance at 80 and you should move the LOD switching positions much further back, This WILL likely have an effect on performance, as one reason for switching to different LOD's is so unseen / redundant polygons are not rendered unnecessarily.

Not tested it, but try it and see how you go Submarine School's "Convoy Attack" is a good quick AA test, there may well be a global LOD setting somewhere I've not seen, or worse a hardcoded value somewhere but hopefully not and this will be enough.

K.

well rendering sooner sounds like the key because they dont seem to "appear" as quickly as i think they should in the game. basic idea is to allow enough time to locate and target incoming aircraft before they are already on top of you.

no time today but i will try your instructions tomorrow and see what happens. im not looking for dramatic change just seems a little off as is.

donut 02-08-09 08:03 PM

Insteresting tread
 
Would love to see A/C rendered sooner.:up:

Webster 02-08-09 11:12 PM

Quote:

Originally Posted by WEBSTER
Quote:

Originally Posted by Krishna
Found it for you, You can find the LOD settings for the aircrafts in their dat file in their respective directories under \data\air, open with S3D and look for the following:

Node 7 --> *aircraft name_MainFrame* --> 9. UnifiedRenderControler --> 10. UnfiedRenderControler

Select this node and in the property tree you'll see 2 different keys you can change:

MediumLODDistance = 15 (On mine, TMO & RSRD installed)
LowLODDistance = 80

These values are in Decimeters (1 = 10 Meters)

Just change them to further out, so put your LowLODDistance at 120, and your MediumLODDistance at 80 and you should move the LOD switching positions much further back, This WILL likely have an effect on performance, as one reason for switching to different LOD's is so unseen / redundant polygons are not rendered unnecessarily.

Not tested it, but try it and see how you go Submarine School's "Convoy Attack" is a good quick AA test, there may well be a global LOD setting somewhere I've not seen, or worse a hardcoded value somewhere but hopefully not and this will be enough.

K.

well rendering sooner sounds like the key because they dont seem to "appear" as quickly as i think they should in the game. basic idea is to allow enough time to locate and target incoming aircraft before they are already on top of you.

no time today but i will try your instructions tomorrow and see what happens. im not looking for dramatic change just seems a little off as is.

:nope: nope, that had no effect at all no matter what i tried. and the more i think about it the more i think its not about distance but rather the size that they appear as at long distance.

after trying many settings that didnt show any effects, im thinking the LOD in LODDistance stands for level of decent angle and has nothing to do with the distance or size they first appear at. after much testing im thinking its not the distance that is the problem but rather the planes are showing up as too tiny a speck to see. i can barely see them against bright blue sky and white clouds much less trying in overcast grey clouds. i cant say if they are supposed to be that tiny but for my taste they are way too hard to see even if you know where they are and the direction they are flying in. maybe while they are at long distance the plane textures could be swapped out for a black dot so its easier to locate them, then as they get closer switch to the plane textures..

Krishna 02-09-09 05:16 AM

Quote:

Originally Posted by WEBSTER
:nope: nope, that had no effect at all no matter what i tried. and the more i think about it the more i think its not about distance but rather the size that they appear as at long distance.

after trying many settings that didnt show any effects, im thinking the LOD in LODDistance stands for level of decent angle and has nothing to do with the distance or size they first appear at. after much testing im thinking its not the distance that is the problem but rather the planes are showing up as too tiny a speck to see. i can barely see them against bright blue sky and white clouds much less trying in overcast grey clouds. i cant say if they are supposed to be that tiny but for my taste they are way too hard to see even if you know where they are and the direction they are flying in. maybe while they are at long distance the plane textures could be swapped out for a black dot so its easier to locate them, then as they get closer switch to the plane textures..

Nope, LOD is definitely detail related - it's a standard 3D engine mechanic, See: http://en.wikipedia.org/wiki/Level_of_detail

What a 3D engine usually does is have a reduced detail model with a lower number of polygons that is used for displaying the model at distances where higher polygon models are unnecessarily wasteful.

After further checking it seems that these two LOD settings affect texture & lighting only, not the 3D model, in which case it's possibly as I first thought, and the 3D model LOD handling is either hardcoded into the game, or just uses standard graphics driver routines, not something that can be adjusted.

Webster 02-09-09 10:38 AM

Quote:

Originally Posted by Krishna
Nope, LOD is definitely detail related - it's a standard 3D engine mechanic, See: http://en.wikipedia.org/wiki/Level_of_detail

What a 3D engine usually does is have a reduced detail model with a lower number of polygons that is used for displaying the model at distances where higher polygon models are unnecessarily wasteful.

After further checking it seems that these two LOD settings affect texture & lighting only, not the 3D model, in which case it's possibly as I first thought, and the 3D model LOD handling is either hardcoded into the game, or just uses standard graphics driver routines, not something that can be adjusted.

what chance is there that maybe while they are at long distance the plane textures could be swapped out for a black dot so its easier to locate them, then as they get closer switch to the plane textures?

Krishna 02-09-09 11:11 AM

Quote:

Originally Posted by WEBSTER
what chance is there that maybe while they are at long distance the plane textures could be swapped out for a black dot so its easier to locate them, then as they get closer switch to the plane textures?

Well, the LOD settings in the dat only seem to affect the caustics (sea relflections) which are disabled on aircraft anyway, and bumpmapping.

Texture LOD is controlled via the objects texture mipmaps, which if you open the objects texture .dds file in photoshop (with a necessary .dds plugin filter) you will see.

An example of what it should look like (not from SH4 obviously :P) is:

http://wiki.aqsis.org/_media/dev/mip...inc_boxwin.png

With the mipmaps being the increasingly smaller versions to the right of the main image.

You could (theoretically) edit the texture so the furthest right version(s) are just black boxes and see if that works.

Krishna.

Note: I'm only a week into playing SH4, let alone modding it, so anything I say is theoretical until I learn more about the way SH4 handles things, and there are more people here I'm sure with a better idea of how the engine works, if so please feel free to correct me if I go down the wrong track :P

Webster 02-09-09 12:12 PM

Quote:

Originally Posted by Krishna

Texture LOD is controlled via the objects texture mipmaps, which if you open the objects texture .dds file in photoshop (with a necessary .dds plugin filter) you will see.

With the mipmaps being the increasingly smaller versions to the right of the main image.

You could (theoretically) edit the texture so the furthest right version(s) are just black boxes and see if that works.

Krishna.

i dont see them in air or objects folders so where are they found?

Krishna 02-09-09 12:24 PM

Quote:

Originally Posted by WEBSTER
i dont see them in air or objects folders so where are they found?

They can be found in:

\Games\SH4\Data\Textures\TLowRes\tex (For Low Res Textures)
and
\Games\SH4\Data\Textures\TNormal\tex (For Hi Res Textures)

I would guess that the setting you use in Option -> Graphics Settings decides which of the two above texture sets you use.

You'll need to find the names of all the aircraft you wish to edit as the textures in these directories are not sorted into their own folders.

Krishna.

Webster 02-09-09 03:31 PM

Quote:

Originally Posted by Krishna
Quote:

Originally Posted by WEBSTER
i dont see them in air or objects folders so where are they found?

They can be found in:

\Games\SH4\Data\Textures\TLowRes\tex (For Low Res Textures)
and
\Games\SH4\Data\Textures\TNormal\tex (For Hi Res Textures)

I would guess that the setting you use in Option -> Graphics Settings decides which of the two above texture sets you use.

You'll need to find the names of all the aircraft you wish to edit as the textures in these directories are not sorted into their own folders.

Krishna.

well trouble is there is only one straight forward texture image called A6M2_Zero and then a second file called A6M2_Zero_SelfIlum which is like a transparent mask or overlay. nothing like you showed above so sh4 must do something different for sizing images.

Krishna 02-09-09 03:44 PM

Quote:

Originally Posted by WEBSTER
well trouble is there is only one straight forward texture image called A6M2_Zero and then a second file called A6M2_Zero_SelfIlum which is like a transparent mask or overlay. nothing like you showed above so sh4 must do something different for sizing images.

A6M2_Zero.dds is the right texture file, you can't be loading it correctly, you need to make sure the program you load/edit the .dds file with loads the mipmaps, when I load the .dds file in Photoshop it asks if I want to load the mipmaps, and when I do then displays the image like the following:

http://img17.imageshack.us/img17/807/zerovc8.jpg

What program are you loading the .dds with?

Webster 02-09-09 04:43 PM

Quote:

Originally Posted by Krishna
What program are you loading the .dds with?

im using paint.net but i dont see any mipmap option, anyway im totally jacking your mod thread so lets finish this with PM's so people can talk about your mod here :up:


All times are GMT -5. The time now is 05:20 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.