Adam's Lair Forum

game development and casual madness
It is currently 2020/02/25, 07:52

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: 2015/01/30, 13:38 
Veteran Member
Veteran Member
User avatar

Joined: 2015/01/07, 09:58
Posts: 102
Location: Sweden
Role: Hobbyist
So I was feeling kind of limited with my own animation system, and then I had a license of Spine just laying around. So I thought why not try to get Spine running in Duality instead :D

So far I've just gotten basic rendering to work. Take the export files from spine (atlas & skeleton json file) and just drop them in duality. Add a SpineAnimationComponent & a SpineAnimationRenderer and voila, spine animations! :)

Click the image, it is beautiful! :)
Gfycat Video - Click to Play. [Source]


I think this is basically all needed to have full support for Spine. Some things I know are missing are debug rendering, for bones and such, mesh animations [edit: mesh animations do actually work :P just tested with an example from Spine!] (I don't have a pro version so I can't even do that) and skinned animations. But other than that, the spine core runtime should take care of the rest. Events and such.


I'm going to clean up the code and drop this bad boy on github :)

Edit: Now on github -> https://github.com/eriksk/Duality-Spine-Runtime


Last edited by skoggy on 2015/01/31, 11:58, edited 1 time in total.

Top
 Profile  
 
PostPosted: 2015/01/30, 14:59 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 883
Location: Italy
Role: Hobbyist
Hooooooooooooooly *bleep* cow :omg:

Do want!

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2015/01/30, 15:55 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
What :omg: I mean.. awesome :D There was this open issue on GitHub on Spine support, but I didn't expect anyone to step up and actually do it anytime soon.

skoggy wrote:
I'm going to clean up the code and drop this bad boy on github :)

When you release it, any chance to get a Duality package at some point? It would require a little more time investment on your side and might need some getting used to, but would be incredibly convenient for anyone who wants to use your plugin. Maybe not directly after source code release, but as soon as you consider it stable enough for a binary release.

There is some quickstart info here on this Wiki page and a lot of NuGet package specs examples here, if you're interested.

Again, nice work :D

Edit: Looking at your screenshot, some of your Resources in the Project View don't have a Type identifier - did you stick to the .ResourceClassName.res naming convention?

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/01/30, 16:17 
Veteran Member
Veteran Member
User avatar

Joined: 2015/01/07, 09:58
Posts: 102
Location: Sweden
Role: Hobbyist
Adam wrote:
What :omg: I mean.. awesome :D There was this open issue on GitHub on Spine support, but I didn't expect anyone to step up and actually do it anytime soon.

skoggy wrote:
I'm going to clean up the code and drop this bad boy on github :)

When you release it, any chance to get a Duality package at some point? It would require a little more time investment on your side and might need some getting used to, but would be incredibly convenient for anyone who wants to use your plugin. Maybe not directly after source code release, but as soon as you consider it stable enough for a binary release.

There is some quickstart info here on this Wiki page and a lot of NuGet package specs examples here, if you're interested.

Again, nice work :D

Edit: Looking at your screenshot, some of your Resources in the Project View don't have a Type identifier - did you stick to the .ResourceClassName.res naming convention?


I just hacked this together last night. I'm sure there's a lot of errors in the code. About the Resources, is there a template or something somewhere that I can use? I'm not really sure of what is required and not. Looking at other resources right now but there's a lot of other stuff going on in the standard ones so I'm not really sure what to do...

I think I'm going to push a repo to github first and may try to make a nuget package later on when I feel more comfortable with the code. Don't know what works and what doesn't yet.

I'm also not really sure about making a Duality plugin because of the licensing on the spine runtimes. They say you can use it only if you own Spine... It's a bit sketchy.

Edit: Just sent an email to esoteric asking about this. We'll see, it's not very obvious on their site what is allowed and what isn't.


Top
 Profile  
 
PostPosted: 2015/01/30, 16:32 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
skoggy wrote:
I'm also not really sure about making a Duality plugin because of the licensing on the spine runtimes. They say you can use it only if you own Spine... It's a bit sketchy.


Ah.. well, that might indeed be a problem. We'll figure this out later. In any case, it sure isn't a bad choice to get a little more comfortable with the code first.

