Captain510

  • 한 달 전
  • 2013년 8월 10일에 가입함

    I just print the binary value of float value between 3.8 and 4.2, it has round difference
    the same frame 13/30 value:
    3.8

    4.2

    It seems that the float export precision has changed

    Nate I have try to skip step 2-4, but result is same, still have minor float value difference between 3.8 and 4.2 binary

    Is there any value loss in 4.2 export json ? I will check tommorrow

    Nate Sorry for the misleading description, We are using binary both 3.8 and 4.2.I just use c# json to output value in the binary. Still there have these small value different. But we have json convert process. Our upgrade process:1.import 3.8 binary to 3.8 project 2. export to json file to normalize image path to relative path"./images" 3.import 3.8 json to 3.8 spine project 4. upgrade to 4.1 project(avoid rotation problem)5. upgrade to 4.2 project 6.export o 4.2 binary.

    Hi,We are updating our 3.8 spine game assets to 4.2. We found that some float values loaded in runtime have small difference between two version.
    Let's say in our realtime game battle, we have attack animations for character, and we create a keyframe on event timeline which will to trigger attack game logic, we will get the muzzle position from this time event in which muzzle is a specficed bone. So small frame value difference may impact real gameplay damage value.
    So at best case, we hope no position change after upgrade spine version. But We compare the animation translation timeline data loaded from method ReadAnimation in SkeletonBinary.cs.
    these are two output info(z is keyframe time, serialized using Newtownsoft.json ):
    4.2
    [
    {
    "animationName": "Attack",
    "onAttackTime": 0.433333337,
    "muzzleName": "F_Muzzle",
    "frameInfo": [
    {
    "x": 3.12239981,
    "y": -1.67009914,
    "z": 0
    },
    {
    "x": 1,
    "y": 1,
    "z": 0
    },
    {
    "x": 0,
    "y": 0,
    "z": 0
    }
    ]
    }
    ]

    3.8
    [
    {
    "animationName": "Attack",
    "onAttackTime": 0.433333367,
    "muzzleName": "F_Muzzle",
    "frameInfo": [
    {
    "x": 3.12239981,
    "y": -1.67009985,
    "z": 0
    }
    ]
    }
    ]

    You can see that onAttackTime and frame zero's y is different after the 7th decimal place.
    I review the runtime Code, It looks no precision difference on import animation data, So I have to suspect the editor export logic has changed( which is blackbox for me)
    Do you know about this case, or is there any way can avoid this export bias from two unity version?
    I can send you our project and export for further investgation.
    thanks for any helps.

    Misaki ok. I will send 3.8 version

    • Misaki님이 이에 답장했습니다.

      Hi,We are upadating our 3.8 spine game assets to 4.2.We met 360 spine rotation problem. In 3.8,we made clockwise rotation animation like next 3 images



      after update to 4.2. It became counter clockwise rotation



      But I tried updated to 4.1. It remain clockwise rotation correctly



      It seems the local rotation value is different from 4.1 (0->-180-> -360)to 4.2(0->180->360).
      Is there any way to auto handle these update changes?(We have about 4000 spine project, check by human eyes are quite error-prone)
      thanks for the helps.

      • Misaki님이 이에 답장했습니다.
      • 1.no need.I use 2.2.3 and just update spine to nearest version.You need change some code for spine which is now using some C++11 features.

      • Hi, Except the characters skeleton animation, We are also using spine to make simple sprite frame animation to for football and others' animation. And we found a animation difference between editor and runtime(we are using cocos2d-x).
        In our case , ball's rolling animation has 4 simple keyframe,
        0:roll_00.png, 1:roll_01.png 2:roll_00.png (scaleXY: -1) 3:roll_00.png (scaleXY: -1).
        So I just key the scale value on 2,3 key-frame,but do not key any scale information on 0,1 keyframes. And in editor, it runs exactly correct. But after exporting , we got wrong results in game which seems omit some keyframes, so I check the .json files found 0, 1's scale data missing.

        "roll": {
        		"bones": {
        			"root": {
        				"translate": [
        					etc..
        				],
        				"scale": [
                                                 //missing 0,1 key!!
        					{ "time": 0.1333, "x": -1, "y": -1, "curve": "stepped" },
        					{ "time": 0.2, "x": -1, "y": -1, "curve": "stepped" },
        					{ "time": 0.2666, "x": -1, "y": -1 }
        				]
        			}
        		},
        etc..

        The solution is simple, just back to editor manually key the 0,1 scale value(which is simply default as 1,1).

        It is not a good thing for spine to have animation difference(WYSIWYG is perfect between editor and runtime. So Is there any improving plan for this?

      • do not use old spine runtime in cocos2d-x extension, it is very old. And Upgrade to lastest is quite simple. you just grabbed spine-c and spine-cocos2dx code into your classes folder, add in your xcodeproj ,and add include search paths, and last do not forget to delete the folder references for old spine and include spine code in cocos-ext.h.

      • Nate wrote

        1.5.27 is now up, can you try with that?

        Now everything goes back to normalThanks!

      • Nate wrote

        Ah I see, you are getting missing images when exporting images. Not good! I have a fix but it is mixed in with other changes that aren't quite ready to deploy yet. I'll hopefully upload a fixed version today, maybe tomorrow. Sorry!

        I just stay in 1.5.21, everything works fine~Thanks for your hardwork anyway

      • I update the images, can you see by now?

      • Nate wrote

        To be clear, the OP doesn't have a problem


        there was never a feature to export all skins. This was just added.

        @Captain510, your image didn't work. Did you choose type sequence and animations all?
         Loading Image

        "no configs can export all animations in a single json file" <- This doesn't make sense. This thread is about exporting images. If you export JSON then all animations are always in the JSON.

        Yes, I tried the configs in your screenshot(I just updated to 1.5.24), and it will export like this:
         Loading Image
        this is my config
         Loading Image
        And If I don't check "create atlas", then will create more images for each animations
         Loading Image
        And many images are missing.
         Loading Image
        I just make simple 2d sprite animations now(no bone for now), I add many images to root slot, and I just change image in different frames to make simple animation. And When I was in 1.5.21, exporting is simply export JSON with "create atlas" checked, I do not need to set anything in PNG panel. What I used to have is a single png, a single json, a single atlas. now are a lot of png and atlas.So can you take a look at this problem?

        Best regards,

      • Nate wrote

        I guess you are exporting image sequences? I've added an option to export the current skin (old behavior) or all skins when exporting image sequences (in 1.5.23).

        Hi, Nate. I got the same problem. When I export my animation ,now only add current animation but not all animations.  Loading Image
        And I tried to change options in export panel, but no configs can export all animations in a single json file...

        Can you give me a right config for this ?

      • Nate wrote

        internal->queue can be null if the queue is empty.

        You could use addAnimation("stop") and have logic in your game to avoid adding stop many times. Eg if velocity changes from > 0 to 0 only then call addAnimation("stop"). If fight is playing, stop will happen after. If nothing is playing stop will happen right away. If playing some animation other than fight and you want stop to happen right away, use setAnimation("stop") instead.

        Thanks it works, I just add a non-existed animation called "Stop", I think you can make a more clearer function to do this 🙂

      • Thanks for the quick reply. Honest saying your code is not much different from mine 🙂

        Sounds like whatever you passed for self is null.

        from debug watch, your guess is right.
        Internal* internal = SUB_CAST(Internal, self);
        I check the variable data inside internal , the queue var is null. So I wonder maybe I just not figure out what inside the spine logic(Sorry, I'm from 3d games..in those engines..animation has a lot of combinations)

        What I did before is just play a loop running animation. and when I stop moving, call stop animation. But I can not call clear all animation, because I write play/stop running animation code in player's tick function(I have to check player velocity every tick to determine whether player stop or start running), but player play fight animation instantly, which will like: play fight animation==>next tick velocity is zero, so call stop animation.then the fight animation will be cleared.

      • Hi.Nate.I got a problem when use your spine runtime with cocos2d-x, I need to stop animation by its name,
        But I check the code of CCSkeletonAnimation and CCSkeleton:

        	void setAnimation (const char* name, bool loop, int stateIndex = 0);
        	void addAnimation (const char* name, bool loop, float delay = 0, int stateIndex = 0);
        	void clearAnimation (int stateIndex = 0);
        

        clearAnimation just stop all animation in queue, then I want to implement one by my own, so I check the code
        inside, I knew I just need find animation by its name, and clear it from the queue, here is my code:

        void AnimationState_clearAnimationByName(AnimationState* self, const char* animationName)
        {
        	Animation* animation = animationName ? SkeletonData_findAnimation(self->data->skeletonData, animationName) : 0;
        	if(NULL == animation)
        		return ;
        	_Internal* internal = SUB_CAST(_Internal, self);
        	_Entry* entry = internal->queue;
        	if(NULL == entry)
        		return ;
        	//if is first one in queue, clear it and return
        	if(entry->animation == animation)
        	{
        		internal->queue = entry->next;
        		return ;
        	}
        	while (entry) 
        	{
        		_Entry* nextEntry = entry->next;
        		if(nextEntry->animation == animation)
        		{
        			_Entry* nnextEntry = nextEntry->next;
        			entry->next = nnextEntry;
        			FREE(entry);
        			break;
        		}
        		entry = nextEntry;
        	}
        }

        But I got null ptr in line (_Entry* entry = internal->queue😉, can you give some code guide how to find the playing animation in queue?

        Very appreciated.