Hi. I wrote a 2d animation program called Spriter, that we're funding through Kickstarter. It's getting alot of attention for it's claims that it can be supported on any platform. A teacher using Scratch in the classroom emailed me asking if it would work on Scratch, and I did a little research on Scratch, and it definitely seems possible to make it work in a way that other people could easily use.
I'm wondering if anyone experienced on the platform could tell me if it's possible to do the following in Scratch, and if you think it's a task one of the developers might take on. I'm going to point the teacher to this thread, so he can continue to follow if anyone decides to.
Basically the program would just need to read xml, and use the data in the xml, simple tags like <name> <x> <y>, etc to position a sprite called "name" at x,y? for a time given in <duration>, then draw the next set of sprites.
If any developers, or just anyone curious wants to learn more about the program, please go to kickstartspriter.com
Offline
Hey lucid,
I'm not the most experienced person with the Scratch Squeak VM but since no one else has replied yet I'll give you an answer.
Because Scratch isn't an animation tool, it doesn't store frames. Mostly animations done in it are scripted using waits and costume changes. In the Scratch "project summary" output, the X-position, Y-position, size, costume number etc will be stored as they were when the project was saved and the scripts that tell them where to move at what times are there also, written in semi-pseudo-code. However, without frames, I see turning this information into frames for an animation as very difficult.
It is, of course, possible to use a variable called "frame" that changes once every whatever your framerate is, and the other sprite reading the framerate to decide where they should be and how they should look but most people don't do this because it's more complicated than it needs to be. I mostly use it if I'm exporting images of an animation frame-by-frame.
Scratch doesn't have XML support in its outputs so in short, I don't think that compatiability is possible, or if it is, it'll take a lot of work with a middle-man program converting everything around.
However, as I said, I'm not the absolute expert here, so there may be a way I don't know about. I will contact nXIII, a fellow Scratcher who is probably the best person for your answer
Offline
sparks wrote:
Hey lucid,
I'm not the most experienced person with the Scratch Squeak VM but since no one else has replied yet I'll give you an answer.
Because Scratch isn't an animation tool, it doesn't store frames. Mostly animations done in it are scripted using waits and costume changes. In the Scratch "project summary" output, the X-position, Y-position, size, costume number etc will be stored as they were when the project was saved and the scripts that tell them where to move at what times are there also, written in semi-pseudo-code. However, without frames, I see turning this information into frames for an animation as very difficult.
It is, of course, possible to use a variable called "frame" that changes once every whatever your framerate is, and the other sprite reading the framerate to decide where they should be and how they should look but most people don't do this because it's more complicated than it needs to be. I mostly use it if I'm exporting images of an animation frame-by-frame.
Scratch doesn't have XML support in its outputs so in short, I don't think that compatiability is possible, or if it is, it'll take a lot of work with a middle-man program converting everything around.
However, as I said, I'm not the absolute expert here, so there may be a way I don't know about. I will contact nXIII, a fellow Scratcher who is probably the best person for your answer![]()
spriter to scratch might work but scratch to spriter will be harder
EDIT: 1000th post!
Last edited by TRocket (2012-04-03 06:41:29)
Offline
Hi Lucid,
Scratch would probably be able to read in an XML file and position images at a specific point for a specific duration, based on the XML file. The best way in my opinion would be to create a Scratch Patch which simply adds a menu item saying "Import Spriter project..." and decompiles the XML into a Scratch project by adding sprites and scripts.
However, it seems like too much work for something which is quite obvious to do in Scratch itself. So a better way would be to import a list (Scratch uses 1-dimensional arrays called lists) and create a project which follows the instructions in the lists. Simple, graceful, and quite cool. The problem there is that Scratch only supports images added into the resources pack manually. So it's not feasible to actually build an image on the spot at a reasonable speed. So, you would have to add each image as a costume, and reference each costume with the XML item.
Offline
Oh, I didn't realise you wanted to be able to run spriter animations in Scratch too.
If you use a patch, you could definetly use the system hardmath123 suggests above, the language Scratch is written in (smalltalk) is also capable of importing image from a folder to costumes, so it might be possible to get the patch to import all images in a folder you've created.
Offline
Yeah, I'm pretty sure he wants a viewer, not an editor. Read the website for more info.
Offline
Is there any reason why this teacher would prefer to use Spriter animations in scratch? Whats wrong with the normal method of presentation within your program?
lucid wrote:
It's getting alot of attention for it's claims that it can be supported on any platform. A teacher using Scratch in the classroom emailed me asking if it would work on Scratch, and I did a little research on Scratch...
Just pointing out, Scratch is not a platform.
Last edited by LiquidMetal (2012-04-03 08:57:55)
Offline
Hardmath123 wrote:
Yeah, I'm pretty sure he wants a viewer, not an editor. Read the website for more info.
![]()
Lucid, are you able to save the animation as an animated gif?
If so, you can import all the costumes of an animated gif into a sprite at once, and display would most likely work in scratch.
Last edited by LiquidMetal (2012-04-03 09:01:15)
Offline
LiquidMetal is right, dragging an animated GIF into Scratch will turn each frame into a costume for easy playback, though it's not a very efficient method, as a lot of images have to be loaded.
Scratch is a platform.
Offline
sparks wrote:
LiquidMetal is right, dragging an animated GIF into Scratch will turn each frame into a costume for easy playback, though it's not a very efficient method, as a lot of images have to be loaded.
In my experience, loading gifs with lots of images has been slow (I think because of Squeak? - and showing each in the costumes tab). I also had some trouble with certain gif-exporting-programs, where once imported into scratch, any black part of those gifs would become transparent (That may have been a save options error on my part). However, Scratch 2.0 is due before the year is out, and both of those problems may be fixed.
sparks wrote:
Scratch is a platform.
Oh! I didn't realize programming languages count. Thanks.
Last edited by LiquidMetal (2012-04-03 13:13:54)
Offline
Thanks everyone for your replies.
Hardmath is correct, I was curious if scratch could be a 'viewer' for the animation data. It's possible to eventually add export to animated gif, and it currently supports export to sequential png, but those methods defeat the main purpose of Spriter, which is to allow a target platform to display unusually large characters, or unusually fluid animation, by building each frame from a small set of images, rather than one full image for each frame.
So basically it just needs to load a set of images from disk(specified in the xml), and then go through a list of <frame>s which would basically say - display these images at this position, angle, etc, then wait for <duration> and move on to the next set of images. From these two posts, it seems possible:
sparks wrote:
the language Scratch is written in (smalltalk) is also capable of importing image from a folder to costumes, so it might be possible to get the patch to import all images in a folder you've created.
Hardmath123 wrote:
Scratch would probably be able to read in an XML file and position images at a specific point for a specific duration, based on the XML file.
So it seems it's possible. Part two of this question, is whether, based on the difficulty involved, and the number of users in the community proficient enough to attempt it, what do you think is the likelihood of someone taking the time to do it, once we release the file format.
Offline
lucid wrote:
So it seems it's possible. Part two of this question, is whether, based on the difficulty involved, and the number of users in the community proficient enough to attempt it, what do you think is the likelihood of someone taking the time to do it, once we release the file format.
Yes, I reckon this is certainly possible to play animations from a set format in Scratch.
I wouldn't mind having a go or working on it with some other people, though I will have to see what my schedule is like when you release!
I think that a patch is a good option. However, I think that a project would have to be block-scripted to work and would have to load all the data first, reading from the file live to play the animation would probably be too slow.
What you really need is image importing, sprite cloning and file reading. Panther actually has all these things and I think creating the animation player in that would be very easy, but I assume you specifically want to target Scratch.
The question is, then, if Panther is a version of Scratch, would using a patch be defeating the objectives of your project? Scratch is a sandboxed scripting language, so without patching it, a lot of the importing would have to be done by hand.
Have you any rough drafts of the format we could look at? Would the settings of every sprite be determined once per frame?
_________________________________________________________________________________
I've just been watching your video and the program looks pretty good! I'm an indie gamer studying game development at university at the moment and it looks like a truly useful tool!
Having watched the video I feel I should give a few warnings:
I notice you showcased parent-child sprites for "mannequin" characters as one of your main selling points. Scratch does not support sprite nesting or inheritance so you will need to include full position, direction etc. for each part in your output document rather than a parent name an relative positioning.
You mentioned above that you're aiming to create fluid animations across platform and whilst I agree that Spriter will make the development and animation process faster, I'm not confident that the method Scratch would use to READ the animation data and play it would be as smooth as directly animating in Scratch unless one of us can work out how to write a script to write scripts in Scratch (It's not very fast at reading from its array database).
I also hope that a free version will be available since the vast majority of Scratchers are young people without the money to buy such a tool.
Last edited by sparks (2012-04-03 16:03:39)
Offline
Once Scratch 2.0 comes out, it may be harder, or easier, to make patches.
Also, the scratch screen is currently set at 480*360 pixels: What would you do about larger sizes of animation?
Last edited by LiquidMetal (2012-04-03 21:27:19)
Offline
LiquidMetal wrote:
Also, the scratch screen is currently set at 480*360 pixels: What would you do about larger sizes of animation?
Scratch just resizes it. I draw in 800x600 and it fits the screen perfectly.
Offline
MrScoop wrote:
LiquidMetal wrote:
Also, the scratch screen is currently set at 480*360 pixels: What would you do about larger sizes of animation?
Scratch just resizes it. I draw in 800x600 and it fits the screen perfectly.
Yes, it resizes, but not only does it do it with a lot of image quality loss, it hasn't increased the size of the stage, so coordinates for an animation will either have to remain in a 480*360 rectangle or be scaled.
Offline
MrScoop wrote:
LiquidMetal wrote:
Also, the scratch screen is currently set at 480*360 pixels: What would you do about larger sizes of animation?
Scratch just resizes it. I draw in 800x600 and it fits the screen perfectly.
If I understand correctly, lucid wants there to be separate sprites for separate pieces of the animation, so that they will take up less space. If each sprite is less then 480*360; they will not auto-resize, and then the animation will not fit on the screen... And the X and Y values would need to be scaled also for the animation.
sparks wrote:
Yes, it resizes, but not only does it do it with a lot of image quality loss, it hasn't increased the size of the stage, so coordinates for an animation will either have to remain in a 480*360 rectangle or be scaled.
Scratch 2.0's vector graphics capability should help fix the image quality problem.
If, lucid, spriter will also have vector graphics support?
Offline
sorry for the late reply,
no Spriter will not have vector graphics support.
Eventually it will have it's own brand of image deformation, given proper funding, but it's not likely it would be compatible with any current vector formats
Offline
It means that you can't re-size 800 * 600? Or if you re-size pixel splits. There must be some alternative out there for same. Isn't?
Offline
lucid wrote:
sorry for the late reply,
no Spriter will not have vector graphics support.
Eventually it will have it's own brand of image deformation, given proper funding, but it's not likely it would be compatible with any current vector formats
And the importer we would make for scratch would need to support that format?
BrynnaeBroghan wrote:
It means that you can't re-size 800 * 600? Or if you re-size pixel splits. There must be some alternative out there for same. Isn't?
If each sprite is less then 480*360, scratch will NOT resize it.
Last edited by LiquidMetal (2012-04-12 11:22:03)
Offline
hi, lucid, Zeroluck and i are building a scratch-like program in Java called JBlocks and we were wondering if you would like us to try and implement opening and saving spriter projects. If so please reply to this thread and we will try incorporate this into JBlocks.
Offline
TRocket wrote:
hi, lucid, Zeroluck and i are building a scratch-like program in Java called JBlocks and we were wondering if you would like us to try and implement opening and saving spriter projects. If so please reply to this thread and we will try incorporate this into JBlocks.
Here is a screen-shot:
https://sourceforge.net/p/jblocks/scree … blocks.png
Offline