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

Rework monster animation code #73

Open
demoth opened this issue Aug 23, 2021 · 2 comments
Open

Rework monster animation code #73

demoth opened this issue Aug 23, 2021 · 2 comments
Assignees
Labels
file-formats gamemod game logic related

Comments

@demoth
Copy link
Owner

demoth commented Aug 23, 2021

Move the enormous descriptions of the animation from the source code (for example in M_Soldier.java) into a resource file. For example json?

Upd. 2024: After reviewing of what is done and what is still achievable, it makes sense now to settle on what is already implemented in the scope of the animation rework and if necessary improve later.

The biggest understanding now is that the decision making solution (which was previously tied to the animation and monster logic) can be done outside of the initial scope of this task (moved to Rework monster decision code #109).

New approach:
Animation is controlled with the state machine. Each state is an animation sequence which can either loop or transition to another state. The transition rules govern which transitions are allowed. The character can interact with the game world (or with itself) via events, which are emitted in certain frames (for example sounds and firing projectiles).
An excerpt from the new animation definition:

        AnimationSequence(
            name = "fidget",
            type = StateType.IDLE,
            frames = (1..49).toList(),
            events = mapOf(0 to "sound-fidget"),
            loop = false,
            nextState = "stand"
        ),
        AnimationSequence(
            name="pain",
            type = StateType.PAIN,
            frames = (100..109).toList(),
            events = mapOf(1 to "sound-pain"),
            loop = false,
            nextState = "stand"
        ),
@demoth demoth added gamemod game logic related file-formats labels Aug 23, 2021
@demoth demoth changed the title Move animation data our of the source code Move animation data out of the source code Aug 24, 2021
@demoth
Copy link
Owner Author

demoth commented Sep 6, 2023

Actively working on it, merged a preview for animation and states (merged at 6bd1033)

@demoth
Copy link
Owner Author

demoth commented Sep 6, 2023

At first, let's refactor to a readable solution in code, then we can think of a non-code way for animation description

@demoth demoth changed the title Move animation data out of the source code Rework monster animation code Sep 6, 2023
@demoth demoth self-assigned this Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
file-formats gamemod game logic related
Projects
None yet
Development

No branches or pull requests

1 participant