View Full Version : Haze

27th Aug 2004, 04:34 AM
I d'know if this is supposed to go here or GD, so, oh well. :b
Haze is a mutator that lets y' mess with the fog in maps. Got the idea from playing Turok and remembering how thick the fog was. Anyway, asside from making UT feel like an old N64 game, I'm stickin' s'more features in there. Right now you can either use a custom fog color, or have Haze pick a color based on the map's fog. You can also modify the thickness by setting the distance at which the fog starts, and the distance at which it's too thick to see past. The next feature I'm going to implement will let you pick to use the map's existing thickness (if you just wanna change the color), an option to specify the thickness (what I have implemented now), and an option to remove fog altogether.

fog start: -2000, end: 4000
Rauschfreiheit! :O
same as above, but with fog start set to 2000

fog start: -1000, end: 2000
Reminds me of statue park or whatever that map was from Goldeneye.

27th Aug 2004, 06:37 PM
Okay, so I'm wokrin' on this dropdown menu for the mute, and I think I'm gonna add a checkbox that lets you decide if you want your settings to affect water zones.
Anyway, I got rid of the check box for custom color, and incorporated it into the dropdown menu as follows:
Custom Thickness, Custom Color
Custom Thickness, Map Color
Map Thickness (Custom Color)
No Fog

BTW, I don't think I've explained very clearly what the "map color" deal means. It doesn't leave each zone it's own color, it picks one color from one zone in the map and uses it everywhere. This is necessary because if you increase the thickness a lot, when stuff in front of the skybox disappears you can see the skybox. Not good seeing sky and then having a wall suddenly appear. So I unify the color based on one zone in the map, and fill the skybox with fog so when stuff disappears it appears to sink into the fog, rather than disappearing.

Anyway, since water fog isn't the same as atmospheric fog, I figure you should have the option of leaving it alone, otherwise it'll be discolored and not watery. Does that all make sense? O_o

27th Aug 2004, 08:00 PM
Boy I sure did love the original turok for the N64 (and goldeneye of course). I like this mutator idea a alot. Do you have a link for this yet? Another quick question though. When you select the custom fog color, do you have some way of showing the user what the color actually looks like (like in UT where the crosshair would update its color as you adjusted it). I was just wondering as this would be a nice feature to have. Also an in game menu (or at least a mutate command) would be cool to allow you to adjust the fog color in the middle of the game, so you could type something like "mutate LevelFogColor 128 128 64" to adjust the fog.

27th Aug 2004, 08:17 PM
No dl just yet. Pretty soon, though. :3 -- EDIT: Go here (http://forums.beyondunreal.com/showthread.php?t=143810). :)
My old 2K3 fogmatch mute I started on showed the color, but 2K4's fancy new simple config menu jazz doesn't let you do as much fancy stuff. For now you just gotta stick in numbers and play the game to see it in action. In the future I may add an "open" button like WoRM's got and make a spiffier menu with a color preview and maybe a few other features (like hiding the RGB input boxes if you've selected "Custom Thickness, Map Color" or something).
I d'know about adding console commands. Never done it. I'll see what I can find out.

Anyway, more testing results:

"Map Thickness" option:

"No Haze":

Skybox anomaly on Space Noxx. Wouldn't be so bad if the earth's atmosphere stayed consistently, but it jumps in and out of view seemingly at random. :\

Why I'm removing the option to leave water fog alone:

27th Aug 2004, 11:28 PM
Okay, so this "mutate" deal is pretty simple. The only thing is, I have to be able to screw around with strings so I can check numbers (though I can still let you change the "Haze Customization" option by simply matching strings), which 1: I d'know how t' do in UScript, and 2: I haven't done much with in any language, so it'll make my brain ache even when I do figure out how to do it in UScript (assuming I'm able to locate the info). Also, it sounds like anyone'll be able to use the command, not just the server dude person. There oughta be a way to check that, but I d'know how, 'cause I don't know anything about network junk.

28th Aug 2004, 01:26 AM
'Kay, so I got "mutate haze cleanse" in there easily. As you might have guessed, it cleanses the map of haze. Since you can't restore any fog properties to their default values (that'd require storing all the defaults at the beginning, which doesn't seem especially practical o_o), the only other mutatate commands will be fore modifying the haze color and thickness. I could just have a few commands that increase/decrease values by certain ammounts, but I think letting you input values yourself would be considerably simpler. Must figure out string crap.
Oh yes, btw, since you can't reset stuff to the maps' defaults, I've added a "No Customization" option to the "Haze Customization" property, in case you wanna, like, mess with the fog from scratch purely through the mutate commands on a per-map basis without leaving the game to mess with the mutator.
Also, I've added a bit of code that'll make sure the "Zero Visibility Distance" setting is neither negative nor less than "Hazy Distance."

28th Aug 2004, 11:12 AM
Tried it out. Very nice! Does this fog occlude geometry (it should right)? I ask this because I did not remember if "rmode 1" allowed you to see the effects of distance fog or not and whenever I turned it on I only saw the occluding effects due to zoning and antiportals. Hope you get the ingame commands working soon.

The whole string to number thing (I think) is actually simpler than it would seem. here is a snippet from my code where i take a console command and break out the string number and send it to another function.

function Mutate(string MutateString, PlayerController Sender){
local int blind;
local string newSpeed;
/*Allow a console command to change the groundspeed of the players*/

blind = InStr(MutateString, "tdspeed");// search to see if the speed command is present in this mutate string
// If it was in the string and this player is the admin, or a standalone game
if(blind >=0 && (Sender.playerreplicationinfo.bAdmin || Level.NetMode==NM_StandAlone)){
blind = (Len(MutateString) - Len("tdspeed"));// separate the string float
newSpeed = Right(MutateString, blind);
log("calling TDspeedscale: "$newspeed);// log the string we got
SetTDSpeedScale(float(newspeed));// cast it to a float and send it to the speed adjuster function

if ( NextMutator != None )
NextMutator.Mutate(MutateString, Sender);

I think the console itself actually contains some way of parsing the text into numbers, so you might be able to do it even easier than this.

28th Aug 2004, 04:26 PM
I read about fog occlusion yesterday at Wiki. Zone fog occludes, volume fog doesn't.
That snippet o' y'rs has all the stuff I needed. :) Seperating the number as well as the admin jazz.

28th Aug 2004, 06:25 PM
All right, I got all the mutate commands done. They are "mutate haze" followed by, "cleanse," "start," "end," "r," "g," or "b." Everything other than "cleanse" should, of course, be followed by a value. The RGB ones should use 0 if you give it a negative, or 255 if you give it something too big, though I haven't actually tried feeding it such inappropriate values just yet. The mutator also will reset "Haze Customization" according to the changes you make. So, for example, if you chose "No Haze" or used "cleanse," then use one of the color mutate commands, it'll automatically change "Haze Customization" to the "Custom Thickness, Custom Color" setting. Custom thickness because turning the haze off altogether compromised the map's settings, so it goes with the custom thickness. Custom color 'cause you're obviously wantin' t' change that bit. Anyway, it's got logic for all those settings, and I've tested all that. I'll see what I can figure out about the new, spiffed up config menu and once that's done let y'all play with it to make sure it's ready for release on WMP. :)

28th Aug 2004, 07:18 PM
One thing I've been accidentally reminded of by a Wiki topic: bots. If possible I'd like to make 'em unable to shoot at anything past the visible distance. Sounds like this may be how to go about it (quoting Wormbo): "It would be possible to reset the bot's target to None from an external actor if the distance to the enemy gets too big. The Tick function might be handy (and hacky ;)) here." The problems are that 1: I wouldn't know how to set that up properly for network play, and 2: I wouldn't know how to make bots with weapons with fancy vision modes (like my railgun) immune to the limited visibility, other than using a list of weapons (which would be pretty icky, trying to account for every weapon in existence, updating for new mods, etc. :\).