Jump to content

SCML questions


mythgarr

Recommended Posts

Unfortunately the SCML documentation is still not finished. I have a few questions about the current implementation and spec:

* Since transient objects and bones are no longer part of the standard, can the mainline be ignored entirely when importing the data? It looks like the mainline simply serves as a quick key-by-key reference of the latest key for each object - information that is duplicated in the individual timelines. Is that correct?

EDIT: I realized after posting that parenting information is stored in the mainline - NOT the timeline.

* There are some undocumented fields in mainline object_ref objects. I'm looking at the platformer pack in player.scml and seeing name, file, folder, abs_x, abs_y, abs_pivot_x, abs_pivot_y, abs_angle, abs_scale_x, abs_scale_y and abs_a. It looks like these might be override settings for the base object data? What does abs_* mean?

* Is there a list somewhere of what SCML features are currently implemented, what version of Spriter implemented various features or something along those lines? I'm working from http://www.brashmonkeygames.com/spriter ... cation.pdf and the current source code right now.

I'm sure I'll think of more as I work on this. I'm hesitant to use any of the existing implementations as a reference point since it's difficult to tell what version of Spriter they were written against, and consequently how relevant they currently are.

Link to comment
Share on other sites

* Since transient objects and bones are no longer part of the standard, can the mainline be ignored entirely when importing the data? It looks like the mainline simply serves as a quick key-by-key reference of the latest key for each object - information that is duplicated in the individual timelines. Is that correct?

EDIT: I realized after posting that parenting information is stored in the mainline - NOT the timeline.

Hello mythgarr. I will be updating the documentation comprehensively after 1.0, but we're running a bit behind schedule. You are correct about the mainline storing the hierarchy, but it also stored the draw(z) order for the objects. Lastly, it also directs you to the key, without having to search through each timeline to find the current time.

* There are some undocumented fields in mainline object_ref objects. I'm looking at the platformer pack in player.scml and seeing name, file, folder, abs_x, abs_y, abs_pivot_x, abs_pivot_y, abs_angle, abs_scale_x, abs_scale_y and abs_a. It looks like these might be override settings for the base object data? What does abs_* mean?

In the latest version, these abs_ values are optional to the save, and you set that in File/Save Options. This data is available as an option so authoring tools that have separate code for a level or layout editor, than the runtime game code. These systems won't have to have an entire bone system, etc. The absolute values here are how to display the first frame of each animation without using bones.

* Is there a list somewhere of what SCML features are currently implemented, what version of Spriter implemented various features or something along those lines? I'm working from http://www.brashmonkeygames.com/spriter ... cation.pdf and the current source code right now.

This will be updated with deeper explanations of why each thing works the way it does, and to support the latest features, but Domenic is right, this is the newer version of the documentation. It hasn't been updated with the latest pro features. Feel free to ask specific questions about how something is implemented though in the meantime.

cheers.

Link to comment
Share on other sites

Thanks, lucid! I was having a tough time figuring out which source was most current.

Only one question for now - what do the scale_x and scale_y properties mean on a bone? Treating it as a traditional hierarchy where the scale is multiplied down causes some serious problems - looks like this is expected to be 1?

EDIT: I think I figured it out - it DOES multiply down the hierarchy, but the scale is only applied on the leaf node objects. This makes sense - otherwise a rotated child scaled in the x direction would be squished into a diamond shape instead of a smaller rectangle.

Link to comment
Share on other sites

Are folder and file IDs guaranteed to be in consecutive order starting at 0? It would greatly simplify my life if the id was a simple index into an array rather than a full dictionary.

And on a similar note, is there a better way to determine which files are part of the animation and which are part of a character map than looping through animations, then timelines, then sprite keys?

Link to comment
Share on other sites

@mythgarr

yes, the folders and files (for scml/scon generated by Spriter) will always be consecutive.

To your second question. Right now there is no simple way to determine, but that's something I can definitely add in a future build as an option for the save. There are already an option or two for saves that are based on specific requests like this.

Link to comment
Share on other sites

I can definitely add in a future build as an option for the save. There are already an option or two for saves that are based on specific requests like this.

It wouldn't be terribly helpful in this case, since I'll still have to allow for those SCML files that weren't exported with that option. It's not a big deal - I was able to just crawl all animations after parsing in order to determine which are used. I'm trying to provide a reasonably straightforward way (in Unity) to allow remapping sprites as needed. I've got the importer functioning reasonably well but I'm running into some issues with how I was intending to swap sprites - I'll let you know as I run into more issues!

Link to comment
Share on other sites

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...