Jump to content


Photo

Gmspineapi - Official C-Runtime Port


  • Please log in to reply
76 replies to this topic

#1 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 21 September 2013 - 10:01 PM

Hello everyone. Since the original Gamemaker Spine runtime isn't being developed anymore, I decided to port the Official Spine C-Runtime. Porting the official runtime offers the following benefits:

  1. It should be fairly straight forward to keep the feature set in sync ( free form deformation is coming! )
  2. Others with varying levels of skill should be able to contribute
  3. Ability to take advantage of documentation available online as well as examples provided by the Spine community, see: http://esotericsoftw...using-runtimes/

 

Download

Compatible with: GMS v1.2+ (Tested with v1.2.1264)

Direct download: v0.55

Github Page: https://github.com/ecriss/gmspineapi

HTML5 Demo: https://dl.dropboxus...eapi/index.html

 

RELEASE v0.55 - Feb 27, 2014

- WHAT'S NEW
- Now works in Internet Explorer!
- WebGL is now optional so now it works on Internet Explorer 9 to 11, Opera and Safari
- HTML5 is now much faster. Seems even faster than Windows YYC on Chrome and IE11 on my machine
- Added title screen demo
- Added Spine sample Power Up animation

- BUG FIXES
- fixed HTML5 bug where the animation locks up after a certain number of instances
- Fixed YYC crash when switching skins
- other fixes I didn't keep track of


- NOTE
- GM:S still can't detect IE11 properly see: http://bugs.yoyogames.com/view.php?id=13212
  So in order to test on IE11 set forceHtml5Rendering=true in spine_controller. 

 

 

 

RELEASE v0.54 - Feb 22, 2014

- Finally works on HTML5
  - Check the demo at: https://dl.dropboxusercontent.com/u/4489901/gmspineapi/index.html
  - Confirmed working on Firefox and Chrome, doesn't work on IE11 as you might expect
  - Doesn't work when using Win JS
  
