Running/Compiling Löve without graphics?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Running/Compiling Löve without graphics?

Post by Germanunkol »

Hi,

I want to write a gameserver for my game. Ideally, I'd like it to use as much of the code that I have already written as possible. Also, it will need threads to run correctly and do everything I want to do.
I was planning on only using plain Lua, since most of the server-side functions don't use löve at all. But the threading has been giving me headaches. The threading solution I liked the most (Lua Lanes) won't run/compile and seems out of date. Other threading options don't truly thread - they only use coroutines.

So I started to write my own C++ code which should call Lua functions in seperate threads. However, I really like the way Löve does Threads, and I'd love to stick to it. That's why I was wondering: Is it possible (and does it make sense to) compile only a part of Löve (namely, the threading part)? Can anyone point me in the right direction?

Thanks...
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Running/Compiling Löve without graphics?

Post by Nixola »

Does disabling every LÖVE module inside conf.lua work?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Running/Compiling Löve without graphics?

Post by Inny »

This probably won't answer your question, but if you can get luaposix working, it has fork() available, and you can go multi-process. Though, it doesn't have the type of message-passing interface that lanes or LOVE does, you'd have to talk through a basic file stream, which means writing annoying framework functions.

I personally wouldn't accept this solution, so consider it just an all-else-fails fallback.
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Running/Compiling Löve without graphics?

Post by Germanunkol »

Thanks to both of you for your answers!

The conf.lua trick worked wonders. It runs the game without graphics and at the same time I can still communicate with the game using io.write() and typing in the console.
Awesome, thank you!
Now I just have to check if I can get all this to work on my Rasberry Pi when I get it :D
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
qaisjp
Party member
Posts: 490
Joined: Tue Sep 04, 2012 10:49 am
Location: United Kingdom
Contact:

Re: Running/Compiling Löve without graphics?

Post by qaisjp »

Good luck, Young 'un.
Lua is not an acronym.
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Running/Compiling Löve without graphics?

Post by Inny »

Thats amazing, I'm going to have to try it out myself. I imagine though that there would be a few server-side dependencies that might need to be met. If you're just going to run a windows sever, then you can ignore the rest of my comment. Running a Linux server would require SDL to install love2d, which would probably pull in some X requirements. You can probably get away without running X on the server, but it's typically considered a strange thing to pull in.

At any rate, high five on the conf.lua solution.
Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests