maranpis

Ryusui ha scritto: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 :)
Avatar utente
maranpis
  • Messaggi: 33

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.
Avatar utente
Nate

Nate
  • Messaggi: 12136

maranpis

Nate ha scritto: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?
Avatar utente
maranpis
  • Messaggi: 33

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
  • Messaggi: 28

maranpis

Ryusui ha scritto: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.
Avatar utente
maranpis
  • Messaggi: 33

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
  • Messaggi: 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
  • Messaggi: 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.
Avatar utente
Mario

Mario
  • Messaggi: 3242

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
  • Messaggi: 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()
  • Messaggi: 18

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.
Avatar utente
Mario

Mario
  • Messaggi: 3242

maranpis

Mario ha scritto: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 :)
Avatar utente
maranpis
  • Messaggi: 33

SirBarrett

Hi, I don't know why but when I run the convert.py script to rename the skeleton.json file it shows several errors. I also tried to use .skel file export with no success. Can somebody explain me what i'm doing wrong?
SirBarrett
  • Messaggi: 1

Nate

It looks like your skeleton.json is in use by another process. Maybe try closing Godot, then run the script.
Avatar utente
Nate

Nate
  • Messaggi: 12136

alexhivelk

Mario ha scritto:Aye, it's on my todo, see https://github.com/EsotericSoftware/spine-runtimes/issues/2134
Thanks!
alexhivelk
  • Messaggi: 1

Eliance

Are there plans to release Mono builds? I tried compiling myself but haven't been successful.
Eliance
  • Messaggi: 1

Mario

We currently have no plan to do that I'm afraid. However, with Godot 4 getting more stable, and GDExtensions also getting stable, we might be able to switch the Godot Spine Runtimes from being an engine module to an extension. Then you should be able to use vanilla Godot with whatever language support you want and drop in our runtime. This will be a while tho, as GDExtensions isn't finalized yet.
Avatar utente
Mario

Mario
  • Messaggi: 3242

maranpis

Hello guys, ⁣ :grinteeth: I'm doing a boxing game in Godot with Spine and I don't know how to solve this problem. I'm now programming when the player gets hurt animation. The player has a tail attached to the head and when it dodges to the left or to the right the tail attachment changes. I created a get hurt animation that only changes the upper part of the player, and it works fine except the tail. You can watch it in the video.


Avatar utente
maranpis
  • Messaggi: 33


Torna a Spine