Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3] 4 5 ... 10
  ignore  |  Print  
  Spine: 2D skeletal animation  (Read 69853 times)
0 Members and 1 Guest are viewing this topic.
Offline davedes
« Reply #60 - Posted 2012-12-02 19:49:54 »

Ah, good to hear you are not restricting it to Java7. Smiley

The new plist file you gave me doesn't fix the problem... Undecided

Offline Nate

JGO Kernel


Medals: 147
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #61 - Posted 2012-12-02 22:30:11 »

Ok, I managed to borrow a Mac and I think I've figured it out. I've updated the download links to 0.83beta. Can you give that a try, pretty please? Smiley

Offline davedes
« Reply #62 - Posted 2012-12-02 23:00:58 »

Yup, it opens now. Smiley

No splash screen, and it seemed to take slightly longer to load compared to the first release. But maybe I'm just imagining it.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Nate

JGO Kernel


Medals: 147
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #63 - Posted 2012-12-03 00:10:04 »

Nice! Grrr stupid splash screen and Macs! :p Thanks for trying it out so many times. I've updated the 0.83beta Mac download and I think I've got the splash screen fixed (didn't think it was worth bumping the version number). I had to give back the Mac I had briefly borrowed, so I don't know for sure.

Edit: nope, still didn't work. After two more tries I got it working and confirmed with a friend that has a Mac. The next version (which isn't up yet) 0.84beta will have a working splash on Mac. What a pain! Special thanks goes to Starfarer, who solved the bullshit Apple pulled in the latest OSX, where launching an untrusted Java app told the user "this app is damaged, you should move it to the trash".

Offline Nagi

Junior Newbie





« Reply #64 - Posted 2012-12-03 14:26:49 »

Hello. I've tested Spine on Windows and just recently on my Mac mini (OSX 10.8.1) and it works perfectly fine. It loads pretty fast and also works smoothly. By the way, switching between Setup and Animate was not intuitive, I had to watch the videos. But it's not a big deal. I think Spine is an excellent tool, and I will buy it if our artists think it might contribute to their work.

Offline Shiu

Junior Member


Medals: 2



« Reply #65 - Posted 2012-12-03 14:30:34 »

Hello. I've tested Spine on Windows and just recently on my Mac mini (OSX 10.8.1) and it works perfectly fine. It loads pretty fast and also works smoothly. By the way, switching between Setup and Animate was not intuitive, I had to watch the videos. But it's not a big deal. I think Spine is an excellent tool, and I will buy it if our artists think it might contribute to their work.

Thank you very much Nagi, we are making a couple of small changes to highlight that you can actually press the SETUP/ANIMATE and spine logo buttons Smiley Hope your artists like working with it.
Offline Krøllebølle

Junior Newbie





« Reply #66 - Posted 2012-12-03 18:12:01 »

I have just started testing Spine and it looks great, but I am having some troubles getting started. My OS is Ubuntu 64-bit and I run the *.jar file by "java -jar java -jar ~/Downloads/spine-0.81beta-linux.jar" and Spineboy appears. I go to the folder where I have my images for the limbs and import them, but I can't really find out how to create spines to make animations. Each image has a slot and when I select a slot I can click on "Set Bone" at the bottom right, but nothing happens. Isn't this the proper way to create a bone? I have tried clicking and dragging as well, but nothing happens then either.

I also had some troubles with Spine chrashing when deleting images under slots, but I can't really reproduce those errors. The stack traces are sent through the great web though Smiley
Offline Nate

JGO Kernel


Medals: 147
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #67 - Posted 2012-12-03 18:18:29 »

Krøllebølle, can you make sure you are using the latest? I see some exceptions were submitted from a Linux user, but the version is 0.81beta, which is now old. The current version is 0.83beta and the latest links are in the first post in this thread. That should fix the crashes.

To create bones, use the "Create" tool under the "Tools" group in the main toolbar at the bottom of the screen. Click and drag in the editor to create a bone, but first be sure to click the bone you want as the parent of the new bone you are creating. If you don't have any bone selected, you can't create a new bone.

