[WIP] Oblivion XP Update

Post » Thu Apr 07, 2011 9:22 pm

It's great to see someone picking this great mod up and fixing some of the issues it has! Thanks! In my short time playing Oblivion XP I have found a couple of issues. Not sure if they've been posted already, but I just want to add my two cents. Note: I'm using Oblivion XP v4.15 which I believe is the latest version (correct me if I'm wrong).

First: If you're attacking a creature and someone comes to your help, say a guard, and you don't land the finishing blow - the guard does - then you don't get any XP! Its frustrating to think that you've gone through all the effort only to lose all the XP because someone else finished the creature off. It would be nice to get a certain amount of XP for that, possibly based on how much damage you've dealt before the creature was killed.

Second: Combat mods. I've been playing with Unnecessary Violence recently, and noticed that if you kill something with a UV combat move you get no experience...again! I've used Deadly Reflex and Adrenaline-Fuelled Combat as well, but haven't tested with Oblivion XP. When I get round to I'll post the results here.

Lastly, a suggestion: When I advance in levels, I get more experience from lockpicking. Shouldn't this be the other way around? My suggestion is that I should get less experienced based on the difficulty of the lock and my Security skill. For example, I open an easy lock with a Security skill of 30, and it yields 50 XP. If my Security skill goes up to 40, then the same lock should yield less XP. I understand that there are, probably, a finite number of locks that you can pick in the game, and that as you level up, the XP required to advance is greater, but it just seems a bit more realistic to reduce the XP gained as my Security skill improves.

Thanks again!
User avatar
Tiffany Carter
 
Posts: 3454
Joined: Wed Jul 19, 2006 4:05 am

Post » Thu Apr 07, 2011 9:44 pm

Second: Combat mods. I've been playing with Unnecessary Violence recently, and noticed that if you kill something with a UV combat move you get no experience...again! I've used Deadly Reflex and Adrenaline-Fuelled Combat as well, but haven't tested with Oblivion XP. When I get round to I'll post the results here.

From my experiences, Deadly Reflex 5 and Oblivion XP work quite well together. You still get XP from doing special killing moves. I haven't tried out UV or Adrenaline-Fueled Combat, so I can't tell you if your experiencing some sort of issue, or if the other mod is compatible.

I actually remember back in the day that Oblivion XP and Deadly Reflex 5 used to work too well together. In the earlier versions, sometimes decapitating a level 5 enemy would cause the system to glitch and said I killed a level 50 enemy and gave me that much experience. But that has been fixed and I'm glad.
User avatar
Channing
 
Posts: 3393
Joined: Thu Nov 30, 2006 4:05 pm

Post » Thu Apr 07, 2011 1:59 pm

It's great to see someone picking this great mod up and fixing some of the issues it has! Thanks! In my short time playing Oblivion XP I have found a couple of issues. Not sure if they've been posted already, but I just want to add my two cents. Note: I'm using Oblivion XP v4.15 which I believe is the latest version (correct me if I'm wrong).

First: If you're attacking a creature and someone comes to your help, say a guard, and you don't land the finishing blow - the guard does - then you don't get any XP! Its frustrating to think that you've gone through all the effort only to lose all the XP because someone else finished the creature off. It would be nice to get a certain amount of XP for that, possibly based on how much damage you've dealt before the creature was killed.


