maurvir Posted September 9, 2021 Share Posted September 9, 2021 (edited) Since the EE's came out, I have always regretted that. you only get to see the new weather effects for a brief time on the way to Dragonspear castle, and then it's back to just rain and sun. How hard would it be to modify all of the outdoor regions in the game to have biome specific weather that includes the new fog weather from SoD in an EET build? Clearly, since it's running within BG2EE, it should be technically possible. What I would like is for areas like the forests near the Cloudpeak Mountains, Nashkel and surrounding areas, etc. have fog as well as snow and rain. The forests between Nashkel and Beregost along the coast should have more fog than rain, and more rain than sun, etc. Similarly, the De'Arnise keep, the forest areas near Tethyr, and Suldanessar should have occasional fog. If it's as simple as setting flags, I could probably just do it to my local copy, but I worry that this might break something else. However, I really would like to see some unified weather effects across the Sword Coast and Amn. Also, do the EE's disable occasional weather damage? It seems I haven't ever seen one of my party members get hit by lightning since playing them. If possible, it would be nice to reenable that for a bit of flavor - and as an excuse to rest during storms. Edited September 9, 2021 by maurvir Quote Link to comment
maurvir Posted September 10, 2021 Author Share Posted September 10, 2021 As an aside, this is the kind of coding task I could probably tackle if someone could point me in the right direction. I just don't know how to set/alter the weather in a region, or how to do it programmatically with WEIDU. With the proper template, I would be up for working out the details/probabilities and doing the rest. Quote Link to comment
Graion Dilach Posted September 10, 2021 Share Posted September 10, 2021 I haven't tested this, but it's probably enough if you tweak the values of 0x4A, 0x4C and 0x4E in the area header https://gibberlings3.github.io/iesdp/file_formats/ie_formats/are_v1.htm - atleast going through the ARE file format implies that. The EE don't disable lightning, that's for sure, I've had a run when two of my NPCs got hit by one in close succession. I'm not sure if the cpm_vars library actually has a thread somewhere to get from, but in WeiDU, you just need to look the area codes up and then use WRITE_SHORT to update them. Yiou might want to test things with relying on manually updating the values with NearInfinity first. Quote Link to comment
CamDawg Posted September 10, 2021 Share Posted September 10, 2021 Honestly I'd just regexp through all areas and use a rule like 'if the area is outdoors and allows rain, also allow fog' rather than picking out specific areas. Something like this would set fog probability at 50% of the rain probability, if the area allows weather and doesn't already have fog set: ACTION_IF GAME_IS ~bgee bg2ee iwdee pstee eet~ BEGIN // only for EEs COPY_EXISTING_REGEXP GLOB ~^.+\.are$~ ~override~ READ_SHORT 0x48 flags READ_SHORT 0x4a prob_rain READ_SHORT 0x4e prob_fog PATCH_IF ((prob_rain != 0) AND // if area can have rain and (prob_fog = 0) AND // doesn't already have fog set and ((flags & BIT2) = BIT2)) // weather flag is set WRITE_SHORT 0x4e (prob_rain / 2) // set fog probability to 1/2 the rain probability END BUT_ONLY END Quote Link to comment
Guest tipun Posted September 10, 2021 Share Posted September 10, 2021 It seems to me that this refers to the fog effects that were added to the SoD. They are configured in the fogarea.2da and fogpt.2da files. Quote Link to comment
maurvir Posted September 11, 2021 Author Share Posted September 11, 2021 (edited) Yup, that's the fog effect I was referring to. It obviously works in BG2EE, since EET is hosted by it, and my goal is to recreate those effects outside of the SoD areas. Looking in these files, it appears that fogarea.2da defines the fog itself, but I'm guessing you would still need to set a flag for the area to enable the fog. Interestingly, you seem to have control over the fog alpha, inner and outer color, and dispersal rate. That's quite a few tunable parameters! With these parameters, you could really create some sweet effects, like green fog for swamps, blueish fog for mountains, etc. Thanks! As an aside, if you do horse around in these files, I'm assuming you would need to do it with a new game? Edited September 11, 2021 by maurvir Quote Link to comment
argent77 Posted September 11, 2021 Share Posted September 11, 2021 It depends on your expectations. Using the code snipped provided by CamDawg should be enough to enable fog on maps. However, if you want to have full control over the fog behavior then you also have to add definitions to FOGPT.2DA and/or FOGAREA.2DA. I wouldn't recommend to define FOGPT.2DA entries though, because without it the fog will creep in from the edges which looks more natural. Setting up definitions allows you to specify only a single fog generator location which may look artificial. Btw, fog on maps with active day/night cycle may cause problems because of a bug in the fog implementation. It looks like the engine applies the night lighting incorrectly to the fog which causes some unwanted coloration (see screenshots below). Spoiler Day: Night: Quote Link to comment
maurvir Posted September 11, 2021 Author Share Posted September 11, 2021 That is, indeed, unnatural. I wonder why the SoD areas appear fine, even though they have day/night cycles? If I could get it to work well, though, I would really like to have fog elsewhere in the game, so I've created an otherwise "blank" EET build to play in. Quote Link to comment
maurvir Posted September 11, 2021 Author Share Posted September 11, 2021 (edited) I had to add a bit more to make a functioning TP2 file, but it *seems* to have worked. I also added a BEGIN line after the PATCH_IF line. BACKUP ~weather/backup~ // location to store files for AUTHOR ~Maur'vir~ VERSION ~v0~ ALWAYS ACTION_IF GAME_IS ~bgee bg2ee iwdee pstee eet~ BEGIN // only for EEs COPY_EXISTING_REGEXP GLOB ~^.+\.are$~ ~override~ READ_SHORT 0x48 flags READ_SHORT 0x4a prob_rain READ_SHORT 0x4e prob_fog PATCH_IF ((prob_rain != 0) AND // if area can have rain and (prob_fog = 0) AND // doesn't already have fog set and ((flags & BIT2) = BIT2)) // weather flag is set BEGIN WRITE_SHORT 0x4e (prob_rain / 2) // set fog probability to 1/2 the rain probability END BUT_ONLY END END However, looking at the ARE file for, say, Beregost shows that the fog probability is still set to 0. Not sure what went wrong, as the rain probability is 30. Edited September 11, 2021 by maurvir Quote Link to comment
maurvir Posted September 11, 2021 Author Share Posted September 11, 2021 (edited) After a bit of playing, I discovered that the red shift bug appears to be linked to the Extended Night flag. If the flag is set, you get normal looking fog. If it isn't, you get red-shifted fog. However, the game apparently really doesn't like it if you set the flag arbitrarily, and I'm not sure why. I set the flag for Beregost, and as soon as the sun went down, the game crashed. I have also noticed that all of the new areas have two tilesets - one for day, one for night. My guess is that setting this flag makes the engine think there should be a second night time tile set, and when it can't find it, it crashes. Which means this may be an intractable problem. I'm pretty sure that the red is because the game thinks "night time" is "twilight" Edited September 11, 2021 by maurvir Quote Link to comment
Guest tipun Posted September 13, 2021 Share Posted September 13, 2021 The Extended Night flag requires the presence of tis(+pvrz) and wed files in the game. I don't have BGEE installed right now. But in EET, Beregost does not have a nighttime graphics files. Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.