Jump to content


Photo

GMSpriterAPI


  • Please log in to reply
68 replies to this topic

#1 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 19 April 2012 - 04:47 AM

Summary
This adds support to load Spriter character animation files into your games.

Interface:

  • SpriterInit() Initializes the setup
  • SpriterLoadProject() Loads the SCML file. Supports multiple files
  • SpriterSetCharaterAnimation() Set the animation for the character
  • SpriterDrawCurrentFrame() Draws the animation frames
  • SpriterDebugMakeAnim() pops up a menu to create an animation from the characters available

NOTICE:
Included in the zip is the Spriter R1 and R3 character files, no harm intended, used for proof of concept

Limited support for R1 and R3

There are features in Spriter that could be supported... Collisions would need to be synchronized and I think there is hot point support to come in Spriter but the file did not have anything regarding the 2.

If you are interested, I can add support to fetch where an item is, like the sword in the animation so you can drop a collision enabled object at the location, so to detect sword hits. I could also provide support for compound characters where each sprite could possibly be linked to an instance.

Support
  • Spriter R1 files support
  • Spriter R3 files support
  • hot spot support (to us, x,y origins)
  • bounding box loading, no access

Issues:
  • The frame timing is slightly off (not noticeable though)
  • <charmap> section is ignored
  • <group> ignored

Please provide feedback... and I do have a donate link below in my sig :)


The Demo
It asks for the animation file when it starts
Right Click will show the characters available.
  • 5

#2 Arusiasotto

Arusiasotto

    GMC Member

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

Posted 19 April 2012 - 07:29 AM

Shiney. Good work Brosky.
  • 0

#3 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • GMC Member
  • 965 posts
  • Version:GM8

Posted 19 April 2012 - 07:37 AM

I think a lot of us don't know what "Spriter character animation files" are, so it would be great if you could clarify that.
  • 0

#4 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 19 April 2012 - 07:40 AM

I think a lot of us don't know what "Spriter character animation files" are, so it would be great if you could clarify that.


http://gmc.yoyogames...1
  • 0

#5 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • GMC Member
  • 965 posts
  • Version:GM8

Posted 19 April 2012 - 09:18 AM


I think a lot of us don't know what "Spriter character animation files" are, so it would be great if you could clarify that.


http://gmc.yoyogames...1

Wow, that looks great! Thanks!

EDIT: This is actually very useful. I've been looking for a software like this but haven't managed to find one. If only I knew about it before I started my current game :dry: :tongue:

Edited by D1g1talAli3n, 19 April 2012 - 09:24 AM.

  • 0

#6 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 19 April 2012 - 04:28 PM

EDIT: This is actually very useful. I've been looking for a software like this but haven't managed to find one. If only I knew about it before I started my current game :dry: :tongue:


We have a few tools like this on the GMC but most are a clumsy due to the nature of GM. GM's lack of GUI functions makes it hard to make things like this.

I was 3/4 done with mine when this came out. Now I'm not sure if I'll finish mine and risk being called a cloner. Seeing this in action, the 2 programs look like siblings separated a birth, one raised by Windows and the other raised by Ubuntu.
  • 0

#7 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • GMC Member
  • 965 posts
  • Version:GM8

Posted 19 April 2012 - 07:29 PM


EDIT: This is actually very useful. I've been looking for a software like this but haven't managed to find one. If only I knew about it before I started my current game :dry: :tongue:


We have a few tools like this on the GMC but most are a clumsy due to the nature of GM. GM's lack of GUI functions makes it hard to make things like this.

I was 3/4 done with mine when this came out. Now I'm not sure if I'll finish mine and risk being called a cloner. Seeing this in action, the 2 programs look like siblings separated a birth, one raised by Windows and the other raised by Ubuntu.

That's quite a sticky situation you're in. If I were you though, I'd continue on. I'd say given your skill, you could probably come up with something that'll be great, and not only that, you'll be able to have it easily portable to GM. I'm not quite so sure which one is Ubuntu and which one is Windows though :sweat:
May I ask, are you using GM to create your animation software?

Edited by D1g1talAli3n, 19 April 2012 - 07:31 PM.

  • 0

#8 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 19 April 2012 - 08:28 PM

That's quite a sticky situation you're in. If I were you though, I'd continue on. I'd say given your skill, you could probably come up with something that'll be great, and not only that, you'll be able to have it easily portable to GM. I'm not quite so sure which one is Ubuntu and which one is Windows though :sweat:
May I ask, are you using GM to create your animation software?


Mine looks like Windows. Yes, I'm using GM and WinApi 2 GEX. Originally, I started with VB but I had trouble with finding proper sprite support. As for being portable, the end result when loading the animation in the GM game is quasi identical; that is why it took only about 2 hours to make this, tweaked my setup to support the structure and the file format. It's just series of sprite references, position and styles.

I guess I'll keep going. One main thing is though, I tend to abandon a lot of things (I'm too strict on myself). so at least the community has this to help them out.
  • 0

#9 Cyahnidde

Cyahnidde

    GMC Member

  • New Member
  • 1 posts
  • Version:Unknown

Posted 19 April 2012 - 09:03 PM

I hate for my first post to be a (probably stupid) question instead of contributing something, but... I seem to be stuck.

First off, I'm new to the whole Game Maker scene (coming from using Flixel a lot) and am pretty interested in this stuff. I'm currently using Game Maker Studio so I can check out what Game Maker is all about.

So, Is it possible to use this on Game Maker Studio? If so, would you care to explain how to get this working? Thanks a lot!
  • 0

#10 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 19 April 2012 - 10:12 PM

I hate for my first post to be a (probably stupid) question instead of contributing something, but... I seem to be stuck.

First off, I'm new to the whole Game Maker scene (coming from using Flixel a lot) and am pretty interested in this stuff. I'm currently using Game Maker Studio so I can check out what Game Maker is all about.

So, Is it possible to use this on Game Maker Studio? If so, would you care to explain how to get this working? Thanks a lot!



Right click the scripts treeview folder, click Add existing scripts, locate the gml file provided.

Oops, that's broken and it made one huge pile of crap script. Just make a new project and import the gmk form the first screen. You can export the scripts in studio format afterwards

In the controller
//this function not suported by Studio ATM. hard code the path and filename
var fname; fname = get_open_filename("Spriter Files (*.scml)|*.scml","");
if(fname !="")
SpriterLoadProject(fname);
else
game_end();
  • 0

#11 Spector_Slayor

Spector_Slayor

    GMC Member

  • New Member
  • 81 posts

Posted 20 April 2012 - 01:47 AM

  • Title: GMSpriterAPI Beta1.
  • Description: Support for Spriter files (SCML)
  • GM Version: :GM81: :GM8:
  • Registered: Yes
  • File Type: .zip (gmk, gmres, gml, animation project file and resources)
  • File Size: 333kb
  • File Link: http://www.host-a.ne...MSpriterAPI.zip

Can someone create an alternate DL link, prefferably from this site. Host-a doesn't want to load the page for some reason.
  • 0

#12 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 20 April 2012 - 02:28 AM


  • Title: GMSpriterAPI Beta1.
  • Description: Support for Spriter files (SCML)
  • GM Version: :GM81: :GM8:
  • Registered: Yes
  • File Type: .zip (gmk, gmres, gml, animation project file and resources)
  • File Size: 333kb
  • File Link: http://www.host-a.ne...MSpriterAPI.zip

Can someone create an alternate DL link, prefferably from this site. Host-a doesn't want to load the page for some reason.

Try again. I think it was down for a few moments.
  • 0

#13 Research

Research

    GMC Member

  • GMC Member
  • 94 posts

Posted 20 April 2012 - 06:20 PM

Very promising.
Especially the fact that portable while using only GML scripts.

In the SpriterAddSprite the "removeback" is better to false.

Edited by Research, 20 April 2012 - 08:56 PM.

  • 0

#14 kabecao

kabecao

    GMC Member

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

Posted 20 April 2012 - 09:42 PM

This is great!

A file of R2 Spriter (not Save Beta) return a error and only R2 version is available for download (I think).

if HTMLNextTag() = "<hotspotarray>" {
    while true if HTMLNextTag() = "</hotspotarray>" break;
}
After "if(thetag != "<spriterdata>") {show_message("Error reading <spriterdata>"); return 0;}" solves the problem until the new feauters aren't supported.

Edited by kabecao, 20 April 2012 - 09:56 PM.

  • 0

#15 SLarouche

SLarouche

    GMC Member

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

Posted 20 April 2012 - 10:25 PM

Very nice work on the Spriter API!

I tried with GM8 this morning, and the idle animation was playing no problem.

But this evening I tried in GM8.1, and the game hangs on the init... Anyone had this problem too?

thank you,

Smon
  • 0

#16 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 20 April 2012 - 11:10 PM

Very nice work on the Spriter API!

I tried with GM8 this morning, and the idle animation was playing no problem.

But this evening I tried in GM8.1, and the game hangs on the init... Anyone had this problem too?

thank you,

Smon


I just ran it in GM8.1. It's incredibly slow to load. I think gm8.1 reworked the string system and it's slow like molasse. Frack I hate xml files. It's a stupid format.

I'll see if I can work something out. Same for the added tag. but not tonight. It's party time.
  • 1

#17 SLarouche

SLarouche

    GMC Member

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

Posted 20 April 2012 - 11:30 PM

But not tonight. It's party time.


Amen.
  • 0

#18 Spector_Slayor

Spector_Slayor

    GMC Member

  • New Member
  • 81 posts

Posted 21 April 2012 - 12:48 AM



  • Title: GMSpriterAPI Beta1.
  • Description: Support for Spriter files (SCML)
  • GM Version: :GM81: :GM8:
  • Registered: Yes
  • File Type: .zip (gmk, gmres, gml, animation project file and resources)
  • File Size: 333kb
  • File Link: http://www.host-a.ne...MSpriterAPI.zip

Can someone create an alternate DL link, prefferably from this site. Host-a doesn't want to load the page for some reason.

Try again. I think it was down for a few moments.

No, still hangs on my PC. Can't DL it, can someone please upload here(no signup required/no ads/wait time) as a mirror?
edit: or any other hosting site, I seriously can't DL the file from Host-a. :mellow:

Edited by Spector_Slayor, 21 April 2012 - 06:44 PM.

  • 0

#19 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 22 April 2012 - 01:33 AM

UPDATE Beta1.2 is up, same download.

Fixes GM8.1.
Faster loading
GM8.1 support

New R2 Spriter tags still not supported.

Will add R2 tags later.


@Spector_Slayor
Sorry about that. can you try with Firefox or EI or another browser? One should work. Having multiple files staggered around the web is not ideal for me, caused me a lot of trouble in the past when updating stuff, I forget to update all sources and someone gets the bad end of the stick.
  • 1

#20 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 22 April 2012 - 03:25 AM

UPDATE Beta1.3 is up, same download.
Spriter R1 files support
Spriter R3 files support
hot spot support
bbox loading
group ignored
  • 1

#21 Spector_Slayor

Spector_Slayor

    GMC Member

  • New Member
  • 81 posts

Posted 22 April 2012 - 05:55 AM

@Spector_Slayor
Sorry about that. can you try with Firefox or EI or another browser? One should work. Having multiple files staggered around the web is not ideal for me, caused me a lot of trouble in the past when updating stuff, I forget to update all sources and someone gets the bad end of the stick.


Ah this slipped my mind, anyways got it DL'd and tested. Thanks for working on it ^^ , but you're right it is quite slow (loading) and when the GM plugin is made I hope it's a lot faster.
  • 0

#22 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 22 April 2012 - 06:06 AM

Ah this slipped my mind, anyways got it DL'd and tested. Thanks for working on it ^^ , but you're right it is quite slow (loading) and when the GM plugin is made I hope it's a lot faster.


The loading is almost instantaneous now, I rewrote the whole file loading system. Are you talking about the number of instance being low before the fps drops? That can be fixed. Optimization is in the works.

[edit]
I only tested on the supplied files. DO you have another that you find is slow to load?
  • 1

#23 superx140

superx140

    GMC Member

  • GMC Member
  • 98 posts

Posted 22 April 2012 - 10:10 AM

I see that GMSpriterAPI loads the sprites externally from files. Is it possible to load the files to the GM tree-view and use them instead? I've read that it is a lot faster as GM automaticly puts the sprites on texture pages.

I also see that GMSpriterAPI only uses GML and no DLL-file. Does that mean that you can load it with GMStudio (for ios games) too without using the extension system?
  • 0

#24 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 22 April 2012 - 04:05 PM

I see that GMSpriterAPI loads the sprites externally from files. Is it possible to load the files to the GM tree-view and use them instead? I've read that it is a lot faster as GM automaticly puts the sprites on texture pages.

I also see that GMSpriterAPI only uses GML and no DLL-file. Does that mean that you can load it with GMStudio (for ios games) too without using the extension system?

It's not faster or more efficient to have the images in your GM project. gm7,8,8.1. I cant vouch for GM Studio.

When they fix the import scripts to load the gml file properly in Studio, you will be able to add the Spriter feature to your game easily.

See post 10
  • 0

#25 SLarouche

SLarouche

    GMC Member

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

Posted 22 April 2012 - 09:59 PM

UPDATE Beta1.3 is up, same download.


Very impressive indeed. Works really well now.

One question, probably related to the fact that I am not familiar with the format, but why if I name my charater something else than: "first character" it only plays the first animation (idle) and never the walk. Any idea?

Thank you,

Simon
  • 0

#26 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 22 April 2012 - 10:36 PM


UPDATE Beta1.3 is up, same download.


Very impressive indeed. Works really well now.

One question, probably related to the fact that I am not familiar with the format, but why if I name my charater something else than: "first character" it only plays the first animation (idle) and never the walk. Any idea?

Thank you,

Simon


The system does not care what you name your animations or characters. Right click on the screen to add a new animation from the loaded file. You will see the character names and animation names available. Names you should use in SpriterSetCharaterAnimation

BTW, I would appreciate some more files to test with.
  • 0

#27 Spector_Slayor

Spector_Slayor

    GMC Member

  • New Member
  • 81 posts

Posted 23 April 2012 - 09:06 PM


Ah this slipped my mind, anyways got it DL'd and tested. Thanks for working on it ^^ , but you're right it is quite slow (loading) and when the GM plugin is made I hope it's a lot faster.


The loading is almost instantaneous now, I rewrote the whole file loading system. Are you talking about the number of instance being low before the fps drops? That can be fixed. Optimization is in the works.

[edit]
I only tested on the supplied files. DO you have another that you find is slow to load?


Much much much better. You're right it is virtually instantaneous now. Seems to be working wonderfully, tyvm. :thumbsup:

Edited by Spector_Slayor, 23 April 2012 - 09:07 PM.

  • 0

#28 hexdump

hexdump

    GMC Member

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

Posted 18 July 2012 - 02:38 PM

Hi,

I know I'm kicking in a bit late, but have some questions about this software:

1) Has it been released? Can't see a download link on its website.
2) As I have been reading it seems there's no possibility to make all sprite parts into a texture or include them into a texture shared by other sprites (Yes, I'm using GMS and for us drawcalls are really important).
3) Do you think this is a good alternative to sprites for mobile systems?

Thanks in advance.
  • 0

#29 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15775 posts
  • Version:GM:Studio

Posted 18 July 2012 - 06:54 PM

Hi,

I know I'm kicking in a bit late, but have some questions about this software:

1) Has it been released? Can't see a download link on its website.

The beta is still available on the page I link to

2) As I have been reading it seems there's no possibility to make all sprite parts into a texture or include them into a texture shared by other sprites (Yes, I'm using GMS and for us drawcalls are really important).

You can modify the code to use a texture an uvs to map to single sprite/texture. I dont really see the point as drawing primitives is slower than drawing sprites in GM plus I dont know if primitives are even implemented in Studio

3) Do you think this is a good alternative to sprites for mobile systems?

In depends. surely it shrinks the resource requirements especially for animations. A sprite based animation sequence yields a large animation image file when as a sequence of positions using the same chunks is much less demanding memory/size wise. However it is slower to have code that draws all the chunks in the right position each frame than using a plain jane animated sprite due to the nature of GM. Though this may not be a factor in the case of the java based executable Studio generates
  • 0

#30 RuinaImperi

RuinaImperi

    GMC Member

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

Posted 07 October 2012 - 09:44 AM

Amazing, great to see someone works on this. Will you continue to improve it, or is it pretty much done? Also does Spriter offer to export your animation as a png sequence, or is this way the only one to get it into your game?

Thanks again.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users