Can't help this one, I'm afraid :( The issue is that the guard technically isn't a companion (or a follower), so there's no way to link him to you. There are actually built-in game functions that determine if someone is a companion or not and those are what Ob XP uses. I actually made a little quip in one of my previous posts that Ob XP users hate guards and that is what I was referring to. The latest version of OBSE does have some functions that might help with this, but I think it would be a lot of work compared to the reward. I don't think the loss in XP from these cases is enough to overhaul the killing script that rewards the points.

Second: Combat mods. I've been playing with Unnecessary Violence recently, and noticed that if you kill something with a UV combat move you get no experience...again! I've used Deadly Reflex and Adrenaline-Fuelled Combat as well, but haven't tested with Oblivion XP. When I get round to I'll post the results here.


I don't know if this is something I can fix or not. Ob XP uses miscellaneous stats to determine kills. I suspect these mods are using another mechanism to actually kill the opponent and those kills don't increase the miscellaneous stats, so Ob XP doesn't record them. Now this is just a guess. If you could run these commands in the console before and after you kill something with a UV move, I will be able to confirm my suspicions:

getPCMiscStat 5
getPCMiscStat 6

Misc. stat 5 is the counter for creature kills and 6 is the counter for NPC kills. If you could run that command just before you kill the creature or NPC and then run it again afterwards, I'll be able to see if those stats are increased after the kill. The game is paused when you open the console, so you can do it right in the middle of combat :)

Lastly, a suggestion: When I advance in levels, I get more experience from lockpicking. Shouldn't this be the other way around? My suggestion is that I should get less experienced based on the difficulty of the lock and my Security skill. For example, I open an easy lock with a Security skill of 30, and it yields 50 XP. If my Security skill goes up to 40, then the same lock should yield less XP. I understand that there are, probably, a finite number of locks that you can pick in the game, and that as you level up, the XP required to advance is greater, but it just seems a bit more realistic to reduce the XP gained as my Security skill improves.

Thanks again!


I might be able to do something like that. I have to get the misc. actions script working reliably first :) Some people don't get any XP at all for misc. actions at all... There is an ini setting that allows you to turn off the bonus XP due to level, but that would apply to all misc. actions. Currently Ob XP doesn't consider your skills at all when awarding points, so that's why you see an increase in the points awarded. If you flip the ini setting, you would get the same amount of XP through the whole game. However you would still get 60 pts for opening a very hard lock, whether your security skill was 10 or 100. I have to be careful what effect the Skeleton Key might have on this though... I always have the Skeleton Key, so I don't worry about the lockpick mini game anymore. I still play it every once in a while - and usually pick the lock faster that way :)
User avatar
Sunny Under
 
Posts: 3368
Joined: Wed Apr 11, 2007 5:31 pm

Post » Thu Apr 07, 2011 10:10 am

I guess this is the best place to ask for now:

In my HUD Status Bars mod thread, I have got request for how to set up a status bar that display OblivionXP leveling. To do so, I need to know which quest variables to read from. E.g. if you have a variable for current number of XP, a variable for number of XP needed to reach next level, and possibly a variable for the number of XP to reach the previous level, or something like this. Can you provide me the details (with fully qualified name of variables, questName.varName)?
User avatar
Juan Cerda
 
Posts: 3426
Joined: Thu Jul 12, 2007 8:49 pm

Post » Thu Apr 07, 2011 1:52 pm

I guess this is the best place to ask for now:

In my HUD Status Bars mod thread, I have got request for how to set up a status bar that display OblivionXP leveling. To do so, I need to know which quest variables to read from. E.g. if you have a variable for current number of XP, a variable for number of XP needed to reach next level, and possibly a variable for the number of XP to reach the previous level, or something like this. Can you provide me the details (with fully qualified name of variables, questName.varName)?


I've also gotten requests to fix Ob XP's own status bar so that it's more in line with the others when using Darn UI. I think we traded comments on that earlier. Now in Ob XP, you can turn off the level progress bar. So I guess that's how people have fixed it - turn it off and use your's instead! :)

I think the variables you need are:
ObXPMain.currentXP
ObXPMain.neededXP

The neededXP has already been adjusted so that it's a round number. The level progress is calculated by (currentXP / neededXP) * 100. There is also a variable for the total experience points and the playing time is also recorded. Both are used to calculate an hourly experience point amount which is displayed in the character menu, not in the HUD. Here is a screenshot showing the http://i855.photobucket.com/albums/ab118/AndalayBay/Oblivion/ObXPprogressbar.jpg. And here is the http://i855.photobucket.com/albums/ab118/AndalayBay/Oblivion/ObXPcharmenu.jpg in the character menu.

If you want the other variables, they are:
ObXPMain.totalXP
ObXPMain.playTime
ObXPMain.restedXP

restedXP is the experience point bonus you get for resting. I have it turned off (it's an option in the ini). Ob XP is as configurable as your mods are :) I don't know how you would use rested XP in a HUD status bar, but I'll provide the variable anyway. All of these variables are floats, except needed XP has been rounded down (modulus function).

Lastly there are variables to record the number of training sessions per level. That's how many sessions you've had and how many you are entitled to. You can have training sessions carry over in Ob XP. That has some bugs right now that I'm trying to fix, so I won't include those variables right now. Besides, do you want me to put any more ideas in players' heads? :) I can provide those variables once I have fixed the script, if you want.

If you need anything more, let me know.

Edit: Ignore rested XP. It doesn't work directly as a bonus. I've had it disabled for so long, I forgot how it works :) Anyway, it works more like a repository. While you have rested XP, any experience points you gain are doubled. The base experience points you gain are deducted from your rested XP. Once your rested XP runs out, the experience points you gain revert to normal levels. Interesting way to do it... That's what I love about this mod - the design details that went into it...
User avatar
bimsy
 
