[Ohrrpgce] SVN: teeemcee/7831 Implemented correct Z-based centering of attacks on top of targets.

Ralph Versteegen teeemcee at gmail.com
Fri Mar 18 10:49:04 PDT 2016


On 19 March 2016 at 06:45,  <subversion at hamsterrepublic.com> wrote:
> teeemcee
> 2016-03-18 10:45:09 -0700 (Fri, 18 Mar 2016)
> 503
> Implemented correct Z-based centering of attacks on top of targets.
>
> Previous implementation used just Y, now use Y and Z to align them while
> keeping the attack spatially in front.
>
> In all cases, attacks that already used Z coordinates did not interfere at all.
>
> Also, add a wait(1) to beginning of Projectile and Reverse Projectile so that
> you can see the attack starting at its intended location. There seem to be
> more early/late starting/stopping problems with other animations.
>
> Added XYZTriple UDT.
> ---
> U   wip/bmod.rbas
> U   wip/util.bi

One thing I didn't mention in the commit was rounding error for anim_absmove.

I noticed that BattleSprite.x/yspeed are stored as integers, which
means that the position actually moved to by anim_absmove can be quite
a bit out from the intended destination. For example if you move to
your target in 6 ticks, like meteor does, you can be up to 3 pixels
out. Since both the old and the new attack positioning is 2 pixels
below the target, this could end up 1 pixel above the target and so
appear behind it. It's interesting that noone ever noticed this. I
just tested and confirmed that for one sixth of targets (for large
enemies, anyway) Meteor attacks hit behind the target.

The old attack positioning appears 2 pixels below the target, which
helps to make it unlikely that the attack will appear behind it due to
rounding error. For the new positioning I added an invisible offset of
4 pixels "out of the screen" for the same effect.


More information about the Ohrrpgce mailing list