Page 1 of 2

A few suggestions for Löve 0.10.0

Posted: Thu Jun 11, 2015 7:36 pm
by jjmafiae
So far it sounds like Löve 0.10.0 is gonna be great (https://love2d.org/wiki/0.10.0) and thankful that Slime (and everyone else who contributed in some way) are putting alot of effort into it however there a few things I'd like added in if possible:

1. Microphone support (this would be great for multiplayer games, I'm working on a multiplayer game myself atm)
2. Audio compression codec (this ties into the one above)
3. Zip file extraction (Would be great for launchers, it is already possible to do however takes a bit time)

Re: A few suggestions for Löve 0.10.0

Posted: Thu Jun 11, 2015 7:56 pm
by Nixola
About 3), you can already [wiki]love.filesystem.mount[/wiki] zip files.

Re: A few suggestions for Löve 0.10.0

Posted: Thu Jun 11, 2015 7:58 pm
by jjmafiae
Nixola wrote:About 3), you can already [wiki]love.filesystem.mount[/wiki] zip files.
yes but I need extraction, mounting only allows reading and that isn't what I need. Since the OS can't launch .exe files with .dlls properly in Zip files (trust me I have tried)

Re: A few suggestions for Löve 0.10.0

Posted: Thu Jun 11, 2015 10:42 pm
by slime
You can copy files into the save directory if you need to make sure something is in the 'real' filesystem. Or for fused games you can use the technique described in the [wiki]love.filesystem.getSourceBaseDirectory[/wiki] page.

Re: A few suggestions for Löve 0.10.0

Posted: Fri Jun 12, 2015 1:07 am
by Kingdaro
slime wrote:You can copy files into the save directory if you need to make sure something is in the 'real' filesystem. Or for fused games you can use the technique described in the [wiki]love.filesystem.getSourceBaseDirectory[/wiki] page.
About this... is there a reason why mounting the source base directory only works with fused games? (Apparently when running love games/folders with --fused as well, which makes sense to some extent...) In a game I'm working on, I'd have gladly used the appdata directory for storing songs (custom charts of songs, think like Stepmania), but with this, distribution becomes somewhat cumbersome, as the player would have to download a separate zip of the songs that actually come with the game. I can pack them with the actual game, but I can't write files inside of a .love or .exe file, so making edits of a song from there becomes difficult, because I have to move it from the AppData directory every time I want to distribute the game.

I fixed the issue myself by just making the songs folder come with the game itself in the source base directory, then mounting and reading from that. The only problem here is that, to mount the source directory, I have to make sure both the source and the .love file are all started with the --fused derivative. Why not just always have the ability to mount the source base?

Re: A few suggestions for Löve 0.10.0

Posted: Fri Jun 12, 2015 8:01 am
by Positive07
jjmafiae wrote:
Nixola wrote:About 3), you can already [wiki]love.filesystem.mount[/wiki] zip files.
yes but I need extraction, mounting only allows reading and that isn't what I need. Since the OS can't launch .exe files with .dlls properly in Zip files (trust me I have tried)
Here you have an amazing snippet :D

Code: Select all

local lf, recursive = love.filesystem

recursive = function (from, to)
    if not lf.isDirectory(to) then lf.createDirectory(to) end
    for _,v in ipairs(lf.getDirectoryItems(from)) do
        local name = from.."/"..v
        local result = to.."/"..v
        if lf.isFile(name) then
            lf.write( lf.read(name), result)
        elseif lf.isDirectory(name) then
            recursive(name, result)
        end
    end
end

local unzip = function (zip, dir)
    local ok, err = lf.mount(zip, "zip")
    if not ok then return nil, err end
    recursive("zip", dir)
    lf.unmount(zip)
end
Writing .zip would be nice (I already made an issue... but I say it again :P)

And I also consider that --fused could be the default behaviour... Is there something to lose?

Re: A few suggestions for Löve 0.10.0

Posted: Fri Jun 12, 2015 10:26 pm
by Robin
Positive07 wrote:And I also consider that --fused could be the default behaviour... Is there something to lose?
Two things right off the bat:
  1. Easier to make mistakes in distribution if you forget to include stuff in the .love but it still works on your computer
  2. Weird shit going on if you're like me and you have a lot of .loves in your download folder

Re: A few suggestions for Löve 0.10.0

Posted: Fri Jun 12, 2015 11:10 pm
by s-ol
jjmafiae wrote: 1. Microphone support (this would be great for multiplayer games, I'm working on a multiplayer game myself atm)
2. Audio compression codec (this ties into the one above)
both of these can be archieved with the ffi afaik. I'm not sure whether microphone input can be abstracted/simplified to a level that matches the rest of the LÖVE Api whilst keeping it variable enough to actually be useful.

Re: A few suggestions for Löve 0.10.0

Posted: Sat Jun 13, 2015 12:27 am
by I~=Spam
S0lll0s wrote:both of these can be archieved with the ffi afaik. I'm not sure whether microphone input can be abstracted/simplified to a level that matches the rest of the LÖVE Api whilst keeping it variable enough to actually be useful.
As a small counter-argument the entire (or at least most of it) LOVE API could be written with the ffi but that doesn't mean we shouldn't.

Re: A few suggestions for Löve 0.10.0

Posted: Sat Jun 13, 2015 3:24 pm
by bobbyjones
Shots fired