Next, attach images to your bones by using drag and drop. It is easiest to drag an image from the tree to a bone in the tree. Once the image is on a bone, you can click it in the editor and position it where you like. After that you can click "SETUP" in the upper left to go to "ANIMATE" mode, where you can set keys and animate your skeletons.

Offline Krøllebølle

Junior Newbie





« Reply #68 - Posted 2012-12-03 18:37:15 »

Thanks, didn't check for an update today, so that'll be me then! Grin I'll remember to check for updates from now on.

I guess I kinda started in the wrong end by importing the images first. Makes sense to create the skeleton first and then import images for the bones.
Offline Nate

JGO Kernel


Medals: 147
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #69 - Posted 2012-12-03 18:41:28 »

Either workflow can make sense, I suppose. In a lot of cases it is probably easier to arrange the images how you want, then create the bones in the correct place on top. You can do this by attaching images to the root bone, position them all, draw bones on top, then use the tree to move the images from the root to the appropriate bone. Tip: disable image selection in the "Options" toolbar group so you can create bones on top of the images. Also note you can drag images from the tree directly into the editor, which attaches them to the root bone.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Drakkheim

Senior Newbie





« Reply #70 - Posted 2012-12-03 19:49:33 »

So assuming I'm already working on a game in LibGDX (which would be a good assumption because it's true) do you have any tips on what would make integration with Spine driven characters as painless as possible?  Do I want to go back and use Scene2d as a base?  Any suggestions/best practices that I can put in my codebase to make things easier to integrate once you guys start selling exporters?
Offline Nate

JGO Kernel


Medals: 147
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #71 - Posted 2012-12-03 20:25:51 »

There is not really anything special you need to do. You don't need to use scene2d. The libgdx runtime is easy to use, I'll describe it really quick and show the current API. Here is how you would load the data:

1  
2  
3  
4  
5  
6  
7  
SkeletonJson json = new SkeletonJson();
TextureAtlas atlas = ...
SkeletonSkin skin = json.readSkin(skinFile, atlas);
Skeleton skeleton = json.readSkeleton(skeletonFile);
SkeletonAnimation animation = json.readAnimation(animationFile, skeleton);
SkeletonModel model = new SkeletonModel(skeleton);
model.setSlotImages(skin);

  • SkeletonJson: Loads from JSON files. There is also a SkeletonBinary class for faster loading and smaller disk size. The API is identical.
  • SkeletonSkin: Stores the data for images and their attachment SRT (scale, rotation, translation) for each bone they can attach to. It looks up texture regions in the atlas by image name.
  • Skeleton: Stores the bones, slots, and bind pose.
  • SkeletonAnimation: Stores the key frame data for an animation
  • SkeletonModel: Stores data per instance of a skeleton: the current color and image for each slot.

As you can see, the only state is in SkeletonModel, the other objects are just data. Your game will have a SkeletonModel instance for each thing you want to draw. To draw, first you pose the model's skeleton by applying an animation, then you draw the model:

1  
2  
3  
animation.apply(model, time, true); // true is for looping
model.update(deltaTime);
model.draw(batch);

That's all there is to it. The time you pass to the animation is how much time (a float, in seconds) has elapsed since the model has been in the animation state. So the state you need to store in your game is 1) which animation a model should use, and 2) how long the model has been using that animation.

Of course if your model can attach various images to slots, you'll also need to manage what images are attached. model.setSlotImages(skin) as shown above is a shortcut which attaches the first image for every slot. This is convenient for models that only ever have one image per slot, but you can also set the images yourself and that works like this:

1  
2  
3  
4  
SkeletonSkin skin = ...
SlotImage image = skin.getImage("slotName", "imageName");
model.setSlotImage("slotName", image);
model.setSlotColor("slotName", r, g, b, a); // rgba are floats

