Battle animations #574

Merged
merged 13 commits into from Sep 13, 2015

Projects

None yet

4 participants

@scurest
Contributor
scurest commented Sep 7, 2015

Implements some missing features for battle animations. In particular

  • both the screen and the target (on either the map or in battle) should flash correctly now
    battler_flash
  • battle animations are not fixed to the point on the screen where they first occurred, but follow their targets around
    follow
  • the position of animations targeting map characters is fixed (#365)
    position
  • "Show on entire map" animations work, I think

Shaking isn't implemented, but there's an obvious path to doing it once shaking is actually working :)

What I'm planning to do before I call this finished:

  • Game_Screen::ShowGlobalBattleAnimation was completely removed. Need to check exactly what RPG_RT does in this case (should be used for targeting the whole enemy party, I think) Done for RM2k3, need to check 2k now
  • Need to check I didn't break 809b381

(Also, @Ghabry, I backed out the GetX/SetX/etc. functions from BattleAnimation you just put in. Hope that's okay...)

@Ghabry
Member
Ghabry commented Sep 7, 2015

Cool, working battle animations. Seems we need a 0.3.2 hotfix soon.

Yeah, change whatever you want, only the result matters :)

@BlisterB
Member
BlisterB commented Sep 7, 2015

Cool commits guy !
The project is really increasing in quality, it's a shame that I don't have time to get back to C++ !

@Ghabry
Member
Ghabry commented Sep 7, 2015

Don't worry @BlisterBoy you can help us by improving the Android port by using Java :D

@BlisterB
Member
BlisterB commented Sep 7, 2015

The external storage thing broke my heart hahaha. I don't really know what to do except this one : [, I'm open to any proposition !

@Ghabry Ghabry added this to the 0.3.2 milestone Sep 7, 2015
@scurest
Contributor
scurest commented Sep 8, 2015

So, I decided not to fix "Show on entire map animations" on looping maps. The problem is that the animations are located at the vertices of a 20x10(11?) grid which is independent of the map. So after looping around, the animations play at different spots on the map. Illustration: (the white grid shows the map edges, and the red spots are where animations play)

entiremap

So you can't know where to put them just from GetDisplayX/Y and would have to complicate Game_Map with code to track the position against the grid of animations. OTOH, the graphical glitch from this tiny: just a slight jump in the animation grid position when the camera crosses a looping map edge. So I kind of decided it's not worth it :|

@scurest
Contributor
scurest commented Sep 8, 2015

That said, this is ready.

@Ghabry
Member
Ghabry commented Sep 8, 2015

The same graphical glitch happens with Panoramas at the moment when crossing map boundaries. As you said: Not worth it.

Have no time until Thursday, somebody else can review.

@fdelapena
Member

Thanks scurest, great fixes and improvements ๐Ÿ‘. Also 2k3 battlers flickering was annoying ๐Ÿ˜„.

I have an exam tomorrow, same here until Thursday.

@Ghabry
Member
Ghabry commented Sep 9, 2015

Okay the flickering was then not observable for me because the VS-compiler probably inserted a 0. Good find.

@fdelapena
Member

It seems like the animation sound playing when attacking is not OK anymore in OFF. The attack sound plays the same as the hit sound. Other things worked like a charm ๐Ÿ‘.

@scurest
Contributor
scurest commented Sep 11, 2015

My bad. Of course there can be multiple AnimationTiming for one frame (eg. flash both the target and screen, though OFF's playing two SEs in one frame doesn't make a lot of sense). Try this.

@fdelapena
Member

Thanks! now it plays the splat audio combined. It seems to behave correctly now.
(I guess it sounds different than RPG_RT because of #349, but this one won't be soon probably).

@scurest scurest Only play the SE for the last AnimationTiming
b3665de
@scurest
Contributor
scurest commented Sep 11, 2015

Urk, you're right. I changed it to only play the last SE if there are multiple in one frame... Sorry, one more try.

@Ghabry
Member
Ghabry commented Sep 12, 2015

I have an empty frame now in rpg2k3 battles when the battler is a battle animation. This wasn't happening before.
My fix to this was "return GetFrame()+1 >= GetFrames();", but you have this code already...

There is one corner case, but I assume almost no game uses this because it's nonsense:
When a battler has a battle animation as a pose flash effects have the actor as a target and screen effects are ignored.

@fdelapena
Member

Thanks @scurest, however RPG_RT seems to play both sounds in the same frame, I guess 029710c was OK already. I think it just sounds different because the playback speed adjust is not implemented yet (#349).

@Ghabry
Member
Ghabry commented Sep 12, 2015

Concerning the one blank from of Battle Animation battlers.
A potential fix is changing back IsDone to the old behaviour:

// battle_animation.cpp
// Battle animation line 99
bool BattleAnimation::IsDone() const {
    return GetFrame() >= GetFrames();
}

Completly avoid the function in sprite_battler and reset frame count one tick earlier to avoid the blank frame rendered:

// sprite_battler.cpp line 107 
// old if (animation->IsDone())
if (animation->GetFrame()+1 >= animation->GetFrames()) {
@scurest
Contributor
scurest commented Sep 13, 2015

Thanks for being patient guys.

@Ghabry, how about reverting IsDone and then moving the Update call on L119 up before the IsDone check?

@scurest scurest Fix flickering for battle poses
6b16d79
@Ghabry
Member
Ghabry commented Sep 13, 2015

@scurest Yeah that's the best solution.

@Ghabry
Member
Ghabry commented Sep 13, 2015

Thanks for fixing all issues, excellent job.

@Ghabry Ghabry merged commit b03b3e4 into EasyRPG:master Sep 13, 2015

1 check passed

default Build finished. No test results found.
Details
@scurest scurest deleted the scurest:animations branch Sep 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment