Barry

  • 17 de Mai de 2018
  • Entrou em 1 de Mai de 2013
  • I'm using a custom Cocos2D-iphone Objective-C runtime and am curious how you plan to implement the draw code for the new features especially FFD. I'm not asking for examples just some psuedo code or even planned techniques/technologies you hope to leverage.

    For example, are you going to use shaders for FFD? Its probably very obvious how these features should be done but I'm still lacking in experience around these more advanced and very cool concepts.

    Will meshes require we use your texture packer and have a new format to support them?

    There's lots of lower level things that are very runtime dependant than have scratching my head and I'm sure you have some great approach to solving them I am just not seeing.

  • Nate I love this tool and its been a great help to us. I have one concern before I back though and that's how do you plan on implementing these features for the different runtimes? If you've discussed this somewhere else on the forums sorry I couldn't find it.

  • We use state 0 for the main animation, 1 for facial expressions, and 2 for blinking.

    When its time to play a main animation, like fire weapon, we stop the animation in state 1 and 2, play the main animation (which could have its own blinking, facial expressions), and then start them back up afterwards.

    I'm not sure if this is a good or bad use of the state feature but it works for now.

  • So why does my json structure look very different for the default skin versus a regular skin? Is there some way to make the skin definition output consistent?
    regular skin:

    	"Clown": {
    		"Body": {
    			"Body": { "name": "Clown/Human_ClownBody", "x": 30.45, "y": 6.03, "rotation": 90.9, "width": 72, "height": 124 }
    		}
    	}
    

    default skin:

    	"default": {
    		"Bandaid": {
    			"Damage/Bandaid1": { "x": 35.12, "y": 18.8, "rotation": -87.74, "width": 32, "height": 32 },
    			"Damage/Bandaid2": { "x": 29.48, "y": 9.57, "rotation": -87.74, "width": 32, "height": 32 },
    			"Damage/Bandaid3": { "x": 35.39, "y": 11.8, "rotation": -87.74, "width": 32, "height": 32 }
    		},
    	}
    

    Just look at where the image names for the attachements are compared between the two.

  • This confuses our animators too btw. The issue to me is the "default" skin works one way, and has a data structure that is one way and you can have multiple images from the default skin under a single slot. Skins work differently with a different json structure and you can only have one image from a skin per slot.

    Why is the default "skin" different from the other skins?

  • Sorry I know this is a unity question but are you certain this is in the c runtime? I can't find it with a search of FindNames.

  • Is there anyway in the runtime to get at this list of valid images for a slot?

  • I don't think I should have to understand all the nuances of the root bone to use spine. It sounds like the root bone also means too many things and has conflicting uses. Anytime I find something like this in my code I know I'm asking for trouble.

    I think all the runtimes should support positioning a skeleton in the same way they all support positioning sprites or whatever objects they have in their engines. Its not really productive to have to understand the way spine does positioning so I can then position the skeleton where I want it to be. At that level the skeleton should just be another object not something that I have special understanding of. I also think you are asking for a support nightmare if everyone has to write their own "make the spine skeleton position correctly" in my game engine code. There will be an endless supply of forum posts asking why my skeleton is not positioned where I want it to be. And please don't get me wrong I know I can figure out how to do it no matter what you provide but you really probably know better than me how varied the spine user skillset is going to be.

    For example, in Cocos2d, I should be able to set the position and anchorpoint of the AnimationNode just like I can any other node and the skeleton should work like I expect. So if I set the anchorpoint to 0.5,0.5 and then set the position of the AnimationNode to the middle of the screen the skeleton should be centered on the screen.

  • Thanks the keying of the slot at the start of the animation fixed the problems. Thank you Nate!

    Thank you for the convenience methods!

  • Hi Nate,

    I'm working with Sheila trying to figure out how to use your product in our game. I'm using Cococ2d-iphone and have downloaded the runtime and the sample and got all that to work.

    All we are trying to do right now is test the features of the runtime and learn how to use the editor to create the animations we want to create. However, even after looking at the source and trying to do as much searching as I can I'm stuck and I think it might be a problem with how we are organizing our files or how we are using this new addAnimation feature.

    Basically all I want to do right now is chain three animations together named "1 Hand Weapon", "Idle", "2 Hand Weapon". I can play each animation individually and it works fine. However, once I try to chain them the order of the chain will make one or more of the animations not play correctly.

    There are also 3 skins in the mix a "default", "Clown", and "Nurse" skin. The "default" skin contains all the shared skin elements (like the Shotgun, facial features, and Pistol) where the Clown and Nurse skin have the art elements for those characters. Here is the code I'm using to play these three animations:

    	animationNode = [CCSkeletonAnimation skeletonWithFile:@"skeleton.json" atlasFile:@"SpineHumanTest.txt" scale:1];
        Skin* myskin = SkeletonData_findSkin(animationNode.skeleton->data, "Clown");
        Skeleton_setSkin(animationNode.skeleton, myskin);
        Skeleton_setToBindPose(animationNode.skeleton);
        [animationNode setMixFrom:@"1 Hand Weapon" to:@"Idle" duration:0.2f];
        [animationNode setMixFrom:@"Idle" to:@"2 Hand Weapon" duration:0.2f];
    	[animationNode setAnimation:@"1 Hand Weapon" loop:NO];
        [animationNode addAnimation:@"Idle" loop:NO afterDelay:0];
        [animationNode addAnimation:@"2 Hand Weapon" loop:YES afterDelay:0];

    When they are in this order the final animation is missing the shotgun. If I change the order different elements will be missing, sometimes its the weapons, sometimes its different arms and hands we use for holding the weapons.

    Is there something obvious I need to do to ensure this works?