
Dak'kon's Zerth Blade
#1
-Guest-
Posted 02 August 2008 - 07:20 AM
#2
Posted 02 August 2008 - 09:59 AM
Qwinn
Edited by Qwinn, 02 August 2008 - 10:43 AM.
#3
Posted 02 August 2008 - 10:43 AM
My guess is, since they yanked all the morale stuff as you mentioned, they also half-ass yanked the bit with the morale and the sword. If the morale is continually resetting itself as you mention (which I haven't confirmed yet), then you should generally always get the best version of the sword (which is the Chained version, stat wise), unless you were unlucky and did something like finish the Unbroken Circle just before Dakkon goes up one of the two levels that gets him a sword upgrade.
Does that make sense? Or am I misinterpreting what I'm seeing here?
Qwinn
Edited by Qwinn, 02 August 2008 - 10:48 AM.
#4
-Guest-
Posted 02 August 2008 - 12:00 PM
The differences between the blades are marginal. It's more of an aesthetic thing than anything else: The Streaming Blade is bright blue and the item description is different, particularily because of the mention of how the blade reflects Dak'kon's now much more focused mind after you solved his doubts with the Circle. Both Level 10 upgrades double 1st and 2nd levels spell slots and have the same overal stats, only the Chained Blade has +6AC, while the Streaming Blade has +3 but adds an extra Level 3 spell slot.
Of course, when you take in consideration the big picture, neither one makes much of a difference, since the extra spell or extra AC can easily be supplied through other means. It's more of a consistency thing, as all mentions of Dak'kon's improvement vanish after the third upgrade reverts the sword to Chained (I might be wrong here, but I think talking to Dak'kon when the blade is Streaming also gives you a different description, about how he looks younger or something like that).
By the way, there was a third form, the Kinstealer (way low morale) but I don't think there's any actual in-game method of getting that one.
#5
Posted 02 August 2008 - 12:28 PM
And you're definitely correct about the Streaming blade having a better description.
There are a few ways to lower Dak'kon's morale that might make Kinstealer achievable, but yeah, you'd have to be trying pretty damn hard.
Honestly, until you mentioned it, I had no idea that morale was resetting every 8 hours. If that is indeed happening, it's happening in the game engine and I can't stop it. If I can confirm that that is indeed the case, I -might- be able to use a different variable to keep track of what the morale should be, and try to come up with a way to reset the actual Morale to match it every so often.
Since you seem to have played with it a lot, and it's been a bit since I got there, tell me something - does boosting his morale (say, via finishing the UC) immediately upgrade the sword? Or does the upgrade not take effect until you hit the next level upgrade - say, fighter level 7 for upgrade 1 or fighter level 10 for upgrade 2)?
If the sword only changes when you get those upgrades, then the idea I just mentioned -might- work, but if the sword changes whenever your morale hits a new bracket, bleah, I doubt I could do anything, because I'm -not- going to make it where every 8 hours the sword switches and then switches back again, that's begging for bugs and misery.
Qwinn
#6
-Guest-
Posted 02 August 2008 - 01:08 PM
The thing is, and I've been wondering this myself, I never checked if I just happened to hit Level 7 (The second upgrade) just as I finished the circle (Which would be a hell of a coincidence if this happened every time I've played), or if the sword changes regardless of the level. Maybe it was already on its 2nd upgrade as Chained and just changed to 2nd stage Streaming... I dunno, sorry.
Nevertheless, I'm pretty sure that, the question of the Circle aside, the only other thing that causes changes in the sword is hitting the next asigned upgrade level. So, say, if I get Streaming at level 7, it'll stay like that until I hit 10 and the game checks Dak'kon's morale again to decide on the next upgrade. It doesn't immediately change back as soon as morale resets, if that's what you are asking.
#7
Posted 02 August 2008 - 04:30 PM
About the sword and when upgrades happen: every time Dak'kon hits a certain level (I think it's 4, 7 and 10 or something like that) the sword upgrades itself. Only then the morale is checked and based on the morale the sword changes into one of its three possible forms. To raise his morale you can solve the Unbroken Circle of Zerthimon (general update for Dak'kon as well) or you could make him feel better by killing the githzerai woman in the Lower Ward in the "good" way or by talking with him about the past and saying the right things (at least I think this is another possibility). To lower his morale one can tell him he's still a slave or make him feel miserable by making him kill the woman painfully.
Personally I always preferred the Chained Blade, well, at least as a weapon. RP-wise I'd prefer the Streaming Blade since it reflects how TNO helped Dak'kon.
#8
Posted 03 August 2008 - 02:13 PM
Qwinn
Edited by Qwinn, 12 August 2008 - 06:52 PM.
#10
Posted 12 August 2008 - 02:12 PM
For those who don't know, scient has already found ways to fix a few engine-related bugs that I previously thought were unfixable (such as the Hermit and Mebbeth not healing the party properly in dialogue, and the bugged "Usable only by Xaositect" flag). Note that none of these engine changes will be going in before version 3.0 of the Fixpack at the earliest - that's going to get a -whole- lot of testing before we mess with it.
Anyways, back to the morale issue: If it -is- a matter of the same morale variables getting used for both fleeing and fear spell related effects and for tracking how well you treat your companions, no wonder they yanked the whole thing. Perhaps what could be done is to introduce new variables, and change the "MoraleInc" and "MoraleDec" actions within various dialogues to "IncrementGlobal"s on the new variable, so that it's totally independent. Then whatever's in the engine that decides which sword Dak'kon gets could be tweaked so that it checks that variable instead of whatever it's checking now.
IF we were to do this, I would also advocate changing the stats on the high-morale streaming blade to have the same AC bonus as the mid-morale chained blade. That way, stat wise, the only thing you gain is the one 3rd level bonus spell, but also the cooler description text (and maybe even different graphics? I don't know) that accompanies the streaming version. The reason is that if we don't do this, then making Dak'kon happy will result in a -worse- blade (I'll take permanent +3 AC over a 3rd level spell slot any day)
Qwinn
Edited by Qwinn, 12 August 2008 - 02:16 PM.
#11
Posted 12 August 2008 - 02:14 PM
Qwinn
#12
Posted 12 August 2008 - 05:20 PM

I set up the cheatbook to act like Qwinn's "Book of Scales" in regards to morale to see how it was being altered. The bug happens for all players, not just Dak. There are a lot of instances throughout the game where Dak, Annah, Grace etc have their morale altered. Also, there are a number of conditional triggers dependent on this stat. All players start with their morale set to 10. After 8 hours, the value does indeed get reset back to this base value of 10. Hopefully I can track down where it is doing the reset of this value and remove it.
That being said, I now think this reset was unintentional because in my mind I was thinking of it as fortitude or stamina as opposed to happiness. This is from Dan Simpson's guide:
Morale Note: Every character that joins you has what the game calls
"Morale." This reflects how happy they are. Mostly this
just affects their conversations, however, in some cases
(Dak'kon being the most notable) it affects more tangible
items, such as weaponry and skills. Morale is an integer
value, the nicer you are to the person in question, the
higher this value will rise.
In this context, I think that morale should stay fixed and not reset. Otherwise you could basically treat the other characters like dirt and they'll forget about it in acouple hours. Maybe TNO amnesia is contagious.

Another thing that pushed me in this direction is that I set Dak morale to 25, killed him, then used "Raise Dead" to bring him back and his morale was still 25. If someone can die and keep their morale, wtf does 8 hours have to do with anything?!?
So ya, I'm going to track down where it resets it and squash this bug. I'll also look into if it actually does play a role in horror/confusion, I could of sworn it did in BG1/2. If anyone has an idea how morale is handled in other IE games, I would appreciate that info.
edit:
To answer some of your questions directly, it's kind of weird how morale value is stored. Even tho I traced through MoraleSet function, I couldn't find a cut and dry place inside the char object structure where it stored it unlike with sorting the Hermin/Mebbeth issue (there is an offset that includes the base+bonus hp). It may be a bitfield or something that I'm missing. Like an earlier poster said, they seemed to remove a lot of stuff relating to it. Like there is no global variable set inside the scripts. It could be possible to find some unused space and try create a new global for it but then you're moving into "unexplained weirdness" area where you fix one bug and create 10 more. To do that you'd really need the source.
The reason I thought it might of been a stat that should reset itself like regen hp or negative spell effects, is because I was thinking of it as stamina. It would also make sense how someone's happiness level could contribute to how easily they are affected by fear/confusion spells. I still have to check whether or not these spells even use the morale level however I don't think this would cause any conflict with the value not being reset. If anything, these spells would act more like they were intended to.
I agree that as part of the update the "Streaming" blade should include a +3 AC bonus to match the "Chained". It's kind of weird that the lower one ends up being more useful stat wise. It's a shiny blue colour tho.

Edited by scient, 12 August 2008 - 06:06 PM.
Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.
#13
Posted 12 August 2008 - 06:41 PM
So, if we're going to get rid of the morale reset (which I'm leaning against), we need to be very careful that we don't activate something that -was- intentionally pulled. As it stands, I can't really think of anything morale-dependent lingering in the game files that we -want- to restore other than fixing the issues with Dak'kon's blade. That's why I'm suggesting it might be better to forget about morale as it currently exists, not take the risk of reactivating anything unpleasant or interfering with existing spells, and just add an independent global variable (I can make new ones easily) where we replace his existing MoraleIncs and MoraleDecs with IncrementGlobals affecting that new variable (call it Dakkon_Morale or Dakkon_Happiness). Then all we need to do in the engine is find wherever it upgrades the sword, and have it check the new global instead of the current Morale, wherever that's being stored.
I can't think of anywhere in the game scripts or dialogues where morale is directly checked for otherwise, so "reactivating" morale by getting rid of the reset is unlikely to make anything positive happen other than the blade, and as just described we have safer way of accomplishing that.
Qwinn
Edited by Qwinn, 12 August 2008 - 06:45 PM.
#14
Posted 12 August 2008 - 07:10 PM
I did a test of Horror/Confusion and morale doesn't have any effect. It was an empirical test, but I set morale to 100 then cast confusion/horror a batch of time and the failure rate was the same as if it was set to 10. I would have expected that if morale played a role it would have prevented the spell from landing atleast fewer times than at 10.
So it really only looks to be used by Dak sword quest and dialog triggers. The only bug with it I found is that if use MoraleDec to lower morale below 0, I can't get it back up. Which is weird because in MoraleSet they have a number of checks to set it to zero if this happens. I'll have to step through MoraleDec to see but this would be an easy fix regardless. This is the only potential problem I can see with disabling the morale reset.
I really think that it plays an importent enough role to be enabled. Regardless, I still have to go find where it resets it. Atleast then testing can be done to see if it causes any unwanted issues.
If anyone else has some info where morale might be used it would help in preventing potential problems.
Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.
#15
Posted 12 August 2008 - 08:01 PM
However, for the brave soul who would like a version with just the reset patched out let me know. I have to do more analysis on how it all fits together before anything stable can be made.
Edit:
I also should say, I found where it does check of morale for sword and it looks like it might be easy to use another global. But, I'd like to see if it is possible to get it working without resorting to this.
Edited by scient, 12 August 2008 - 08:11 PM.
Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.
#16
Posted 12 August 2008 - 08:15 PM
So I wouldn't say it plays an important role, I'm afraid. (It probably looks like more than it is, because what is essentially a single check for Dak'kon gets copied to every other NPC's file). None of the changes would alter gameplay in any way, it just changes the flavor slightly in a handful of conversations. I certainly don't -object- to that flavor, and if we can get rid of the reset without causing any problems, I'm all for it, especially when you add the sword issue in. I just don't think that reset is something that would happen spontaneously as the result of a bug - it was probably done for a reason, which is what makes me hesitant. I think you'll probably have a better idea of whether or not it was intentional when you find it and can see what's doing it, though, so let's see what it looks like when you find it.
Qwinn
#17
Posted 12 August 2008 - 08:18 PM
If we do go with replacing the morale with a global, we can certainly change the dialogues where the value is checked so that it uses that variable too. (that'll be easier than changing all the places where the value gets changed, actually). And in theory we could do it for Annah and Morte too.
Qwinn
#18
Posted 13 August 2008 - 05:12 AM
Say you have 0 morale (0x00), then something happens where you loose 5 moral the byte value will be 0xFB. So what does the code read it as? 251. So instead of setting the value to zero, it would set it to 20. So basically if you got the morale low enough you could make it roll over to max.
The real easy fix is to use MOVSX (mov with sign extension) instead of just MOV. This will extend the sign in a byte value turning 0xFB (251) into 0xFFFFFFFB (-5). Boom, bug solved!
Now I just need to understand whats what with the resetting.
edit:
Inside the "morale modifcation" function there are three branches: set, inc/dec, unknown. The unknown part does the proper sign extension for one calculation but then not for another part.

As far as I can tell, the unknown one isn't used anywhere in the code. I forced it to step through to see what it does and I came up with the following. It takes the current morale, say 20, and multiplies it by the modifier value (which can be negative), say 5, then divides by 100. The current morale is then replaced with this value.
current_morale = (20 * 5) / 100 = 1
current_morale = (6 * 5) / 100 = 0 // it is using int value, so remainder gets truncated
The only other morale functions I could find that might have been part of IE engine that were removed are SetMoraleAI and IncMoraleAI. However the function calculation doesn't make sense for these, so I dunno.
Regardless, I patched it so incase it is some internal function that I'm missing it won't suffer the same bug that set and inc/dec had.
Edited by scient, 13 August 2008 - 06:05 AM.
Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.
#19
Posted 13 August 2008 - 06:39 AM
As far as I can tell, the unknown one isn't used anywhere in the code. I forced it to step through to see what it does and I came up with the following. It takes the current morale, say 20, and multiplies it by the modifier value (which can be negative), say 5, then divides by 100. The current morale is then replaced with this value.
WTF? That's bizarre. I can't imagine a sane reason to ever do that. Good thing it was never used.
Qwinn
#20
Posted 17 August 2008 - 06:10 PM
With that said, I think the reason the reset was implemented was to prevent the bug I describe above where negative morale rolls over to twenty. There may of not been enough time to track it down so a band-aid was thrown on to prevent any gameplay mishaps since Dak morale can get into negative numbers depending on choices you make. Since I fixed it I think it is safe to say that preventing the reset is an ok thing to do. If any of the original posters of this bug are still around send me a PM and I'll provide you with a fixed exe (2cd/4cd) for testing purposes. I patched out where it was resetting it and left the game running for ~10-12 game hours and morale didn't change. The same goes if you rest your party (RestParty()).
Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.