Jump to content


Photo

Sk2d: 2d Skeletal Animation System


  • Please log in to reply
79 replies to this topic

#1 Drifter

Drifter

    GMC Member

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

Posted 29 January 2010 - 01:11 AM

SK2D Is a 2D skeletal animation system built for use with Game Maker. It is based on 3D Skeletal Animation Systems.

3D Skeletal Animation Systems uses special controllers called bones to position vertices in a 3D mesh called a skin. These bones exists in a hierarchy where each bones transformation is determined by the transformation of all it's parent. bones. For example, in a model of a person, moving the arm also moves the hand and the fingers(just like in real life).

A game using SK2D will typically uses SK2D to to position sprites or other instances at the location of bones.

Version 2.2 Downloads:

Editor Version 2.3 Setup File 1.2 MB

Extension 778.93 KB

Source Code 17.6 MB

Examples 12.9 MB

Demos 30.2 MB

Documentation(Unfinished) 43 KB



Features:
  • Ability to manipulate bones directly
  • Framerate independent keyframed animations.
  • Multiple animations per skeleton.
  • The ability to play multiple animations overlapping each other.
  • A mechanism for synchronizing animations with game code.
  • A functional editor is included.
  • Example files are included.

Advantages over Sprite Animation:
  • No need to define every single frame.
  • Interpolation means smoother animations.
  • Less memory & disk space used.
  • Ability to position multiple objects together with ease(For example placing a gun in the hand of your hero).
  • Ability to position particle effects visually
  • Ability to animation separate parts of an entity independently.

Version 2.2 is now available:

Version 2.2 Features:
  • Inverse Kinematics(IK) are now supported
  • IK Chains can cover multiple bones with few limitations.
  • IK Chains can blend between IK Determined positions and animation determined position.
  • This blending can be animated.
  • Source code for this extension is now available under the BSD license.
  • New functions for extracting sprite resources directly into memory(C/C++ only)

New Editor Features:
  • Support for Inversve Kinematics.
  • IK testing mode added


Spoiler

Spoiler

Spoiler


Permissions:

I give permission to use this extension or free or commercial games. No credit is required.