I also showed how to set the color for a slot, if you needed to do that. Note that an animation can change the image and color for slots, so you could use animations instead of tracking it in your code. Eg, if you want to equip a sword you can have an animation where the character pulls out a sword. Halfway through, the animation would attach the sword to the "hand item" slot. When you play this animation on your model, it changes the image attached to that slot until you or another animation changes it again.

Feedback on the API is welcome!

Offline Krøllebølle

Junior Newbie





« Reply #72 - Posted 2012-12-03 20:37:50 »

Thanks for the info, seems pretty easy to use.

I noticed a thing while playing around; if I switch desktop while Spine is open and then back to the desktop with Spine it is not possible to run animations anymore. It is on Ubuntu 64 bits. I guess this shouldn't be a top priority, but now you guys know! This happens whether an animation is already running or not.
Offline Shiu

Junior Member


Medals: 2



« Reply #73 - Posted 2012-12-03 22:59:14 »

Thanks for the info, seems pretty easy to use.

I noticed a thing while playing around; if I switch desktop while Spine is open and then back to the desktop with Spine it is not possible to run animations anymore. It is on Ubuntu 64 bits. I guess this shouldn't be a top priority, but now you guys know! This happens whether an animation is already running or not.

I've just tested this, and I believe it has to do with the way lwjgl handles key input, if you use the switcher and not the shortcut keys for it, it doesn't cause any problems, ctrl seems to get stuck, so hit ctrl again after switching if you use shortcut keys to make it resume playback.
Offline Krøllebølle

Junior Newbie





« Reply #74 - Posted 2012-12-09 20:34:51 »

I've just tested this, and I believe it has to do with the way lwjgl handles key input, if you use the switcher and not the shortcut keys for it, it doesn't cause any problems, ctrl seems to get stuck, so hit ctrl again after switching if you use shortcut keys to make it resume playback.

Yup, that seems to do the trick! When I reported this previously the whole OS freezed because of this, but I believe that is an Ubuntu problem, not a problem with Spine. I'll just stick with pressing ctrl now and then Smiley

Something weird happened just now when I loaded a project; I suddenly had moved to a position at around 200000,-50000. Dunno what happened, but it took some scrolling to get back to 0,0. Maybe a button "zoom to center" might be handy?

Btw, do you have an ETA for Spine? Is it more likely to be January instead of April for instance?
Offline Shiu

Junior Member


Medals: 2



« Reply #75 - Posted 2012-12-09 20:40:31 »

Quote
Btw, do you have an ETA for Spine? Is it more likely to be January instead of April for instance?

A little hesitant to give you an exact date, but it will definitely be in January, maybe even a version with export in December.

Regarding your position issue, that sounds very strange, I'll see if I can reproduce. However click the zoom icon in the lower left corner of the viewport twice, to set the camera back to 0.0 Smiley
Offline davedes
« Reply #76 - Posted 2012-12-09 22:27:31 »

Not sure if this was mentioned, but would it eventually be possible to "blend" between animations?

By that I mean... If the user is running, and then stops running, it "blends" smoothly into the idling position rather than just switching animations immediately.

Offline Shiu

Junior Member


Medals: 2



« Reply #77 - Posted 2012-12-09 22:29:55 »

Quote
Not sure if this was mentioned, but would it eventually be possible to "blend" between animations?

Yes this is something we want to add later, it should be pretty simple to do at runtime in your game given the data you get, but we want to add an animation mixer for creating this later on.

Offline Nate

JGO Kernel


Medals: 147
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #78 - Posted 2012-12-10 03:41:20 »

Since animations just pose the skeleton, blending two animations will be easy. I plan to write the method to do it, but haven't gotten to it yet.

Don't hold your breath on an animation mixer. Smiley This is different than mixing two animations, it's a tool in the editor like the dopesheet, but shows you animations instead of keys. This makes it easy to arrange various animations to build a cinematic cutscene. It would take a lot of effort to build though, and there are many features prioritized above it.

Normally I'd have more Spine updates in this amount of time, but I've moved 3 times in as many weeks (crashing on couches!). Tomorrow I'm on a plane to Austria, land of zee fried meats, to visit Mario.

