Jump to content

[iwdee] Rest encounter probabilities differ greatly from oIWD


Recommended Posts

Posted

The probabilities of hostile rest encounters have been greatly reduced in IWDEE compared to oIWD. It looks like this was a systematic change since all encounter probabilities were reduced to 20 percent of the original value.

@CamDawg Do you know whether (or why?) this was intentionally changed by BD? Should it be reverted to the original values by the EEFP?

 

Comparison of rest encounter probabilities (oIWD and IWDEE):

Spoiler
AREA        IWD_DAY     IWDEE_DAY   IWD_NIGHT   IWDEE_NIGHT
AR1200      6           1           6           1
AR1201      15          3           15          3
AR2000      40          8           70          14
AR2001      30          6           50          10
AR3000      25          5           25          5
AR3001      20          4           20          4
AR3501      25          5           25          5
AR3502      30          6           30          6
AR3503      30          6           30          6
AR3601      50          10          50          10
AR3602      60          12          60          12
AR4001      50          10          50          10
AR4002      10          2           10          2
AR4003      50          10          50          10
AR4005      50          10          50          10
AR5001      35          7           35          7
AR5002      40          8           40          8
AR5003      45          9           45          9
AR5104      40          8           40          8
AR5202      35          7           35          7
AR5203      40          8           40          8
AR5204      20          4           20          4
AR5301      50          10          50          10
AR5302      50          10          50          10
AR5303      50          10          50          10
AR5304      15          3           15          3
AR5402      50          10          50          10
AR5403      50          10          50          10
AR5404      20          4           20          4
AR6001      15          3           15          3
AR6002      10          2           10          2
AR6003      15          3           15          3
AR6004      20          4           20          4
AR6008      10          2           10          2
AR6009      10          2           10          2
AR7004      40          8           40          8
AR7005      30          6           30          6
AR8001      40          8           40          8
AR8003      35          7           35          7
AR8005      35          7           35          7
AR8006      40          8           40          8
AR8007      40          8           40          8
AR8008      40          8           40          8
AR8009      35          7           35          7
AR8011      40          8           40          8
AR9300      30          6           70          14
AR9400      40          8           60          12
AR9500      33          6           33          6
AR9501      60          12          60          12
AR9502      60          12          60          12
AR9601      30          6           30          6
AR9602      40          8           40          8
AR9700      33          6           33          6
AR9709      33          6           33          6
AR9710      33          6           33          6
AR9711      40          8           40          8
AR9712      40          8           40          8
AR9713      33          6           33          6
AR9714      40          8           40          8
AR9716      40          8           40          8
AR9717      40          8           40          8
AR9718      40          8           40          8
AR9800      n/a         8           n/a         8

 

Posted

Looking at my IWD-in-BG2 install, this is from the original converter. I'm going to ping @DavidW as well--I can't remember any reason for this change offhand.

Posted

IIRC the oIWD and oBG2 engines interpreted the rest probability field differently (or at least I convinced myself they did). I'd suggest testing directly in oIWD here to see if that's correct.

Posted

I checked the IESDP to see what that bit of crowdsourced wisdom had to say ... ARE v1.0 applies to all games under consideration. The info on the rest encounter substructure claims that it's a per-hour percentage chance, with no mention of any variation between games. Which ... testing in BGEE ... seems plausible, at least for the EE engine. If it was true for original IWD with the larger numbers above, that would make it essentially impossible to ever rest in most of those areas, given the eight uninterrupted hours needed.

(Outdoor wilderness areas in BGEE tend to have that rest probability field at 3 or 4.)

Posted

Exactly. Another round of BGEE tests - increase the numbers to 13 for an area in a save, try to rest ... eight successful rests out of twenty. So it's eight independent rolls on the table to get through a rest successfully. If you fail, the monsters show up and no time passes regardless of which roll it was that failed.

