Odd issue when running as .love or .exe

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
BOT-Brad
Citizen
Posts: 87
Joined: Tue Dec 02, 2014 2:17 pm
Location: England

Odd issue when running as .love or .exe

Post by BOT-Brad »

Hi guys.

I have a small project which I have been working on for a few weeks now, and it works fine in the IDE I am using (Zerobrane Studio, it's great!). It runs with no bugs (as far as I can tell) when I run using F5 or F6 from ZBS. However, as soon as I package the directory into an archive and rename as a .love file, the game launches for about a second and everything comes up fine, but then closes straight away.

Is there any general 'this is your problem' solutions to this happening? I will post up the .love file shortly, as I get no error messages or anything so am not sure where the problem is.

DL Link: https://mega.co.nz/#!SNhDzLLQ!v8s_mt5vU ... BZleeVI16A
(Roughly 12Mb .love file)
Follow me on GitHub! | Send me a friend request on PSN!
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Odd issue when running as .love or .exe

Post by Jasoco »

I'll have to wait for you to upload the .love elsewhere. Mega is terrible. I just downloaded 99% of the file before it froze up and complained that I needed to install Flash, and that my browser was incompatible and tried to tell me to install something else. Screw Mega. Use DropBox or something else. There's no reason a file hosting site should require Flash to be installed in order to work. Safari is a fine browser and it's 2015. Maybe I'll try enabling Flash for Mega and reload the link again. Sorry, stupid rant. I get defensive when a website tries to tell me to change browsers because they can't program their site better.

That said, the only times I've ever had a Löve project simply crash out without an error is when I use up memory way too fast. Are you loading all 12MB of that stuff all at once? Maybe it's a memory error? I dunno. I can't tell until I see the code.

Edit: Okay, I got up off my ass and opened the link again and pressed Command+, and enabled Flash for Mega and downloaded the file again. And after putting up with their smug "Our site is better in another (shitty as hell) browser" message and saving it to my desktop I can confirm it does crash right out immediately when I double-click the .love file.

But if I uncompress it, it works fine. But when I recompress it again myself it crashes again.

I don't really see a reason why though. I mean there are a lot of image files.

I do notice you replace Löve's error handler. Any reason why? It would explain why you don't see a message. If you remove the new error handler maybe it'll give you an error. I dunno.
User avatar
BOT-Brad
Citizen
Posts: 87
Joined: Tue Dec 02, 2014 2:17 pm
Location: England

Re: Odd issue when running as .love or .exe

Post by BOT-Brad »

Hi there, thanks for your response.

Sorry about Mega, it was the first site I thought of to upload too. I'll use alternatives from now on;

Although there are a lot of image files, only around 3 to 4 Mb worth of them are loaded in at the beginning. Is there a better way to go about handling large quantities (Well, 100 or so) of images?

Also, I only tried replacing Love's error handler to try and get some sort of error to be recorded in a log.txt file. If you remove it, then it still closes straight away with no error reported.
Follow me on GitHub! | Send me a friend request on PSN!
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Odd issue when running as .love or .exe

Post by bartbes »

I'm still not sure why there's no error shown, I'll maybe look into that after. But now why it fails in a zip (and even unzipped on my machine) is because zips (and ext4) are case-sensitive, and in navbar.lua you try to load 'assets/graphics/ui/Home.png', but the file is actually called 'assets/graphics/ui/home.png'.

EDIT: I'm still not quite sure what is (not) handling the errors, but restoring the errhand to the original after State.registerEvents() (which modifies it so it can also call errhand on the state) does make the errors appear.
User avatar
BOT-Brad
Citizen
Posts: 87
Joined: Tue Dec 02, 2014 2:17 pm
Location: England

Re: Odd issue when running as .love or .exe

Post by BOT-Brad »

You are indeed correct, changing from "Home" to "home" does indeed solve the issue. I forgot that vrld's Gamestate.registerEvents modifies a lot of the default love callbacks, I should have check that out first. Thank's for your help.

PS.
Is my method of loading in loads of images and storing them in a table (FE.images in my case) OK? How many love.graphics.newImage calls are 'too many', where you should perhaps call them as you need them>
Follow me on GitHub! | Send me a friend request on PSN!
Post Reply

Who is online

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