Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2018-07-20 13:17:35

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

[Suggestion] Animation system improvements

Yet another suggestion lifted from my experience with OpenBOR.

managing animations through scripting can be a pain. especially because A: most default animations will take priority based on certain events (jump, fall, jump apex,land, just to name a few), and B: keeping track of all the states that cause animation changes can be difficult, especially when debugging.

what I suggest here is that in the animation or character script certain parameters can be used to define when an animation plays.

for example, a sprite script could look like this:


sprite "player"
{
    animation 0 "idle"
    {
    //engine could accept names OR numbers for quicker reference.
    you can use this to easily make a template character while knowing what animations look like.

        trigger default
        //new instruction/command. it defines what makes the animation play.
         
           possible values:

           default (managed by .chr file)
           input [button combo] (if the player is controlling this entity or input is simulated)
           event [name] using the same events as the engine uses with .chr definitions 
                                 (jump, fall, walk, run etc.). multiple events could be possible
                                 (roll+in the air, hurt+on the floor, etc)
           vars [variable conditions] if the variable matches the expression's value (ex: if $_pause == 0)

           you can combine input and event and variable for more complex animation linking
          (ex: input up fire1 + event on_the_floor roll + vars collectibles()>0


I'll probably follow up with more ideas and in-depth  descriptions

Last edited by KZR (2018-07-20 13:26:25)


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#2 2018-07-20 18:51:44

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,279
Website

Re: [Suggestion] Animation system improvements

Hey KZR, thank you for the suggestion.

Most animations are not programmed (i.e., item boxes).

KZR wrote:

managing animations through scripting can be a pain.

Most of what you guys used in the old scripting API is no longer applicable in SurgeScript. SurgeScript brings about a different way of doing things. The animation / player API isn't even designed yet, so we don't know how it's gonna be (but it will be simple smile). Perhaps we can use this thread to do some brainstorming.

If I understand correctly, you want to link player events with animations. Is that correct?

Offline

#3 2018-07-21 23:25:42

Race the Hedgehog
Member
From: Sao Bernardo do Campo, Brazil
Registered: 2010-12-16
Posts: 163
Website

Re: [Suggestion] Animation system improvements

I agree, when your character has many actions where the animations overlap eachother it becomes difficult to handle the companions states.

I would like to add, I think it would be super useful if we had a "set_animation_speedfactor" for the player animations.
You can see in Sonic's original trilogy that the speed of the walking and rolling animation is dependent on the player's horizontal speed. In Open Surge, the speed of the animation is always fixed, no mather how the player is moving.
With the newest addition of the smooth angle transition, I think this would be something more that would help polish the game visual presentation.

(You can already do this by attaching an object to the player, but making the player invisible causes him to lose the collision with objects)


PunBB bbcode test
Creating and Editing Sprites.

Offline

#4 2018-07-23 09:10:54

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: [Suggestion] Animation system improvements

yes Alex, in a way that's the point of my suggestion.

Either the animation or character scripts should have a way to tell the engine "this animation is only available when..." and "this animation is triggered like this", so that animations don't overlap, and the creator doesn't have to write a lot of "if" cases in the companion script. This not only allows creators to build complex animation trees, it also allows creators to disable or change the logic behind the default animations, and change the control scheme in a simple and easy to remember way by directly linking buttons with animations.

Last edited by KZR (2018-07-23 09:15:24)


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#5 2018-07-23 11:29:12

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,279
Website

Re: [Suggestion] Animation system improvements

What if your companion object spawned a child that just handles animations?

With the new syntax of SurgeScript, things are much simpler.

-----

As an example, you could have a pre-programmed SurgeScript object that, upon receiving input from the user, changes the animation of an actor / character. In its API, you say which input buttons translate to which animations, and then it does the rest automatically.

Offline

#6 2018-07-23 21:20:42

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: [Suggestion] Animation system improvements

Yes, but the problem I've been finding in previous releases (still have to try the new one to see if it still happens), default animations will take priority over scripted, resulting in some awkward moments at the very least.


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org