Sprite Swap Tips/Suggestions

Discuss issues pertaining to the Creature Animation Editor here.
chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: Sprite Swap Tips/Suggestions

Post by chong » Sat Sep 02, 2017 7:38 pm

Hello,

So to speed up loading times, here are a couple of tips:

1) When you export out your animations you should try trimming the export frame range if possible. ( for looping animations )
IMPORTANT: Export Frame Range is DIFFERENT from your animation frame range. Export Frame Range is the actual frame range that is exported out. This means you can have your animation say from 0 to 280 but your export frame range of 70 to 120. Typically you do this because you want to make the animation loop with motors and the actual looping frame range is different from the entire animation's frame range.
I recommend you look at this doc first:
https://www.kestrelmoon.com/creaturedoc ... ation.html

Next, when you do your export ( Export -> Game Engines ), there is a "Frame Ranges..." button. Click on that to set your actual Export Frame Range. If you use Auto Loop Inference or the Loop Analysis Tool, it will set those for you. Remember, you change the Export Frame Range. Please keep your actual animation range the same ( do not touch those ).

2) The file format to use should be the Flat Buffers Binary file format. This loads a lot faster than the regular text based JSON format.

3) If you are loading lots of background/non major characters, the recommended file format to use ( since you don't need that much programmable gameplay control ) is CreaturePack:
https://github.com/kestrelm/Creature_Un ... eaturePack

Read through the docs for CreaturePack, in particular, how to tweak the "Gap Step" parameter. This allows you to shrink your exported animation assets quite dramatically ( 2 - 6x compression ) at the expense of some quality. CreaturePack is what a lot of studios use for deployment on Mobile since it executes extremely fast and very compact after tweaking the "Gap Step" compression value.

4) Finally, you will be happy to note that I am also going to be adding a "Gap Step" control for regular JSON and FlatBuffers file formats for the next update! This means they too will also allow you to tweak and shrink your exported file asset sizes which should help with load times. The changes for the core Unity runtime have already been checked in:
https://github.com/kestrelm/Creature_Unity
(Check the change logs )
The Creature Editor feature to allow you to export with "Gap Step" compression will be in for the upcoming update. I will be doing a video tutorial on exporting optimized compact game assets after that update.

Cheers

Pixel Mush
Posts: 31
Joined: Sat Jul 29, 2017 3:58 pm

Re: Sprite Swap Tips/Suggestions

Post by Pixel Mush » Tue Sep 12, 2017 9:35 pm

Hello again.

I have all my export frame ranges set properly, I have used gap step. We have tried the creaturepack. I tried converting to the Flat Binary using command prompt but I honestly don't think I am doing it right. I read the directions but they aren't all that informative. I ended up using the provided windows.exe file and dragging it into CMD which said it re-wrote the binary files. But I could not find said files anywhere? We still have had zero luck getting our animations to work properly within unity. I don't know if it's on my end or the programmers end. I am going to have him post in the forum as well as he might be able to explain his problems much better than I can. I believe he said the files are missing an end cache, which means nothing to me, I have no idea. I will post some screen shots he sent me.


Image
said that gives the error object

Image

Image
these are the errors

Pixel Mush
Posts: 31
Joined: Sat Jul 29, 2017 3:58 pm

Re: Sprite Swap Tips/Suggestions

Post by Pixel Mush » Tue Sep 12, 2017 9:41 pm

Or I will happily send you one of my files and you can take a look at it maybe? Idk, it's very frustrating.

chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: Sprite Swap Tips/Suggestions

Post by chong » Wed Sep 13, 2017 3:57 am

Hello,

Sure send me your creature animation project file via a PM ( using a dropBox or some other cloud service link ) and I can take a look.
Having said that, I saw your configuration in Unity. Why are you pointing it to JSON? You should be using the FlatBuffers slot and check "Use FlatBuffers". You do not have to convert to FlatBuffers using the command prompt, when you export, the flatBuffer files are automatically written out for you into your export directory. ( it has the extension ".bytes" )


Why can't you use CreaturePack? Are you using the correct plugin? CreaturePack uses the CreaturePack plugin which is different from the regular plugin. You also need to rename the CreaturePack file to a ".bytes" extension ( this is a Unity requirement, not mine ) The Unity plugin is used by quite a few companies everyday on multiple platforms ( PC, mobile, console etc. ) with no issues.

Anyway, here's some info that you and your programmer should know:
1) When you export out into a folder using Game Engine Export, you will get the JSON, the FlatBuffers and CreaturePack all written out for you already.
2) JSON has .json extension, FlatBuffers has .bytes and CreaturePack has .creature_pack
3) For Unity ( and only Unity, this is a Unity specific thing ), you should rename the .creature_pack file into a .bytes file so it can recognize it as a binary file
4) If you are using Sprite Swapping, make sure that when you export for CreaturePack you check the "Uv swaps" option.
5) CreaturePack uses a different plugin from the standard JSON/FlatBuffers
6) For Flatbuffers, you have to drag the the .bytes file into the FlatBuffers slot, then check "Use FlatBuffers"

Standard Unity Plugin: https://github.com/kestrelm/Creature_Unity
CreaturePack Unity Plugin: https://github.com/kestrelm/Creature_Un ... eaturePack

Btw, there is a bug in the gap step export for the regular JSON/Flatbuffers ( not sure if it is causing your issue ). An update will be pushed out soon.


Cheers

blady
Posts: 5
Joined: Tue Sep 12, 2017 9:52 pm

Re: Sprite Swap Tips/Suggestions

Post by blady » Wed Sep 13, 2017 11:17 am

Heey Chong, the programmer here.

Took a while to get the verification email, so that's why i'm posting a bit late.
First of all, thank you for your ongoing support and the amazing software!

Something definitely went wrong while exporting the files, cause none of the giving files where accepted into the flafbuffer slot. When I tried, I got more errors, but these where the same errors as listed above (missing bones).
Just a couple of questions:
1. How can I enable/trigger the skin swap with the creaturepack plugin? I know how to use it for the normal one, but can't find the command or online information about the creaturepack skin swab.
2. Is it possible to change pose bone vectors in the script while using the creaturepack instead of the heavy weight one? It's not the end of the world if it can't, but would be nice to know.
3. Is there any loss in functionalities when using the flatbuffers, or is it just quality of the animation?

The reason we have to use the creaturepack over the normal one is because of our framework. We spawn default enemies into an object pool and assign new interfaces to them when the factory spawns them. For this we need the creaturepack to change the animation of the current enemy to the correct animation loaded from the interface. I want to pool those animations for that and the only way to alter them during gameplay is with the creaturepack.
The loading time with creaturepack is currently ~500ms each (~300ms without transparency), so that's quite nice opposed to the ~6000ms each for the normal pack.

Hope this information would be of any help during the troubleshooting.
Thanks again for your time!

-Blady

chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: Sprite Swap Tips/Suggestions

Post by chong » Wed Sep 13, 2017 3:31 pm

Hello,

Thanks for your support of Creature!

So sorry to say but CreaturePack is more limited ( which is why it is way faster ). It does not have many of the functions you describe in 1) and 2). It is not intended to be a fully featured plugin like the standard plugin, otherwise it will not load so fast.

However, with the new update of Creature, you should try exporting again and tune the Gap Step of the Regular export up ( New feature, so the Regular export too benefits from Animation Compression ). This will reduce file size ( you can see the file size now in the Game Engine Export window ). The FlatBuffers as I said is exported out together with the regular JSON automatically, you do not need to run any external binary ( wonder if that was the reason why things failed ). Do you mind sending me over PM a dropbox or cloud link to your Creature project? I can take a look when I get the cycles. ( Will try to export to FlatBuffers and see what is going on )

Thanks

Pixel Mush
Posts: 31
Joined: Sat Jul 29, 2017 3:58 pm

Re: Sprite Swap Tips/Suggestions

Post by Pixel Mush » Wed Sep 27, 2017 9:47 pm

We got everything working. Not sure if it was the update or what but no problems now. I have a question now though, I exported my own rig. When importing into a new project I can't get it to let me assign regions to it. I'm not sure if I did something wrong or why it's not working?
It doesn't show any of the region boxes at the bottom? Also none of my bones are yellow like in your rigs, not sure exactly what that means or if maybe I didn't include a step or something?
Another question using that rig originally I fully animated four animations for a different character. I "Captured the animation" for the bones, how do I use those captured animations on the new rig I am trying to import on the new character? That way I dont have to re-animate all of the same actions for the same exact bone structure. Thanks -Pixel
Image

chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: Sprite Swap Tips/Suggestions

Post by chong » Thu Sep 28, 2017 3:40 am

Hello,

It looks like when you exported out your rig, you did not create any Parts and did not assign any bones to those parts.
So the way it works is in the Export view, you see your set of bones. You first add a new part ( like say "Hello" ). Then you go in and click on the bones and click "Assign Bones" to that part ( you can hold down CTRL + Click to multi select a group of bones )
After that, you can proceed to Export out the rig file.

When you are in import mode, you will see the parts you created. You can then select the part and Assign Regions to those parts:
https://www.kestrelmoon.com/creaturedoc ... lates.html

Sorry, Capture Animations does not work between projects. It will be quite complicated to get it working cross projects. Will look into that at some point.

Pixel Mush
Posts: 31
Joined: Sat Jul 29, 2017 3:58 pm

Re: Sprite Swap Tips/Suggestions

Post by Pixel Mush » Thu Sep 28, 2017 5:48 am

Is there anyway to use the same animation for multiple projects? I have 3 characters that are basically the same.

chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: Sprite Swap Tips/Suggestions

Post by chong » Thu Sep 28, 2017 6:22 am

One way to do it is to go to File -> Export Project As ... into a different project name. Then open up the new project and import your new character art work, re-rig. But the animation data remains the same.

Post Reply