Skip to content

Conversation

@KoloInDaCrib
Copy link
Contributor

@KoloInDaCrib KoloInDaCrib commented Oct 30, 2025

Linked Issues

None that I can think of.

Description

The animation editor uses the character's frames to generate the outline data. This works great most of the time, however for multisparrow characters, it can lead to generating the frame outlines for frames that aren't on the main spritesheet, considering the frames get appended to the character's frame collection.
The PR fixes it by forcefully creating a new frame collection instance for multisparrow characters (since Flixel reuses the frame collection instances, even if it has appended frames from other frame collections).

The memory usage shouldn't in theory be horrible, however if you find a better solution, let me know.

Screenshots/Videos

Pico (Playable) Before:
image

Pico (Playable) After:
image

@github-actions github-actions bot added status: pending triage Awaiting review. size: medium A medium pull request with 100 or fewer changes. pr: haxe PR modifies game code. and removed status: pending triage Awaiting review. size: medium A medium pull request with 100 or fewer changes. labels Oct 30, 2025
@AbnormalPoof AbnormalPoof added type: minor bug Involves a minor bug or issue. status: pending triage Awaiting review. size: medium A medium pull request with 100 or fewer changes. topic: animation editor Related to the operation of the Animation Editor. labels Oct 31, 2025
Copy link
Member

@AbnormalPoof AbnormalPoof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One note when reviewing the code

Comment on lines +73 to +84
// Forcefully create a new FlxAtlasFrames collection so that we don't add to the same FlxAtlasFrames instance.
var texture:Null<FlxAtlasFrames> = null;

if (frameBase == null)
{
frameBase = FlxGraphic.fromAssetKey(Paths.image(_data.assetPath), true, this.characterId, true);
}

if (frameBase != null)
{
texture = new FlxAtlasFrames(frameBase);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes don't seem to be used in the Animation Editor at all.

Copy link
Contributor Author

@KoloInDaCrib KoloInDaCrib Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Paths.getSparrowAtlas from multisparrow characters, regardless of where in the code, will retreive the frame collection with appended frames from other spritesheets since Flixel constantly reuses the frame collection objects that have the same base graphic.
While this could be moved directly to the animation editor, I found it somewhat nicer to put in the Multisparrow character class in case other sprites end up using the same base asset path as a multisparrow character, saving the need to have the non-multisparrow character have the same frames as the multisparrow character. For example this change will make Pico opponent not have the same frames as Pico playable and therefore prevent Pico opponent having the same outline problems as Pico playable after Pico playable has been created at least once.

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

Labels

pr: haxe PR modifies game code. size: medium A medium pull request with 100 or fewer changes. status: pending triage Awaiting review. topic: animation editor Related to the operation of the Animation Editor. type: minor bug Involves a minor bug or issue.

Development

Successfully merging this pull request may close these issues.

2 participants