Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Solatar on November 28, 2002, 10:09:29 pm

Title: Freespace 1 Nebulas
Post by: Solatar on November 28, 2002, 10:09:29 pm
How hard would it be to re-enable the fs1 nebula stuff? I really liked them, despite fs2's better ones. The blue nebula behind the Rakshasha's in the trailer looked awesome...

Everything works so far except for one thing, once you enabled it in FRED2, FRED2 crashes. All the .neb files are in the effects folder of one of the .vps.
Title: Freespace 1 Nebulas
Post by: EdrickV on November 29, 2002, 01:44:44 am
FRED2 crashes because it's still missing some files. You need to copy the game palette pcx files to data\effects for it to not crash. Also, FRED2 (the original version) seems to have trouble setting the nebula 1 settings when you load a file, though it can save them. (We could use an "Ok" button on that editor, clicking the close box does not save changes you've made at least in the original version.) The last thing I think you need (I'm not entirely sure what I got was a FS1 nebula, but it was really odd, will describe it later in this post.)  to do is change the mission flags. From looking at the source code, it seems to check for the full nebula flag, but if the full nebula flag is enabled it won't save nebula 1 info. So, save your mission, turn on the full nebula flag, and save another copy of the mission. (Don't change anything else.) Then copy the flag entry from the mission you just saved to the one you saved before via a text editor and save it. (My simple mission had flags: 0 and the full neb version had flags: 4. I copied the 4 over.) You should now be able to play an FS1 nebula mission. (I'm not sure if the original exe will play them, mine is crashing when I try to run it, but I wouldn't think a mission would crash it before it gets to the login screen, will retry after I reboot. Some other programs crashed which might be affecting it.)

And now a description of what I did get:
I used Nebula03 and Grey Green in the background editor. I was flying around in a really odd looking nebula that changed colors when I changed direction. I could not target any other ships (maybe awacs info and/or an awacs ship is needed?) and the nebula did not look like any I remember seeing in FS2. (I don't remember playing any FS1 nebula missions.)

Addendum: Set the range thing for the fullneb version and copy over the +NebAwacs: entry that's right below the flags entry in order to set the radar range.

(PS Interesting note, I think the variable that counts the total messages in the mission for the comment is used uninitialized, it says I've got 207 messages total when I really have none. :) )
Title: Freespace 1 Nebulas
Post by: Slasher on November 29, 2002, 03:20:56 am
Hehe, I think Hades is talking about nebula backgrounds rather than full nebulas that you fly around in.  

FS1 backgrounds worked differently than FS2's.  FS2 uses images that you place manually into the mission, while FS1 generated them based on user input; namely what color the mission author wanted.

Still, I'm sure it'll warm his heart that you went to all that trouble EdrickV. :D

And if I misinterpreted Hades, it'll warm my heart too. :D :D
Title: Freespace 1 Nebulas
Post by: Solatar on November 29, 2002, 09:05:38 am
No, slasher, you're correct.:D
Title: Freespace 1 Nebulas
Post by: Solatar on December 01, 2002, 03:45:49 pm
*BUMP*

Does anyone have any idea how this can be done? At all? PLEASE!:D
Title: Freespace 1 Nebulas
Post by: HotSnoJ on December 01, 2002, 05:09:18 pm
Maybe you could make some?! That or get the coders to work on it.
Title: Freespace 1 Nebulas
Post by: IceFire on December 01, 2002, 05:41:23 pm
You could make some less defined, more cloudy nebulas....which is what I've been doing alot of for various campaigns (see screen shots of OTT, Inferno, and BWO).
Title: Freespace 1 Nebulas
Post by: Solatar on December 01, 2002, 06:18:50 pm
I really wanted the fs1 nebula backgrounds. The backgrounds in the fs2 trailer look kind of cool. I really like that Rakshahsa in front of the nebula getting blown away by that oversized beam.
Title: Freespace 1 Nebulas
Post by: EdrickV on December 01, 2002, 09:25:29 pm
Seems what I had gotten with my trick was a black nebula, which looks a lot weirder then any FS2 nebulas I've seen before. After investigating more, I believe I discovered exactly why nebulas aren't getting drawn even though the data is getting read and setup. It also seems to be a very easy fix.

Code: [Select]

void nebula_render()
{
int i;
// int r, g, b;

[b]// no nebula for you!
return;[/b]

if ( !Nebula_loaded ) {
return;
}

if ( !Detail.planets_suns ) {
return;
}

// Rotate the nebula.
g3_start_instance_matrix( NULL, &Nebula_orient );

for (i=0; i {
g3_rotate_faraway_vertex( &nebula_verts[i], &nebula_vecs[i] );
g3_project_vertex( &nebula_verts[i] );
}

int saved_gr_zbuffering = gr_zbuffer_get();

gr_zbuffer_set(GR_ZBUFF_NONE);

for (i=0; i
vertex * verts[3];

verts[0] = &nebula_verts[tri[i][0]];
verts[1] = &nebula_verts[tri[i][1]];
verts[2] = &nebula_verts[tri[i][2]];

g3_draw_poly(3, verts, TMAP_FLAG_RAMP | TMAP_FLAG_GOURAUD | TMAP_FLAG_NEBULA );
}

g3_done_instance();

gr_zbuffer_set(saved_gr_zbuffering);

// always switch off fogging for good measure
if((The_mission.flags & MISSION_FLAG_FULLNEB) && (Neb2_render_mode == NEB2_RENDER_NONE)){
gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
}
}

Title: Freespace 1 Nebulas
Post by: Solatar on December 01, 2002, 09:40:33 pm
Could that be put in fs2_open3.4?
Title: Freespace 1 Nebulas
Post by: Sesquipedalian on December 01, 2002, 10:12:15 pm
Maybe, but might I suggest some good testing first.  If it says "no nebula for you!" there's quite probably a reason why...
Title: Freespace 1 Nebulas
Post by: EdrickV on December 01, 2002, 11:12:20 pm
From the looks of things, I think they disabled the FS1 nebulas when they started the FS2 nebula system and built FS2's background bitmap stuff. But they didn't seem to get rid of the actual code. Whether that code still works or not is something I couldn't say, (the referenced functions might have changed) but I know the old nebula data is still read by the game. FRED2 doesn't seem to load it right (or at least doesn't seem to set the options right in the background editor) but does save the chosen settings.