I give permission to use the code found within the examples as a base for creating other games. But I do not however, give permission to use any of the art assets(including sk2d files). Manly because most of them use my actual face. It would creepy if someone made a game with them :(.

Edited by Drifter, 22 October 2011 - 03:18 AM.

  • 6

#2 blue_chu_jelly

blue_chu_jelly

    Shut your FMaj7

  • GMC Member
  • 228 posts

Posted 29 January 2010 - 12:49 PM

It'd be good, if it worked with GM8. It doesn't like sprite_replace_alpha.
  • 0

#3 Blue Leader

Blue Leader

    GMC Member

  • New Member
  • 467 posts

Posted 29 January 2010 - 11:02 PM

This sounds quite handy indeed. Very nice.
  • 0

#4 Drifter

Drifter

    GMC Member

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

Posted 10 February 2010 - 02:38 PM

It'd be good, if it worked with GM8. It doesn't like sprite_replace_alpha.


I don't have gm8 so. If you comment out the script Load_Alpha most of the examples will work just as well (with the exception of the game) . It just for graphic niceness and is not relevant to the extension.
  • 0

#5 Drifter

Drifter

    GMC Member

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

Posted 31 March 2010 - 07:12 PM

Version 1.1 is now available:
  • Support for Game Maker 6.1 and earlier(Just import the scripts from SK2D.gml and define the constants listed in the SK2D_Readme script)
  • Now you can save multiple named user variables per bone.
  • New functions to translate coordinates into different coordinate spaces.
  • Fixed animator behaviour when moving child bones(i hope)
  • Add ability to copy animations.
  • Included the ListEvent tool which list all events in a sk2d file.
  • New file version (Files saved with the new editor will not work with the older version of this extension).
  • Various other fixes.

  • 0

#6 DJ Gman

DJ Gman

    GMC Member

  • New Member
  • 685 posts

Posted 31 March 2010 - 07:26 PM

You've just saved me a buttload of work with translating it to gm6 thx bunches!!!!
  • 0

#7 Darth

Darth

    GMC Member

  • New Member
  • 436 posts

Posted 03 April 2010 - 11:55 AM

This is exactly what I was in the middle of making for my own game. Thanks a lot for releasing it!
Unfortunately, the extension package does not seem to work with game maker 8 ("An error occured installing the extension package").
Will you be releasing a version compatible with GM8? Or is there another way to use this extension with GM8?

Also, your documentation looks great!
  • 0

#8 Drifter

Drifter

    GMC Member

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

Posted 05 April 2010 - 01:56 PM

Also, your documentation looks great!

Thanks.

This is exactly what I was in the middle of making for my own game. Thanks a lot for releasing it!
Unfortunately, the extension package does not seem to work with game maker 8 ("An error occured installing the extension package").
Will you be releasing a version compatible with GM8? Or is there another way to use this extension with GM8?


I am going to have to check that. In the mean time you can load the old school gm6 way. Just import the scripts from sk2d.gml and define these constants:
DLL_VALIDATE_ARGUMENTS = 1 || 0 (set this to 1 the check the arguments types in dll scripts)
SK_NULL = -1

Also try re-downloading the file. it may have gotten corrupted somehow.

Edited by Drifter, 06 April 2010 - 07:25 PM.

  • 0

#9 Drifter

Drifter

    GMC Member

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

Posted 06 April 2010 - 07:24 PM

This is exactly what I was in the middle of making for my own game. Thanks a lot for releasing it!
Unfortunately, the extension package does not seem to work with game maker 8 ("An error occured installing the extension package").
Will you be releasing a version compatible with GM8? Or is there another way to use this extension with GM8?

Also, your documentation looks great!


I just tested this in gm8. It loaded fine for me.
  • 0

#10 Darth

Darth

    GMC Member

  • New Member
  • 436 posts

Posted 11 April 2010 - 11:40 AM

This is exactly what I was in the middle of making for my own game. Thanks a lot for releasing it!
Unfortunately, the extension package does not seem to work with game maker 8 ("An error occured installing the extension package").
Will you be releasing a version compatible with GM8? Or is there another way to use this extension with GM8?

Also, your documentation looks great!


I just tested this in gm8. It loaded fine for me.


I re-downloaded the SK2D_Full.zip file (Extension + Examples) and I received the same error when attempting to install the .gex file.
Also, I have confirmed that I can install other .gex files, it seems that there is something with this one in particular.
When I come around to using SK2D in my game, I can suffice with using the workaround so it doesn't matter too much.

Also, I notice that you are using a dll. Did you create it yourself (is it merely to speed up the calculations)? Or are you using another library?

Edit
Also, I downloaded SK2D_Lite.zip and I received the same error

Edit 2
Thanks to blue_chu_jelly I found out the cause of the problem. I'm using Windows 7 and to install this package in particular I need to run Game Maker with administrative privilages.
I've installed the extension now.

Edited by Darth, 11 April 2010 - 01:26 PM.

  • 0

#11 Drifter

Drifter

    GMC Member

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

Posted 17 April 2010 - 05:46 PM

Also, I notice that you are using a dll. Did you create it yourself (is it merely to speed up the calculations)? Or are you using another library?


SK2D is written completely in C++, there is no GML(although that may change in the future).

I am glad that you got it installed. Do know why Win7 would single out my extension.
  • 0

#12 Maxinston

Maxinston

    Epic Phail

  • GMC Member
  • 1248 posts
  • Version:Unknown

Posted 18 April 2010 - 10:08 AM

Awesome, Thx.
  • 0

#13 HeadInjuryGames

HeadInjuryGames

    AKA Suppercut

  • GMC Member
  • 171 posts
  • Version:GM8.1

Posted 10 June 2010 - 11:50 PM

And to think I was about to make one of these myself with only intermediate knowledge of GML. You, my friend, are thanked very much. You are going straight to the credits for my new 2D Sidescroller Shooter engine.
  • 0

#14 BOXCOMEAUX

BOXCOMEAUX

    GMC Member

  • New Member
  • 3 posts

Posted 21 June 2010 - 06:07 PM

HOW DO U PUT IT ON GAME MAKER 7? :(
  • 0

#15 Drifter

Drifter

    GMC Member

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

Posted 22 June 2010 - 05:23 AM

HOW DO U PUT IT ON GAME MAKER 7? :(

The gex file is in the zip file, to install the extension follow the directions in this topic.
  • 0

#16 BOXCOMEAUX

BOXCOMEAUX

    GMC Member

  • New Member
  • 3 posts

Posted 22 June 2010 - 02:10 PM


HOW DO U PUT IT ON GAME MAKER 7? :(

The gex file is in the zip file, to install the extension follow the directions in this topic.


  • 0

#17 BOXCOMEAUX

BOXCOMEAUX

    GMC Member

  • New Member
  • 3 posts

Posted 22 June 2010 - 02:13 PM

yeah,iv'e done that. i just cant find out how to use it in game maker.i dont know how to load my skeleton. :unsure:
  • 0

#18 Drifter

Drifter

    GMC Member

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

Posted 27 June 2010 - 06:04 PM

yeah,iv'e done that. i just cant find out how to use it in game maker.i dont know how to load my skeleton. :unsure:

There is an example in the help file that will step through how to load and use skeletons. If you are looking for Drag & drop actions, there aren't any.
  • 0

#19 Drifter

Drifter

    GMC Member

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

Posted 18 August 2010 - 08:35 PM

I am just writing this to update you on the next large update that is in the works. This update will feature the ability to embed graphic elements into the skeleton, and a completely rewritten editor.

***Please note that this update is not currently released so don't be scouring this page looking for a download link. Also, all features listed here are tentative except those that are marked done.***


SK2D Version 2.0:

New Features:
  • New graphics API for adding depth-sorted sprites to skeleton(done).
  • Sprites can be animated and support color-blending,scaling,and alpha transparency(done).
  • Ability to embed sprite resources & info within sk2d files(done).
  • More robust error functions. with the option to save to log file and display on screen(done).
  • High level API Layer that automates loading sprite resource, rendering skeletons and other common tasks(done).
  • Drag & Drop actions based on the high level API layer(todo).
  • Better support for integration with physics engines(done).

Changes:
  • Shortened the names of the coordinate functions(a script file will be provided for ease of conversion).
  • Error messages are now displayed when an error occurs. this can be turned off.
  • Animations timing mechanism changed to prevent pesky rounding issues when editing.
  • New binary file format.
  • Removed or disabled unneeded functions that were used only for the old editor.

Editor Features:
  • Completely rewritten in C++.
  • The Main window can now be resized.(done)
  • Supports reading and writing both SK2D 2.0 and SK2D 1.1 files.(done)
  • The contents of a file are now displayed in a hierarchal tree view.(done)
  • Unlimited Undo/Redo actions.(done)
  • A real toolbar & menu.(done)
  • Transforming bones will now transform the bones children as well like in most animation packages.(done)
  • You can now change the parent of a bone or sprite using drag & drop in the Skeleton Explorer.(done)
  • Multiple settings profiles for people with more than one project on the go.(done)
  • Animations and bone can now be renamed.(done)

Editor Screenshots:
Posted Image Posted Image

Edited by Drifter, 04 September 2010 - 07:09 PM.

  • 0

#20 CyrusRoberto

CyrusRoberto

    GMC Member

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

Posted 19 August 2010 - 11:37 PM

I'm very thankful that you're finally rewriting the Sk2d editor in C++. I've been keeping track of this project for a while, hoping that you would fix the glitches in the old editor (which have really hindered my experience with your DLL). I was about to give up hope in seeing the next major update until I decided to check the GMC post just one more time before I started looking for another skeleton system that is a bit easier to use. I'm very glad I did so. :D

-George

Edited by coolgeorge423, 20 August 2010 - 06:51 PM.

  • 0

#21 Drifter

Drifter

    GMC Member

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

Posted 26 August 2010 - 07:15 PM

I have uploaded a beta version of the new editor. It requires Windows XP and OpenGL enabled video card.

***Download Editor link on first page***

When you first start the program it will present a dialog asking you to select a profile.
Each profile has its settings and recent file list. To create one press create. specify a profile name and the default project directory to save files to. Make sure to select the file version to SK2D 1.1 since the 2.0 files are not compatible with the current dll.

*** I have just noticed a glitch in the create profile dialog. If it won't allow you to create a profile make sure your project path doesn't end with \ or / ***

Edited by Drifter, 02 March 2011 - 04:52 PM.

  • 0

#22 Drifter

Drifter

    GMC Member

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

Posted 26 August 2010 - 08:09 PM

I'm very thankful that you're finally rewriting the Sk2d editor in C++. I've been keeping track of this project for a while, hoping that you would fix the glitches in the old editor (which have really hindered my experience with your DLL). I was about to give up hope in seeing the next major update until I decided to check the GMC post just one more time before I started looking for another skeleton system that is a bit easier to use. I'm very glad I did so. :D

-George


Which glitches exactly. The only glitches I can think of is the animation editor. which had mouse translation issues which I only just fixed this week(crosses fingers).
  • 0

#23 Drifter

Drifter

    GMC Member

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

Posted 28 September 2010 - 08:41 PM

Version 2.0 is now availible.
  • 0

#24 CyrusRoberto

CyrusRoberto

    GMC Member

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

Posted 30 September 2010 - 03:52 AM

The new release is great, and the editor is almost flawless. I have been recommending this DLL to people and giving it some attention at 64digits.

However, it would be nice if it were possible to scale the skeleton models in the same way that they can be zoomed in and out in the editor, as well as scaling the sprites with them. It would also be nice if flipping/mirroring the skeleton was a built-in feature. I was able to do this in previous versions of Sk2d by flipping the sign of the local x coordinates of a bone when drawn and flipping the sign of the angles. It seems that all of the drawing functions Sk2d 2.0 are automated by skx_draw_images(skeleton_name), and I can't mirror the skeleton without having to draw the bones the old way.

Here's what I did (press <Enter> to flip the skeleton):

http://64digits.com/...ns_Modified.zip THIS IS FOR SK2D 1.1

However, the skeleton uses global coordinates, and I flipped the skeleton by subtracting the x value of the bone coordinates from the room width. Also, note that I had to flip the sign of the value of the angle as well.

if dir = 1 //facing left
{
sx = sk_bone_get_global_x(Sk,"RightArm1");
sy = sk_bone_get_global_y(Sk,"RightArm1");
sa = sk_bone_get_global_angle(Sk,"RightArm1");
draw_sprite_ext(SPR_UpperArm,0,sx,sy,1,1,sa,c_white,1);
}
else if dir = -1 //facing right
{
sx = sk_bone_get_global_x(Sk,"RightArm1");
sy = sk_bone_get_global_y(Sk,"RightArm1");
sa = sk_bone_get_global_angle(Sk,"RightArm1");
draw_sprite_ext(SPR_UpperArm,0,640-sx,sy,1,1,-sa,c_white,1);
}

But yeah, this extension is awesome, and I plan to use it in a lot of my future projects.

Take care,
-George (aka Cyrus)

Edited by coolgeorge423, 30 September 2010 - 03:59 AM.

  • 0

#25 zeroonea

zeroonea

    GMC Member

  • New Member
  • 41 posts

Posted 11 October 2010 - 06:03 PM

Hi, your editor is great. But I have no idea how to make animation? Can you write a guide?
  • 0

#26 Drifter

Drifter

    GMC Member

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

Posted 15 October 2010 - 01:17 AM

However, it would be nice if it were possible to scale the skeleton models in the same way that they can be zoomed in and out in the editor, as well as scaling the sprites with them.


I have to give some thought to that.

It would also be nice if flipping/mirroring the skeleton was a built-in feature. I was able to do this in previous versions of Sk2d by flipping the sign of the local x coordinates of a bone when drawn and flipping the sign of the angles. It seems that all of the drawing functions Sk2d 2.0 are automated by skx_draw_images(skeleton_name), and I can't mirror the skeleton without having to draw the bones the old way.

This will be in the next version. but in the meantime.

Hi, your editor is great. But I have no idea how to make animation? Can you write a guide?

I may post a video tutorial.
  • 0

#27 CyrusRoberto

CyrusRoberto

    GMC Member

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

Posted 18 January 2011 - 06:56 AM

Have you ever considered releasing the source code to Sk2D's DLL? I would love to use it in a C++ project that I can port to other systems. :3
  • 0

#28 jack1993jack

jack1993jack

    GMC Member

  • New Member
  • 231 posts

Posted 22 January 2011 - 10:52 PM

Just downloaded and it looks good! I remember the days of trying to figure out how do code this from scratch myself ^_^
  • 0

#29 Semantic

Semantic

    GMC Member

  • New Member
  • 9 posts

Posted 31 January 2011 - 09:28 AM

Is it possible to switch off filtering when zooming in editor? I am working with rather small sprites, and it looks bad and hard to position bones correctly sometimes...
  • 0

#30 Markolainen

Markolainen

    GMC Member

  • New Member
  • 426 posts

Posted 02 March 2011 - 11:48 AM

This extension is just awesome. Love it in each and every way. There are some things that could need some smaller improvements imo though.
I get a bug when I delete a sprite:
Spoiler

Then it stops drawing all the sprites and skeletons.

I'd like to see some kind of ability to draw grid, a line etc so you can position the limbs better. Would be great if you could have any angle on them too for ex a walk cycle up a slope.
Best would be if you could import pictures to have in the background too. I know you can import right now but now you have to attach them to a skeleton. And since all skeletons are affected by root I have to make some unnecessary skeletons and grounp. To biggie really but some others may not think of that and could benefit a lot from some kind of reference points.
And I'd have too agree with Sematic that it'd be nice to be able to switch off the AA-filter.

EDIT: It would be nive to be able to switch to next and previous timeline events without having to selevt the animation itself in the skeletal explorer.
EDIT2: Noticed you already had those. Thought they were some kind of fast forward...

Edited by Markolainen, 02 March 2011 - 05:33 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users