fakelove : love in pure lua

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.
User avatar
TsT
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France
Contact:

fakelove : love in pure lua

Post by TsT » Sun Apr 24, 2011 11:25 pm

Why using fakelove ?

When you want running something without graphics. Like a server game, only manage network connections.
When your girl friend has left and you loose her löve :rofl:

Another use :
- I want learn more about how löve run (internally)
- You want play with emulation (emulate keyboard, mouse, joystick event ?)

Why fakelove is better than lua

fakelove is not better than the lua interpretor.
But with fakelove you should more easily use the love specific libraries.


How contribute

Post your comment ! I'm open to everything :)

Roadmap

Done recently :
- provide a love.event emulation
- provide a love.timer emulation (for dt calculation)

My next goal are :
- run a sample of network exchange between love-client and fakelove-server
- build a network things to send/receive event (like keyboard/mouse emulation)
- use LuaZip to read inside .love file.
- provide a love.thread emulation (with coroutine if it's possible)
- so much things...

Original post
TsT wrote: Hello,

I'm starting to play with network on löve.
I need to run a "server" to listen connection, and clients.
But for the server part I don't need lot of things.
One solution is to build a pure lua script, but I see LUBE using some little part of love.filesystem.* things.
For the fun I'm trying to build a pure lua script compatible with löve (0.7.1)

I have take the boot.lua from the source.

My approach is :
running fakelove.lua
it will catch the standard require() function.
load the boot.lua (exactly the same than the löve 0.7.1 one) move in embeded/
It will load the love and love.* modules that are implemented in love.lua and love/*.lua

I have put a conf.lua (usefull to disable most of the love modules)
Also a main.lua to check basic function, and see the too many functions to implement !

To check fakelove you need :
- uncompress content of fakelove*.zip somewhere
- cd fakelove
- lua fakelove.lua
(you need the lfs package, named liblua5.1-filesystem0 on debian)

Have fun!
EDIT: for information for now I think the main missing part of code is the love.event module
Attachments
fakelove-20110426.zip
fakelove v0.2 20110426
(30.85 KiB) Downloaded 145 times
fakelove-20110425.zip
fakelove Proof of concept, first release
(26.65 KiB) Downloaded 119 times
Last edited by TsT on Tue Apr 26, 2011 10:35 pm, edited 4 times in total.
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)

User avatar
schme16
Party member
Posts: 127
Joined: Thu Oct 02, 2008 2:46 am

Re: fakelove : love in pure lua

Post by schme16 » Mon Apr 25, 2011 12:27 am

Thia seems like an interesting project, I'll be keeping an eye on it for sure!
My Development Diary - http://shanegadsby.info

User avatar
TsT
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France
Contact:

Re: fakelove : love in pure lua

Post by TsT » Tue Apr 26, 2011 10:08 pm

Done:
- provide a love.event emulation
- provide a love.timer emulation (for dt calculation)

Now fakelove 0.2 is able to manage events, and quit properly !
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)

User avatar
ishkabible
Party member
Posts: 241
Joined: Sat Oct 23, 2010 7:34 pm
Location: Kansas USA

Re: fakelove : love in pure lua

Post by ishkabible » Wed Apr 27, 2011 2:52 am

LuaIL can handle textures(works ok with LuaGL, textures come out upside down :( )
LuaGL can handle graphics
LuaSDL can be used for Audio and Input (and Kinda Graphics, hard to use with LuaGL in this case)
LuaOpenAl can be used for Audio (however that will be tricky to use with LuaSDL)
you can make your own binding for anything (like Freetype and Box2D, something for file system)
threading might be tricky

i do have another Idea that while would be A LOT harder would speed things up to near C/C++ level and allow you to make bindings easier, LuaJIT. like i said, it would be very hard to make all these bindings using LuaJIT's FFI but it would be SOOOOOO COOOOOL if you could do it.

User avatar
TsT
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France
Contact:

Re: fakelove : love in pure lua

Post by TsT » Wed Apr 27, 2011 7:48 am

ishkabible wrote:LuaIL can handle textures(works ok with LuaGL, textures come out upside down :( )
LuaGL can handle graphics
LuaSDL can be used for Audio and Input (and Kinda Graphics, hard to use with LuaGL in this case)
LuaOpenAl can be used for Audio (however that will be tricky to use with LuaSDL)
you can make your own binding for anything (like Freetype and Box2D, something for file system)
threading might be tricky

i do have another Idea that while would be A LOT harder would speed things up to near C/C++ level and allow you to make bindings easier, LuaJIT. like i said, it would be very hard to make all these bindings using LuaJIT's FFI but it would be SOOOOOO COOOOOL if you could do it.
Your information are interesting but unfortunately I have not planned to use graphics or audio library.
My goal is more "faking" or emulating than building a new love project full compatible.
Of course I'm refusing to do that just think that is hard and love already do that :)
I like playing with lua, not with C/C++ :nyu:
fakelove is able to be launched with lua or luaJIT.

I just discover luaJIT's FFI, it's really interesting !!
I search about that and found :
- Inline C http://lua-users.org/wiki/InlineCee
Define C source, compiled with gcc on runtime (linux only?). I improved it. I will release ASAP.
- luatcc http://luatcc.luaforge.net/index.html#manual
Interesting because multiplatform but have more dependencies
- c invoke http://cinvoke.teegra.net/bindings.html https://bitbucket.org/bogen/cinvoke/
You have a .so library like libc6.so, it build a interface to call the function.
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)

User avatar
bartbes
Sex machine
Posts: 4944
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: fakelove : love in pure lua

Post by bartbes » Wed Apr 27, 2011 8:10 am

We used tcc for a bit, with love.native, it was killed when we found out it wasn't portable enough though.

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: fakelove : love in pure lua

Post by Robin » Wed Apr 27, 2011 11:21 am

bartbes wrote:We used tcc for a bit, with love.native, it was killed when we found out it wasn't portable enough though.
Wasn't it just PPC it couldn't handle?
Help us help you: attach a .love.

User avatar
bartbes
Sex machine
Posts: 4944
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: fakelove : love in pure lua

Post by bartbes » Wed Apr 27, 2011 2:04 pm

Yeah, that's what I seem to remember. Though of course this would cause problems on say arm and mips too.

User avatar
ishkabible
Party member
Posts: 241
Joined: Sat Oct 23, 2010 7:34 pm
Location: Kansas USA

Re: fakelove : love in pure lua

Post by ishkabible » Wed Apr 27, 2011 10:45 pm

dose Love really need to be for architectures other than x86? ...o wait is nlove's device use ARM?

User avatar
TsT
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France
Contact:

Re: fakelove : love in pure lua

Post by TsT » Thu Apr 28, 2011 8:57 am

ishkabible wrote:dose Love really need to be for architectures other than x86? ...o wait is nlove's device use ARM?
Can be good to support Android device ;)
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests