maranpis

Ryusui писал(а):I might be misunderstanding how your game works but it feels like you're stuck on the idea of "the final left jab has to reset the animation." What's wrong with setting a count for the number of queued animations, decrementing it by one each time an animation in the sequence ends, and when it hits 0, returning to the idle state? You could configure this for any sequence of animations, without having to worry about which specific ones are queued. (And if anything interrupts the sequence - like the character getting hit mid-combo - you could set the count to 0 then!).
That's a great idea! thanks for the suggestion :)
maranpis
  • Сообщения: 21

Nate

If you want the track to clear when it reaches the animation duration, you need to set TrackEntry trackEnd. However, you probably want to use an empty animation to transition to the setup pose rather than clearing the track.

You could use a listener on the TrackEntry for the last queued animation (eg the second left jab) to set to idle. I'm not sure spine-godot supports that yet, but it will.

Using the animation system for your game state isn't great. It would be much better to track what state your game is in separately, then set animations based on that. Separating animating from game state simplifies things and will help if you ever need to serialize the game state. You can Google for the "MVC design pattern". Super Spineboy uses it:
https://github.com/EsotericSoftware/spine-superspineboy/tree/master/src/com/esotericsoftware/spine/superspineboy

You can see how it works here:
https://github.com/EsotericSoftware/spine-superspineboy/blob/master/src/com/esotericsoftware/spine/superspineboy/CharacterView.java
The game state keeps track of what the player is doing, then this code checks if the corresponding animation is playing. If not, it plays it.
Аватара пользователя
Nate

Nate
  • Сообщения: 12040

maranpis

Nate писал(а):If you want the track to clear when it reaches the animation duration, you need to set TrackEntry trackEnd. However, you probably want to use an empty animation to transition to the setup pose rather than clearing the track.

You could use a listener on the TrackEntry for the last queued animation (eg the second left jab) to set to idle. I'm not sure spine-godot supports that yet, but it will.

Using the animation system for your game state isn't great. It would be much better to track what state your game is in separately, then set animations based on that. Separating animating from game state simplifies things and will help if you ever need to serialize the game state. You can Google for the "MVC design pattern". Super Spineboy uses it:
https://github.com/EsotericSoftware/spine-superspineboy/tree/master/src/com/esotericsoftware/spine/superspineboy

You can see how it works here:
https://github.com/EsotericSoftware/spine-superspineboy/blob/master/src/com/esotericsoftware/spine/superspineboy/CharacterView.java
The game state keeps track of what the player is doing, then this code checks if the corresponding animation is playing. If not, it plays it.
Thanks, Nate! I'll keep that in mind for the animations. Now, I have a problem with the enemy's hook: I want the player to be able to dodge the hook by going under the glove like this:




I have no idea how I can change just the drawing order of the left arm because as you see if I change the entire skeleton's draw order the enemy torso overlaps the player's right glove. I've come up with 3 possible solutions:

1) Put the left arm on a different skeleton and copy the animations.

2) Maybe use the tracks, put the arm on track 1, and maybe you can change only the drawing order.

3) The easiest solution when the glove passes over the head is to make the player's head disappear, making the illusion that it has passed under it, and play then with the mesh tool to progressively make the face appear at the edge of the glove and the face.

Any ideas?
maranpis
  • Сообщения: 21

Ryusui

Have you considered adjusting the composition of the player and enemy sprites so you don't have to adjust the drawing order? Perhaps make the player dodge backwards instead of crouching, or crouch low enough that the punch looks like it's sailing over their head without overlapping. Alternately, move the sprites further apart so that the fist doesn't reach beyond the player's body, so that it makes sense that the fist never overlaps the player.
Ryusui
  • Сообщения: 28

maranpis

Ryusui писал(а):Have you considered adjusting the composition of the player and enemy sprites so you don't have to adjust the drawing order? Perhaps make the player dodge backwards instead of crouching, or crouch low enough that the punch looks like it's sailing over their head without overlapping. Alternately, move the sprites further apart so that the fist doesn't reach beyond the player's body, so that it makes sense that the fist never overlaps the player.
Hi Ryusui, yes, I have tried it, I have to keep in mind that the player can either dodge the hit or then take damage and for that there will be a taking damage animation. I have tried different positions and this is the only one that works for all actions.
maranpis
  • Сообщения: 21

funfrock

Would it be possible to get pre-built versions of the runtime with Godot 4 that line up with the alphas (or beta, which is due very soon)? I know neither Godot 4 nor Esoteric's support for it is stable yet, but a lot of folks are trying to get a jump on Godot 4 for various reasons (myself included) and would love to be able to use Spine without having to custom build everything all the time.

Really appreciate you all!
funfrock
  • Сообщения: 2

Ryusui

You can count out alpha builds, since they're still finalizing APIs and whatnot. Beta is possible, but still doubtful unless there's some huge demand for it.
Ryusui
  • Сообщения: 28

Mario

You can fork the spine-runtimes repository on GitHub, enable Actions on your fork, then modify this file in your fork:

https://github.com/EsotericSoftware/spine-runtimes/blob/4.1/.github/workflows/spine-godot.yml#L16

Change the GODOT_TAG value from 3.5-stable to master and the GODOT_VERSION to whatever you like, e.g. 4.0.alpha. You can then manually trigger the Build and Publish Godot editor and templates workflow on GitHub. If the build succeeds, you can download the binaries from GitHub, like for this run:
https://github.com/EsotericSoftware/spine-runtimes/actions/runs/3043534000

We currently simply do not have the resources to support both pre-built 3.5 and 4.0 binaries. 4.0 is still in flux, even if the API is frozen, and has quite a few bugs. Before there's a stable release, we won't be able to suppor it I'm afraid.
Аватара пользователя
Mario

Mario
  • Сообщения: 3157

funfrock

Understood. I appreciate the suggestion of running it myself. I had been building locally but running in to errors, I'll give GH Actions a try.
funfrock
  • Сообщения: 2

T.Fly()

Godot 4 won't be stable for the next 6 months at least. And while most things are locked in, there will still be some API changes so officially supporting early beta versions seems counter productive.

I'd rather see current Godot 3.5 issues resolved like this one: https://github.com/EsotericSoftware/spine-runtimes/issues/2119 and stuff like the .json conflict with Dialogic and similar plugins.

EDIT: And now that https://w4games.com/, a corporate entity founded by lead developers of Godot, exists, there should be no issues with representing interests of Spine in a commercial context. They're not FOSS purists and no one will get lynched by interacting with them via regular bug reporting and feature proposal channels.
T.Fly()
  • Сообщения: 17

Mario

I've now "fixed" the .json issue. More infor here: https://github.com/EsotericSoftware/spine-runtimes/issues/2134

Blog post will also be up this week. TL;DR: backup your project, use the convert.py script to rewrite files, open project with Godot editor containing the latest spine-godot.
Аватара пользователя
Mario

Mario
  • Сообщения: 3157

maranpis

Mario писал(а):I've now "fixed" the .json issue. More infor here: https://github.com/EsotericSoftware/spine-runtimes/issues/2134

Blog post will also be up this week. TL;DR: backup your project, use the convert.py script to rewrite files, open project with Godot editor containing the latest spine-godot.
thanks a lot :)
maranpis
  • Сообщения: 21


Вернуться в Spine