hankmorgan / UWReverseEngineering

Repository for Reverse Engineering work on UW1/2
16 stars 1 forks source link

About XP gain #5

Open KarlClinckspoor opened 4 months ago

KarlClinckspoor commented 4 months ago

Accumulating XP when exploring the map

In the document, there's this passage when listing ways of accumulating XP:

When visiting new maps (mechanic not fully understood but appears to be linked to character level). A good example of this in action is if you run from level 1 of UW straight to level 2. Enough exp for a level gain occurs without any combat.

The way I understood the wording, this is supposed to be related to changing levels (lvl1 to lvl2 in UW1 for example), but from experience, this looks to be related to exploring the levels themselves. Is this what was meant here?

I ran a test here. I put break points at Experience_seg038_342C_45, and monitored my current exp in-game (character panel), in memory and the arg0 to the function that adds EXP.

I started a new character in UW2, and when I rotated to the right, that function triggered and I got a trickle of XP (I think 1 unit). Then I started exploring the secret passageways and wrote down the following:

At this point, my EXP in the panel was 6, which is what it should be (40h = 64d).

I kept exploring and my EXP went up. It's annoying that my character wouldn't stop moving on its own, and instead kept marching on and hitting the breakpoints without my control. I didn't have the time to find out what specifically was causing this function to be called

Anyway, I didn't see this mentioned in this document or in UnderworldGodot, and I think that's a crucial mechanic that should be implemented and, in the way you worded things, it seemed you had a different idea of how this worked.

Possible typo:

Also, you wrote this comment down:

seg019_21BA_349: ; mov bx, 0Ah ; (dseg*worldNo)/16

Shouldn't this be (dseg*worldNo)/10? I also didn't find a reference to this yet in UnderworldGodot, but when you come around to doing it, it'd be a shame if the wrong value was used.

Skill point gain

I noticed in your document that you refer to Mitch Aigner's FAQ about skill point gain. In the disassembly and in UWGodot, you use the formula skill points = exp / 1500d. This should be updated, right? I can do a pull request with those changes if you want.

hankmorgan commented 2 months ago

Re XP: When I last looked at this a few months back my suspicion was that it is something to do with the number of revealed tiles under certain conditions (probably first visit to level). Which lines up with your experiment. I'll need to check.

The relevant code is at seg019_21BA_356

Yes. That typo needs fixing

hankmorgan commented 2 months ago

to clarify code is at

seg019_21BA_356 in UW2

seg017_C5 in UW1

My comment in UW1 disassembly was that I thought it had to do with unmarked tiles within visible range of the level exits but I can't remember why I thought that. So it's just a theory.

hankmorgan commented 2 months ago

I'd have to review what is happening xp gains. I took the summer off from the project and I've forgotten everything again!