Jump to content

Corona SDK


StarCrunch

Recommended Posts

Hi.

lucid brought this up on the Corona forum, so I had a go at it. It sounds like the dev team might be working on their own, but I had already started, so...

My implementation, so far

It's not well-documented, but I implemented what I could given the example file + compact spec, so up to a2 sans transients, I guess. The monster moves a little bit (just to show relative coordinates are right) playing the "Posture" animation, stops, then 5 seconds later plays the "Idle" animation.

I modeled the interface after Corona's SpriteObject (minus frames, which probably don't make sense). The spriter_event listener is available and mirrors sprite, basically. The non-frame properties are there, more or less, and should be considered read-only apart from timeScale.

I figure some of what the editor can do now should be obvious, so I'll try to update some more. If anybody could point me to a decent list of a4-current stuff, that would be great.

Anyhow, that's all for now.

Link to comment
Share on other sites

  • 3 weeks later...

Wow, thanks for this! :D

I was able to get this up and running, but first I had to take the example.SCML file and rename it so that the extension was in lower case. (There was a message in my debugger telling me exactly what to do)

I look forward to playing with / studying this further!

Have you been able to chain animations, or loop them? I tried putting a 2000ms delay and looped the 'posture' animation, but it looks like I have a delay after the end of the first animation, and before the second (very slight).. that, or the animation wasn't meant to be looped :D

Again, thanks!!, I am sure i will spend hours playing with it! I'm sure there are a lot of folks in the community who will also appreciate this.

-Ray

Link to comment
Share on other sites

I've played a bit more with this, and have been having some fun.

I was able to spawn multiple monsters on the screen, and give them touch events to play their posture animations.

I was able to a fluid loop animation by adding a copy of the first keyframe (on the first frame) to the last frame of the animation in the Spriter, and saving the resulting scml.

I see in your notes that looping ,bouncing, and sound are still on the todo list, again, wow! great work!

I did some testing, and was getting framerates of 8-34 on my Nook color running 3 monster instances in idle loops

when i changed to 2 monsters, I was getting ~45fps with drops down to 14 / 15. (I use nook for testing because it is my slowest device)

I imagine that less complicated structures would have fewer timer / transition objects, and would likely allow more on screen at once.

I figured that you could want two complex monster type figures, maybe battling, along with background and other small animations, so that's why I was going for 3 monsters.

I am going to poke around in there tomorrow, and see if I can figure how to expose an individual piece of the entity to touch or collisions.

Link to comment
Share on other sites

I've posted a video of some of the animations I've done.

I made all the animations with bones, then copied the file, and removed all the bones one at a time, then fixed the animations. Once bones is fully implemented, look out!

I still have to look at collisions for individual pieces, not sure how easy that's going to be.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...

Doh, I didn't realize this had replies. :oops:

I haven't abandoned it, just been distracted with several things. I'm veering back into it now, though I think I'll try to doc the code a bit first and remind myself what I was doing. Also, I need to flatten the post-parsed XML structure a bit; there's a lot of superfluous stuff that was causing me no end of confusion when cross-referencing against the spec. :D

I was able to get this up and running, but first I had to take the example.SCML file and rename it so that the extension was in lower case. (There was a message in my debugger telling me exactly what to do)

I look forward to playing with / studying this further!

Have you been able to chain animations, or loop them? I tried putting a 2000ms delay and looped the 'posture' animation, but it looks like I have a delay after the end of the first animation, and before the second (very slight).. that, or the animation wasn't meant to be looped :D

-Ray

Oh, heh. I haven't gotten around to testing any of my Corona projects on a case-sensitive file system yet. I do have a Mac and some iOS stuff around, but so far they're reserved for "more official" / professional projects, since I'd have to kick an employee off for a while. :) That issue is probably easy enough to fix (enumerate the directory, find the file sans extension, voilà).

I'll keep the animation / chaining stuff in mind, though off-hand I don't think Example was loop-ready (there would be a looped field for that purpose, I believe). We'll see what makes most sense.