Regarding those Resources, I would suspect that you simply forgot to append the proper file ending in your importer. Take a look at this one here:

Code:
string targetResPath = PathHelper.GetFreePath(Path.Combine(targetDir, targetName), Pixmap.FileExt);


When it determines the path to save the newly generated Resource to, it specifies Pixmap.FileExt as extension, which is a static readonly field (mostly for convenience) derived from this:

Code:
Resource.GetFileExtByType(typeof(Pixmap));


Which determines the proper file ending. Resources themselfs don't really require anything specific, besides [Serializable].

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/01/30, 17:01 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 883
Location: Italy
Role: Hobbyist
Adam wrote:
skoggy wrote:
I'm also not really sure about making a Duality plugin because of the licensing on the spine runtimes. They say you can use it only if you own Spine... It's a bit sketchy.


Ah.. well, that might indeed be a problem. We'll figure this out later. In any case, it sure isn't a bad choice to get a little more comfortable with the code first.

Just my 2 cents, and since I don't know how Spine works they might be complete rubbish:
if it's a separate dll you have to reference, wouldn't it be possible to make a plugin that does not include the "Spine.dll" in its distribution? It would then be the single developer's job to obtain a Spine license and provide the dll to the plugin.

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2015/01/31, 11:57 
Veteran Member
Veteran Member
User avatar

Joined: 2015/01/07, 09:58
Posts: 102
Location: Sweden
Role: Hobbyist
skoggy wrote:
Adam wrote:
What :omg: I mean.. awesome :D There was this open issue on GitHub on Spine support, but I didn't expect anyone to step up and actually do it anytime soon.

skoggy wrote:
I'm going to clean up the code and drop this bad boy on github :)

When you release it, any chance to get a Duality package at some point? It would require a little more time investment on your side and might need some getting used to, but would be incredibly convenient for anyone who wants to use your plugin. Maybe not directly after source code release, but as soon as you consider it stable enough for a binary release.

There is some quickstart info here on this Wiki page and a lot of NuGet package specs examples here, if you're interested.

Again, nice work :D

Edit: Looking at your screenshot, some of your Resources in the Project View don't have a Type identifier - did you stick to the .ResourceClassName.res naming convention?


I just hacked this together last night. I'm sure there's a lot of errors in the code. About the Resources, is there a template or something somewhere that I can use? I'm not really sure of what is required and not. Looking at other resources right now but there's a lot of other stuff going on in the standard ones so I'm not really sure what to do...

I think I'm going to push a repo to github first and may try to make a nuget package later on when I feel more comfortable with the code. Don't know what works and what doesn't yet.

I'm also not really sure about making a Duality plugin because of the licensing on the spine runtimes. They say you can use it only if you own Spine... It's a bit sketchy.

Edit: Just sent an email to esoteric asking about this. We'll see, it's not very obvious on their site what is allowed and what isn't.


That did it :)

SirePi wrote:
Adam wrote:
skoggy wrote:
I'm also not really sure about making a Duality plugin because of the licensing on the spine runtimes. They say you can use it only if you own Spine... It's a bit sketchy.


Ah.. well, that might indeed be a problem. We'll figure this out later. In any case, it sure isn't a bad choice to get a little more comfortable with the code first.

Just my 2 cents, and since I don't know how Spine works they might be complete rubbish:
if it's a separate dll you have to reference, wouldn't it be possible to make a plugin that does not include the "Spine.dll" in its distribution? It would then be the single developer's job to obtain a Spine license and provide the dll to the plugin.


Yep, that's what I thought to. But I sent an email to esoteric so we'll see.

In the mean time; here's the repo -> https://github.com/eriksk/Duality-Spine-Runtime


Top
 Profile  
 
PostPosted: 2015/01/31, 12:48 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
Nice :D

Gfycat Video - Click to Play. [Source]


There were two additional steps to get this to run: Compile the plugins and copy the spine_csharp.dll to the Plugins folder. Will throw errors otherwise because it has no idea what Spine is without the binaries. :D

