Jump to content
  • 0

Additional Frames Appearing When Casting


Apache_

Question

Hello all, 

 

I did a quick search around the help section but I was unable to find a previous post with this same issue. I just started messing around with a new project this morning and ran into an issue that I can get worked out, although I'll admit I have only been messing around with the visual stuff for the most part. 

 

I have a sprite template that I am working on, but to keep stuff simple I am just using this sprite sheet for movement and casting. The movement side of things works perfect. All sheets are based on sprites being 64x64. I can throw a sprite in there if it makes things easier. 

 

Movement:

Spoiler

6e2585a342b2ac349f24d6afa3a93a0f.png

 

Sprite sheet is 384 x 256

 

Example (Just walks down and then in a circle, it looks stupid, but its working exactly how I wanted):

Spoiler

0b7efe05fcea6a70a3c3c75f52eaba30.gif

 

The issue I run into is with the casting animation. It looks like it runs through fine but then after frame 4 it goes to a blank frame before going back to the standing frame. 

 

Casting:

Spoiler

45a55f2182e01fc903841af44e05ec49.png

 

This sheet is 256x256

 

Example:

Spoiler

40b1be4091358f6749e363c479edfbae.gif

 

I get that I could probably adjust the cast time of the spell or something but I assume if there was a minute cast time it would spend 15 seconds on each frame. Currently it goes 1, 2, 3, 4 , blank blue frame. Even if I make every single 64x64 frame a different color it still has the blue blank frame at the end of the casting animation. When I have an actual sprite filled in the blue frame is just a completely blank frame. 

 

The one and only thing I have changed so far is the NormalFrames. I did attempt to move the cast frames up and down by one but it kind of did the same thing. I have restarted both client and server.

 

  "Sprites": {
    "IdleFrames": 4,
    "NormalFrames": 6,
    "CastFrames": 4,
    "AttackFrames": 4,
    "ShootFrames": 4,
    "WeaponFrames": 4,
    "NormalSheetAttackFrame": 3,
    "NormalSheetDashFrame": 1,
    "MovingFrameDuration": 200,
    "IdleFrameDuration": 200,
    "TimeBeforeIdle": 4000

 

Do I need to have more or less casting frames? I

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

I did search here before posting, but I didn't check the Git which I just did now and I didn't see anything about this issue. I just now just increased the cast frames to 6 and duplicated 2 of the 4 frames on the sheet and if anything it looks arguably better as it looks like the end of the cast goes a little quicker.

Link to comment
Share on other sites

  • 0

The last blue frame without a number, makes me think that somehow right before shooting the spell the sprite changes it's direction somehow? (the other 3 directional rows have no numbers... uhh, weird).

Now, here's something to consider at Client/Entities/Entity.cs ....

This happens when we actually attack:

            if (AttackTimer >= Timing.Global.Ticks / TimeSpan.TicksPerMillisecond) //Attacking
            {
                if (SpriteAnimation != SpriteAnimations.Normal && SpriteAnimation != SpriteAnimations.Idle)
                {
                    SpriteFrame = (int)Math.Floor((timeIn / (CalculateAttackTime() / (float)SpriteFrames)));
                }
            }

 

This happens when we cast a spell:

SpriteFrame = (int)Math.Floor((timeIn / (duration / (float)SpriteFrames)));

 

i'm just tryin to guess which could be the issue here, if we compare how the variable that handles the frames work on both situations, we can notice the difference...
what if attack's SpriteFrame is messing up with casting's SpriteFrame?

 

You could in theory, try the following and see if it solves this:

            if (AttackTimer >= Timing.Global.Ticks / TimeSpan.TicksPerMillisecond) //Attacking
            {
                if (SpriteAnimation != SpriteAnimations.Normal && SpriteAnimation != SpriteAnimations.Idle && SpriteAnimation != SpriteAnimations.Cast)
                {
                    SpriteFrame = (int)Math.Floor((timeIn / (CalculateAttackTime() / (float)SpriteFrames)));
                }
            }

We basically add an extra check (SpriteAnimation != SpriteAnimations.Cast) inside the client's graphic attack handler in order to prevent it from overwritting / messing with SpriteFrame when going from casting -> attack, this way, only when the cast animation is over, the attack animation one will be played (in your case, the movement one, since there's no attack animation in this example).

Please note that like i said, i'm just trying to guess what the issue could be related to (i could be wrong on this, does casting means that there will be an attack afterwards ??), if nobody has yet opened an issue report for this, you could open one with the details provided here on forums, when it comes to issues like these, it's better to discuss them over there in order to keep things more organized.

:95_v:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...