Offline CommanderKeith
« Reply #79 - Posted 2012-12-10 07:27:04 »

Cool, what are you guys planning to do? Or is it just a friendly meet up?

Offline Nate

JGO Kernel


Medals: 147
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #80 - Posted 2012-12-10 07:59:47 »

Well, I'm homeless, unemployed, and have exhausted my supply of friend's couches that I can crash on in LA, so I'm moving the operation to Europe. Cheesy I suppose it's also good to be with friends for the holidays. Wink I spent last Xmas at Mario's in Austria too. In January I'll visit Shiu in Denmark for a while. After that, I don't know. Hopefully I can make some money with my software by then, funds are getting low!

2.5 years ago I began this nomad lifestyle, in stark contrast to my previous life -- 13 years of mindless corporate zombification, going to work each day, then going home so I could do it again the next day. I like this much better, it's a lot more interesting. I have nothing to show for the 13 years anyway, lost in the housing market thievery.

Offline ra4king

JGO Kernel


Medals: 345
Projects: 3
Exp: 5 years


I'm the King!


« Reply #81 - Posted 2012-12-10 08:48:21 »

Well, I'm homeless, unemployed, and have exhausted my supply of friend's couches that I can crash on in LA, so I'm moving the operation to Europe. Cheesy I suppose it's also good to be with friends for the holidays. Wink I spent last Xmas at Mario's in Austria too. In January I'll visit Shiu in Denmark for a while. After that, I don't know. Hopefully I can make some money with my software by then, funds are getting low!

2.5 years ago I began this nomad lifestyle, in stark contrast to my previous life -- 13 years of mindless corporate zombification, going to work each day, then going home so I could do it again the next day. I like this much better, it's a lot more interesting. I have nothing to show for the 13 years anyway, lost in the housing market thievery.
Damn man, I don't know how you can live like this! Shocked

Hopefully things go over well in the future! Smiley

Offline badlogicgames
« Reply #82 - Posted 2012-12-10 11:35:26 »

i'll put him in our cellar and will only feed him cookies.

http://www.badlogicgames.com - musings on Android and Java game development
Offline gouessej
« Reply #83 - Posted 2012-12-10 12:09:30 »

Well, I'm homeless, unemployed, and have exhausted my supply of friend's couches that I can crash on in LA, so I'm moving the operation to Europe. Cheesy I suppose it's also good to be with friends for the holidays. Wink I spent last Xmas at Mario's in Austria too. In January I'll visit Shiu in Denmark for a while. After that, I don't know. Hopefully I can make some money with my software by then, funds are getting low!

2.5 years ago I began this nomad lifestyle, in stark contrast to my previous life -- 13 years of mindless corporate zombification, going to work each day, then going home so I could do it again the next day. I like this much better, it's a lot more interesting. I have nothing to show for the 13 years anyway, lost in the housing market thievery.
That's a courageous choice. I see a bit what you mean about corporate zombification, I always end up by finding my job very boring, I feel forced to work, I have to pay the bills.

Offline CommanderKeith
« Reply #84 - Posted 2012-12-11 01:38:50 »

Well, I'm homeless, unemployed, and have exhausted my supply of friend's couches that I can crash on in LA, so I'm moving the operation to Europe. Cheesy I suppose it's also good to be with friends for the holidays. Wink I spent last Xmas at Mario's in Austria too. In January I'll visit Shiu in Denmark for a while. After that, I don't know. Hopefully I can make some money with my software by then, funds are getting low!

2.5 years ago I began this nomad lifestyle, in stark contrast to my previous life -- 13 years of mindless corporate zombification, going to work each day, then going home so I could do it again the next day. I like this much better, it's a lot more interesting. I have nothing to show for the 13 years anyway, lost in the housing market thievery.
That's sweet! I also love the backpacking lifestyle. Well that's lucky that you can avoid corporate completely. Most people here seem to have to do full time corporate or at least project work which is a good compromise.
I had great fun visiting jgo people on my last trip overseas (deltor, shannon and eli, thanks guys). deltor was in vienna austria, that was a beautiful city. Great place to be for christmas

