SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH4 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 09-30-14, 09:31 PM   #1
Sniper297
The Old Man
 
Join Date: Dec 2005
Location: Philadelphia Shipyard Brig
Posts: 1,386
Downloads: 160
Uploads: 19
Default Radar hacking

Looking for two things here;

1. Which file or files controls the color of the PPI scope, for example if you want to change the display from red to green?
2. Which file or files controls the depth at which the radar automatically shuts down?
Sniper297 is offline   Reply With Quote
Old 05-04-15, 02:12 PM   #2
aanker
Eternal Patrol
 
aanker's Avatar
 
Join Date: Apr 2004
Location: Yellow Sea
Posts: 1,894
Downloads: 236
Uploads: 14


Default

Quote:
Originally Posted by Sniper297 View Post
Looking for two things here;

1. Which file or files controls the color of the PPI scope, for example if you want to change the display from red to green?
2. ......
Edit:
Hitman, Nisgeis, Frederf, Anvart & Capt Scurvy all came to mind on this radar topic.

I must remember: Stock PPI is red, Stock PPI is red, Stock PPI is red, Stock PPI is red, ....

I'm guessing the red green 'switch' is in the Conning Tower Interior *.dat and/or *.sim files for each boat?

Last edited by aanker; 05-04-15 at 07:10 PM.
aanker is offline   Reply With Quote
Old 05-04-15, 03:00 PM   #3
Sniper297
The Old Man
 
Join Date: Dec 2005
Location: Philadelphia Shipyard Brig
Posts: 1,386
Downloads: 160
Uploads: 19
Default

"in RFB the A-Scope is green and his PPI red"

In the stock 1.4 game the A-scope is green and the PPI is red, no different from RFB. I have a mod that adds range rings, but it's still red.



I labeled them to avoid confusion because the buttons on the bottom are reversed, "Go to PPI radar" takes you to the A-scope, "Go to A-scope" takes you to the PPI. Fortunately the main radar button takes you to the PPI when double clicked. (This image is an interior lighting mod for the conning tower plus a camera hack for the conning tower interior view, I haven't uploaded either yet since I haven't bought 1.5 yet.)

I understand how colors work, 255, 0, 0 is red, change to 255, 255, 0 and you get yellow. Problem is I can't find anything in any file that has radar color data in it.
Sniper297 is offline   Reply With Quote
Old 05-04-15, 07:01 PM   #4
aanker
Eternal Patrol
 
aanker's Avatar
 
Join Date: Apr 2004
Location: Yellow Sea
Posts: 1,894
Downloads: 236
Uploads: 14


Default

Quote:
Originally Posted by Sniper297 View Post
"in RFB the A-Scope is green and his PPI red"

In the stock 1.4 game the A-scope is green and the PPI is red, no different from RFB. I have a mod that adds range rings, but it's still red.

I labeled them to avoid confusion because the buttons on the bottom are reversed, "Go to PPI radar" takes you to the A-scope, "Go to A-scope" takes you to the PPI. Fortunately the main radar button takes you to the PPI when double clicked.
I recall that backward "Go to PPI radar" takes you to the A-scope, "Go to A-scope" takes you to the PPI." issue. The fix in menu.txt was simple.

OK, it's been so long since I saw Stock - That is my only excuse .... I just now fired up Stock 1.5 plus looked at screenshots from earlier versions, and sure enough there's a RED PPI. Sorry........

Last edited by aanker; 05-04-15 at 07:54 PM.
aanker is offline   Reply With Quote
Old 10-01-14, 07:29 PM   #5
Sniper297
The Old Man
 
Join Date: Dec 2005
Location: Philadelphia Shipyard Brig
Posts: 1,386
Downloads: 160
Uploads: 19
Default

Nope.

\Data\Library\USSubParts\Sensors_sub_US.sim

has a lot of data, but nothing I can find which controls the cutoff depth.

\Data\Interior\NSS_Salmon\NSS_Salmon_CT.sim

also has a lot of data, but nothing that looks like RGB values.
Sniper297 is offline   Reply With Quote
Old 10-08-14, 09:13 PM   #6
Sniper297
The Old Man
 
Join Date: Dec 2005
Location: Philadelphia Shipyard Brig
Posts: 1,386
Downloads: 160
Uploads: 19
Default

Nobody knows even how to change the color from red to green? Possibly the depth cutout is hard coded into an EXE file somewhere, but it's hard to believe there isn't some file with RGB values for the display. The DDS files are actually green so there must be a shader someplace.
Sniper297 is offline   Reply With Quote
Old 10-09-14, 11:51 AM   #7
ETR3(SS)
Ocean Warrior
 
Join Date: Dec 2007
Location: Between test depth and periscope depth
Posts: 3,018
Downloads: 175
Uploads: 16
Default

To answer your second question, try the units cfg file. Specifically the surface depth entry. It's been some time since I've worked on that aspect but I believe that's where you want to look.
__________________


USS Kentucky SSBN 737 (G)
Comms Div 2003-2006
Qualified 19 November 03

Yes I was really on a submarine.
ETR3(SS) is offline   Reply With Quote
Old 10-09-14, 05:28 PM   #8
Sniper297
The Old Man
 
Join Date: Dec 2005
Location: Philadelphia Shipyard Brig
Posts: 1,386
Downloads: 160
Uploads: 19
Default

Not finding a units cfg file here.
Sniper297 is offline   Reply With Quote
Old 10-10-14, 12:39 AM   #9
ETR3(SS)
Ocean Warrior
 
Join Date: Dec 2007
Location: Between test depth and periscope depth
Posts: 3,018
Downloads: 175
Uploads: 16
Default

Sorry, NSS_Sargo.cfg. That make more sense?
__________________


USS Kentucky SSBN 737 (G)
Comms Div 2003-2006
Qualified 19 November 03

Yes I was really on a submarine.
ETR3(SS) is offline   Reply With Quote
Old 05-05-15, 02:45 PM   #10
aanker
Eternal Patrol
 
aanker's Avatar
 
Join Date: Apr 2004
Location: Yellow Sea
Posts: 1,894
Downloads: 236
Uploads: 14


Default

Quote:
Originally Posted by Sniper297 View Post
Nobody knows even how to change the color from red to green? Possibly the depth cutout is hard coded into an EXE file somewhere, but it's hard to believe there isn't some file with RGB values for the display. The DDS files are actually green so there must be a shader someplace.
I knew I had a green PPI scope. Check this old topic by Mrahh:
http://www.subsim.com/radioroom/showthread.php?t=115207

In the mod are Radar.dds, ppiCircles.dds, & in the Shaders folder is a fix for PPIRadarPS.fx by Anvart. The CT *.sims were included in a version 1.21.
Readme:
Quote:
RadarSweep.7z
Author Anvart.
This mod is for SH4 game ver. 1.2.
This mod fix mistake in script shader file (PPIRadarPS.fx).
Now you can see stock grid on radar display.
On a plan of developers the grid is made of a celluloid film with grid figure and it is put from above on the radar display.
I also have cleaned word "Range:" from the radar display (in SHControllers.act file).
In this mod the size and the form of radar markers also are changed. Main marker is small circle, additional markers are
the slanting cross and the cross.

"SHControllers.act file must to be in main SH4 folder.".....
If these mods could be reverse engineered to see what was changed, it might be possible for you to turn the PPI from red to green in v1.5.



Screenshot from:
http://www.subsim.com/radioroom/show...=115207&page=6

Last edited by aanker; 05-05-15 at 02:55 PM.
aanker is offline   Reply With Quote
Old 05-05-15, 06:58 PM   #11
Sniper297
The Old Man
 
Join Date: Dec 2005
Location: Philadelphia Shipyard Brig
Posts: 1,386
Downloads: 160
Uploads: 19
Default

No mods in there so far, I'm up to page 15 and every link is a 404. The one post where he mentions a hack in the PPIRadarPS.fx file is a string:

So here's the change (orange is my addition) :

float4 f=tex2D(fadetex,In.Tex0)+tex2D(grid,In.Tex1);


I don't have in mine.


float Fade:register(c0);
float Intensity:register(c1);