Posts: 3541
Joined: Wed Oct 11, 2006 3:04 pm

Post » Thu Apr 07, 2011 8:22 pm

How you could show rested xp on an xp bar in the hud would be to have the amount of xp you need to finish your rested xp shaded in with a different color. For example you are half way through the level so the right side of the bar could be blue and the left side is red. You then rest and when you wake up a portion of the bar that was red is now green to represent the rested xp.
User avatar
MISS KEEP UR
 
Posts: 3384
Joined: Sat Aug 26, 2006 6:26 am

Post » Thu Apr 07, 2011 4:43 pm

How you could show rested xp on an xp bar in the hud would be to have the amount of xp you need to finish your rested xp shaded in with a different color. For example you are half way through the level so the right side of the bar could be blue and the left side is red. You then rest and when you wake up a portion of the bar that was red is now green to represent the rested xp.


Yeah, the current progress bar does something like that, doesn't it? I've played with the rested XP thing disabled for so long, I can't remember :) I may have to enable it again to check...
User avatar
Sabrina Steige
 
Posts: 3396
Joined: Mon Aug 20, 2007 9:51 pm

Post » Thu Apr 07, 2011 2:51 pm

Can't help this one, I'm afraid :( The issue is that the guard technically isn't a companion (or a follower), so there's no way to link him to you. There are actually built-in game functions that determine if someone is a companion or not and those are what Ob XP uses. I actually made a little quip in one of my previous posts that Ob XP users hate guards and that is what I was referring to. The latest version of OBSE does have some functions that might help with this, but I think it would be a lot of work compared to the reward. I don't think the loss in XP from these cases is enough to overhaul the killing script that rewards the points.


I don't know if this is something I can fix or not. Ob XP uses miscellaneous stats to determine kills. I suspect these mods are using another mechanism to actually kill the opponent and those kills don't increase the miscellaneous stats, so Ob XP doesn't record them. Now this is just a guess. If you could run these commands in the console before and after you kill something with a UV move, I will be able to confirm my suspicions:

getPCMiscStat 5
getPCMiscStat 6

Misc. stat 5 is the counter for creature kills and 6 is the counter for NPC kills. If you could run that command just before you kill the creature or NPC and then run it again afterwards, I'll be able to see if those stats are increased after the kill. The game is paused when you open the console, so you can do it right in the middle of combat :)



I might be able to do something like that. I have to get the misc. actions script working reliably first :) Some people don't get any XP at all for misc. actions at all... There is an ini setting that allows you to turn off the bonus XP due to level, but that would apply to all misc. actions. Currently Ob XP doesn't consider your skills at all when awarding points, so that's why you see an increase in the points awarded. If you flip the ini setting, you would get the same amount of XP through the whole game. However you would still get 60 pts for opening a very hard lock, whether your security skill was 10 or 100. I have to be careful what effect the Skeleton Key might have on this though... I always have the Skeleton Key, so I don't worry about the lockpick mini game anymore. I still play it every once in a while - and usually pick the lock faster that way :)




Hello, thanks for the quick reply!

Yeah, I figured that would be hard, but if you're facing high level characters that you've put a lot of effort into killing, and some guard comes along at the end of the fight to deliver the killing blow, you get nothing. And I swear I saw that guard walk away with a boastful swagger!

Here are the results that you asked for:

getPCMiscStat 5
Player misc stat value 165.00

getPCMiscStat 6
Player misc stat value 69.00

From what I gathered from the UV readme, UV actually doesn't use the Oblivion combat system at all, instead it builds its own complementary system.


On the last point (lockpicking), I was just making a suggestion. Dunno if its worth the effort though. Just thought of it as something that would add some realism to the game.

Thanks again!
User avatar
Solène We
 
Posts: 3470
Joined: Tue Mar 27, 2007 7:04 am

