Page 2 of 2

Re: Bring back readline!

Posted: Sun Nov 30, 2008 2:04 pm
by 1stAnd10
I put my own values in it and pull their values in and use them. I was going to ask but I figured I would try it first. And it works.

Should it not?

Re: Bring back readline!

Posted: Sun Nov 30, 2008 3:08 pm
by surtic
Probably the only thing you really get from the config file that you can't do in load() is not opening a window if you don't need one. You could add an optional "config()" function to the script and make sure it runs before you open a window. This would make the code lighter (no need to maintain an extra parser) and faster (one file to parse, at least initially).

If you are going to let people change the mainloop code then they can do it themselves, as long as opening the window is explicit (or at least can be overridden with "love.system.openWindow(false)" or something similar).

Re: Bring back readline!

Posted: Sun Nov 30, 2008 3:26 pm
by rude
People will be able to take control over the main loop, but some code still needs to run before main.lua is loaded. For instance, the PhysFS search directories and write directory must be set (and the functions for setting them must self-destruct).

Also, the whole love_version thing could be solved like this, which makes config files even more redundant.

Code: Select all

function load()
   love.system.checkVersion("0.5.0") -- Cause error if incompatible.
end

Re: Bring back readline!

Posted: Mon Dec 01, 2008 8:05 am
by mike
Are we actually deciding to remove the config file completely and just give people more control over how LÖVE works? I'm not sure I favor this decree. Of course, it's great that people CAN change the window size within LÖVE, but I want to be able to write it into the file and then forget about it. The config file MAKES SENSE to me... then again, I've been wrong before.

Re: Bring back readline!

Posted: Mon Dec 01, 2008 10:38 am
by u9_
I think the config file makes sense, if it can be left out of the .love file and still work. That way i can actually edit it to change the behaviour of my game without "recompiling."

Re: Bring back readline!

Posted: Mon Dec 01, 2008 1:44 pm
by TsT
mike wrote:Wait... we can have comments in the config files????
See my patch to support comments : http://love2d.org/forum/viewtopic.php?f=4&t=195

Re: Bring back readline!

Posted: Mon Dec 01, 2008 9:28 pm
by surtic
This is only my opinion (as usual), but I prefer a single mechanism. It's easier on my brain.

My preferred solution is to have LÖVE's default main-loop function dofile "game.conf", then create the window (using the parameters from the config file), then run load() etc. That way, the behaviour will be pretty much the same, but with two advantages: 1. custom parameters and 2. control over this mechanism (in case I don't want game.conf).

It's not like the current situation is so bad. It's quite good, really. It's just that LÖVE has two very similar (to a point, of course) parsers. After comments, people might start expecting simple expression evaluation ("I want to have width = 1.5 * height") etc. Maintaining (and extending) an extra parser is a pain, especially when you get one for free (with good documentation, tutorials, etc.)