sampler map: register(s0);
sampler grid: register(s1);
sampler noise: register(s2);
sampler fadetex: register(s3);

struct PS_IN
{
float2 Tex0 : TEXCOORD0;
float2 Tex1 : TEXCOORD1;
float2 Tex2 : TEXCOORD2;
float2 Tex3 : TEXCOORD3;
};


float4 main( PS_IN In ) : COLOR
{
float gchan;
float bchan;
float mixedchan;
float4 blur = 0;

blur = tex2D(fadetex, In.Tex0);
blur.r = 0;

gchan = blur.g;
bchan = blur.b;

blur.rgb =0;
mixedchan = (gchan+bchan) / 2;
blur.g = mixedchan;

int N = 7;
float R = 0.08;
float Rcolor = 0.005;
blur = tex2D(map, In.Tex0);
float4 color = tex2D(fadetex,In.Tex0);

float4 ret=color;//+blur*0.25;

bchan = ret.b;

ret.g += bchan;
ret.b -= bchan;
ret.rb=pow(ret.g,8);
ret.rgb = ret.grb;
return ret;
}

I assume there's some way to edit this to replace R with G, but it's all Greek to me. I tried the PPIcircles.dds and radar.dds files when I first started looking at this, but one is already green and the other is blue. There's no way to combine blue and green to make red, so the color has to be somewhere in that PPIRadarPS.fx file. The CT*.sim files you mentioned (can't confirm this since all the filefront / rapidshare / whatever links are history) are probably range adjustments or something, if the color change preceded 1.21 it's unlikely to be in anything that wasn't in the first version. I'll look at it anyway;

LightColor = R1, G209, B12

That's for the sonar indicator light, not the radar, but it is the kind of color adjustment that SHOULD HAVE been used for the radar someplace. Why in the world they would use RGB values in sim files for one piece of equipment and C code in a .fx file for another is beyond me, but it looks to me like that's what they did. What the SHControllers.act has to do with anything is a mystery but I'll look at that with a hex editor while I'm at it.
Sniper297 is offline   Reply With Quote
Old 05-05-15, 11:43 PM   #12
Sniper297
The Old Man
 
Join Date: Dec 2005
Location: Philadelphia Shipyard Brig
Posts: 1,386
Downloads: 160
Uploads: 19
Default

Still don't understand how this works, but a direct substitution of R for G and G for R in the PPIRadarPS.fx file works;



float Fade:register(c0);
float Intensity:register(c1);

sampler map: register(s0);
sampler grid: register(s1);
sampler noise: register(s2);
sampler fadetex: register(s3);

struct PS_IN
{
float2 Tex0 : TEXCOORD0;
float2 Tex1 : TEXCOORD1;
float2 Tex2 : TEXCOORD2;
float2 Tex3 : TEXCOORD3;
};


float4 main( PS_IN In ) : COLOR
{
float rchan;
float bchan;
float mixedchan;
float4 blur = 0;

blur = tex2D(fadetex, In.Tex0);
blur.g = 0;

rchan = blur.r;
bchan = blur.b;

blur.rgb =0;
mixedchan = (rchan+bchan) / 2;
blur.r = mixedchan;

int N = 7;
float G = 0.08;
float Gcolor = 0.005;
blur = tex2D(map, In.Tex0);
float4 color = tex2D(fadetex,In.Tex0);

float4 ret=color;//+blur*0.25;

bchan = ret.b;

ret.r += bchan;
ret.b -= bchan;
ret.gb=pow(ret.g,8);
ret.rgb = ret.grb;
return ret;
}

Colored letters are what I changed, the color shows what letter was originally there - swap r and g except where it was obvious it shouldn't be swapped. (rgb is the correct order for programming, so grb might throw a wonky into the code, dunno why the ret.rgb = ret.grb string but it didn't look like something that needed to be changed since it was a straight reversal)

And what that gets me is this;



Gonna make a backup of that and see what I can do to tweak it. Rather than fooling around like I did I would suggest just copying the entire code as I pasted it above, unless 1.5 differs from the original that I have.
Sniper297 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:45 AM.


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