LÖVE 0.9.0 released

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
slime
Solid Snayke
Posts: 3134
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: LÖVE 0.9.0 released

Post 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."
User avatar
Dattorz
Citizen
Posts: 66
Joined: Sat Oct 27, 2012 12:32 am
Contact:

Re: LÖVE 0.9.0 released

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LÖVE 0.9.0 released

Post 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.
User avatar
Ragzouken
Citizen
Posts: 84
Joined: Fri Aug 10, 2012 7:59 am
Contact:

Re: LÖVE 0.9.0 released

Post 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.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: LÖVE 0.9.0 released

Post 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.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: LÖVE 0.9.0 released

Post by Nixola »

LuaJIT's math.random implementation isn't the same as Lua's, and it doesn't vary between OSes.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: LÖVE 0.9.0 released

Post 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.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Dattorz
Citizen
Posts: 66
Joined: Sat Oct 27, 2012 12:32 am
Contact:

Re: LÖVE 0.9.0 released

Post 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.
Ekamu
Party member
Posts: 178
Joined: Fri Sep 20, 2013 11:06 am

Re: LÖVE 0.9.0 released

Post by Ekamu »

Oh my god! Its really here!? (0_0)
JaseMourne
Prole
Posts: 13
Joined: Sat Aug 11, 2012 7:37 pm

Re: LÖVE 0.9.0 released

Post by JaseMourne »

Thank you, guys, for your diligent work. Of all the engines and frameworks using Lua, I love LÖVE the most.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 55 guests