Hi, this is
Another Movie Clip for Gideros:
featuring texture switching, coroutines and TNT Animator compatible.
Here you can find the latest update.
I had to encapsulate the whole thing into a Sprite because I needed setScale to flip frames.
What do you think?
Do you see any chance of optmization?
If someone wants to benchmark it, I am not sure on how to do it scientifically..
Thank you
Comments
p.s. I see tiny optimization options, but they won't make difference, I'd not even call it 'optimization'.
I guess experienced folks can find something more fundamental
Likes: pie, SinisterSoft
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
https://deluxepixel.com
Attached the last release of anotherMovieClip, with usage examples and TNT Animator Studio by @GregBUG: mac version of TNT Animator Studio should be available in TNT Animator package: get it here http://www.tntparticlesengine.com/?cat=14
AMC 0.3 is capable of playing TNT Animator Studio .tan files through realtime conversion: obviously it would waste some resource to convert the XML files at creation time.
I've kept the option to precache texture regions or not, it all depends on how the animations table is written. This is to maintain the possibility to use AMC as a "simple MovieClip" writing the animation directly in lua.
Attached you will also find tntTOamc: a standalone win32 converter for TNT tan files, that translates the animations to a Json format readable by anotherMovieClip
(split in 2 parts because the forum allows me to upload only 2Mb per file)
If you are bothered by real time conversion and want to keep everything "lighter" (json files are smaller than xml files, and their conversion to lua table is really fast) go for this conversion option. You may also remove half of the code in AMC.lua (the conversion part).
However, you will also need the JSON plugin in your project to load json files.
If you spot bugs or optimization chances, please let me know.
I'm starting to use it today, so it has to be considered "beta", maybe "release candidate", I didn't test it thoroughly yet.
Quick reference is at the beginning of AMC.lua
Likes: keszegh, Apollo14
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
I am just returning a bit to the community
thanks to you all!
Likes: SinisterSoft
https://deluxepixel.com
https://deluxepixel.com
I like the TextureRegion caching and think you should just make it cache them all the time, not make it optional if it's faster performance
Many more bugs could come out as I switch a couple of existing projects from tnt animator to amc..
I think that the attached project is a good starting point to evaluate the performance: just place as many crocks as you like and see how it is performing: it seems pretty good to me.
Do you have an already working enterframe based animation system to compare values?
However I don't think there is much overhead: the basics should be pretty much the same thing (loading textures and switching them) but we save a lot on enterframe events / function calls.
Amcloop is just a local function that calls itself: doesn't need to listen to any event.
The reason to keep precaching as an option is that we could easily write frames by hand (like we did in standard MovieClip) in the end it's just a couple of conditions that shouldn't affect the overall performance.
It's good for prototyping.
If you can think of a better way to benchmark than reading player osd info with loads of actors, please let me know
Thank you
Likes: antix
I think however if I was going to test I'd just be using some cutdown version of each thing because you don't really need to do any graphics stuff as they would run at the same speed in each thing. The purpose would be to see which method worked faster, core yielding or enterframe.
Maybe I'll play with this later today
EDIT: Okay I just started messing with this and I see the yielding method uses Core.asyncCall() which the documentation says creates a new thread. How many threads can Gideros have?
http://forum.giderosmobile.com/discussion/comment/57637/#Comment_57637
Using AMC a bit extensively in a real time game, I noticed that there is a delay switching animations, due to the fact that any change in parameters has to wait for its turn in the queue. Things are better if yielding very fast, but I have to think of a trick to slow down frame switching.
@hgy29 would it be possible to add a control to stop asyncCall on call?
Likes: pie, Apollo14
Fixed some bugs here and there and improved with "pause" control.
hgy29 you were right, shame on me
Likes: Apollo14, antix
-Rewritten amcloop without "for" loop
-now it's possible to start animation from # frame
-better "pause" control
Like before, if you spot any bug or optimization chance, please let me know
Likes: Apollo14, keszegh, antix, talis, SinisterSoft, oleg, dreiko65
Likes: pie, antix
remixed it a bit: it seems to work better in my old projects
Likes: antix, Apollo14, talis