I see in your notes that looping ,bouncing, and sound are still on the todo list, again, wow! great work!

I did some testing, and was getting framerates of 8-34 on my Nook color running 3 monster instances in idle loops

when i changed to 2 monsters, I was getting ~45fps with drops down to 14 / 15. (I use nook for testing because it is my slowest device)

I imagine that less complicated structures would have fewer timer / transition objects, and would likely allow more on screen at once.

I figured that you could want two complex monster type figures, maybe battling, along with background and other small animations, so that's why I was going for 3 monsters.

I am going to poke around in there tomorrow, and see if I can figure how to expose an individual piece of the entity to touch or collisions.

Most of those features don't sound like too much trouble, though I think for sound and a few other things, I'll have to allow some options (with nice defaults). Audio channel allocation, whether to handle sound playing if you jump past its frame, etc.

Naively, I'd guess the speed might just be all the texture switches (no Nook handy, alas). With an atlas I'd use image groups, which I assume Corona interprets as some "batch these draw calls, and don't switch out the texture and shader" hint behind the scenes.

An option I've considered, on that thinking, is that once atlases are working (mostly a matter of bringing in already-implemented code...), I could attempt to auto-atlas an entity (another option) via some of the capture functionality in Corona: basically load up all the images, bin them in some reasonable way, capture as one image--several images, if they don't all fit on-screen, and cobble those together--and then divvy that up.

Touch should be straightforward, I think, with invisible isHitTestable() objects in the hierarchy. With collision, there will probably be issues dealing with groups, so I'm not sure yet. :)

Anyhow, I'm still not sure how soon I'll get back to work. When I do, I'll probably resume with bones.

Link to comment
Share on other sites

  • 1 month later...

Just want to let people know I've made a pull request that adds bone support and a bunch of comments (unevenly distributed).

I'm not likely to keep working on this, but perhaps it will be useful to someone else.

It's pretty hard to work on this, both because the xml format is a moving target and the documentation is lacking/confusing, and because the code base is still pretty rough – it's pretty hard to get a handle on the responsibilites of the different files involved.

Nevertheless, great work StarCrunch! If Spriter shapes up to be what its makers have envisioned, this work will be valuable to a lot of Corona folks.

The pr here:

https://github.com/XibalbaStudios/Spriter/pull/1

Link to comment
Share on other sites

It's pretty hard to work on this, both because the xml format is a moving target and the documentation is lacking/confusing

the xml format hasn't changed much since we announced it was finalized in April. The one change is that 'spin' may have a 0 value (if the object doesn't change angles).

also, if you can clarify which part of the documentation is confusing (or the whole thing), I can try to edit it to be more clear in the next version.

Link to comment
Share on other sites

  • 1 year later...

My implementation, so far

Hello

Thanks for this implementation for Corona SDK.

When building it in Lua Glider and playing the created APK on Bluestacks/Android Device it fails.

The implementation also brings an error when playing it on Corona Simulator on MacOSX.

The error is in the xml.lua file where io.open function cannot read the path (which is a nil).

I read about the system.ResourceDirectory which is not available on Android devices.

It works only on the Corona Simulator on PC so far.

Can someone confirm this and if yes, bring a solution which is viable on the Android device?

The Corona implementation for Spine works on the android device, so I would like to see a working solution for Spriter, too.

Cheers,

Matt

Link to comment
Share on other sites

  • 1 year later...

Has anyone revisited this Corona SDK implementation recently? I attempted to create a test application in Corona that utilizes the pull request mentioned above (which has actually been merged into the master since that time) with my own animation in .scml format. The latest version of Spriter appears to export a much different format (generator_version="r6") than the format originally developed against above (generator_version="a2"). Therefore, the implementation above does not work at this time with Corona SDK.

Any information would be greatly appreciated.

Ryan

Link to comment
Share on other sites

  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...