- Added 4th demo to demonstrate Skinning
- Roughly 10% faster
- Fixed drawing bug where attachments don't get drawn when a skeleton contains more slots than bones
- Other minor bugs fixes (I didn't keep track of all the fixes) 

RELEASE v0.53 - Feb 17, 2014

Older versionsv0.52 (release notes), v0.51 (release notes), v0.50

- Added latest fixes and improvements from Official C Runtime
  - Improved animation mixing other minor improvements
  - Fixed memory leaks
  - Updated license to Spine Runtimes Software License version 2
  
- Changed implementation to use Deactivated instances instead of Ds Maps
  - Easier to use and better performammce
  - Speed improvements:
  * With YYC, 58% more instances while maintaining 30fps
  * Without YYC, 20% more instances while maintaining 30fps
  
  - Memory improvements:
  * With YYC, 200% more memory efficient compared to Ds Maps implementation
  * Without YYC, 100% more memory efficient compared to Ds Maps implementation
  
- Other changes
  - Added intellisense argument comments
  - Fixed animation mixing
  - Should now work on both stable and beta versions of GM:S
  - Improved demos to run on touchscreen environment
  - Added 1 additional demo

* Note that the API has issues with the Early Access version of 1.3. The sprites don't seem to draw at all. All that appears is a walking stack of rectangles.
  
  
   

Links

 

Spine runtime by kabecao:

http://gmc.yoyogames...howtopic=574464

 

Spine Website

http://esotericsoftware.com/


Edited by ecriss, 28 February 2014 - 09:19 AM.

  • 7

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#2 Jack Indie Box

Jack Indie Box

    GMC Member

  • GMC Member
  • 1558 posts
  • Version:GM:Studio

Posted 21 September 2013 - 10:31 PM

Hey, cool I'll have a look at it in the next couple of weeks(very busy). I've been planning to implement spine in my game but the previous "spine runtime" was far too inefficient especially as i need 4 simultaneous skeletons at least and due to nested for loops it was slow. So if your port does the job im mighty greatful else I'll be sure to share my code when I have time to optimize it my self.


  • 0
Posted Image
Spoiler

#3 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 21 September 2013 - 10:42 PM

Hey, cool I'll have a look at it in the next couple of weeks(very busy). I've been planning to implement spine in my game but the previous "spine runtime" was far too inefficient especially as i need 4 simultaneous skeletons at least and due to nested for loops it was slow. So if your port does the job im mighty greatful else I'll be sure to share my code when I have time to optimize it my self.

 

I have done a quick performance comparison between the two. My port seems to be able handle more instances before the frame rate drops to 15 fps. I have not done any optimizations yet so there's still a lot of room for improvement. The code is fairly identical to the C code. I'm pretty new to game development so I was hoping for the community to help me on that end. 


  • 1

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#4 Jack Indie Box

Jack Indie Box

    GMC Member

  • GMC Member
  • 1558 posts
  • Version:GM:Studio

Posted 22 September 2013 - 10:22 AM

I'll be sure to check it out when I have time. I haven't looked at the C code. but the previous runtime was no good at having 4 skeletons running, was well bellow 60fps and probably under 30.


  • 0
Posted Image
Spoiler

#5 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 28 September 2013 - 10:30 PM

I've updated gmz file. The jitter in the animation has now been fixed. The animation now runs smoothly. It should also now compile under the YYC. Note that I've yet to update the source files in the Github repository so make sure to download the gmz file instead. The official C-runtime has been recently updated so I'll be implementing the changes in the next couple of weeks.


  • 1

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#6 Serena

Serena

    GMC Member

  • GMC Member
  • 77 posts
  • Version:GM:Studio

Posted 03 October 2013 - 07:15 PM

Thank you so much for doing this, can't wait to try it!


  • 0

My webcomic: http://angelfoodcomic.com

http://seremeres.com

Proud user of Game Maker since 2002!


#7 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 13 October 2013 - 07:47 AM

I just wanted to post an update. I'm still very actively working on this. There's just few issues I need to resolve. Hopefully I can get another release out within the next couple of days.


  • 1

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#8 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 14 October 2013 - 08:10 AM

Alright, I've put out a new release. There's a bunch of breaking changes so I'll be putting up a changelog soon. In the meantime, please check out the the GMZ and run the demos.


Edited by ecriss, 14 October 2013 - 08:17 AM.

  • 1

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#9 FolkerHQ

FolkerHQ

    GMC Member

  • GMC Member
  • 7 posts
  • Version:GM:Studio

Posted 19 October 2013 - 12:17 PM

Thanks for doing this.

 

I tested it with the HTML5 - Output from GameMaker, no animation visible. Maybe a problem with internal files?

 

Performance between Windows and Windows YYC is nearly 1:2

 

Also no crash on Windows Phone, which is very good.

 

 

I think to have better performance the game creater has to stop calculating movement when the figures are not in viewport.

 

Next question ... if everyone with the same skeleton makes the same move at the same time, would it be possible, to calculate the movement only ones, maybe render it on a surface and scale and place it so many times you need it?

 

Or is it not practicable because every instance has to have there own movement and detection and so on.

 

The worst case scenario I can imagine is in a tower defence game. 30 units of both sides all on one screen/viewport all with another animation. Maybe for those problems we need a pre-render on the fly. For the smaller animations with a lot of bones and sprites or so.


  • 1

#10 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 19 October 2013 - 06:38 PM

I tested it with the HTML5 - Output from GameMaker, no animation visible. Maybe a problem with internal files?

 

 

I actually haven't tested on HTML5 yet. That's something I'll be taking a look at next. 

 

 

Also no crash on Windows Phone, which is very good.

 

That's good to know. I don't have a windows phone set up so it's useful to know what works and what doesn't. There are some bugs though that I'm aware of and I'll be putting up a new release soon to address the issues.

 

 

 

I think to have better performance the game creater has to stop calculating movement when the figures are not in viewport.

 

That's a good idea.

 

 

 

 

Next question ... if everyone with the same skeleton makes the same move at the same time, would it be possible, to calculate the movement only ones, maybe render it on a surface and scale and place it so many times you need it?

 

Or is it not practicable because every instance has to have there own movement and detection and so on.

 

I'm actually experimenting with this type of approach. An animation pool, kind of like a sprite sheet but with Spine animations. This is achievable by rendering the animations to a surface, then drawing the surface region using draw_surface_part. This approach will probably only work on games with a lot of repeating characters.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#11 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 19 October 2013 - 06:44 PM

Official Spine animation support is coming to GMS in the future: http://help.yoyogame...-Studio-Roadmap


  • 2

U1FVsm3.png

40799.png


#12 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 19 October 2013 - 06:49 PM

Official Spine animation support is coming to GMS in the future: http://help.yoyogame...-Studio-Roadmap

 

Wow! That's great news.


  • 1

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#13 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 21 October 2013 - 06:12 PM

Released version v0.52. This release contains bug fixes and additive blending for slots. I've started adding support for HTML5 but hit a few snags with bugs in GMS.


Edited by ecriss, 21 October 2013 - 06:14 PM.

  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#14 dadio

dadio

    Potato King

  • YoYo Games Staff
  • 2740 posts
  • Version:GM:Studio

Posted 21 October 2013 - 07:25 PM

Very cool. I'm really looking forward to the official support on this (skeletal animation is *by far* my preferred way of animating...) in the meantime tho, your work is much appreciated!

Keep it up! (^-^)b


  • 0

AczgxAZ.png5aj9t5.jpg
 


#15 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 24 October 2013 - 09:44 AM

Very cool. I'm really looking forward to the official support on this (skeletal animation is *by far* my preferred way of animating...) in the meantime tho, your work is much appreciated!

Keep it up! (^-^)b

 

I'll continue to work on this until the GMS Spine support becomes stable. So for those who want to utilize Spine today, they have something available.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#16 Thygrrr

Thygrrr

    GMC Member

  • GMC Member
  • 59 posts
  • Version:GM:Studio

Posted 30 October 2013 - 11:16 AM

Awesome, thanks - trying to get it to run on Android.

 

The way included files and working directories are handled works differently in my current build (a bit ahead of the current unstable beta branch).

 

To fix it, it was important to rename the included files to not include dashes.


  • 0

#17 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 31 October 2013 - 05:32 AM

Awesome, thanks - trying to get it to run on Android.

 

The way included files and working directories are handled works differently in my current build (a bit ahead of the current unstable beta branch).

 

To fix it, it was important to rename the included files to not include dashes.

 

Loading the images through Included Files doesn't work so well right now. I believe it's because the images sizes have to be power of 2s. 


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#18 kabecao

kabecao

    GMC Member

  • GMC Member
  • 345 posts
  • Version:GM:Studio

Posted 31 October 2013 - 11:04 AM

Great job on this.

 

Loading the images through Included Files doesn't work so well right now. I believe it's because the images sizes have to be power of 2s.

Loading images from included files is not a good deal.

 


Adding Assets At RunTime

Loading sprites and backgrounds from an external source can be done in GameMaker: Studio, as can creating new assets using functions likesprite_duplicate(). However each new asset that you create in this way will also create a new texture page, meaning that (for example) adding 10 new sprites will create 10 new texture pages! And each time you draw these sprites it is a new texture swap and a break in the batch to the graphics card.

As you can imagine, this is not very efficient, and so (unlike previous versions of GameMaker) it should be avoided, with all the graphic assets being added to the game bundle from the IDE. Note that you can use these functions for adding/creating small numbers of things and they won't adversely affect performance, but adding many, many images in this way should always be avoided as it will have an impact.

http://www.yoyogames.com/tech_blog/30

 

When I compile for Windows (YYC) in v1.2.1161 I get this error:

In Script spineapi_binarySearch around line 58 :  error: ambiguous conversion for C-style cast from 'YYRValue' to 'long long'

  • 0

#19 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 01 November 2013 - 06:54 AM

 

 

When I compile for Windows (YYC) in v1.2.1161 I get this error:

 

 

In Script spineapi_binarySearch around line 58 :  error: ambiguous conversion for C-style cast from 'YYRValue' to 'long long'

 

Thanks kabecao, I'll take a look at it this weekend.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#20 eltantillo

eltantillo

    GMC Member

  • GMC Member
  • 416 posts
  • Version:GM:Studio

Posted 03 November 2013 - 06:05 AM

great job on this man, i don't get errors in any module, even the YYC works flawlessly


  • 0

#21 gmouya

gmouya

    GMC Member

  • GMC Member
  • 95 posts
  • Version:GM:Studio

Posted 18 November 2013 - 12:24 AM

Thank you for your work.

 

The example works fine, but i get same strange issues when i try to test it on an android device. (Using newest GMS Version)

 

First i get some strange errors when i do not delete this part of the spineboy_controller.create evente

if (!async) {
  var err = ds_map_find_value(skeletonJson, 'error');
  SkeletonJson_dispose(skeletonJson);
  if (string(err) != '') {
        show_debug_message("Error: " + err);
        game_end();
  }
}

and if i let run this line of the alarm[1] event

SkeletonAnimation_update(skel, delta);

i get

#####

FATAL ERROR:

 

DoMod::Divide by zero

at

gml_Script_AnimationState_up

date (line 72) - checkCompleted = (currLastTime mod endTime)>(time mod endTime);

###########

 

 

Have you or anyone tried the example on android?

Any help appreciated.


  • 0

#22 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 19 November 2013 - 07:13 AM

Thank you for your work.

 

The example works fine, but i get same strange issues when i try to test it on an android device. (Using newest GMS Version)

 

First i get some strange errors when i do not delete this part of the spineboy_controller.create evente

if (!async) {
  var err = ds_map_find_value(skeletonJson, 'error');
  SkeletonJson_dispose(skeletonJson);
  if (string(err) != '') {
        show_debug_message("Error: " + err);
        game_end();
  }
}

and if i let run this line of the alarm[1] event

SkeletonAnimation_update(skel, delta);

i get

#####

FATAL ERROR:

 

DoMod::Divide by zero

at

gml_Script_AnimationState_up

date (line 72) - checkCompleted = (currLastTime mod endTime)>(time mod endTime);

###########

 

 

Have you or anyone tried the example on android?

Any help appreciated.

 

Thanks for the feedback. I haven't tried it on android yet. I'll try to take a look this week.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#23 gmouya

gmouya

    GMC Member

  • GMC Member
  • 95 posts
  • Version:GM:Studio

Posted 25 November 2013 - 09:31 AM

 

Thanks for the feedback. I haven't tried it on android yet. I'll try to take a look this week.

 

Did you have time to try?

I tried on the ouya with the same result


  • 0

#24 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 26 November 2013 - 07:43 AM

 

 

Thanks for the feedback. I haven't tried it on android yet. I'll try to take a look this week.

 

Did you have time to try?

I tried on the ouya with the same result

 

 

I just tried it and it works fine on GMS version v1.2.1221. I tried both the Android export module and the Android YYC. The device I'm using is an HTC One with Android 4.3.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#25 gmouya

gmouya

    GMC Member

  • GMC Member
  • 95 posts
  • Version:GM:Studio

Posted 26 November 2013 - 09:23 AM

I just tried it and it works fine on GMS version v1.2.1221. I tried both the Android export module and the Android YYC. The device I'm using is an HTC One with Android 4.3.

 

Could you send me your apk file just to be sure?


  • 0

#26 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 27 November 2013 - 08:18 AM

 

I just tried it and it works fine on GMS version v1.2.1221. I tried both the Android export module and the Android YYC. The device I'm using is an HTC One with Android 4.3.

 

Could you send me your apk file just to be sure?

 

https://dl.dropboxus...neApi-v0_52.apk


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#27 gmouya

gmouya

    GMC Member

  • GMC Member
  • 95 posts
  • Version:GM:Studio

Posted 27 November 2013 - 10:07 AM

Thank you, this is working on my device. Did you change anything since your last uploaded gmz?


  • 0

#28 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 27 November 2013 - 06:56 PM

Thank you, this is working on my device. Did you change anything since your last uploaded gmz?

Nope, it's version 0.52 without any modifications. Try reimporting the 0.52 gmz.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#29 gmouya

gmouya

    GMC Member

  • GMC Member
  • 95 posts
  • Version:GM:Studio

Posted 29 November 2013 - 04:54 PM

It doesnt work with GMS 1.2.1161

 

updated to to newest version 1.2.1222 and everything works fine. Just wondering what fix did it...


  • 0

#30 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 30 November 2013 - 07:25 PM

It doesnt work with GMS 1.2.1161

 

updated to to newest version 1.2.1222 and everything works fine. Just wondering what fix did it...

That's good to know. Let me know if you have anymore problems.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#31 Lolligirl

Lolligirl

    HEYYEYAAEYAAAEYAEYAA

  • GMC Member
  • 181 posts
  • Version:GM:Studio

Posted 10 December 2013 - 11:57 PM

So sorry for being a newb by asking this, but YoYo and these API's are going to support 2D skeletal animation and not 3D, right? I don't suppose we'll get 3D for awhile.


  • 0

LTCicon.pngTDCicon.pngRFicon2.pngPDicon.png

The Little Tornado, That Doggone Cat, Race Friends, Poker Defense

My Language Blog - Tips, tricks, and resources from yours truly for learning languages! | #gmc IRC - Join us!


#32 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 11 December 2013 - 02:41 AM

So sorry for being a newb by asking this, but YoYo and these API's are going to support 2D skeletal animation and not 3D, right? I don't suppose we'll get 3D for awhile.

 

Spine is designed for 2D animations so 3D is unlikely.


  • 1

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#33 siebenbit

siebenbit

    GMC Member

  • New Member
  • 9 posts
  • Version:GM:Studio

Posted 30 December 2013 - 10:14 PM

How can I use the animation mix feature? I already tried the following in your example, but it does not work:

with(spineboy_controller) {
    if (skelData > -1) {
        var scale = random_range(0.2, 1);
        var skel = SkeletonAnimation_create(skelData, other.locationX, other.locationY, scale);
        SkeletonAnimation_addAnimation(skel, 'walk', true);
        SkeletonAnimation_addAnimation(skel, 'jump', false);
        SkeletonAnimation_setMix(skel, 'jump', 'walk', 0.8);
        SkeletonAnimation_setMix(skel, 'walk', 'jump', 0.8);
        ds_list_add(skeletons, skel);
        instances++;
        
        other.alarm[1]=1;
    } else {
        other.alarm[0]=30;
    }
}

  • 0

#34 Indecom4000

Indecom4000

    GMC Member

  • GMC Member
  • 1636 posts
  • Version:GM:Studio

Posted 30 December 2013 - 11:40 PM

 

So sorry for being a newb by asking this, but YoYo and these API's are going to support 2D skeletal animation and not 3D, right? I don't suppose we'll get 3D for awhile.

 

Spine is designed for 2D animations so 3D is unlikely.

 

Not only is Spine designed for 2d, but this is created by a GM user and has nothing to do with YoyoGames, and as such, some other user could (and probably has) implemented 3d skeletal animation into GM, just have to look around for it.


  • 0

LD-Logo-sml.png


#35 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 31 December 2013 - 06:33 AM

How can I use the animation mix feature? I already tried the following in your example, but it does not work:

with(spineboy_controller) {
    if (skelData > -1) {
        var scale = random_range(0.2, 1);
        var skel = SkeletonAnimation_create(skelData, other.locationX, other.locationY, scale);
        SkeletonAnimation_addAnimation(skel, 'walk', true);
        SkeletonAnimation_addAnimation(skel, 'jump', false);
        SkeletonAnimation_setMix(skel, 'jump', 'walk', 0.8);
        SkeletonAnimation_setMix(skel, 'walk', 'jump', 0.8);
        ds_list_add(skeletons, skel);
        instances++;
        
        other.alarm[1]=1;
    } else {
        other.alarm[0]=30;
    }
}

Hi siebenbit, I'll try to take a look in a couple of weeks. I'm currently on vacation. Thanks.

Edited by ecriss, 31 December 2013 - 06:36 AM.

  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#36 siebenbit

siebenbit

    GMC Member

  • New Member
  • 9 posts
  • Version:GM:Studio

Posted 10 February 2014 - 01:30 AM

I think I found some bugs in your code (especially in the parts that deal with skins). I'll correct and publish them the next few days, might be useful for some others :)


  • 1

#37 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 11 February 2014 - 05:34 AM

Thanks siebenbit. I'm deep into my current game project right now so I haven't been able to update the API. So I appreciate the bug reports.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#38 gmouya

gmouya

    GMC Member

  • GMC Member
  • 95 posts
  • Version:GM:Studio

Posted 12 February 2014 - 09:14 AM

 

How can I use the animation mix feature? I already tried the following in your example, but it does not work:

with(spineboy_controller) {
    if (skelData > -1) {
        var scale = random_range(0.2, 1);
        var skel = SkeletonAnimation_create(skelData, other.locationX, other.locationY, scale);
        SkeletonAnimation_addAnimation(skel, 'walk', true);
        SkeletonAnimation_addAnimation(skel, 'jump', false);
        SkeletonAnimation_setMix(skel, 'jump', 'walk', 0.8);
        SkeletonAnimation_setMix(skel, 'walk', 'jump', 0.8);
        ds_list_add(skeletons, skel);
        instances++;
        
        other.alarm[1]=1;
    } else {
        other.alarm[0]=30;
    }
}

 

Did you get it working? Some code snippet would be nice. Thx


  • 0

#39 siebenbit

siebenbit

    GMC Member

  • New Member
  • 9 posts
  • Version:GM:Studio

Posted 13 February 2014 - 05:10 PM

I corrected three parts of the code in order to get skins working.

 

@gmouya:

I stopped trying to fix the mix feature. I'm not sure, maybe it's just me misunderstanding how to use it correctly :/ I'll look into it later, though.

 

I attached a link to the example project including my fixes below. You can find them by searching (ctrl+alt+f) for "/* EDIT" (without the quotes) in the IDE.

 

https://www.siebenbi...xes_13.2.14.gmz

 

 

EDIT

 

Did you get it working? Some code snippet would be nice. Thx

 

Could you specify what kind of code you would like to see? :)


Edited by siebenbit, 13 February 2014 - 05:19 PM.

  • 0

#40 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 13 February 2014 - 07:14 PM

 

 

How can I use the animation mix feature? I already tried the following in your example, but it does not work:

with(spineboy_controller) {
    if (skelData > -1) {
        var scale = random_range(0.2, 1);
        var skel = SkeletonAnimation_create(skelData, other.locationX, other.locationY, scale);
        SkeletonAnimation_addAnimation(skel, 'walk', true);
        SkeletonAnimation_addAnimation(skel, 'jump', false);
        SkeletonAnimation_setMix(skel, 'jump', 'walk', 0.8);
        SkeletonAnimation_setMix(skel, 'walk', 'jump', 0.8);
        ds_list_add(skeletons, skel);
        instances++;
        
        other.alarm[1]=1;
    } else {
        other.alarm[0]=30;
    }
}

 

Did you get it working? Some code snippet would be nice. Thx

 

 

I'm starting to dig into the code again. I was able to get mixing working with my own animations. I recall having trouble mixing using the Spineboy jump animation so you might want to experiment with the other bundled sample animations that come with Spine. Also the official C runtime has updated how it handles mixing(see here). I'll try to apply that update soon.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#41 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 13 February 2014 - 07:20 PM

Also, while playing around with the code, I realized it's completely broken with both the beta and 1.3 versions. The way GM:S handles the JSON Ds Maps seems to have changed and is doing some strange things with the data structure indexes if you attempt to manually destroy nested data structures on your own. I'll need to post a fix for this soon.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#42 siebenbit

siebenbit

    GMC Member

  • New Member
  • 9 posts
  • Version:GM:Studio

Posted 13 February 2014 - 08:36 PM

I stopped using gamemaker's included json functions some time ago as I found them very unpractical to use. Instead, I rely on JSOnion (http://gmc.yoyogames...howtopic=565659) now, which has been very reliable and stable.


  • 0

#43 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 15 February 2014 - 09:40 PM

I plan on putting up an update soon. The update will include a port of the latest changes to the Official C Runtime as well as support for the /// style comment to display script arguments. It'll also have a fix to animation mixing.


I stopped using gamemaker's included json functions some time ago as I found them very unpractical to use. Instead, I rely on JSOnion (http://gmc.yoyogames...howtopic=565659) now, which has been very reliable and stable.

 

I actually tried using JSOnion for Spine but decided to stick with the built-in JSON parser as JSOnion is much much slower.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#44 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 17 February 2014 - 09:59 AM

As promised, I've released version 0.53. See the orginal post for details.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#45 Research

Research

    GMC Member

  • GMC Member
  • 94 posts

Posted 17 February 2014 - 01:59 PM

How I create a new animation instance or set new one without conflict with the other instances?


Edited by Research, 17 February 2014 - 02:08 PM.

  • 0

#46 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 17 February 2014 - 06:17 PM