Offline Nate

JGO Kernel


Medals: 147
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #85 - Posted 2012-12-16 08:35:03 »

I always end up by finding my job very boring, I feel forced to work, I have to pay the bills.
Please watch this video:
<a href="http://www.youtube.com/v/siu6JYqOZ0g?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/siu6JYqOZ0g?version=3&amp;hl=en_US&amp;start=</a>

Connecting flight was cancelled and I got stuck in London, which was cool because I got to visit some friends there (and eat Nando's!). To Austria on Tuesday! Smiley Have found a little time to work on Spine. I added some export features:


Eg, here is the Spine Boy run animation as a GIF at 15 fps:
Click to Play


Normally you'd want to export JSON or binary and use the runtime library to draw, as that saves lots of disk space and memory over using sprites. Exporting a single frame can be useful to use as a template when you need to draw a new body part to swap an image to change the perspective. Not sure if exporting spritesheets or video might be useful, but it's neat! Smiley

Offline ra4king

JGO Kernel


Medals: 345
Projects: 3
Exp: 5 years


I'm the King!


« Reply #86 - Posted 2012-12-16 19:09:05 »

I always end up by finding my job very boring, I feel forced to work, I have to pay the bills.
Please watch this video:
{ Youtube }
Well the only thing you absolutely need money for is food, otherwise it wouldn't be that challenging to do what you want to do.

Offline Nate

JGO Kernel


Medals: 147
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #87 - Posted 2012-12-16 19:30:42 »

Yeah, food and shelter are the biggest costs. I don't have many friends, but I've been lucky that the few I have let me crash, else my wandering would be quite a lot shorter. I think the key is to focus on what you really want to do. I think it is very rare this is going to be to work to make money so you can go to work more. I think a lot of people let their passions fall to the side so they can stress about their job, feel guilty, overwork themselves, etc. Having a job is often (almost always) necessary, but making it the most important thing in your life is rarely a good way to live. It's easy to do since the money gained enables eating, shelter, heat, a car, etc, even vacations, but meanwhile... are you really happy with how you are spending your life? If not, you owe it to yourself to shake things up. Smiley You only have until you die! This is a lot shorter than it may seem. </rant> Wink

Offline ra4king

JGO Kernel


Medals: 345
Projects: 3
Exp: 5 years


I'm the King!


« Reply #88 - Posted 2012-12-16 19:36:19 »

Well good thing for me, what I want to do in my life is a programming job, so my life shouldn't be that crappy persecutioncomplex

Offline Nate

JGO Kernel


Medals: 147
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #89 - Posted 2012-12-16 19:42:48 »

I love programming and can do it 14+ hours/day, but doing it for a job is different than doing it for fun. A job involves all sorts of stress and the work isn't what you would be doing for fun. It isn't the same at all. Overworking for a job isn't worth it. First, management is going to pat you on the head and tell you that you're doing a great job, whether you are killing yourself at it or just putting in normal hours. You won't get paid more and any meager recognition you might get for going the extra mile is not worth it. But the real reason to not overwork yourself is because you will get burnt out eventually and you'll begin to hate the work. Yes, even programming. They call it work/life balance because work != life. If it was all fun and sunshine and flowers they wouldn't call it work and you wouldn't be getting paid to do it.

Pages: 1 2 [3] 4 5 ... 10
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (24 views)
2014-09-19 03:14:18

Dwinin (39 views)
2014-09-12 09:08:26

Norakomi (68 views)
2014-09-10 13:57:51

TehJavaDev (93 views)
2014-09-10 06:39:09

Tekkerue (47 views)
2014-09-09 02:24:56

mitcheeb (68 views)
2014-09-08 06:06:29

BurntPizza (51 views)
2014-09-07 01:13:42

Longarmx (38 views)
2014-09-07 01:12:14

Longarmx (44 views)
2014-09-07 01:11:22

Longarmx (40 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!