Post » Thu Apr 07, 2011 6:25 pm


Here are the results that you asked for:

getPCMiscStat 5
Player misc stat value 165.00

getPCMiscStat 6
Player misc stat value 69.00

I think you have made a mistake here. According to Andalaybay :
If you could run that command just before you kill the creature or NPC and then run it again afterwards

You have to run both commands before and after a kill for Andalaybay to investigate. :wink_smile:
User avatar
tiffany Royal
 
Posts: 3340
Joined: Mon Dec 25, 2006 1:48 pm

Post » Thu Apr 07, 2011 10:43 pm

Hello, thanks for the quick reply!Yeah, I figured that would be hard, but if you're facing high level characters that you've put a lot of effort into killing, and some guard comes along at the end of the fight to deliver the killing blow, you get nothing. And I swear I saw that guard walk away with a boastful swagger!Here are the results that you asked for:getPCMiscStat 5Player misc stat value 165.00getPCMiscStat 6Player misc stat value 69.00 From what I gathered from the UV readme, UV actually doesn't use the Oblivion combat system at all, instead it builds its own complementary system. On the last point (lockpicking), I was just making a suggestion. Dunno if its worth the effort though. Just thought of it as something that would add some realism to the game.Thanks again!



I think you have made a mistake here. According to Andalaybay :You have to run both commands before and after a kill for Andalaybay to investigate. :wink_smile:


Thanks for running the commands, but as lth886 said, you need to run it before and afterward ;) I need to see if the misc. stat is being increased - that's how Ob XP detects the kill.

If your target is a creature, then you only need to run

GetPCMiscStat 5

before killing the creature and then again afterwards.

If you target is an NPC, then you only need to run

GetPCMiscStat 6

before and afterward.

Now I have discovered that sometimes these stats will increase and you still won't get credit for the kill. That's not Ob XP's fault: it's a known bug. Anyway, if you could run those commands and post your results then we'll take it from there. I know what the work-around is for the bug and can pass that information along to the UV guys if necessary. Ob XP won't be able to do anything about it if that's the case.
User avatar
Mizz.Jayy
 
Posts: 3483
Joined: Sat Mar 03, 2007 5:56 pm

Post » Thu Apr 07, 2011 2:45 pm

Thanks for running the commands, but as lth886 said, you need to run it before and afterward ;) I need to see if the misc. stat is being increased - that's how Ob XP detects the kill.

If your target is a creature, then you only need to run

GetPCMiscStat 5

before killing the creature and then again afterwards.

If you target is an NPC, then you only need to run

GetPCMiscStat 6

before and afterward.

Now I have discovered that sometimes these stats will increase and you still won't get credit for the kill. That's not Ob XP's fault: it's a known bug. Anyway, if you could run those commands and post your results then we'll take it from there. I know what the work-around is for the bug and can pass that information along to the UV guys if necessary. Ob XP won't be able to do anything about it if that's the case.


Sorry, it seems I misunderstood your post concerning the getpcmiscstat.

I used getPCMiscStat 5 before and after killing a rat.

The results are 0.00 before and after the kill (no change), and I only used UV combat moves to make sure. Uninstalled most of my mods - Oblivion kept CTD-ing - including UV, which is why the value is back at zero. Anyway, reinstalled UV and OXP to test this out.

I think you're hunch is right and there is no solution (UV doesn't use the vanilla combat system at all). Thanks for answering my questions anyway!
User avatar
zoe
 
Posts: 3298
Joined: Sun Nov 12, 2006 1:09 pm

Post » Thu Apr 07, 2011 11:10 pm

I'm not sure if anyone noticed this but you could unlock the next tier of the skill usage (i.e. Expert, Mastery...) if you are one point away from it. You just read a book that gives the +1, and you will unlock the new rank's perks even if you are way underleveled for it.

I am not sure if this has been brought up.

Also, somewhat minor as it would be really tedious to expliot: Steal an item, drop it, steal it again...
User avatar
Lawrence Armijo
 
Posts: 3446
Joined: Thu Sep 27, 2007 7:12 pm

Post » Thu Apr 07, 2011 6:17 pm

I'm not sure if anyone noticed this but you could unlock the next tier of the skill usage (i.e. Expert, Mastery...) if you are one point away from it. You just read a book that gives the +1, and you will unlock the new rank's perks even if you are way underleveled for it.