How I create a new animation instance or set new one without conflict with the other instances?

 

Hi Research. By animation do you mean SkeletonAnimation? The instances should not be conflicting. Can you give me an example of how they're conflicting? Is this happening in the demo?


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#47 gmouya

gmouya

    GMC Member

  • GMC Member
  • 95 posts
  • Version:GM:Studio

Posted 19 February 2014 - 10:34 AM

 

Did you get it working? Some code snippet would be nice. Thx

 

Could you specify what kind of code you would like to see? :)

 

Actually i had no problems while using skins until now.

I was interested in your fixed code for using mixing animations, but you just seemed to skip this feature ;)


  • 0

#48 Research

Research

    GMC Member

  • GMC Member
  • 94 posts

Posted 19 February 2014 - 02:21 PM

 

How I create a new animation instance or set new one without conflict with the other instances?

 

Hi Research. By animation do you mean SkeletonAnimation? The instances should not be conflicting. Can you give me an example of how they're conflicting? Is this happening in the demo?

 

In the demo when I click to create a new instance all the other instance reset to start.


  • 0

#49 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 20 February 2014 - 08:59 AM

 

 

How I create a new animation instance or set new one without conflict with the other instances?

 

Hi Research. By animation do you mean SkeletonAnimation? The instances should not be conflicting. Can you give me an example of how they're conflicting? Is this happening in the demo?

 

In the demo when I click to create a new instance all the other instance reset to start.

 

 

That's because for the first demo, all spawned instances are currently being reset. The first demo is intended to test how many instances can be created while maintaining a decent framerate. But if you want to see each animations not reset as they are spawned, replace the code in spineboy_demo1 alarm 0 and alarm 1 with the code below:

 

Replace 'alarm 0' with this:


with(spineboy_controller) {
    if (skelData > -1) {
        var scale = random_range(0.2, 1);
        var skel = SkeletonAnimation_create(skelData, other.locationX, other.locationY, scale);
        
        SkeletonAnimation_addAnimation(skel, 'walk', true);
        SkeletonAnimation_addAnimation(skel, 'jump', false);
        SkeletonAnimation_setMix(skel, "walk", "jump", 0.2);
        SkeletonAnimation_setMix(skel, "jump", "walk", 0.4);
        SkeletonAnimation_setAnimation(skel, 'walk', true);
        
        ds_list_add(skeletons, skel);
        instances++;
        
    } else {
        other.alarm[0]=30;
    }
}

Replace 'alarm 1' with this:

with(spineboy_controller){
    var i;
    
    for (i = 0; i < instances; i++) {
        var skel = ds_list_find_value(skeletons, i);
        SkeletonAnimation_setAnimation(skel, 'walk', true);
    }
}

For Demo 1, keep in mind that after you make the character jump, all the animations will be reset.

 

If you want to have a better understanding of Spine, I highly suggest looking over the official documentation at:

 

http://esotericsoftw...using-runtimes/

 

Much of what's there should apply. Just the syntax is slightly different.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.


#50 lobosan

lobosan

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 21 February 2014 - 08:29 AM

Alright guys, I promise you're gonna love the next update. Hopefully I can get a new release during the weekend.


  • 0

 

Mod Edit: Your signature has been spoilered as it breaks the maximum total height rule of 150px. Please fix.