Jump to content

Aprowolf

Members
  • Posts

    70
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Aprowolf

  1. I tried deploying the latest lib to android , it works like a charm :)))) so far not many issues in my project , just few code changes in my part and everything should be functional flawlessly just 1 thing though! Sorting layer has some issues using the new Class you made , it does not affect the the layers at all! if i try to write a class that access every sprites renderer @ change it start up only , it only access the game objects that are active only and ignores the not enabled ones. I shall try tonight to deploy it to andoid and see how it will go
  2. I fixed that scaling issue, so boind, your wings should appear correctly now. And they do now , thx a million XD! and I'll be switching to the new tool now, I'll be in touch in case something happens, but so far , everything seems to be good !
  3. Alllllllllllllllllllllllllllllllllllllllllrighty this one works like a Beast XD all of my ground based monsters SCMLs all had 100% proper positioning ^^ thats very very solid converter :DD thats it , shall the issue of Scales value be fixed i'm switching immediately to this converter! seriously this one is better , in the previous one i had tons of Z values issues , This one is very solid when it comes down to it! ^^ btw , thanks for the documentation <3 and i wish you a good night , been awake since forever and I have no clue what is infornt of me right now XD
  4. This tool is way easier to play with than the previous one ( the level of difficulty here is decent , the other one level of difficulty is complex), and I prefer to work with this one than the other one 100%. as for extensibility, it would be better if edgar or mike gave a look into it because they have clear vision of the future of spriter and its future's features. so you might send one of them a message to have look at the tool. as for me , I believe well documentation + 100% well construction of the "AnimationBuilder" class is a core factor for this tool since features like skinning , entities animations, Triggers etc all of them occures there. And you need a second opinion of course since I don't spend that much time on programming as i spend on animating and drawing :P Also yesssss I'd appreciate it if you documented the your code to make working with it easier ----- wishes: if you were a genie in a lamb then I wish for "Collision Boxes" To be implemented (Box2Collider > as trigger > change of width , height , rotation , position in key frames) as well as for "Triggers" (Add animation event that stores a value and a name, the person will manually will add scripts and choose the method he likes and use the stored value and name based on his custome script) and last but not least I wish that you become a human and be free from your lamb prison genie :P Box colliders can help with improving the AI, Make parts of a monster harder to damage, immune to damage , parts of teh monsters that we can climb , parts that triggers and event etc etc . the possibilities are endless Triggers are times savior, instead of adding AnimationsEvents Manully and lose them if we make changes and need to re-import the SCML file and add them again , loading trigger keyframes from scml file and add them as AnimationEvents should save us at least half the time. but these are only selfish wishes of mine , I believe others have diffrent wishes like Skinning or IK or any feature of sprite i've yet to know of , but had to share my thoughts at least :P and even if you can't implement them , I do believe it is possible to be added later with this tool -------------------------- Unexpected behavior : Unexpected behaviours are the ONLY reason for me now to not switch to this new tool. the unexpected behaviours that I noticed so far: 1) Scaling of Sprites instead of bone scaling distort the Images horribly (from negative value to positive and vise versa), for example (changing the values from x=-1 to x=1 inside spriter) yields in weiiiird behaviors (for example I'm trying to flap a wing and i need to change the values from negative scaling to positive , the result is that I can't see the wings 90%of the time). maybe I should send you a SCML file for this weird issue better 2) Not all Placments are correct , it is often that I'd find a single sprite in a position diffrent than excpected but with correct behavior . I'll send you a SCML file that has this issue XD. 3) rotations issues , some sprites gets very weird rotations . for example the Project that I did send to you , leaf storm , all storms are rotated in weird way + in wrong positions , I believe that is because of number 2 Sorry for talking alot but I did not want to give you half baked answers :P thery are not over cooked either though so lol. Anyway , I'll be sending you a file that has issues 1 and 2 I talked about , issue number 3 you should be able to see it for yourself from the previous SCML file
  5. Wow O.o Ok these are huuuuuuuuuuuge improvments than before ^^ like 1200% better XD!!! so Yup , I'm in love with it ^^ a little more push and It will be safe for me to switch from the old Spriter 2 Unity to this one for sure this is how it looks for me now Edit : this is the first time I see my Sprites running properly using the coverter so i'm excited XD seriously man , you are a life saviour , waza waza arigatou gozaimashita :)
  6. hmm Dengar buddy , the problem still here , could you kindly try do the following? ^^ 1) create new project 2) import your new Converter 3) import the SCML project the issue stays the same , all sprites are missing, if you go to sprite renderer in each component you find (Missing sprite) and if you click on the list you will find that every image in base folder was NOT loaded >< I'll go eat breakfast fast and try to see what part of code causing that
  7. Dengaaaaaaaaaaaaaaaaaaaar XD I know you want to hear good news(so was I , I've been waiting for your update since morningXD) but your update ..... It is kinda scary lol :P ok 1 very good news and 1 small bad news , which one you prefer to hear first lol ? very Good News :My alpha Issues , the values from 0 to 1 that I had has been solved!! I can see the effects of my attacks now which is amaaaaaaaaazing. small Bad News: Hmmm the converter now has issue finding/displaying the sprites at folder ID = 0 , seriously watch this image No monster ! just his effects loool XD when I examined the prefab , every single Sprite from folder with id 0 is Missing! and that is in every project , and other image in any diffrent folder is being improrted fine but I think the solution to that should be very easy XD i hope lol ,I think either he is not finding the correct path , or he finds the correct path but RESETS the sprites to null somewhere(i did not look at the code yet but just guessing w ), try deleting your prefab and reimport it , see if you get same issue again , amazing job on the alpha channel , it works like a charm now .I Appreciate your hard work making an converter with high potential even though you arevery busy working on other stuff ^^
  8. ooooooh XD all of my SCML files are out of alignment coz I always start by changing the pivots of my sprites. I Kept silence and did not report it becuase you said previously : so I thought thats why all of my alignments are wrong , and I thought you had the same issue as well lol:P
  9. I sent you in private message an example of a test special monster that I've been working on , the project has sprites without bones in some animations (XPpattern animation for example at the end key frames) , and in last animation LeafStorm all alpha channels on the 4 storms remain as alpha 1 for me. feel free to use this SCML project to test converter ^^ since it has alot of translation movments , rotation , alpha channels tweaking and multiple animations
  10. Ok I tested the texture swapping , and it is AMAZING XD that is exactly what i had in mind and does everything i needed in my projects , you r a beast! XD very easy to use. regarding the issue of Sprites with no bones, when I examined the prefab i found them in the hierarchy "Not Enabled" , in every project thats the case, i have no clue what is causing that. but when enabling them manually , they fuction as excpected. other than that hmmm the alpha channel still issue for me , and i'm defintely using the alpha channels on sprites not on bones. I'll look into it more myself and see what i come up with.
  11. fast input , amazing speed on your side , the problem is totally fixed and works like a charm now XD! it was the backslash as you said Also I just noticed the curves improvments you made and just WOW XD! now thats clean, I tested it on a complex scml file with lots of curves and it works just fine (ignoring the fact that the spirits are not in their correct positions yet :P) btw , my experiance with Unity is only 3 weeks more or less , so my contribution will be very limited sadly , I'll still try to test as much as I can (if that helps) and give feedback as necessary if that is ok :) 2 Issues about sprites : 1) I tried some of the SCML Files , the ones that has "sprites without bones" are not being played by the converter, am i the only one? 2) the alpha channel is always at 1, am i the only one? ----- regarding texture swapping , as i said before , I hate Accessing the animationclip > find the Animationcurve > swap the picture each keyframe, to me it was very very tedious work , and I have no clue how you will approach it but when I did approach it , in the Animation , each monster kept the same charmap (if i set a single monster to be blue , everyone becomes blue etc) but again perhaps because I don't know how to handle animations properly :P Regarding AnimationEvents , isn't Animation events best used with "Spriter Triggers " instead of sprites swapping? like reading a tag from SCML file and creat Animation event from it (tags is not implemented in the previous Spriter2Unity and the current one if i am correct, but it would be very Helpful later in the far future if it was implemented) if you wanna see what is spriter Trigger watch this : regarding the last approach , game compnents , i think it has the most future potential , because of the possibility to add diffrent compenents to each gameobject that has a sprite . mind you I don't know why someone would need that :P perhaps adding physics or triggers on individuals sprites? I'm just shooting in the dark here XD anyhow lunch time , sorry for rambling alot
  12. Ok I just woke up from a short nap and i just had to test it before going back to sleep XD first of all , good job on your scml support class , waaaaaaaay much friendly than the original one I tested the converter it a bit , one thing worth noting is , DELETING the prefab and trying to re-import it is not working atm , instead I get the following Warnning (line 1): 'Assets/SCML/TestSCML\entity_000.prefab' is not a valid asset file name.UnityEditor.PrefabUtility:CreatePrefab(String, GameObject, ReplacePrefabOptions)Spriter2UnityDX.Prefabs.PrefabBuilder:Build(ScmlObject, String) (at Assets/Spriter2UnityDX/Editor/PrefabBuilder.cs:33)Spriter2UnityDX.PostProcessing.ScmlPostProcessor:ProcessFiles(IList`1) (at Assets/Spriter2UnityDX/Editor/ScmlPostProcessor.cs:33)Spriter2UnityDX.PostProcessing.ScmlPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Assets/Spriter2UnityDX/Editor/ScmlPostProcessor.cs:25) which located at prefab Builder line 33 , var name = entity.name; var path = Path.Combine (directory, name + ".prefab"); var prefab = AssetDatabase.LoadAssetAtPath (path, typeof(GameObject)); GameObject instance; if (prefab == null) { instance = new GameObject (name); prefab = PrefabUtility.CreatePrefab (path, instance, ReplacePrefabOptions.ConnectToPrefab); //HERE } which is true because prefab entity_000.prefab was deleted by me, so re-importing should recreate the prefab from scratch(reading the SCML again) if and only if the prefab does not exists , right? for the time being , deleting the entire SCML folder and reimporting it again seems to solve the issue any how , really really really good start of the converter , I'll look into it again tonight to see if I find anything else or if there is a contribution I can give :) peace and out
  13. It's not a very elegant way of doing it, mind you. I mean you're basically playing tug o' war with the animator. The animator changes the sprite, you change it to something else. The animator changes it back, and you change it back as well. I know right XD? but sadly after 1 week of trying to change sprites, this is the only solution i found that actually change the sprite to something else with the current implementation. will be looking forward to your implementation because i like your philosophy XD peace and out
  14. &*^*%&^%( MY LIFE XD Ok I found a simple Solution in the same video I linked , I just need to change the Sprites in SpriteRenderer in a Method Called LateUpdate() and it will be applied to all animation Clips for example : public void LateUpdate(Sprite s){ foreach (var renderer in GetComponentsInChildren<SpriteRenderer> ()) { renderer.sprite = s; } } now I just need to make a script that would handle different swapping situations , change a speficc sprite , change entire folders etc :) this is best since I'd need to animation events or edit animations at all I'll share the long Script when I'm done and happy with it, for time being , peaceout~
  15. I looked into the deleted implementation and restored it for testing , and it had many problems like creating a single Charmap (original one) and ignoring the rest of your CharMaps, Not following The SCML Documintation so it does not have variables to swap images and folders , and SpriteChang not working in 5.0 for me at all. thats my current progress regarding this matter: If I change an animation Directly without an animation Event , I'll need to create multiple prefabs for diffrent charmaps , which is ok for monsters but not ok for hero. If I try to Change it via animation Events , I'll need to access each AnimationClip from Animator , and access the Curves and Keyframs, and find the curve that has the images and the time to swap the image which is guaaaaaaaaaah mindblowing and tiring x,x if there is an easy way to get a sprite from a running animation and change it , i'm currently unable to find it XD Ideally , it would be great if we simply attach script with a string of a charMap Name , run through every sprite renderer and change the sprites , and the animations play the new sprites instead of the original ones... like how these people are doing theirCharMap in min 20 to 23 , their method is really simple and friendly without accessing the animation at all , but sadly not working in Spriter2Unity implemntation https://www.youtube.com/watch?v=rMCLWt1DuqI#t=1464 Last but More importantly , Extreamlly happy to hear that you are working on a diffrent converter , and I approve of your Parsing approach since this is how I'd do it XD good luck in your project and hopefully it will be a blast :)
  16. Good Morning~ I need some scripting help in spriter2Unity , I am aware that there is no CharacterMap implementation yet , but how can I access the sprites to be changed to another one during Run time? I tried this Method but the sprites remain the same 1) I made a script that has a method called ChangeSprite , this Method invoked using "Animation Event", it will change all sprites to a specific one public void ___ChangeSprite(Sprite s){ foreach (var renderer in GetComponentsInChildren<SpriteRenderer> ()) { renderer.sprite = s; } } buuut it is not working , is ut being overriden somewhere in Spriter2Unity? or the sprites ment to be accessed diffrent way? I'd really appreciate an insight to the matter
  17. Two Issues I want to address at the momment for spriter 2 Unity 1) any projects that i have that contains "Boxes" replaces the boxes with an image during run time , so in order to make my animations animate correcty I have to remove the boxes colliders from spriter SCML 2) In the class SpriterTimeLineKey.cs is causing reimport issues for me in the lines File GetFile(XmlElement element) { // Issue here var folderId = element.GetInt("folder", -1); var fileId = element.GetInt("file", -1); File file = null; var folder = Timeline.Animation.Entity.Scml.GetFolder(folderId); //rest of the code} I don't think any of projects built with R3 has -1 for a folder and id right? so i replaced the -1 to 0 to get correct animations , i still have the issue with rendering boxes though var folderId = element.GetInt("folder", 0); var fileId = element.GetInt("file", 0); am i the only one who faced these issue?
  18. here is something you can do manually to fix that , remmber before you start , in each SCML file , each folder you make has ID and A name , and each image has an ID and a name as well 1) Copy your SCML file and past it as back up in case you do something wrong 2) Create a folder to put your original image , call it for example "Parts" 3) edit the SCML file using note pad or notepad++, give your folder a name and add the name of the folder along with the sympol "/" to you images , check the code for original code and the modified code // ORIGINAL <folder id="0"> <file id="0" name="arm_l.png" width="14" height="13" pivot_x="0" pivot_y="1"/> <file id="1" name="arm_R.png" width="13" height="28" pivot_x="0" pivot_y="1"/> </folder>// Modified <folder id="0" name "Parts"> <file id="0" name="Parts/arm_l.png" width="14" height="13" pivot_x="0" pivot_y="1"/> <file id="1" name="Parts/arm_R.png" width="13" height="28" pivot_x="0" pivot_y="1"/> </folder> 4) your done , i wish there was option in spriter that would do that for us XD jus don't play with the code too much cause it can cause problem if you don't know what you are doing , and never play with IDs , also check that your charmaps is functioning well when your are done also I don't think there is a sorting for charmaps sadly hope that answers your questions
  19. if you don't mind me asking , in unity , did you use Spriter2Unity to excute the animations or simple spriter sheets ^^? I don't know how effecient spriter2Unity compared to the generic spriter importer thats why i am asking
  20. Played the game twice in terms of animations , the game holds itself , in terms of execution , the game feel slow as bwwd mentioned here is some pointers regarding the game: -try giving main char and diffrent kind of monsters diffrent speeds , fast enemies and slow enemies provides room for the player to think between an enemy who is weak and fast and enemy who is slow and strong etc -the levels : the levels seems to be move from point A to point B and only monsters chasing behind from left and right , try to add obsticles that will force the player to change his direction like a big hole in the ground or falling boulders or barracades etc there is many many many things you can do to make a player change his directions -check points and increase difficulty in terms of damage recieved , monsters attack speeds , also remmber mini bosses are as important as bosses and easier to make - you can make the player do other stuff than killing monsters , like collecting files , saving innocent people , destroying the road behind them etc - I don't play games of similar styles, so make sure to get different feedbacks and plan accordingly ^^ aaaaaaaaand best of luck to you, looking forward for the finished product :)
  21. Original Post : ----- FINALLY after 6 months i found the solution XD!!!~ Ok here is the thing , XML reader class uses DOM parsing method which is not very ideal to parse huge xml files for android devices, SAX parsing on the other hand DOES NOT load xml file into memory, it is also relatively very fast , using the following code i was able to read a file with 4.8MB of data with over 100 animations with over 100 thousands lines WITHOUT any single Memory leak :))))),making it possible to create tons of animations without worrying about how big the animation file is. the android app starts with 5MB in ram and end with 6MB in RAMonly after finish reading the file~ finally the search is over , the only thing left is to alter the generic java importer to use SAX instead/Alongside of DOM, i don't know if you still updating the generic java importer library , but i really hope to see this library being updated again some day soon :) -- New Post : Thing is , since we are not loading the xml fileto memory , we need to creat the animations folders etc during run time using the following methods of SAX parser instead of waiting for the parser to finish parsing the original implementation of the generic java importer private void SaxCons() { SAXParserFactory spf = SAXParserFactory.newInstance();// FileHandle FH = Gdx.files.internal("Edge/CurrentProj.scml"); SAXParser parser; try { parser = spf.newSAXParser(); try { parser.parse(FH.read(), new DefaultHandler()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } catch (ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } } we ovveride the following Method in default handler to read each element : try { parser.parse(FH.read(), new org.xml.sax.helpers.DefaultHandler(){ @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { // TODO Auto-generated method stub super.startElement(uri, localName, qName, attributes); String name, type; float id , width, height,pivot_x,pivot_y,w,h; if(qName.equals("file")) { id = Float.valueOf(attributes.getValue("id").toString()); name = (attributes.getValue("name").toString()); width = Float.valueOf(attributes.getValue("width")); height = Float.valueOf(attributes.getValue("height")); pivot_x = Float.valueOf(attributes.getValue("pivot_x")); pivot_y = Float.valueOf(attributes.getValue("pivot_y")); System.out.println(id + name+ width+ height+pivot_x+ pivot_y); //store these values into a file } if(qName.equals("entity")) { if(qName.equals("obj_info")){ name = (attributes.getValue("name")); type = (attributes.getValue("type")); w = Float.valueOf(attributes.getValue("w")); h = Float.valueOf(attributes.getValue("h")); //store these values somewhere } } } @Override public void characters(char[] ch, int start, int length) throws SAXException { // TODO Auto-generated method stub super.characters(ch, start, length); } }); } well you get the idea~ again : we r reading the file without loading it into memory , therefore each time we come accross a node we create variables to store its elements
  22. Edit till i gather more info about sax parsing~
  23. Back after a long break from coding~ sightly more updates about the memory leak issue in andriod devices: I tried few XML parsers and Json Parsers to just READ SCML/SCON spriter projects and the memory issue still there , while there is still no solution in the near future for me to remove the memory leak completely here is few TIPs that might help u reduce the amount of memory being leaked from me. ------Solutions------ 1) Limit the number of entities to 1 only 2) limit the number of animations to 5 maximum, each time you define a new animation in .scml file a new set of keys + ids + bone refrences even if you have them in all of your animations in the entity, thats like 500~1k lines of codes each time you create new animation 2.a) I tried mixing 3 animations of mine into 1 animation only and used the following codes to swap between them : public static void LoopAnimation(Entites_General attacker, int framerangestart, int framerangeend) { { if (attacker.player.getTime() >= framerangeend) { attacker.player.setTime(framerangestart); } } } public static void FreezeTime(Entites_General attacker, int framerangeend) { { if (attacker.player.getTime() >= framerangeend) { attacker.player.setTime(framerangeend); } } } results : i saved around3k lines of code and reduced the file size from 1219 to 990kb + loading time for parsing .scml file obviously went faster 3)each time u finish saving the scml file edit with note pad (i use notepadd++) to check how many lines of codes you have , 5k lines of codes in each scml file should be fine ------Possible diffrent solution------ after reducing my project size from 18k lines of code into 15k line of code i'm thinking of separating the project files into 3 scml files,5k lines of code each (1 for IDLE animations , 1 for attacks , 1 for extra animations) , create 3 players in java and 1 (main player) that will swap between the animations , wonder how it will goes ------Memory Leak Tests------ the following way of readings generated the following memory leaks : Method A : Parsing A "String" // FileHandle FH = new FileHandle(Gdx.files.internal("Offical/Spriter/" + Folder + "/CurrentProj.scml").readString().trim());// String s = FH.toString().trim();// data = new SCMLReader(s).getData(); String s = FH.toString().trim(); line generated 40MB memory Leak in total, while data had NO memory leaks, this method we r parsing A string Method B : Parsing a stream: data = new SCMLReader(Gdx.files.internal("Offical/Spriter/" + Folder + "/CurrentProj.scml").read()).getData(); loader = new LibGdxLoader(data); loader.load(Gdx.files.internal("Offical/Spriter/" + Folder + "/CurrentProj.scml").file()); public Element parse(Reader reader) from SCMLReader ,in the line of code : char[] newData = new char[data.length * 2]; generated same result,40MB memory Leak in total, this method we r parsing a stream both tests were done in a project that has only these lines of codes + project files , same results , same amount of memory leak but in diffrent ways ////////////////// I believe the solution lies somewhere in method A , we need to get .scml file somehow into a string without causing a memory leak then parse the string using the SCML reader because it did not generate a memory leak there in method A last but not least : spriter uses tons of lines of codes in their xml files /////
  24. greetings , I have Programming conference that will last for the entire week and i'll be back next sunday , if any guy with android device can perform more tests for this memory leak issue it will be great, have yourselves a nice week peeps
  25. I tried using the current xmlReader in libgdx 1.1.0 , only the parsing method using the following code : try { Element root = new XmlReader().parse(Gdx.files.internal("Offical/Spriter/Edge/CurrentProj.scml")); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } for some reason i get allocations of 30MB rather than 47MB for the same file that i always use ,in another file 15MB allocations became 11.04MB, and in one more no allocations were called. in the no allocations called file it had 9 images , 1 entity and 2 animations still lil bit of improvemt but it is always the same method that calls Grow heap, perhaps if there is a way to call toString.trim() method during the parsing we might get better results
×
×
  • Create New...