I am not sure if this has been brought up.

Also, somewhat minor as it would be really tedious to expliot: Steal an item, drop it, steal it again...


The level restrictions only apply in the levelling screen, so yes, if you read a book or do certain quests that award skill increases, you could unlock the next rank of proficiency even though your character has not reached the appropriate level for it. I can't do anything about that, I'm afraid, because the base game doesn't have any such restrictions. At least the levelling screen should prevent you from increasing those skills any more until you attain the appropriate level.

Also can't do anything about the stealing thing. Yes this is an exploit, but there are lots of those in the game, both with Ob XP and without :) Makes up for the points you lose when a guard kills a baddie on you (and deprives you of the points for the kill). ;)
User avatar
Melissa De Thomasis
 
Posts: 3412
Joined: Tue Feb 27, 2007 6:52 pm

Post » Thu Apr 07, 2011 12:03 pm

Sorry, it seems I misunderstood your post concerning the getpcmiscstat.

I used getPCMiscStat 5 before and after killing a rat.

The results are 0.00 before and after the kill (no change), and I only used UV combat moves to make sure. Uninstalled most of my mods - Oblivion kept CTD-ing - including UV, which is why the value is back at zero. Anyway, reinstalled UV and OXP to test this out.

I think you're hunch is right and there is no solution (UV doesn't use the vanilla combat system at all). Thanks for answering my questions anyway!


Then that's not just a problem for Ob XP, that's an issue for the base game itself! Creature and NPC kills don't count for much, but I know of one occasion in which you have to have had a certain number of NPC kills to get something :) Not murders, just kills. Mind you, this might affect your murder stats too. Probably in the end doesn't matter unless you use UV combat moves for all your kills. I'll check the UV thread and see if it is still in development. If so, I'll suggest a fix for the mod author.

As I said there are some issues with these stats, but there is a work-around. I had to use it to get the poison kills working :)
User avatar
Causon-Chambers
 
Posts: 3503
Joined: Sun Oct 15, 2006 11:47 pm

Post » Fri Apr 08, 2011 12:51 am

I couldn't find a thread for UV - nothing recent anyway, so I sent a note to Hex_off. At one point he was saying that an upgrade was in the works that would fix a variety of bugs, but I don't know where that stands. I mentioned the issue to him. At this point I'll wait and see if there is a fix that can be done on that side because trying to do one in Ob XP would mean code specific for that mod. I'm also not sure I could get enough information from UV to detect the condition and do a fix. I see that this has been an issue for quite a while - even when SirFrederik was still working on Ob XP. So we'll hang on to this one for a while and see what develops.

Another update: my parcel is supposed to arrive tomorrow. Then I have to figure out how to install SI into an existing, modded game :eek: I think the summoner or poison fix was easier :)
User avatar
Dj Matty P
 
Posts: 3398
Joined: Sat Jun 09, 2007 12:31 am

Post » Thu Apr 07, 2011 6:35 pm

Question: Would you like me to reward points for the master training quests? These are the little mini quests you do to get training from a master trainer. Some of them involve a bit of work, so I think points should be rewarded. Currently no points are awarded for these quests.
User avatar
Oceavision
 
Posts: 3414
Joined: Thu May 03, 2007 10:52 am

Post » Thu Apr 07, 2011 1:37 pm

Question: Would you like me to reward points for the master training quests? These are the little mini quests you do to get training from a master trainer. Some of them involve a bit of work, so I think points should be rewarded. Currently no points are awarded for these quests.


+1 Vote. Yes please! :)
User avatar
biiibi
 
Posts: 3384
Joined: Sun Apr 08, 2007 4:39 am

Post » Thu Apr 07, 2011 9:54 pm

I figured it wouldn't take much considering that most of the complaints revolve around not getting points for stuff :wink_smile: I wasn't going to make it a huge amount, but I figure once you're getting to the point of doing master quests, even a few points would be welcome!

Good to hear from you Aequitas. I've been looking for some of the "oldtime" Ob XP users...
User avatar
Eoh
 
Posts: 3378
Joined: Sun Mar 18, 2007 6:03 pm

Post » Thu Apr 07, 2011 1:43 pm

Just'd like to say I fully endorse this undertaking.

