Ordering an attack while in range of an opponent starts a round, but note that this is a different calculation from the activities one, i.e. you can have 2 separate round calculations going at the same time and at different stages.
I'm frying my brains trying to understand this, but it seems trickier than quantum mechanics. Can you give us some examples to clarify the concept? You know, something like "my bard attacks with his sword, then casts spell x, then sings a bard song... and rounds start at points x, y, z".
@subtledoctor I know you don't value my personal experience and observation highly . However, for what it's worth my experience is that in the situation you describe you will indeed fail to attack for a long period (at least it seems a long period to me as the icon flails around with the sword without actually making a genuine attack).
Consider this example for an attacker with 1 APR:
- an attacker clicks to attack with a long sword (speed 5), but rolls -1 on initiative meaning the attack is expected in segment 4.
- the attacker switches to cast a magic missile spell just before they actually attack.
- that means they're now in segment 5, but have missed their attack for that round.
- the next attack could be made in, say, segment 7 of the following round if they get a poor initiative, i.e. they fail to attack for more than 6 seconds (if you play at the standard 30 fps).
I've seen the type of behavior outlined in that example numerous times - where there's a delay of something like a full round between clicking to attack and actually attacking. That's never the case when you attack in a fresh combat round and confirms that the combat round does not stop at the point you stop attacking. If you're using a fast weapon you get more attacks in by attacking then casting rather than the reverse.
If I inadvertently get into the situation where I think I've missed my intended attack for the round - for instance in moving around between attacks for slightly longer than I intended - then I will normally briefly retreat from combat (after a full round of not attempting to attack the round counter does reset) rather than attempt to attack when I know I won't actually do so, but my opponent will.
Just dropping in two cents here--ranged weapons with ammunition have speed factors of zero. The weapon's speed factor gets overridden by the ammunition's speed factor; at present all ammo in the game uses zero. We had a similar issue where bows/slings/etc. were usable without a non-proficiency penalty due to the ammo overriding the weapon. We had a similar discussion on speed factor, but for the life of me I can't find it.
Does this help to clarify that rounds for combat and spell etc activities are different things?
How can you measure all the segments with so much precision? For instance, how do you know that the second attack happens at t=7, and not at t=6 or t=8?
@subtledoctor apologies for the delay in responding. I've now had the time to do a little bit of actual testing to try and clarify the situation.
I set up a simple combat with a gnoll to verify the baseline situation with initiative. That produced results as follows:
Those results confirm the variability of attack speed, i.e. the presence of a random initiative roll and are pretty consistent with the theoretical -3/+2 range of initiative that @Bubb found in the code. I've highlighted 4 very marginal exceptions to that range, but that's likely to be the result of measurement error or the length of rounds not being exactly the 13 seconds I've assumed at 15 frames per second. The other highlighted cell was a clear anomaly where the gnoll failed to get an attack for the round at all - I'd just put that down to a random program glitch.
Next I tried to look at the effect of retreating briefly from combat before re-engaging - still at 1 APR.
Those results confirm the expected position that if you let a full round pass before attacking again, you will be back at the baseline with normal initiative delays. If you try to attack again before a full round has elapsed from initiating the previous attack, you will be delayed and the attack will only initiate after a full round.
Next I tried to look at the effect of increasing APR to 2 using an oil of speed.
This shows a couple of things:
- haste reduces the delay until attack. As was said before I think that's not the result of changing the initiative roll directly, but cutting in half the length of rounds. Thus an action that has been calculated by the engine as due in segment 6 would occur in the same timeframe as segment 3 if there was no haste effect. This explanation is supported by looking at the detailed timings of initial attacks (those have gaps of half-segments, rather than the full-segment gaps seen for an identical set of attacks without haste).
- retreating and re-engaging does not result in the second attack in a round being lost. Again, I think that's the effect of the round durations being halved. Thus what would normally be later in the same round, is actually in a new round thanks to the haste effect. Theoretically, whether that explanation is correct could be established by retreating and re-engaging in a much shorter period, but the variations associated with initiative and measurement error when using the pause button and a stopwatch mean I think it would be difficult to get decisive results (at least for me).
To confirm the difference the oil of speed makes I used throwing daggers to get APR 2.
This confirms that if you delay re-engaging long enough you can miss your second attack in the combat round and start afresh with the normal attack in the following round. However, if you only move more briefly you can attack again without missing any attacks.
In relation to the example 1 and 2 you posted on the effect of round behavior, I agree those are correct and I think they are consistent with the situation I included in my original example (though reading again the other posts I made one of those was clearly misleading and I've deleted that). Stripping out the bits relating to magic behavior, this is the original example I used :
- t=0 click to attack
- t=2 attack takes place
- t=3 breaks off attack to move round briefly
- t=4 clicks to attack again
- t=7 second attack in the round takes place, i.e. breaking off attack did not result in a new round
- t=8 breaks off attack to move round briefly
- t=9 clicks to attack again
- t=10 end of round 1
- t=11 breaks off attack to move round
- t=14 first attack of round 2 would have taken place, but that was missed
- t=15 clicks to attack again
- t=16 second attack of round 2 takes place
- t=20 end of round 2
I think you were probably interpreting the example as meaning that there was no attack being made at the start of round 2 - and therefore that the attack initiated at t=15 was starting a new combat round, rather than picking up the continuation of an existing round - is that correct?
Next I tried to look at the effect of retreating briefly from combat before re-engaging - still at 1 APR.
Can you elaborate on what you did here? I'm not sure of what you're testing in this case.
I was confirming that the combat round does not reset when you break off combat. All the 10 attacks listed fell into the expected range (of between speed 1 and 6) for the initial attacks and I then retreated briefly before coming back in for a second attack.
- in 4 cases the delay was long enough that the second attack was made after the end of the first round and in all of those the speed of attack fell into the expected range for a new attack.
- in the remaining cases the second attack was ordered while still in the first round. In all of those cases the speed of attack was consistent with a fresh initiative roll having been made for an attack only at the start of the second round, but in 3 of them the speed of attack would not have been consistent with an initiative roll having been made immediately (as the speed of attack was slower than 6 segments after the order to attack).
Though the sample is small, for the purpose of confirming already 'known' behavior, the results are convincing (at least to me ).
@subtledoctor@Grond0: Can you guys summarize your findings in a way I could better understand? This is pretty dense for me.
I don't have findings, only hypotheses.
My understanding is:
- There is a 6-second timer that runs for weapon attacks, and a separate one for spells/potions/wands/etc. The former represents you think of as APR; the latter represents your "aura being cleared."
- When attacks take place in the weapon attack timer is subject to a random variation of plus or minus ~1.2 seconds, for no good reason at all.
- When spells are cast is not subject to that variation.
- Those timers can interfere with each other. If you have an attack "scheduled" to take place 3 seconds into the round, you can cast Magic Missile before one second passes and still go back and execute the attack; but if you cast a spell like Wish that takes 5+ seconds to cast, you will miss your chance to attack.
- Likewise, if you break off your attack and then re-engage - in this example, if you tell your character to move somewhere 2 seconds into a round, and then click to attack someone 4 seconds into the round, you will have missed your attack that was scheduled at 3 seconds into the round.
- (This one is my hypothesis) If you tell your character to move around 2 seconds into a round, and keep moving around for 8 seconds, and then click to attack 4 seconds into the next round, you will not miss your round-2 attack. In this case because the attack round timer expired with no attacks scheduled, the next 4 seconds are not measured at all; when you click to attack again, a brand new attack timer begins from that moment.
I agree with the above. A few points of clarification about how I think it works are:
- the round timer (which I agree is about 6 seconds if you're playing at 30 fps) for weapons commences at the point you order an attack while in range with the weapon being used. That timer continues until you stop attempting to attack for at least a round, i.e. you don't actually have to make an attack to start the timer and the timer is not renewed by any actual attacks you do make.
- attacks can only take place at defined times (one each segment).
- haste works not just by affecting APR, but by doubling the speed your attacks are processed at. At 30 fps that means that a hasted round would only last 3 seconds (and you would thus only have to break off combat for 3 seconds to end the combat round timer). Slow halves the speed your attacks are processed at. Although fast and slow don't affect initiative directly the change in the duration of the rounds does affect that indirectly. Hence if the combination of weapon speed and initiative means an attack would take place in segment 4, a slowed attack would only happen in segment 8 as far as the rest of the combatants are concerned.
- the random variation is to reduce weapon speed by up to 2 segments or increase it by up to 3 (and I think reducing the advantage of fast weapons is a good reason for that ).
That seems to match my experience with kiting, since I've found that running away at the wrong time can mysteriously remove an attack per round, and it's nearly impossible to prevent that from happening because the timing is partly random.
I've also noticed evidence that the round timer starts when you give the order to attack; not when an attack roll is made or even when the target is within range. I once ordered a character to attack an enemy while dual-wielding, and since it took several seconds to actually make an attack roll, the character struck with the off-hand weapon first, because the main hand attacks were lost.
i was running some tests puzzled by this thread and i noticed something weird.
aerie dw under regular haste:
expected behavior 2 attacks with main hand and 1 with off hand every 6 sec.
results of test is 1 3 sec round with oh attack followed by mh attack, followed by 1 3 sec round with oh attack. over and over.
this happens both if the mh weapon is faster than the oh one and if the opposite is true, the speed factor of weapon seems to not affect which hand attacks first.
if i throw in also some spellcasting the thing becomes even more complicated. the weapons used have sf of 2 and 3, after the first 2 attacks she is able to cast a magic missile before the end of the round, ordering her to attack again the next 3 sec round she performs the oh attack, just as the test without casting, but then if ordered to cast again she cast and then the round never ends.
autopause on round end used to see the end of each round.
if i am not wrong the splitting of the round into 2 of 1/2 duration was introduced by EE, probably to avoid that all the attacks are performed by the mh but the last one that is with the oh.
judging by the results of my test the thing seems to not work properly as now in some cases like the one tested by me the oh gets more attack than the mh and as to have 2 3 sec lasting rounds instead of a 6 sec one gives problems possibly cause the apr and the 1 spell/round refer to a 6 sec one but that one is replaced by 2 short ones.
I think the halving of the round length goes back to vanilla - as does the preference for the extra attack by the off-hand. I vaguely recall seeing an engine explanation for the latter behavior a long time ago - possibly from @kjeron?
Autopause on round end is a bit of a strange one because as is discussed above rounds don't really exist in BG. The autopause often kicks in at the point a timer is about to start, rather than when it stops (I think on the grounds it assumes that's the end of a previous round even where there was no timer running at that point). If you didn't order another attack after the second magic missile then there would be no further action to trigger the autopause (to show when the new timer is about to begin).
i was running some tests puzzled by this thread and i noticed something weird.
aerie dw under regular haste:
expected behavior 2 attacks with main hand and 1 with off hand every 6 sec.
results of test is 1 3 sec round with oh attack followed by mh attack, followed by 1 3 sec round with oh attack. over and over.
That's normal.
Haste reduces the attack round timer from 6s to 3s - this is not EE specific.
As long as you attack uninterrupted (and don't have 0 APR):
- At least one mainhand attack occurs every 2-round period.
- Offhand attacks always occur in equal amounts over a 2-round period.
- With an offhand weapon, if you have 3/2 APR unhasted or 3 APR hasted, you will attack once with mainhand every other round, and once with the offhand every round, and always with the offhand first.
- With an offhand weapon, if you have 1 APR unhasted, you will attack ONLY with the mainhand, once every round.
- All other values allow giving the offhand one attack every round with the rest (equal or more) going to the mainhand.
Comments
Consider this example for an attacker with 1 APR:
- an attacker clicks to attack with a long sword (speed 5), but rolls -1 on initiative meaning the attack is expected in segment 4.
- the attacker switches to cast a magic missile spell just before they actually attack.
- that means they're now in segment 5, but have missed their attack for that round.
- the next attack could be made in, say, segment 7 of the following round if they get a poor initiative, i.e. they fail to attack for more than 6 seconds (if you play at the standard 30 fps).
I've seen the type of behavior outlined in that example numerous times - where there's a delay of something like a full round between clicking to attack and actually attacking. That's never the case when you attack in a fresh combat round and confirms that the combat round does not stop at the point you stop attacking. If you're using a fast weapon you get more attacks in by attacking then casting rather than the reverse.
If I inadvertently get into the situation where I think I've missed my intended attack for the round - for instance in moving around between attacks for slightly longer than I intended - then I will normally briefly retreat from combat (after a full round of not attempting to attack the round counter does reset) rather than attempt to attack when I know I won't actually do so, but my opponent will.
edit: found the thread
I set up a simple combat with a gnoll to verify the baseline situation with initiative. That produced results as follows:
Those results confirm the variability of attack speed, i.e. the presence of a random initiative roll and are pretty consistent with the theoretical -3/+2 range of initiative that @Bubb found in the code. I've highlighted 4 very marginal exceptions to that range, but that's likely to be the result of measurement error or the length of rounds not being exactly the 13 seconds I've assumed at 15 frames per second. The other highlighted cell was a clear anomaly where the gnoll failed to get an attack for the round at all - I'd just put that down to a random program glitch.
Next I tried to look at the effect of retreating briefly from combat before re-engaging - still at 1 APR.
Those results confirm the expected position that if you let a full round pass before attacking again, you will be back at the baseline with normal initiative delays. If you try to attack again before a full round has elapsed from initiating the previous attack, you will be delayed and the attack will only initiate after a full round.
Next I tried to look at the effect of increasing APR to 2 using an oil of speed.
This shows a couple of things:
- haste reduces the delay until attack. As was said before I think that's not the result of changing the initiative roll directly, but cutting in half the length of rounds. Thus an action that has been calculated by the engine as due in segment 6 would occur in the same timeframe as segment 3 if there was no haste effect. This explanation is supported by looking at the detailed timings of initial attacks (those have gaps of half-segments, rather than the full-segment gaps seen for an identical set of attacks without haste).
- retreating and re-engaging does not result in the second attack in a round being lost. Again, I think that's the effect of the round durations being halved. Thus what would normally be later in the same round, is actually in a new round thanks to the haste effect. Theoretically, whether that explanation is correct could be established by retreating and re-engaging in a much shorter period, but the variations associated with initiative and measurement error when using the pause button and a stopwatch mean I think it would be difficult to get decisive results (at least for me).
To confirm the difference the oil of speed makes I used throwing daggers to get APR 2.
This confirms that if you delay re-engaging long enough you can miss your second attack in the combat round and start afresh with the normal attack in the following round. However, if you only move more briefly you can attack again without missing any attacks.
In relation to the example 1 and 2 you posted on the effect of round behavior, I agree those are correct and I think they are consistent with the situation I included in my original example (though reading again the other posts I made one of those was clearly misleading and I've deleted that). Stripping out the bits relating to magic behavior, this is the original example I used :
- t=0 click to attack
- t=2 attack takes place
- t=3 breaks off attack to move round briefly
- t=4 clicks to attack again
- t=7 second attack in the round takes place, i.e. breaking off attack did not result in a new round
- t=8 breaks off attack to move round briefly
- t=9 clicks to attack again
- t=10 end of round 1
- t=11 breaks off attack to move round
- t=14 first attack of round 2 would have taken place, but that was missed
- t=15 clicks to attack again
- t=16 second attack of round 2 takes place
- t=20 end of round 2
I think you were probably interpreting the example as meaning that there was no attack being made at the start of round 2 - and therefore that the attack initiated at t=15 was starting a new combat round, rather than picking up the continuation of an existing round - is that correct?
Can you elaborate on what you did here? I'm not sure of what you're testing in this case.
I was confirming that the combat round does not reset when you break off combat. All the 10 attacks listed fell into the expected range (of between speed 1 and 6) for the initial attacks and I then retreated briefly before coming back in for a second attack.
- in 4 cases the delay was long enough that the second attack was made after the end of the first round and in all of those the speed of attack fell into the expected range for a new attack.
- in the remaining cases the second attack was ordered while still in the first round. In all of those cases the speed of attack was consistent with a fresh initiative roll having been made for an attack only at the start of the second round, but in 3 of them the speed of attack would not have been consistent with an initiative roll having been made immediately (as the speed of attack was slower than 6 segments after the order to attack).
Though the sample is small, for the purpose of confirming already 'known' behavior, the results are convincing (at least to me ).
I agree with the above. A few points of clarification about how I think it works are:
- the round timer (which I agree is about 6 seconds if you're playing at 30 fps) for weapons commences at the point you order an attack while in range with the weapon being used. That timer continues until you stop attempting to attack for at least a round, i.e. you don't actually have to make an attack to start the timer and the timer is not renewed by any actual attacks you do make.
- attacks can only take place at defined times (one each segment).
- haste works not just by affecting APR, but by doubling the speed your attacks are processed at. At 30 fps that means that a hasted round would only last 3 seconds (and you would thus only have to break off combat for 3 seconds to end the combat round timer). Slow halves the speed your attacks are processed at. Although fast and slow don't affect initiative directly the change in the duration of the rounds does affect that indirectly. Hence if the combination of weapon speed and initiative means an attack would take place in segment 4, a slowed attack would only happen in segment 8 as far as the rest of the combatants are concerned.
- the random variation is to reduce weapon speed by up to 2 segments or increase it by up to 3 (and I think reducing the advantage of fast weapons is a good reason for that ).
I've also noticed evidence that the round timer starts when you give the order to attack; not when an attack roll is made or even when the target is within range. I once ordered a character to attack an enemy while dual-wielding, and since it took several seconds to actually make an attack roll, the character struck with the off-hand weapon first, because the main hand attacks were lost.
aerie dw under regular haste:
expected behavior 2 attacks with main hand and 1 with off hand every 6 sec.
results of test is 1 3 sec round with oh attack followed by mh attack, followed by 1 3 sec round with oh attack. over and over.
this happens both if the mh weapon is faster than the oh one and if the opposite is true, the speed factor of weapon seems to not affect which hand attacks first.
if i throw in also some spellcasting the thing becomes even more complicated. the weapons used have sf of 2 and 3, after the first 2 attacks she is able to cast a magic missile before the end of the round, ordering her to attack again the next 3 sec round she performs the oh attack, just as the test without casting, but then if ordered to cast again she cast and then the round never ends.
autopause on round end used to see the end of each round.
if i am not wrong the splitting of the round into 2 of 1/2 duration was introduced by EE, probably to avoid that all the attacks are performed by the mh but the last one that is with the oh.
judging by the results of my test the thing seems to not work properly as now in some cases like the one tested by me the oh gets more attack than the mh and as to have 2 3 sec lasting rounds instead of a 6 sec one gives problems possibly cause the apr and the 1 spell/round refer to a 6 sec one but that one is replaced by 2 short ones.
Autopause on round end is a bit of a strange one because as is discussed above rounds don't really exist in BG. The autopause often kicks in at the point a timer is about to start, rather than when it stops (I think on the grounds it assumes that's the end of a previous round even where there was no timer running at that point). If you didn't order another attack after the second magic missile then there would be no further action to trigger the autopause (to show when the new timer is about to begin).
Haste reduces the attack round timer from 6s to 3s - this is not EE specific.
As long as you attack uninterrupted (and don't have 0 APR):
- At least one mainhand attack occurs every 2-round period.
- Offhand attacks always occur in equal amounts over a 2-round period.
- With an offhand weapon, if you have 3/2 APR unhasted or 3 APR hasted, you will attack once with mainhand every other round, and once with the offhand every round, and always with the offhand first.
- With an offhand weapon, if you have 1 APR unhasted, you will attack ONLY with the mainhand, once every round.
- All other values allow giving the offhand one attack every round with the rest (equal or more) going to the mainhand.