• RuntimesUnity
  • Unity workflow: support for animations that haven't been made yet?

  • Изменено

Hi. Newcomer here. First post.

So I'm in games dev, currently self-funding my own thing on iOS. Right now, it's just me and a laptop, and a whole heap of placeholder graphics. I have a question about workflow, and placeholder animations (I realise that 'placeholder' is a term that's used for a specific Spine thing which is nothing to do with what I'm asking about; has made searching the forums harder!).

Rewind a year or so, and I'd kind of assumed that 2D sprite-based animations would be the way forward for my game. So I bolted together some tools to automaticallyish generate hundreds upon hundreds of placeholder animations (essentially: sequences of four identical sprites, each then having the name of the animation and that sprite's frame number super-imposed on top; wound up with about a hundred placeholder anims, for each of six different characters), and wired up the systems code-side to make everything work and have the right placeholder anim displayed at the right time. General idea being, that when I got to the point where I could take an animator on board, they'd just need to generate final in-game animation assets with the same file name, I'd replace my placeholders assets with their finalised versions, and everything would Just Work.

As I'm poking around Spine, though, I'm not seeing a way of doing anything similar. From what I can gather, exporting from Spine exports everything in one go, and then you pull the assets into Unity, and go from there. I guess I was expecting to be able to do some level of these-anims-don't-exist-yet stuff outside of Spine – like take an animation file, dupe it a hundred times, and rename those files. Some sort of slightly quicker, more programmatic, quick-and-dirty-but-allows-me-to-get-the-code-running solution.

Does this mean that, to get to the same level of integration as I'm currently at with my sprite-centric code, but with Spine, I – and I am very much Not An Artist! – would have to go into Spine, manually set up some sort of placeholder animation in Spine for each of 100ish animations across six characters, export, get and then get everything going from there? And then once I was working with an animator, they'd essentially take my Spine project as a starting point, and replace my placeholder stuff with their shippable-quality stuff?

Or am I missing / misunderstanding something?

(career's been in design / production, btw, and I'm only a self-taught coder, so I very easily could have missed something 🤷‍♀️)

Thanks in advance for any help 😄 🙏

[edit: a '~' in front of '100ish' subscripted the text, so I removed it]

Related Discussions
...

Hmmm, I would like to know a little more about what kind of animation you ultimately want, or it is hard to give you the answer you are looking for.

As for whether you can edit the animation outside of Spine, for example, you can override the bone position and change the pose by changing the mix value of constraints via code, or in the case of the spine-unity runtime, you can use Skeleton Baking:
http://esotericsoftware.com/spine-unity#Skeleton-Baking

For basic information on how skeletons can be manipulated at runtime, please see the runtime documentation:
http://esotericsoftware.com/spine-runtime-skeletons

  • PeteM ответили на это сообщение.

    Misaki

    Hey Misaki – appreciate you taking the time to respond 💪

    So I'm not looking to edit animations outside of Spine; think wa-a-ay more basic than that. My question would still stand even if it's a single walk cycle that I'm talking about.

    Alls I'm wanting to do is create code such that, with minimal extra effort, I can slot in finished animations once they've been created. The game I'm working on (top-down-ish, 2D, mobile) is functionally complete; all ("all"! Ha!) that's left to do is to make it look pretty.

    As a one-person-show, I can't sit back and twiddle my thumbs for three months, wait for finalised animations to come in, and then write the code to support them. I want to do as much of the code-side heavy lifting ahead of time as humanly possible. So ideally, as with my sprite-based code, I want to be writing the support for the animations before those animations actually exist. So, for example, when Character A is walking left, play a placeholder version of a 'walkLeft' animation; when they're walking right, play a placeholder version of 'walkRight'. Those animations needn't actually consist of anything¹; they could just consist of a static character. The animations just need to exist to a level such that when the code tries to play them, the code doesn't crash. Then, when I've found an artist, and they've created shippable-quality 'walkLeft' and 'walkRight' animations, and I've given them some lovely money, I can simply replace my placeholders with those final assets, and everything'll just work.

    (I've just realised that saving / exporting / etc is part of the ESS version of Spine; I'd misremembered and thought it was Pro-only. That being the case, I guess I just whack down sixty quid, and start playing with it myself 🤷‍♀️)

    ¹ whilst placeholder anims could just be static images, I think I'd likely look to use the attachment system to display the words 'walkLeft' and 'walkRight', showing visually that the code is doing the right thing

    • Misaki ответили на это сообщение.

      PeteM Thank you for elaborating it, now I understand. I believe it should be possible to add animations by directly editing the JSON file that stores the skeleton data. You can download several example skeletons from here: http://esotericsoftware.com/spine-examples

      If you download a zip file of an example skeleton and unpack it, you will find a folder named “export”, in which you will find some .json files. You can edit the "animations" section to add animations, and implement them as temporary animations. For more information about the JSON export format, please see the following documentation: http://esotericsoftware.com/spine-json-format

      By the way, the Spine runtimes can be used for evaluation purposes without a license, but a Spine license is required to integrate it into a product. This means that even if you are not the one creating animations using the Spine editor, you still need a license to use the spine-unity runtime. If you have not yet read the Spine Editor License Agreement, please confirm it here: http://esotericsoftware.com/spine-editor-license#s2

      • PeteM ответили на это сообщение.
      • PeteM оценил это.

        Misaki

        Ah brilliant. Thank you. That sounds like it could be just the sort of solution I'm after. I'll have more of a noodle, but I can see myself setting up one or more placeholder characters in Spine (I'm still working out whether sharing a single set of anims across all characters is a good idea or not 🤔), giving each a single animation, then using your solution to copy-paste-paste-paste-paste the 'animation' section of the exported JSON, rename, and then I'll have something to play with. Ace.

        And yep, don't worry, I figured I'd need a licence. No problem from my point of view. You peeps have put a lot of work into what looks like a very powerful product, so I'm more than happy to pay.

        ...and then hopefully in a year or two, I'll be needing to stump up for Enterprise Licenses 🎉🤞🤞🤞

        5 дней спустя

        Thought I'd do a quick follow-up post for anyone that had the same question as me.

        The first answer is: I was asking the wrong question!

        How I got to where I wanted to get to (which was essentially a boned-animation version of the sprite-based setup I described in earlier posts) was:

        • I realised that an image with a single bone defined and some sort of animation was, as far as the code I'm working on is concerned, a completely valid boned animation.
        • So for one character, I did just that: loaded in an image, and gave it the simplest possible skeleton.
        • Over in OmniGraffle, I made little rectangles that just had a word that represented each of the animations (e.g. 'idle', 'walk e', etc).
        • I added a slot, and to that slot, I added separate attachments for each of the Animation Name Rectangles I made above.
        • I animated the Rectangle just tilting back and forth, so that when the animation played in Unity, I could tell that something was indeed happening.
        • I created empty animations, named to match the Rectangles.
        • For each animation, I turned on the relevant attachment, and keyed.
        • Once I'd done that for each of the 80ish animations on a character, I saved. I duplicated the Spine file, renamed, opened it, and just changed the image I used to represent the character. That gave me all the animations I'd previously created, but with a new character graphic, more or less instantly.

        So once I'd twigged that the simplest-possible skeleton was a perfectly valid solution as far as the code on the other end was concerned, I created all 500 or so placeholder animations I needed over a few hours on Friday afternoon. Hashtag winning.

        And yesterday I replaced all my sprite-based code with stuff to handle boned Spine animations, and it's all working gloriously 🎉 🎉

        • Misaki ответили на это сообщение.

          PeteM Glad to hear it is all working now! 🥳 Thank you for sharing the process you went through to reach your solution!