Also, in regards to the getting experience for repeatedly "re-stealing" an object, perhaps remove gaining experience from stealing items altogether and instead give experience for fencing them instead. If such a thing were possible.
I'm really looking forward to your fix for poison kills as well. My poor assassin needs his xpziez.
User avatar
Elisha KIng
 
Posts: 3285
Joined: Sat Aug 18, 2007 12:18 am

Post » Thu Apr 07, 2011 5:46 pm

Just'd like to say I fully endorse this undertaking.

Also, in regards to the getting experience for repeatedly "re-stealing" an object, perhaps remove gaining experience from stealing items altogether and instead give experience for fencing them instead. If such a thing were possible.
...

You know, I might just look into that - that's an excellent idea :) I always felt stealing an object was typically no big deal and I usually disable the xp, but fencing it at least is a little more commitment ;) If I'm not mistaken, you can even fence stolen items to Manheim, although you'll need a mod like Living Economy or Enhanced Economy to make that feasible (he doesn't have much gold otherwise).

Alright, got my parcel - off to install SI now. Keep fingers crossed :)
User avatar
Javaun Thompson
 
Posts: 3397
Joined: Fri Sep 21, 2007 10:28 am

Post » Thu Apr 07, 2011 8:57 pm

That is a good idea making it so you get experience for fencing the items instead. I suggest that the experience be based on the items worth and there should be a minimum value to get experience.
User avatar
Mylizards Dot com
 
Posts: 3379
Joined: Fri May 04, 2007 1:59 pm

Post » Thu Apr 07, 2011 6:37 pm

If i'm putting redundant just ignore me.
1. My PC out of fight , litches are fighting eatch other (FCOM), I get exp. point from summoned creatures by fighting ones.
2. Very important for me - option to disable all OXP messages .Into hard fight its may decide -" CTD or not CTD?"
User avatar
vanuza
 
Posts: 3522
Joined: Fri Sep 22, 2006 11:14 pm

Post » Thu Apr 07, 2011 2:26 pm

If i'm putting redundant just ignore me.
1. My PC out of fight , litches are fighting eatch other (FCOM), I get exp. point from summoned creatures by fighting ones.
2. Very important for me - option to disable all OXP messages .Into hard fight its may decide -" CTD or not CTD?"


I am not quite sure what you mean by the first point. There are a couple of bugs regarding summoned creatures that I have fixed. Normally you should get points for killing a summoned creature, but there are some mods that do not assign a level to the summoned creature, so no points are awarded for the kill and in fact your running total for points is corrupted. I have fixed that. If your summoned creature kills someone, you should get the points for that because technically your summoned creature is a companion. That works fine and I have had no issues with that. If that is what you are referring to, then that is what is supposed to happen. If your summoned lich kills another one, you would get the points for that - your summoned lich is a companion who is fighting for you.

You can disable the messages by holding down the L key and pressing the left arrow key. If you press the left arrow key a second time, the HUD status bar will be removed as well.

You can re-enable the messages by holding down the L key and pressing the right arrow key. Press the right arrow key again to make the Log window larger.

Basically while you hold down the L key, press the left or right arrow keys to cycle through the different sizes of the Log window. These will also make the HUD status bar appear or disappear.
User avatar
jenny goodwin
 
Posts: 3461
Joined: Wed Sep 13, 2006 4:57 am

Post » Thu Apr 07, 2011 8:22 pm

I am not quite sure what you mean by the first point. There are a couple of bugs regarding summoned creatures that I have fixed. Normally you should get points for killing a summoned creature, but there are some mods that do not assign a level to the summoned creature, so no points are awarded for the kill and in fact your running total for points is corrupted. I have fixed that. If your summoned creature kills someone, you should get the points for that because technically your summoned creature is a companion. That works fine and I have had no issues with that. If that is what you are referring to, then that is what is supposed to happen. If your summoned lich kills another one, you would get the points for that - your summoned lich is a companion who is fighting for you.

You can disable the messages by holding down the L key and pressing the left arrow key. If you press the left arrow key a second time, the HUD status bar will be removed as well.

You can re-enable the messages by holding down the L key and pressing the right arrow key. Press the right arrow key again to make the Log window larger.

Basically while you hold down the L key, press the left or right arrow keys to cycle through the different sizes of the Log window. These will also make the HUD status bar appear or disappear.


