Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: DaBrain on June 06, 2005, 01:57:18 pm

Title: Fog distance request
Post by: DaBrain on June 06, 2005, 01:57:18 pm
As you can see in this (http://www.hard-light.net/forums/index.php/topic,33103.0.html) thread, the fog distance is way too close for a decent land-like fog effect.

Is it possible to change this?

And I don't know about the 'range' filed in FRED. Is it used to define this distance? I can't enter greater values than 3000. Values above that will get lost, or set back to 3000 after saving.
Title: Fog distance request
Post by: Black Wolf on June 06, 2005, 02:13:25 pm
Range is radar range.

TI could definitely use something like this as well. :nod:
Title: Fog distance request
Post by: DaBrain on June 06, 2005, 03:29:54 pm
Hmm, I think the Robotech mod could use it too.
Title: Fog distance request
Post by: WMCoolmon on June 06, 2005, 05:46:47 pm
I changed some code so you guys could fool around with this (you guys = anyone with a debug build)

Go into a debug build and bring up the debug console (shift + backspace or something like that). Then type in "neb2". You will see a list that looks something like this:

Code: [Select]
neb2_fog  : set near and far fog planes for ship type X
where X is an integer from 1 - 11
1 = cargo containers, 2 = fighters/bombers, 3 = cruisers
4 = freighters, 5 = capital ships, 6 = transports, 7 = support ships
8 = navbuoys, 9 = sentryguns, 10 = escape pods, 11 = background nebula polygons\n

neb2_max_alpha   : max alpha value (0.0 to 1.0) for cloud poofs. 0.0 is completely transparent
neb2_break_alpha : alpha value (0.0 to 1.0) at which faded polygons are not drawn. higher values generally equals higher framerate, with more visual cloud popping
neb2_break_off   : how many pixels offscreen (left, right, top, bottom) when a cloud poof becomes fully transparent. Lower values cause quicker fading
neb2_smooth      : magic fog smoothing modes (0 - 3)
neb2_select      :  where the first # is the bitmap to be adjusting (0 through 5), and the second int is a 0 or 1, to turn off and on
neb2_rot         : set max rotation speed for poofs
neb2_prad        : set cloud poof radius
neb2_cdim        : poof cube dimension
neb2_cinner      : poof cube inner dimension
neb2_couter      : poof cube outer dimension
neb2_jitter      : poof jitter
neb2_mode        : switch between no nebula, polygon background, amd pof background (0, 1 and 2 respectively)\n
neb2_ff          : flash fade/sec
neb2_background : rgb background color


Fool around with the top one (neb2_fog) and see if you can find a value that works...

I can probably set up a table or something you can put the values into for a couple weeks.

Also, note that neb2_fog seems to be incorrect. Here is a table of the current values from the source. The first value is the "near", second value is the "far", the index starts at 0 (so super capital ships would be 11, rather than nebula polygons.)
Code: [Select]
{0.0f, 0.0f}, // SHIP_TYPE_NONE
{10.0f, 500.0f}, // SHIP_TYPE_CARGO
{10.0f, 500.0f}, // SHIP_TYPE_FIGHTER_BOMBER
{10.0f, 600.0f}, // SHIP_TYPE_CRUISER
{10.0f, 600.0f}, // SHIP_TYPE_FREIGHTER
{10.0f, 750.0f}, // SHIP_TYPE_CAPITAL
{10.0f, 500.0f}, // SHIP_TYPE_TRANSPORT
{10.0f, 500.0f}, // SHIP_TYPE_REPAIR_REARM
{10.0f, 500.0f}, // SHIP_TYPE_NAVBUOY
{10.0f, 500.0f}, // SHIP_TYPE_SENTRYGUN
{10.0f, 600.0f}, // SHIP_TYPE_ESCAPEPOD
{10.0f, 1000.0f}, // SHIP_TYPE_SUPERCAP
{10.0f, 500.0f}, // SHIP_TYPE_STEALTH
{10.0f, 500.0f}, // SHIP_TYPE_FIGHTER
{10.0f, 500.0f}, // SHIP_TYPE_BOMBER
{10.0f, 750.0f}, // SHIP_TYPE_DRYDOCK
{10.0f, 600.0f}, // SHIP_TYPE_AWACS
{10.0f, 600.0f}, // SHIP_TYPE_GAS_MINER
{10.0f, 600.0f}, // SHIP_TYPE_CORVETTE
{10.0f, 1000.0f}, // SHIP_TYPE_KNOSSOS_DEVICE


If you can confirm that the table is right, rather than the description, I'll update the description so it's correct.

Edit: Note that I made the necessary change awhile back, so you should be able to play around with all the fog stuff in any recent build.

Edit 2: And if this didn't clue you in, fog distance seems to be set depending on the ship type, rather than with just some global value. ;) Kind of unfortunate as I think it would look more realistic with the latter.
Title: Fog distance request
Post by: DaBrain on June 06, 2005, 05:50:00 pm
Great, I'll test that right now. ;)
Title: Fog distance request
Post by: DaBrain on June 06, 2005, 06:22:12 pm
For some reason no debug build works with SoL. :(

Code: [Select]
Assert: strlen(lookup_str) <= (unsigned int)(max_len - 1)
File: U:\src\cvs\fs2_open.testing\code\Localization\localize.cpp
Line: 966
[This filename points to the location of a file on the computer that built this executable]

Call stack:
------------------------------------------------------------------
    lcl_ext_localize()    stuff_string()    parse_weapon()    parse_weaponstbl()    weapon_init()    game_init()    WinMainSub()    WinMain()    WinMainCRTStartup()    kernel32.dll 7c816d4f()
------------------------------------------------------------------

(taylor's new OpenAL build)

I guess it something wrong with the tables...

Edit: Shift+backspace doesn't do anything. I can't find the right keys.
BTW the debug builds work without the mod.

Edit2: Did you change the code right now? So I'd have to compile a new build?
Title: Fog distance request
Post by: DaBrain on June 08, 2005, 05:24:51 pm
*Bump*

Can someone test this out?

I'd love to, but the debug builds won't work for me.. :(
Title: Fog distance request
Post by: Bobboau on June 08, 2005, 07:48:50 pm
you have a weapon that uses a file for somethnig with a file name that is too long.
this bug is knowen to also cause crashes in relese builds so don't ignore it.

(BTW, I thiought we had a more descriptive error mesage for this thing)
Title: Fog distance request
Post by: WMCoolmon on June 08, 2005, 08:22:06 pm
Debug console is shift + enter, I don't know why I said backspace. I just tried it too, so I know it's right. ;)

And yeah, check weapon and file names, max is 31 characters.
Title: Fog distance request
Post by: DaBrain on June 09, 2005, 04:19:21 am
Thanks. :)

Now this is going to be fun.... :blah:
I just checked the wapon table and found nothing... it was time do redo it anyway...



I hope I can get a debug build running somehow.
Title: Fog distance request
Post by: Nuke on June 09, 2005, 08:08:37 am
run with a *****y version of fred, that usualy pinpoints bugs quickly