The oIWD numbers look like a much more intuitive "this is the chance of encountering something in the entire rest". And there's no easy conversion between the two systems.

So, three possibilities: either oIWD and IWDEE use different rest encounter calculations, the oIWD numbers are badly out of whack and that change was made so that it was reasonably possible to rest in the wilderness and dungeons (more than a 98% chance of an encounter for a region with a "40" probability such as daytime AR2000), or oBG2/BGEE uses a different calculation to oIWD/IWDEE and the changed numbers were a mistake.

Testing the system in both IWD and IWDEE should clear this up.

Posted

Looking back through my code archive: I can't actually find where (if at all) this was implemented in the last released version of IWD-in-BG2 (which means nothing, the code for that is a tangled mess). It's explicitly in the converter I gave Beamdog (which was the baseline on which IWDEE was built), but the comments just say 'basically Cam's code'.

I *strongly* suspect this just passed into IWDEE without Beamdog QA really seeing it. In which case we're relying on Cam's personal QA (in which case we are probably okay) or my personal QA (in which case we are probably in trouble). 

Posted

It looks like encounter probability is indeed calculated differently in oIWD.

Based on my tests the reduction to 20 percent is a good approximation - maybe even a bit low. 22 or 23 percent would be closer to the original spawn rate. The oIWD calculation seems to distribute the rest encounters more evenly, but that's not something we can control.

I have also noticed that the number of spawned creatures appears to be calculated differently. In my test setup I got between 1 to 3 instances of a creature type per rest encounter in oIWD. The same setup in IWDEE would always spawn a single creature. I don't know if this indicates a bug or just a different spawn number calculation.

Posted

Interesting, I wonder if the rest spawn scaling has the same 100x scaling as the spawn points--oIWD has more in common with the oBG engine after all. If so, we may need to look at BGEE rest spawns since they didn't get the same scaling as spawn points.

Posted (edited)

BGEE rest spawns definitely aren't using the same scaling as BGEE spawn points. My test referenced earlier used the xvart village with a full party at the campaign cap (sum of levels 51), and got ten xvarts (power level 4) whenever that rest spawn (difficulty 2, maximum number 10) triggered. If that were running on the same scaling that the spawn points use, it would have been one xvart (51*2/100 total power, divide by 4 and round up to one enemy).

Most likely, it just isn't using that factor of 100 in the calculation. So that's ceiling(51*2/4) = 26 xvarts, truncated to 10 by the secondary cap. Working as apparently intended.

Edited by jmerry
Corrected an omitted detail
Posted

I agree with jmerry. The rest spawn calculation in IWDEE seems to be correct.

It's looks like oIWD calculates the numbers differently. The secondary cap (offset 0xa4) appears to be used as some kind of multiplier. I also didn't notice a change in the number of spawned instances when I increased the power level of the creatures.

In any case, I think the rest spawn works as intended in IWDEE considering that the calculations have changed quite a bit.

Posted

oIWD rest interruptions are indeed simpler:

  • If [+0xA6] is 0 rest interruptions are disabled.
  • Roll [0-99], if this roll is  the relevant probability field (day – [+0xA8], night – [+0xAA]) the rest is interrupted by a single spawn pass.
  • If [+0x98] or [+0xA4] is 0 the rest interruption is cancelled.
  • Time is randomly advanced between 0 and 7.5 minutes.
  • A random CRE resref + feedback string is selected using rand[0–[+0x98]-1]
  • The number of spawn attempts is max(1, [+0xA4] + rand[-2–2]) + (bHeartOfFury ? 1 : 0)
  • If the position randomization ends up putting a creature in an invalid spot the creature can be dropped.
Posted

Do I understand correctly that iwd spawned a random amount of the same resref — the randomization was only done once (not per attempt)?

Posted
3 hours ago, lynx said:

Do I understand correctly that iwd spawned a random amount of the same resref — the randomization was only done once (not per attempt)?

Correct.

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...