I was too laconic, I supouse.
1. There are a few kind of liches in FCOM (MMM if I remember). In theory its belongs to the same faction but sometimes, by unknown for me reason, its starting fight eatch other. My PC doesn't fight ,cast spells etc . He is unremarked.
It is no zero-level-bug at all
2. Yes I know, but I still will be getting messages about every exp. point adding action (killing for example). Optional disabling this is usful for people who must be carry on CPU stress .
User avatar
scorpion972
 
Posts: 3515
Joined: Fri Mar 16, 2007 11:20 am

Post » Thu Apr 07, 2011 11:24 pm

Found a little bit of "inefficient" coding in the piece of code that calculates the player's distance from civilization (been snooping around inside the scripts a bit to learn about it).

As you know, it takes the cities' coordinates, the player's coordinates, calculates the distance and then moves down the list to see if any other cities are closer. Then it takes that distance to calculate if the player is far away or not, yadda yadda...
The problem is this (taking first two cities as example):

                ;anvil = ( -189714, -29375, 298 )		let civilizationPosition["x"] := -189714		let civilizationPosition["y"] := -29375		let civilizationPosition["z"] := 298 		;distance		let tempFloat := ( ( playerPosition["x"] - civilizationPosition["x"] ) ^ 2 ) + ( ( playerPosition["y"] - civilizationPosition["y"] ) ^ 2 ) + ( ( playerPosition["z"] - civilizationPosition["z"] ) ^ 2 )		let distance := sqrt tempFloat		;bravil = ( 66180, -35710, 380 )		let civilizationPosition["x"] := 66180		let civilizationPosition["y"] := -35710		let civilizationPosition["z"] := 380 		;distance		let tempFloat := ( ( playerPosition["x"] - civilizationPosition["x"] ) ^ 2 ) + ( ( playerPosition["y"] - civilizationPosition["y"] ) ^ 2 ) + ( ( playerPosition["z"] - civilizationPosition["z"] ) ^ 2 )		let tempFloat := sqrt tempFloat		;if smaller than distance to previous, set active distance to current		if ( tempFloat < distance )			let distance := tempFloat		endif


Notice how 'distance' is immediately made equal to the square root of 'tempFloat', even though it shouldn't have to be.
At the next city 'tempFloat' is recalculated, and again square rooted. Then it is compared to the current value of 'distance'.

What would be better:

Make 'distance' equal to the value of 'tempFloat' straight away, ie. change this line:
                let distance := sqrt tempFloat

To this:
                let distance := tempFloat


At the next city, remove this line:
                let tempFloat := sqrt tempFloat

And just let the two values be compared normally:
                if ( tempFloat < distance )			let distance := tempFloat		endif


Comparing if A < B is the same as comparing if sqrt(A) < sqrt(B ), but way less CPU-heavy. Especially since a square root calculation is needed for every city as it is now.

The redone code would look like this:
                ;anvil = ( -189714, -29375, 298 )		let civilizationPosition["x"] := -189714		let civilizationPosition["y"] := -29375		let civilizationPosition["z"] := 298 		;distance		let tempFloat := ( ( playerPosition["x"] - civilizationPosition["x"] ) ^ 2 ) + ( ( playerPosition["y"] - civilizationPosition["y"] ) ^ 2 ) + ( ( playerPosition["z"] - civilizationPosition["z"] ) ^ 2 )		let distance := tempFloat		;bravil = ( 66180, -35710, 380 )		let civilizationPosition["x"] := 66180		let civilizationPosition["y"] := -35710		let civilizationPosition["z"] := 380 		;distance		let tempFloat := ( ( playerPosition["x"] - civilizationPosition["x"] ) ^ 2 ) + ( ( playerPosition["y"] - civilizationPosition["y"] ) ^ 2 ) + ( ( playerPosition["z"] - civilizationPosition["z"] ) ^ 2 )		;if smaller than distance to previous, set active distance to current		if ( tempFloat < distance )			let distance := tempFloat		endif                << More cities go here >>                ;At the end, square root                let distance := sqrt distance                ;set distance in units of cells		let distance := distance / 4096                ...


It's a (huge wall of text for a) minor thing, since this script is only needed when a new area has been explored, but every little bit helps.
User avatar
Smokey
 
Posts: 3378
Joined: Mon May 07, 2007 11:35 pm

PreviousNext

Return to IV - Oblivion