[WIP] Near perfect level scaling elimination system

Post » Mon Dec 12, 2011 4:55 pm

Okay, I think I may have finally found a balanced way to eliminate level scaling from Oblivion. It works similar to OOO's system but works entirely through script. First let me go over how certain aspects of Oblivion work so you'll better understand.

The player's level (that is, the actual number that represents the player's level that you see when you open your stats menu) has absolutely no effect on any stats. Health increases by a calculated amount every time you gain a level but the actual level number is not included in those calculations. Fatigue, encumbrance and magicka are all determined by your base stats.

Knowing this we can manipulate the player's level using the script command player.setlevel without affecting anything else on the player. I've done this before and it's worked exactly as expected.

What is affected by the player's level is the rest of the world. When stuff spawns, it's level, type, etc. is determined by the player's level. Most everyone should already know this as level scaling. Now, if we set up a script to constantly set the player's level to, say, 15, only stuff set to spawn around level 15 will spawn. Again, I've done this before and it's worked exactly as expected, although I did have to make sure to only run it AFTER the starter dungeon to avoid complications with character generation.

Of course having the entire world set at level 15 has it's limitations. For instance you'll never find glass or daedric armor and expert class alchemy apparatus is forever out of your reach. So the obvious solution is to periodically have the player's level change. But based on what?

At first I thought of using a random variable to change it up but the more I thought about it the more it seemed inefficient. It would work but whenever you revisited a location after a time it would be completely different. Could be good in some cases but it's awfully unpredictable. It would also cause problems in dungeons with multiple cells, where one cell could be level 1 and the next could be level 30.

So after a bit of scouring I came across this little gem of a script command: GetDistance. Apparently it works regardless of whether both objects are in the same cell, although with the player I'll have to make sure the calling object is a disabled creature or something. The idea is I can set the player's level based on the distance to one or several objects. Ideally there would be one object in each major city. The further the player is from a city, the higher his level goes, the higher the world levels with him. Getting each of these objects to work with each other might be a bit complicated. But that's the overall concept. I should even be able to set it up where the player actually sees his true level when he goes into the stats menu.
User avatar
Mario Alcantar
 
Posts: 3416
Joined: Sat Aug 18, 2007 8:26 am

Post » Tue Dec 13, 2011 2:23 am

Oooo, nice. Someone has their thinking cap on :)

A system like that could prove to be very interesting, and not all together unexpected given how most games handle similar situations.

You'll definitely want to swap that level back whenever the player opens the menu, and then back again to it's previous value once closed. Probably for safety also change it back when they open the save menu. That way it will hide what's going on behind the scenes and you won't need to worry about someone being the wrong level if they remove the mod.

The distance thing is actually something some of us were discussing on another forum but in relation to a Divine Intervention spell. Dwip came up with something that appears to work, so it could probably be adapted for whatever calculation you're doing.
User avatar
Kanaoka
 
Posts: 3416
Joined: Fri Jun 16, 2006 2:24 pm

Post » Tue Dec 13, 2011 12:27 am

As reference - have you seen http://tesnexus.com/downloads/file.php?id=23993
User avatar
Dj Matty P
 
Posts: 3398
Joined: Sat Jun 09, 2007 12:31 am

Post » Mon Dec 12, 2011 10:12 pm

One interesting thing about this idea is that it would be possible to get it to work properly - after some work - in combination with Dynamic Leveled Lists. The main thing keeping me from using DLL (aside from the save delay, which is supposed to be fixed or getting there) is that it's basically incompatible with OOO/FCOM. Sure, you can run it (I have) but with standard settings, it undoes a huge portion of the leveled list changes. There's a setting in the DLL INI to allow it to use the List Level instead of the NPC/Creature Level to calculate it's offsets, but in that case you run the risk of running into things hugely more powerful than you in any but the safest areas. Basically you had the chance running into things offset by 7 levels - from the expected level of the area, not YOUR level - ANYWHERE. This forces you to stay in areas that aren't much higher than your level, because otherwise you chance something way too tough to give you even a slim chance of winning.

If you somehow merged this concept with the DLL concept, you could create a system that would balance to a locational "danger level" with a chance of higher level creatures that nonetheless is random.

Here's an idea - rather than just put markers in cities and have danger levels increase according to your distance - which would actually give, in my opinion, too static an experience - create a marker system with a minimal amount of randomization... certain areas given a marker that might have a "base level" of 15, say, but which could vary from that by as much as 3-5 levels in either direction. You could also make it possible for modders to add these markers to their own dungeons to control the spawn level there.

It would also be really cool if you could add, perhaps to the local map, a UI element that told you the "difficulty" of the area you happened to be in, by the difference of the effective level being given to the leveled lists from your real level. Something non-specific, ranging from a green "easy" sign if you were in a dungeon that was 10 levels below you, to a bright red "Danger" anywhere more than 10 levels higher than your real level. That kind of difficulty indicator isn't possible with OOO because there's nothing but the LL's controlling the difficulty, no simple check to be made to return a value that would make it obvious how "hard" an area was for your character. But with this system it would be easy.
User avatar
ruCkii
 
Posts: 3360
Joined: Mon Mar 26, 2007 9:08 pm

Post » Mon Dec 12, 2011 11:05 pm

Well it was a nice idea but it's starting to look like a bust. I think Oblivion can't handle the distances I'm working with. It keeps returning some huge number, like float max value, and it's the same number every time. The original concept is sound but I need something other than distance to base the level adjustment off of.
User avatar
cheryl wright
 
Posts: 3382
Joined: Sat Nov 25, 2006 4:43 am

Post » Mon Dec 12, 2011 10:50 pm

Chances are you'll only be able to perform the distance calculation itself from the Tamriel worldspace, with your markers placed roughly in the center of the city cells in Tamriel. You should be able to get a valid distance so long as you're in the same worldspace as the markers, then set the player's level accordingly.
User avatar
Logan Greenwood
 
Posts: 3416
Joined: Mon Jul 30, 2007 5:41 pm

Post » Mon Dec 12, 2011 12:35 pm

I wonder if the markers could be dynamically created so that it would be mod independent. Markers would be set for the current cell, as well as the surrounding cells. When a marker is added, a level is assigned to it, and perhaps a snapshot of the character's base skill levels, and perhaps a dynamic/static flag (randomly generated?). The level assigned could fall within a range based on the combined skill levels, as well as any surrounding markers. Whenever the character reenters the cell, the character's level changes. But it also compares the characters combined base skill levels to the ones saved in the snapshot. If the combined skills reach a certain threshold, and the marker is flagged as dynamic, a new snapshot is taken and a different level is assigned based on those skills and levels of surrounding markers in adjoining cells. The static markers become anchor points / safe areas. But since they are randomly determined, you won't necessarily know where they are without playing it. As you advance in levels, areas you visit before will also advance, but the static anchor points will pull it back somewhat on average. But new unmarked areas would naturally be more difficult.

This approach would eliminate the need for get distance as all you have to do is determine whether the marker object is in the cell, if not, then add it. If the marker is in the same cell as player, the level is assigned. Since the check would only happen on cell entry, it should keep it light.
User avatar
Harinder Ghag
 
Posts: 3405
Joined: Wed Jan 17, 2007 11:26 am

Post » Mon Dec 12, 2011 5:38 pm

One problem that really complicates things is that any changes to the player's level must be done before the player enters the cell. Otherwise by the time the player's level is changed everything in the cell is already spawned at the level before the change. I thought about trying something in the menumode loadscreen block but the results could be unpredictable and might cause stability issues. Another option is to place triggers at the entrances of dungeons that modifies the player's level. That's a lot of work though and it wouldn't extend to mods. There would also be issues with the player using unconventional means of leaving the cell such as the divine intervention mentioned earlier. I'll sleep on it, see if I can come up with anything else. The random level change idea is starting to look tempting again.
User avatar
Josephine Gowing
 
Posts: 3545
Joined: Fri Jun 30, 2006 12:41 pm

Post » Mon Dec 12, 2011 10:29 pm

One problem that really complicates things is that any changes to the player's level must be done before the player enters the cell. Otherwise by the time the player's level is changed everything in the cell is already spawned at the level before the change.

I don't think that's necessarily a bad thing. That just means that whatever cell you are in determines what you will get in the next cell, that kind of makes sense. And what's interesting about that is if you enter a cell from four different directions, you will have a slightly different experience with newly spawned things, depending on the marker/direction you came from. So it might mix things up quite nicely, without being too extreme or predictable.
User avatar
Agnieszka Bak
 
Posts: 3540
Joined: Fri Jun 16, 2006 4:15 pm

Post » Tue Dec 13, 2011 3:26 am

I suggest adding a modifier to the player's level to control level scaling (effective level = player's level + modifier). That would solve a lot of complications and be more compatible. You could do scaling independently of the player's level, while still keeping leveling. Or include more factors into the effective level, like making it dependent on how many combat skills you are good at. Or have the quality of the items you find depend on luck. Etc, etc. Of course you have to ask the OBSE team to add it. Have two separate modifiers, for creatures and for items.

Also, you could check the region the player is in instead of the distance from a city. Check out World->Regions in the CS. There is already an OBSE function called GetCurrentRegions to get which region(s) the player is in.
User avatar
cosmo valerga
 
Posts: 3477
Joined: Sat Oct 13, 2007 10:21 am

Post » Mon Dec 12, 2011 12:01 pm

One problem that really complicates things is that any changes to the player's level must be done before the player enters the cell. Otherwise by the time the player's level is changed everything in the cell is already spawned at the level before the change.
As others have said, this will not be a problem when staying outside - at worst you get the spawns that belong to the neighbour cell. And in any way, when outside, Oblivion has your cell, + two rings of cells around you, for a total of 25 cells loaded, and a cell respawns the moment in gets loaded. So when moving around outside, a cell loads when a couple of cell's distance away from you, not when you enter it.

I thought about trying something in the menumode loadscreen block but the results could be unpredictable and might cause stability issues. Another option is to place triggers at the entrances of dungeons that modifies the player's level. That's a lot of work though and it wouldn't extend to mods.
For cell transitions that require activation of a door, you can have a gamemode block that runs every frame and keeps checking when the player hits the activation key. When it does, the mod can get the reference of the object in the crosshair, check if this is a load door and where it leads to, and set the level at that moment, a couple of frames before the cell change actually happens. I do similar trick in my Enhanced Economy mod in order to change the content of containers at the moment of activation.

There would also be issues with the player using unconventional means of leaving the cell such as the divine intervention mentioned earlier.
That's true, but is IMHO so specialized that you shouldn't really have to worry about.

Another possibly larger problem that I haven't seen mentioned, is other mods/quests that are dependent on player level for things they do, or mods that adjusts the player level. To the former category are quests that are dependent on the player level for triggers, like the vanilla Daedric quests. To the latter category are leveling mods like Realistic Leveling and nGCD. I know from inspection that RL recalculates the stats now and then, and will then re-adjust level as well. So the best for compatibility is if you could detect when a cell change is about to happen (like I gave a solution for, when it comes to load doors), change the level to whatever you want then - and then change the level back a few frames after the new cell has loaded. That way you avoid incompatibility with both types of mods.
User avatar
BrEezy Baby
 
Posts: 3478
Joined: Sun Mar 11, 2007 4:22 am


Return to IV - Oblivion