Anyway, this kinda makes me want to do a game with Spine animations. Looking really neat and smooth. I can only imagine what a talented artist could to with those :omg: (Edit: Actually Onikira is a nice example, since they're using Spine as well in their local Duality fork.)

Some pointers for improvement on certain areas:

  • Cleaning up Project Structure

    You already know this, so there's nothing much for me to add, except an idea on what structure to target. Take a look at this one. No Duality files, just the plugins in their respective folders. A standalone plugin repo, if you wish. Sure, you can't check it out and run it, but that's what Duality (Sample) packages are there for anyway, so the source repo can stay nicely minimalistic and clean :)

  • Bugfixes, Tweaks and Ideas

    • The BoundRadius property of the renderer needs to be calculated properly. Right now, the actual drawn animation exceeds beyond the radius, leading to it being culled while still being visible.
    • BoundRadius, IsAvailable and Skeleton properties could be nicely hidden in the editor. Slap a [EditorHintFlags(Invisible)] on them :) Same could be true for some Resource properties, but not sure here.
    • Why is the first animation called "animation" and doesn't do anything? Might be a peculiarity of the data or a bug.
    • Resource and Component icons and categories for that extra polishing! Two more attributes and that's it. Here's an example.
    • You should probably rename AtlasDataFile property, because it suggests that you would manually enter a file name here. Which should never be done for Resources anyway, but at first glance, not knowing your plugin, one could assume this. Also, maybe hide this in the editor or make it readonly?
    • Don't use Time.LastDelta for framerate-independent calculations. Instead, use Time.TimeMult * Time.SPFMult if you want to know how many seconds have passed in "game time".

Your code looks well structured overall btw. Nice work!

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/02/01, 10:46 
Veteran Member
Veteran Member
User avatar

Joined: 2015/01/07, 09:58
Posts: 102
Location: Sweden
Role: Hobbyist
Adam wrote:
Nice :D

There were two additional steps to get this to run: Compile the plugins and copy the spine_csharp.dll to the Plugins folder. Will throw errors otherwise because it has no idea what Spine is without the binaries. :D

Anyway, this kinda makes me want to do a game with Spine animations. Looking really neat and smooth. I can only imagine what a talented artist could to with those :omg:

Some pointers for improvement on certain areas:

  • Cleaning up Project Structure

    You already know this, so there's nothing much for me to add, except an idea on what structure to target. Take a look at this one. No Duality files, just the plugins in their respective folders. A standalone plugin repo, if you wish. Sure, you can't check it out and run it, but that's what Duality (Sample) packages are there for anyway, so the source repo can stay nicely minimalistic and clean :)

  • Bugfixes, Tweaks and Ideas

    • The BoundRadius property of the renderer needs to be calculated properly. Right now, the actual drawn animation exceeds beyond the radius, leading to it being culled while still being visible.
    • BoundRadius, IsAvailable and Skeleton properties could be nicely hidden in the editor. Slap a [EditorHintFlags(Invisible)] on them :) Same could be true for some Resource properties, but not sure here.
    • Why is the first animation called "animation" and doesn't do anything? Might be a peculiarity of the data or a bug.
    • Resource and Component icons and categories for that extra polishing! Two more attributes and that's it. Here's an example.
    • You should probably rename AtlasDataFile property, because it suggests that you would manually enter a file name here. Which should never be done for Resources anyway, but at first glance, not knowing your plugin, one could assume this. Also, maybe hide this in the editor or make it readonly?
    • Don't use Time.LastDelta for framerate-independent calculations. Instead, use Time.TimeMult * Time.SPFMult if you want to know how many seconds have passed in "game time".

Your code looks well structured overall btw. Nice work!


Thanks! Great feedback, I will take care of all of these things as soon as I can.


Top
 Profile  
 
PostPosted: 2015/02/07, 21:32 
Veteran Member
Veteran Member
User avatar

Joined: 2015/01/07, 09:58
Posts: 102
Location: Sweden
Role: Hobbyist
Sorry for the slow update on this, I've been busy with my game. But I'm using this in my game now and I've run into a couple of issues. Thinking of how much I want to put in the plugin and how much is actually centered around my game. I'll clean it up and push my changes sooon.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group