LöveTools ideas please :(

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Sosolol261
Party member
Posts: 125
Joined: Wed Nov 26, 2014 6:43 am

LöveTools ideas please :(

Post by Sosolol261 »

Hello lövely community :)

I am working on a toolkit(more or less) with tools every löver could need!! Something like a color picker(RGB color codes) or... an integrated love-wiki? But like you see: I lack of ideas :( Which problems do you have everytime while coding? Post it under this thread please :)
User avatar
arampl
Party member
Posts: 248
Joined: Mon Oct 20, 2014 3:26 pm

Re: LöveTools ideas please :(

Post by arampl »

Texture atlas run-time creation.
I have this project in my mind, but lack time.
You can start from here: http://clb.demon.fi/projects/rectangle-bin-packing
Sosolol261
Party member
Posts: 125
Joined: Wed Nov 26, 2014 6:43 am

Re: LöveTools ideas please :(

Post by Sosolol261 »

arampl wrote:Texture atlas run-time creation.
I have this project in my mind, but lack time.
You can start from here: http://clb.demon.fi/projects/rectangle-bin-packing
...wat is dat
User avatar
arampl
Party member
Posts: 248
Joined: Mon Oct 20, 2014 3:26 pm

Re: LöveTools ideas please :(

Post by arampl »

Obviously, google texture atlas.
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: LöveTools ideas please :(

Post by I~=Spam »

Texture atlases save memory by having all textures in one big texture. Also it increases speed (if you do it right) because all uses of the sub-textures in the big texture can be batched.

**** shamelessly promotes own library :P *****
I wrote a bin packing program in c++ (that displays results with LOVE :awesome: ). This program was intended for exactly this purpose. You give it texture width, height, and the max width of the new big texture and it finds a way that they can be packed together. I included several methods for packing the textures. The one that saves the most space is the "Best-Fit Decreasing Height" algorithm (called BFDH in the library). This algorithm is a tiny bit slower than the others included but this is already really fast.
https://github.com/GoogleBot42/StripPacking

If it would help you I could port this to lua. :)

Here is a picture of it working. :3
(use keys 1-3 to view results of different search methods and use arrow keys to pan around)
Image

EDIT: You will still need to combine the textures themselves but this is a start. ;)
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
User avatar
arampl
Party member
Posts: 248
Joined: Mon Oct 20, 2014 3:26 pm

Re: LöveTools ideas please :(

Post by arampl »

I~=Spam wrote:If it would help you I could port this to lua.
Would be great if you have time for this!
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: LöveTools ideas please :(

Post by I~=Spam »

arampl wrote:
I~=Spam wrote:If it would help you I could port this to lua.
Would be great if you have time for this!
Ok I will port it. :) It might take a while because of school but I will do my best. ;)
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: LöveTools ideas please :(

Post by SiENcE »

There is no need to create another textureatlas tools. There are already a lot out there and for example ShoeBoxis one of the best.

I made an Shoebox export template for Löve. You can use it by yourself or use it with my löve boilerplate.

The great thing is, you can use single image files during development and when you release, you can put everything in an texture atlas, without changing one line of code :-).

And...there is also Fudge.
User avatar
arampl
Party member
Posts: 248
Joined: Mon Oct 20, 2014 3:26 pm

Re: LöveTools ideas please :(

Post by arampl »

SiENcE wrote:There is no need to create another textureatlas tools. There are already a lot out there and for example ShoeBoxis one of the best.

I made an Shoebox export template for Löve. You can use it by yourself or use it with my löve boilerplate.

The great thing is, you can use single image files during development and when you release, you can put everything in an texture atlas, without changing one line of code :-).

And...there is also Fudge.
Yeah, I know there are many standalone tools out there.
What I need is a tool which can append images one by one on the fly into big texture.
This tool can be integrated into graphics editor for example to store newly created shapes or patterns or something else.
In games it can be used for generating spritesheet for next level from one common pool of images.

Fudge looks interesting. Thanks. All I found was in C++/Python.
Do you know how effective it is in terms of speed/area coverage?
Does it support several algorithms (maxrects, skyline, etc.) or only one?
Also I didn't understand, will it try to keep destination surface to be as square as possible (e.g. 128x128 instead of 4x4096).
Hope it will support rotation and borders someday.
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: LöveTools ideas please :(

Post by I~=Spam »

I also new of these tools when I made this... but I couldn't find any written in c/c++ that is designed to do it at runtime (absolutely required for my project because it can be modded). (BTW it works well for the purpose :megagrin:. I haven't benchmarked it because it is so fast that I didn't even bother :P) But I wasn't using this with LOVE. I was using it with Urho3D (http://urho3d.github.io/). But if it isn't needed on the fly you should probably use the other libraries because they probably can pack the textures more because they can spare the time for computing it. :P

EDIT: Fudge looks great for this purpose. No dependencies. Designed just for LOVE :3
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
Post Reply

Who is online

Users browsing this forum: No registered users and 197 guests