Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battle 2k3: Item animations #1269

Closed
20 of 24 tasks
Ghabry opened this issue Sep 27, 2017 · 13 comments
Closed
20 of 24 tasks

Battle 2k3: Item animations #1269

Ghabry opened this issue Sep 27, 2017 · 13 comments

Comments

@Ghabry
Copy link
Member

Ghabry commented Sep 27, 2017

sin titulo

wtf is CBA

Weapon CBA:

Battle Animation CBA:

Ranged CBA:

32 different battle weapon types can be configured (Animation 2 tab). Each item has one of these types with corresponding animation. The graphic used is per battler.

Open questions:
Can this be used together with "Battle animation" battlers? Based on the GUI: No

@Ghabry Ghabry added the Battle label Sep 27, 2017
@Ghabry Ghabry added this to the 0.6.0 milestone Sep 27, 2017
@Ghabry Ghabry mentioned this issue Oct 8, 2017
2 tasks
@CherryDT
Copy link

CherryDT commented Oct 12, 2018

CBA = Character Battle Animation

Can this be used together with "Battle animation" battlers? Based on the GUI: No

No it can not. CBA weapons are only for CBA sprites. "Battle animation" battlers are supposed to be customed for each weapon and assigned accordingly.

@fmatthew5876
Copy link
Contributor

fmatthew5876 commented Apr 1, 2021

CBA Movement details

Here some details about how CBA movement works. More investigation and testing is needed.

Actor::UpdateBattle 004BBD7C

if (hidden) return;
if (battle event is waiting for wait command or waiting for "wait for key" (from wait command, not keyinputproc)) return;

damagePopupTimer -= 4
framecounter++
framecounter++ //Not a typo, this really happens twice?!

// Handle victory conditions
// Handle row command placement

switch(move_type) {
  case NO_MOVE:
    BattleActionNoMove(); break;
  case MOVE:
    BattleActionMove(); break;
  case STEP:
  case JUMP:
   BattleActionStepOrJump(); break;
}

Actor::UpdateBattlePositionToDestination: 004BAE58
framecounter is set to 0 before this is called

yjump = 0
if (move_type == jump) {
  yjump = sin(((framecounter << 7) / 25 * 16.0) / 256.0)
}
if (framecounter < 25) {
  x = origin_x + framecounter * (dest_x - origin_x) / 25;
  y = origin_y + framecounter * (dest_y - origin_y) / 25 - truncate(yjump)
}
if (framecounter > 25) {
  x = dest_x
  y = dest_y
  framecounter = 0
 actorAnimationFrame = 0
}

UpdateBattlePositionToOrigin: 004BAF04

framecounter is set to 25 before this is called

yjump = 0
if (move_type == jump) {
  yjump = sin(((framecounter << 7) / 25 * 16.0) / 256.0)
}
if (framecounter > 25) {
  x = origin_x + (50 - framecounter) * (dest_x - origin_x) / 25;
  y = origin_y + (50 - framecounter) * (dest_y - origin_y) / 25 + truncate(yjump)
}
if (framecounter > 50) {
  x = dest_x
  y = dest_y
  framecounter = 0
 actorAnimationFrame = 0
}

@ghost ghost mentioned this issue Apr 2, 2021
@Ghabry
Copy link
Member Author

Ghabry commented Apr 2, 2021

@rueter37 could you please mention in all CBA related PRs which checkboxes of this issue it resolves? Thanks.
Helps with progress tracking.

@ghost
Copy link

ghost commented Apr 3, 2021

PR #2503 handles all movement related checkboxes.

@ghost
Copy link

ghost commented Apr 4, 2021

The "Attack Count" checkbox is already resolved by @fmatthew5876's battle system rewrite (PR #2399).

@Ghabry
Copy link
Member Author

Ghabry commented Apr 12, 2021

That CBA Animation box is also used by "Super Mario RPG - The seven sages".
Save02.zip

Enter mushroom pass 2 (you stand on it in Save02), then attack a goomba. The standard animation is "Jump boots" because of the equipped item.

@Ghabry
Copy link
Member Author

Ghabry commented Apr 18, 2021

I finally saw what this "After Image" option is by recording a video:
This is about rendering a trail, like you know from this mouse trail option on windows.
Here on a white background for figuring out the opacity:

trail
trail2

@Ghabry
Copy link
Member Author

Ghabry commented Apr 18, 2021

okay at least I can still rant about the UI which uses a [X] Yes [ ] No exclusive radio button for this. Yes-No-Questions should be a checkbox ;)

@ghost ghost removed their assignment Apr 23, 2021
@ghost
Copy link

ghost commented Apr 24, 2021

I'm sorry for the next disappointment but implementing the CBA ranged weapons is above my skill level. It is harder than it looks. The two biggest offenders are the "Boomerang" path and the "Attack in Sequence" range. The former requires greater changes in the battle state machine because the battle animation is played in the middle of the ranged weapon animation. And the latter really messes up the targeting: It changes a single target weapon to an all targets weapon. Every enemy is attacked once in sequence. It gets worse if the "Attack all enemies" item flag is set, then the entire enemy party is attacked times the enemy party size. Trying to implement these badly messes up the code.

@ghost
Copy link

ghost commented Apr 27, 2021

For a change some good news: At least implementing single target CBA ranged weapons which travel a straight path is possible, see #2515.

@Ghabry
Copy link
Member Author

Ghabry commented May 2, 2021

I noticed now some new asshole Ui design here:

Screenshot_20210502_153048-fs8

When the CBA type is "Use ranged" and confirm the setting it will alter the "Attack all enemies at the same time" checkbox state:

  • Single Enemy and Attack in sequence: Check is removed
  • Center and All Enemies: Check is added

Of course you can still alter the checkbox afterwards:

  • Single Enemy:
    • w/o "Attack all": Single bow attacking at one enemy
      -"Attack all": The selected enemy is attacked by the arrow but all take damage
  • Center:
    • w/o "Attack all": Broken behaves like "Single Enemy"
    • "Attack all": Arrow flies into the center, all take damage
  • All Enemies:
    • w/o "Attack all": Broken behaves like "Single Enemy"
    • "Attack all": Arrow flies at all enemies, all take damage
  • Attack in Sequence:
    • w/o "Attack all": They are attacked one-by-one and take damage
    • "Attack all": They are attacked one-by-one but all take damage (totally op must be nerfed)

@Ghabry
Copy link
Member Author

Ghabry commented May 17, 2021

The boomerang type has two differences:

  • It moves back (the dagger type only moves forward)
  • The Y value is on some kind of sinus curve
  • The X path is the same as for the dagger

So the hard part is figuring out all Y-Values (does it depend on the enemy height?)

@Ghabry
Copy link
Member Author

Ghabry commented Jul 12, 2021

To make the issue tracking easier I will close this one and open a new one for the ranged CBA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants