Page 7 of 9

Re: LÖVE 0.9.0 released

Posted: Thu Dec 19, 2013 5:38 am
by slime
Dattorz wrote:There's some undocumented breakage(?) in love.filesystem.load().
It is documented, just not in the wiki page for it yet - but it's in the changelog: "Updated most love.filesystem functions to return nil, error on internal failure."

Re: LÖVE 0.9.0 released

Posted: Thu Dec 19, 2013 7:52 am
by Dattorz
Hmm, so is the pcall() on love.filesystem.load still necessary? Or should users not worry about it? I'm not sure what circumstances "internal error" refers to.

Edit: Looks like it still throws an error if the loaded file has a syntax error, so I'll go ahead and put the pcall() back in.

Re: LÖVE 0.9.0 released

Posted: Thu Dec 19, 2013 10:39 am
by bartbes
It basically matches the lua behaviour of "expected errors are returned", a file not found is something you'd want to check for, it happens (a lot), so returning it makes sense. A syntax error in the loaded file is (hopefully) exceptional, therefore it's a proper error.

Re: LÖVE 0.9.0 released

Posted: Thu Dec 19, 2013 2:34 pm
by Ragzouken
I really hope you will reconsider removing the seeding of math.random from the default love.run. I know there's love.math.random now but I don't really care to use it when math.random is sufficient and it's pretty ingrained in me to type that. I don't think there's anything to lose by also seeding math.random by default.

Re: LÖVE 0.9.0 released

Posted: Thu Dec 19, 2013 3:44 pm
by Karai17
The problem with math.random is it is not consistent over each OS, which can be hugely problematic in many cases. For example, in a multi player game, if you want to generate terrain or objects or whatever, if you use math.random each client will see different results. Using love.math.random, each client will see the same results, regardless of OS or any other factors.

You should seriously reconsider your stance of "this is how I've always done it, so everyone else should change to conform to me" and try using the vastly superior love.math.random.

Re: LÖVE 0.9.0 released

Posted: Thu Dec 19, 2013 4:12 pm
by Nixola
LuaJIT's math.random implementation isn't the same as Lua's, and it doesn't vary between OSes.

Re: LÖVE 0.9.0 released

Posted: Thu Dec 19, 2013 5:17 pm
by Karai17
Love can be built against either Lua or LuaJIT, so the problem still stands. If you use love.math.random, whether using Lua, LuaJIT, Windows, OSX, Linux, or any combinations thereof, you will have consistent results. There is absolutely no reason to do otherwise. "I don't like change" is not a valid reason to hinder progress.

Re: LÖVE 0.9.0 released

Posted: Thu Dec 19, 2013 9:17 pm
by Dattorz
bartbes wrote:A syntax error in the loaded file is (hopefully) exceptional, therefore it's a proper error.
I've been thinking about this for a while, and then remembered that an error also gets thrown if the system runs out of memory while trying to load properties. A change in game behavior as a result of OOM is not something that would be desirable, obviously. Also, while I want to allow the game to continue running without a properties file, I can see a malformed properties file going either way - I think it would be acceptable to let a syntax error in a properties file stop the game.

So I've decided I'm going to leave out the pcall() after all.

Re: LÖVE 0.9.0 released

Posted: Fri Dec 20, 2013 2:05 pm
by Ekamu
Oh my god! Its really here!? (0_0)

Re: LÖVE 0.9.0 released

Posted: Mon Dec 23, 2013 7:57 pm
by JaseMourne
Thank you, guys, for your diligent work. Of all the engines and frameworks using Lua, I love LÖVE the most.