Jump to content

Optimising Project Reality.


EPDGaffney

Recommended Posts

So, Project Reality is one of my favourite mods, one I will never ever remove for any playthrough if I can help it. But it's messy. And it kills my CPU. And on a more subjective level, I'd like it to defer to the default weather in specific regions. So, I've started looking through the scripts and though I wouldn't call myself an expert, a lot of it looks a bit off, and if anyone's willing, I'd like some help understanding how best to approach this.

 

First off, it adds loads of scripts and I think every single one of them starts as soon as the game starts and updates every 0.1 seconds. Now, I don't really know the reason why the mod author did this, but I really feel in my gut that it's probably excessive to update that frequently. The default of 5 seconds is unfortunately, I would think, too infrequent, but what if I set it to maybe every 1 second, or 2 if I wanted to push it?

 

Second, there is an awful bug in this mod, which causes the radstorm effects to last indefinitely. I can't really work out exactly what to alter in the script to fix it. The short and long of it is if you're caught in a radstorm, going inside should stop the effects (spell and image space modifier) but very frequently does not. Granted, I was far worse at modding and scripting when I last tried, and I've been focussing on other aspects of this personalisation so far. Here's a thread that may help:

https://forums.nexusmods.com/index.php?/topic/997928-project-reality-bug-fix-work-in-progress/

 

Last, I want to restore the default weathers in Searchlight, Cottonwood Cove, The Fort, and all of Dead Money. Maybe Honest hearts as well, thinking about it. My current approach was going to be either an IsPlayerInRegion function in a quest script, or maybe a lot of triggers. The idea is to disable some of the Project Reality quests whilst in these regions, and enable it on leaving. I'd like some help thinking this through especially.

 

My plan for Dead Money is much simpler: add a trigger near where you go into the DLC, which turns off the PR quests, and then script it to turn them back on once the player returns.

 

The alternative to all this is to go into all these scripts and actually look for everything that would need to be tempered by conditional statements pertaining to region, and set it manually. I don't like the work that would be, but it may be the cleanest way. Any advice on that would be nice, if possible.

 

Thanks a million.

 

Edit: Already implemented the Dead Money disabling, and it works perfectly. Also, one of the other things I was doing was to add more fog to obscure the poor LOD of the engine. I did this in FNVedit, and a lot of it looks phenomenal, but I overdid it for some weathers. Does anyone know any guide that goes into detail on weather settings like this?

 

Edit 2: For Searchlight, I attempted to use a large trigger box, but it never called the functions. I then tried in the console to turn off all the PR quest scripts, which worked, but then the weather never changed in Searchlight, even when I put it in the console. Have to do more tests.

 

Edit 3: Fog looks good now. Caved and used a script that checks whether the player's in Searchlight, every 5 seconds, and then applies not the weather but an image space modifier. Tried Searchlight's but it looks very different with PR's lighting, so I'm making a custom one. Then I need to make a transition for it as it's currently very jarring. Then I'll use the same technique for the Legion areas, though I'll use a script that only gets called when travelling to and from the Fort, and probably the Legate Camp as well. I'll decide later on whether or not to touch Cottonwood Cove. And finally, been using PR with the scripts set to update every 5 seconds as per the default, and I haven't noticed any difference, whether good or bad, so I can't say anything really useful about it yet.

 

Edit 4: Worked out a pretty amazing look for Searchlight, including some great changes to the fog that revert cleanly once you exit the area. However, 'cleanly' is relative, and what I mean by that here is that it is functionally clean, but visually a jarring change. I'm looking for a way to automate a gradual transition from the image space modifier being off to being on, and vice versa. I thought there was a simple way that I'd encountered over the years but don't see anything now. I can script it pretty easily if necessary. I'd like something similar with the fog but that's less important, I think.

 

If you're interested:

https://prnt.sc/hfoi0t

 

Edit 5: Very pleased with the gradual shift into the image space modifier now, which I did using a fade-in version and a timer that switches the fade-in one with the static one once the fade-in one should be faded in. I used 30 seconds, and it looks great, but if you go in and out of Searchlight's region too rapidly, it can apply the fade-in and the fade-out simultaneously, which if done in just the wrong way, will produce a very dark image. So I added a variable to counteract this. But then you can get a jarring shift. So now I have another idea...I think I'll have to drop it down a bit, but there's another condition I can set that i think will help. Next, unless there's a function I'm missing, I may have to script the fog to close in second by second. Invigorating.

 

Edit 6: New amazing wonderful bug (or incompetence on my part): I turned down the transition from taking 30 seconds to taking 10 seconds, and now it just abruptly switches instead of 'animating' any of the image space modifiers. At 30 seconds, it looked literally perfect after fine-tuning the script, but it took too long, as you could make it very far away from the area in 30 seconds' time. 10 or 5 seconds would be better, but after doing a lot of testing, it's not my script but instead my image space modifier that isn't working. That's good at least.

 

Edit 7: I don't actually know why it wasn't working, but my guess is a glitch, or just maybe I don't understand how the image space modifier editor window works in some capacity. I tried remaking the modifier from scratch and it does the same thing. It just takes longer than 10 seconds to get to where it's supposed to be at 10 seconds, and I have no idea why. So I've increased the time in the script, not the modifier, to 15 seconds, and it does what I wanted. So that's good. Time to do the fog, and then at long last fix it so that if you go into an interior that has a door in Searchlight, coming back from that will make these changes instant.

 

Edit 8: I've done the fog for when the player enters Searchlight. It gradually decreases its distance from the player by 1000 per second. The code for this was simple enough:

            If GetWeatherTraitNumeric rLastWeather 16 > 5000
                Set FogDayDec to GetWeatherTraitNumeric rLastWeather 16 - 1000
            EndIf

            If GetWeatherTraitNumeric rLastWeather 16 > 5000
                SetWeatherTraitNumeric rLastWeather 16 FogDayDec
            EndIf

It looks good, but I wish I could have it increases in smaller increments without placing a huge load on the system, which is already under a fair bit of stress in this area. I'm not sure of the logic I want to use to return the fog to its initial state (which is currently stored as a reference variable on entering Searchlight), but I'm fairly pleased with this.

 

Edit 9: I changed the quest to update every .1 seconds just until the fog is at a distance of 5000 units from the player, and now it moves in increments of 100 for just a few seconds and then it calms down. It works lovely. As for making the fog recede, it honestly looks fine as is, I think, and I may just keep it this way.

Edited by EPDGaffney
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...