-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skyline packer #23
Comments
Hey again! Thanks for being so active on this project, I really appreciate the help =) I reommend you first have a look at this, which is a very comprehensive explanation and benchmark of most known bin packing algorithms. The accompanying reference implementation and benchmarks can be found here. It's what I looked at for the maxrects implementation, and it seems maxrects mostly outperforms skyline except for when it comes to online packing scenarios (i.e. when you're getting the sprites one after another instead of all at once). As for your questions:
|
Yeah, I have read both the implementation and the paper you linked but unfortunately they came before both of the mentioned articles. The complexity of the skyline algorithm was improved from As for iterating and redoing the algorithm multiple times - with |
Oh, very interesting! I'll be sure to look into the newer studies further then. And yes you're right, For now, we could definitely use a very simple heuristic for choosing a bin (such as best first fit), and see if we can find something better once we have the algorithm implemented - benchmarking will also become much easier then. |
Ok, so I'll commit a basic variant in a few hours I guess. |
Sounds great! I'm actually pretty excited to match these 2 against each other and see what happens =P |
I've read about skyline heuristics given in 2011 and 2016 works and they both work by trying to achieve as low height as possible given a width of a spritesheet.
I'm not sure how to adopt this to output multiple spritesheets, since their approach relies heavily on being able to shuffle the input. One possible approach is trying to fit it into one spritesheet, then if it fails, splitting the input randomly into two parts and trying to fit it into two spritesheets and so on. I'm not sure this is an optimal approach and would like to hear your thoughts.
I'm not sure how to choose the width of a spritesheet, I don't really like
maxrects
approach of giving it a default value since in it will just produce a long horizontal stripe of sprites and that doesn't feel optimal (maybe it's really efficient or doesn't make a difference at all, I don't know). So I propose to make some kind of algorithm on top of skyline (and maybe maxrects too) that tries to determine optimal width and height. Again, I'd like to hear your thoughts.The text was updated successfully, but these errors were encountered: