Giter Site home page Giter Site logo

Pysfs about love-webplayer HOT 4 CLOSED

ghoulsblade avatar ghoulsblade commented on September 24, 2024
Pysfs

from love-webplayer.

Comments (4)

BacioiuC avatar BacioiuC commented on September 24, 2024

Hi Enrique,

As far as I know, someone on the forums released a Love-WebPlayer loader,
which loaded the .love file, and ran it, in the browser. Not sure if it's
being actively developed anymore, but you can check it out here:
https://love2d.org/forums/viewtopic.php?f=5&t=8487&start=130

Thanks,
Ciprian

On Fri, Oct 26, 2012 at 1:29 PM, Enrique García [email protected]:

Hi,

This is the first time I look into this project. First thing I noticed is
that you need to uncompress the .love file in order to play games.

I think it would be a very nice change if the player could directly read
.love files instead.

Ideally I'd like to have an index.html with just one line:

<script href="love.js" data-love="http://your.game.url/game.love"></script>

I think one of the missing pieces for setting this up would be having
physfs working in js. It might be possible to bind it to javascript just
like the Lua interpreter has been. I don't know for sure though.


Reply to this email directly or view it on GitHubhttps://github.com//issues/11.

-- Blog http://www.zapakitul.wordpress.com/ |
Twitterhttp://www.twitter.com/zapakitul| LinkedIn
http://ro.linkedin.com/pub/constantin-ciprian-bacioiu/25/14b/476
~ Bacioiu E. Constantin Ciprian
~ My latest blockbuster http://www.youtube.com/watch?v=UZIcFNBiadc.

from love-webplayer.

kikito avatar kikito commented on September 24, 2024

That's not the same thing. That uploader (probably done in PHP or other server-side language, I could not find the source code) takes a .love and generates a love-webplayer compatible file/folder structure, uncompressing the .love file.

What I'm talking about is changing love-webplayer so that it loads a .love file, uncompresses it (probably in memory) and then plays it, without having to manually uncompress anything.

from love-webplayer.

ghoulsblade avatar ghoulsblade commented on September 24, 2024

Hi!

as far as i know accessing binary (non-plaintext) data like .love/.zip with javascript alone is not possible.

Specifically javascript can use XMLHttpRequest (js/utils.js UtilAjaxGet) to load plaintext files from urls dynamically.
The result by the api is a string, and not binary safe.
So as soon as a zero-byte occurs in the middle somewhere, it fails / ends.

You'd either need flash, some other plugin, or something on the server to send to send it as plaintext hex-like instead of binary, e.g. base64.
If you need serverstuff anyway, it would best to just unpack the .love on the servers.
That's what i'd suggest anyway, easiest and cleanest.
I see problems with getting useful lua error messages when using something other than unpacked file structure on the server.

The way i see it, the two main reasons for physfs is
a) giving the player a single file rather than a file structure, to make it more comfortable and increase target audience.
b) sandboxing the game for security so it cannot read/write on the users harddisk

For web, a) the player just needs the url in the browser,
and b) javascript is sandboxed and cannot access the harddisk anyway.

Note that player is not hoster, it does not makes sense that everyone who wants to play installs a webserver,
that would be done once by the author of the game, and the players would just need the url.

So, what goal are you trying to achieve by using physfs ? Maybe there's a different approach to get there easier.

And are you willing to work on it yourself ? because due to lack of community contributions i'm just implementing what i need myself usually ;)

from love-webplayer.

kikito avatar kikito commented on September 24, 2024

Hi, regarding the binary reading problem, I found this:

http://nagoon97.wordpress.com/2008/04/06/reading-binary-files-using-ajax/

I've also read that decent browsers (not ie) have easier ways to read binary data now.

The main reason I see for having physfs (or similar) is making love-webplayer binary-compatible with love. I think that would be very cool indeed.

But no, I'm afraid I can't contribube to that myself. The project does not interest me that much. If I had to write that much javascript, I'd probably just make a love-inspired javascript game engine instead (the whole point was not having to write javascript, which I enjoy less than Lua).

So I understand your arguments. I'll close this issue.

from love-webplayer.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.